Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Member Functions | Private Attributes
Silverstone.Manticore.Core.SampleDataStore Class Reference
Inheritance diagram for Silverstone.Manticore.Core.SampleDataStore:
Inheritance graph
[legend]
Collaboration diagram for Silverstone.Manticore.Core.SampleDataStore:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SampleDataStore ()
void AddObserver (IDataStoreObserver aObserver)
void DoCommand (String aCommand, String aResourceID)
void ChangePrefix (String aPrefix)
void RemoveOdd ()
void AddItems ()
void GetElements (String aContainerID, out IEnumerator aElements)

Private Member Functions

void SetStuff ()

Private Attributes

String mPrefix = "Goats"
Hashtable mTargets = null
Hashtable mObservers = null

Detailed Description

Definition at line 181 of file DataStore.cs.


Constructor & Destructor Documentation

Definition at line 187 of file DataStore.cs.

    {
      mTargets = new Hashtable();
      SetStuff();
    }

Member Function Documentation

Definition at line 255 of file DataStore.cs.

    {
      CommandTarget tgt5 = new CommandTarget(mPrefix + "5", "5", "foopy5" as Object, false);
      mTargets.Add(tgt5.GetHashCode(), tgt5);
      CommandTarget tgt6 = new CommandTarget(mPrefix + "6", "6", "foopy6" as Object, false);
      mTargets.Add(tgt6.GetHashCode(), tgt6);
    }

Implements Silverstone.Manticore.Core.IDataStore.

Definition at line 193 of file DataStore.cs.

    {
      if (mObservers == null)
        mObservers = new Hashtable();
      
      mObservers.Add(aObserver.GetHashCode(), aObserver);
    }

Definition at line 217 of file DataStore.cs.

    {
      /*
        CommandTarget[] oldTargets = new CommandTarget[4];
        mTargets.Values.CopyTo(oldTargets, 0);
        mPrefix = aPrefix;
        SetStuff();
        IEnumerator targets = mTargets.Values.GetEnumerator();
        int i = 0;
        while (targets.MoveNext()) {
          IEnumerator observers = mObservers.Values.GetEnumerator();
          while (observers.MoveNext()) {
            IDataStoreObserver idso = observers.Current as IDataStoreObserver;
            idso.OnNodeChanged(oldTargets[i++], targets.Current as CommandTarget);
          }
        }
        */
    }
void Silverstone.Manticore.Core.SampleDataStore.DoCommand ( String  aCommand,
String  aResourceID 
) [inline]

Definition at line 201 of file DataStore.cs.

    {
    }
void Silverstone.Manticore.Core.SampleDataStore.GetElements ( String  aContainerID,
out IEnumerator  aElements 
) [inline]

Implements Silverstone.Manticore.Core.IDataStore.

Definition at line 263 of file DataStore.cs.

    {
      switch (aContainerID) 
      {
        case "root":
          aElements = mTargets.Values.GetEnumerator();
          break;
        case "goats":
          aElements = mTargets.Values.GetEnumerator();
          break;
        default:
          aElements = mTargets.Values.GetEnumerator();
          break;
      }
    }

Definition at line 236 of file DataStore.cs.

    {
      IEnumerator targets = mTargets.Values.GetEnumerator();
      while (targets.MoveNext()) 
      {
        IEnumerator observers = mObservers.Values.GetEnumerator();
        while (observers.MoveNext()) 
        {
          IDataStoreObserver idso = observers.Current as IDataStoreObserver;
          CommandTarget current = targets.Current as CommandTarget;
          if (Int32.Parse(current.AccessKey) % 2 != 0) 
          {
            mTargets.Remove(current.Data.GetHashCode());
            idso.OnNodeRemoved(targets.Current as CommandTarget);
          }
        }
      }
    }

Here is the call graph for this function:

Definition at line 205 of file DataStore.cs.

    {
      CommandTarget tgt1 = new CommandTarget(mPrefix + "1", "1", "foopy1" as Object, false);
      mTargets.Add(tgt1.GetHashCode(), tgt1);
      CommandTarget tgt2 = new CommandTarget(mPrefix + "2", "2", "foopy2" as Object, false);
      mTargets.Add(tgt2.GetHashCode(), tgt2);
      CommandTarget tgt3 = new CommandTarget(mPrefix + "3", "3", "foopy3" as Object, false);
      mTargets.Add(tgt3.GetHashCode(), tgt3);
      CommandTarget tgt4 = new CommandTarget(mPrefix + "4", "4", "foopy4" as Object, false);
      mTargets.Add(tgt4.GetHashCode(), tgt4);
    }

Member Data Documentation

Definition at line 185 of file DataStore.cs.

Definition at line 183 of file DataStore.cs.

Definition at line 184 of file DataStore.cs.


The documentation for this class was generated from the following file: