ZennoLab Assemblies Documentation
Item Property
See Also  Example Send Feedback
ZennoLab.InterfacesLibrary Assembly > ZennoLab.InterfacesLibrary.ProjectModel.Collections Namespace > ILists Interface : Item Property
listName

Type: System.String
The name of list.

Glossary Item Box

Get the list by the specified name.

Syntax

C# 
IList<string> this[ 
   string listName
]; {get;}

Parameters

listName

Type: System.String
The name of list.

Property Value

Type: IList

The list of items.

Exceptions

ExceptionDescription
KeyNotFoundExceptionThe exception that is thrown when the name specified for accessing a list in a collection does not match any name in the collection.

Example

The following example uses property "Item" (operator []) to access a list with name "MyList".
C#Copy Code
// get list
var list = project.Lists["MyList"];
 
// result
string result = String.Empty;
 
if (list.Count > 0)
{
    foreach (string str in list)
    {
        if (String.IsNullOrWhiteSpace(result)) result = str;
        else result = String.Format("{0}:{1}", result, str);
    }
}
 
// return result
return result;
PHPCopy Code
// get list
$list = $project->Lists->get_Item("MyList");
 
// result
$result = String::Empty;
 
if ($list->Count > 0)
{
    foreach ($str as $list)
    {
        if (String::IsNullOrWhiteSpace($result)) $result = $str;
        else $result = String::Format("{0}:{1}", $result, $str);
    }
}
 
// return result
return $result;

Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows Seven

See Also

© 2013 All Rights Reserved.