Why zennoposter lists is different than C# lists ?

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Example:

List<string> postList = new List<string>();
postList.RemoveAll();

This is what I need now. It works just fine with C# internal lists. But not with any of 3 kind of lists interfaces I can find in Assemblies Documentation...
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Yes

Lists class is the same as ILIST http://msdn.microsoft.com/ru-ru/library/6ywykzh6(v=vs.110).aspx
so instead of RemoveAll you can use method Clear

I'm not sure I understood you.
This RemoveAll was just an example there is bunch of other methods what c# lists have and zennoLists does not. If they are masking behind other words then how can I know what to use ?

Your suggested Clear is different than I need:
https://msdn.microsoft.com/en-us/library/dwb5h52a(v=vs.110).aspx = Clear(); = Removes all elements from the List<T>.
https://msdn.microsoft.com/en-us/library/wdka673a(v=vs.110).aspx = RemoveAll(); = Removes all the elements that match the conditions defined by the specified predicate.

And in my case I wanted to delete some lines from list that match some conditions. So Clear will not what I can use ;-)

Thanks
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
IZennoList - it is interface to work with separate list. Represents the data of the list. Provides methodы to work with this particular list
ILists - it's the inteface to get separate list by it's name. After that we can use methods provided by IZennoList interface
Lists - It's a property of "project"

if you ask this and mean "How to use list objects" then you type project.Lists["MyList"]. and all possible methods will be presented. No other option for this.
If you're curious what's the difference between object, method, interface, property, i suggest you to read any book about C#
 
  • Спасибо
Реакции: lokiys

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)