IZennoList

Assembly: ZennoLab.InterfacesLibrary
Full name: ZennoLab.InterfacesLibrary.ProjectModel.IZennoList


Represents the data of the list. Provides method for binding data.

This interface can be used in action OwnCode (C# or PHP) of ProjectMaker.

Methods

Bind

Method

Binds the specified file to current list.

Parameters

ПараметрОписание
filenameThe file name for bind data.

Example

// get the list
            var list = project.Lists["List 1"];
            // bind
            list.Bind("C:\\mylist.txt");

Example2

// get the list
            $list = $project->Lists->get_Item("List 1");
            // bind
            $list->Bind("C:\\mylist.txt");

AddRange

Method

Adds the elements from IEnumerable collection of the specified collection to the end of IZennoList.

The order of the elements in the collection is preserved in the IZennoList.

Parameters

ПараметрОписание
rangeThe collection whose elements should be added to the end of the IZennoList. The collection itself cannot be null, but it can contain elements that are null.

Example

// create an array of string for adding
            string[] items = new string[3] { "one", "two", "three" };
            // add range of the string to the project list
            project.Lists["List 1"].AddRange(items);
            // create a list of string
            List<string> list = new List<string> { "four", "five", "six" };
            // add list of string to the project list
            project.Lists["List 1"].AddRange(list);

Example2

// create an array of string for adding
            $items = array( "one", "two", "three" );
            // add range of the string to the project list
            $project->Lists->get_Item("List 1")->AddRange($items);
            // create a list of string
            $list = new  System\Collections\Generic\List<string> { "four", "five", "six" };
            // add list of string to the project list
            $project->Lists->get_Item("List 1")->AddRange($list);

AddRange

Method

Adds the elements from IZennoList collection of the specified collection to the end of IZennoList.

The order of the elements in the collection is preserved in the IZennoList.

Parameters

ПараметрОписание
listThe collection whose elements should be added to the end of the IZennoList. The collection itself cannot be null, but it can contain elements that are null.

Example

// add all items from project with name "List 2"
            // to the project list with name "List 1"
            project.Lists["List 1"].AddRange(project.Lists["List 2"]);

Example2

// add all items from project with name "List 2"
            // to the project list with name "List 1"
            $project->Lists->get_Item("List 1")->AddRange($project->Lists->get_Item("List 2"));

GetItem

Method

Gets the first item from the list satisfies the filter.

Parameters

ПараметрОписание
filterThe filter of range.
removeItemtrue if need to remove the item, otherwise and default false.

Returns: The requried item of list, or an empty string, if the item is not found.

Example

// gets random item from several ranges of the list
            return project.Lists["List 1"].GetItem("random1(1,12-15,35-end)");

Example2

// gets random item from several ranges of the list
            return $project->Lists->get_Item("List 1")->GetItem("random1(1,12-15,35-end)");

GetItems

Method

Gets items from the list satisfies the filter.

Parameters

ПараметрОписание
filterThe filter of range.
removeItemstrue if need to remove the items, otherwise and default false.

Returns: The collection of requried elements.

Example

// gets 20 random items from several ranges of the list
            return string.Join(";", project.Lists["List 1"].GetItems("random20(1,12-15,35-end)"));

Example2

// gets 20 random items from several ranges of the list
            return String::Join(";", $project->Lists->get_Item("List 1")->GetItems("random20(1,12-15,35-end)"));

Add

Method

Adds the element to the interface .

Parameters

ПараметрОписание
itemObject that will be added to the interface .