Re: no indexof-function for collection object available.



I've just wrapped up development on a small project that deals with similar
issues. What I ended up doing is writing 2 classes. One was a manager class
that handled all the add/edit/delete/sort routines and implemented
ICollectionsBase interface. I essentially wrote or overloaded collection
routines to affect the collection/innerlist. It's actually quite easy and
intuitive, check out http://www.codeproject.com for some samples. Now the
second class that I wrote was an object that the manager used, taking the
name/value pairs loaded in from the XML file. By adding instances of this
object to my manager class I was able to use InnerList.Items.IndexOf
("string") to locate elements in the collection. The manager class had a
property which would contain a reference to the current element I was
editing. Add a little serialization/deserialzation support and you have a
pretty useful tool. In any case I hope this helps or points you in the
right direction.

--
Message posted via http://www.dotnetmonster.com
.



Relevant Pages

  • Re: It it possible to redirect events?
    ... the Manager, and the Manager has many 'Items'. ... I'm going to assume that what you want is an event in the Manager class ... for clients of the Manager class (specifically, ... 4.Client should respond to ItHappened events. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: It it possible to redirect events?
    ... the Manager, and the Manager has many 'Items'. ... For one, the code you posted wouldn't compile (the Manager class constructor needs a "()" after the name of the constructor), and even if it did, it wouldn't do anything because the instance of Item isn't initialized, nor is it referenced anywhere other than in a local variable. ... But assuming you really want to get rid of the forwarding, you could implement your event explicitly in the Manager class, subscribing to the underlying Item event. ... Note that this actually changes the reference relationships between your instances. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to do unit test on an atom unit which tied with a large unit?
    ... a "manager test stub" and fake the functionality in the test for ... Create a fake ... manager class to work with and control the actual atom class that you ... Since you aren't testing the manager class itself, ...
    (borland.public.delphi.non-technical)
  • Re: Where to instantiate manager class in GUI?
    ... > I have a manager class which controls a couple of proxy classes and a ... > Which GUI class should I use to instantiate the manager class? ... method in the app either). ...
    (microsoft.public.vc.mfc)
  • Re: The literati amongst us.
    ... The producer was called Ken Gibson, who later became the Irish Rovers' ... idea of appearing in a Canadian show and thereby hopefully increasing ... Ken Gibson was *not* the manager; he produced their show in Vancouver in the ... I had a writing partner ...
    (soc.culture.scottish)

Loading