Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just thought about using <em>any collection</em> similar to a <em>generic hashtable</em>... Something like this:</p> <pre><code>Dictionary&lt;string, YourClass&gt; dict = new Dictionary&lt;string, YourClass&gt;(); /// just let's assume you want to add/check for "c:\demo.txt" if (!dict.ContainsKey(@"c:\demo.txt")) { /// add items to dict by passing fullPath as key and your objects as value dict.add(@"c:\demo.txt", obj1); } else if (dict[@"c:\demo.txt"].CheckForIntervall()) { /// replace current object in dictionary with new object - in case you want to.. /// or just do what you want to } </code></pre> <p>edit - your custom class may have some functionality like this:</p> <pre><code>class YOURCUSTOMCLASS { private DateTime creationTime; public DateTime CreationTime { get { return creationTime; } } public YOURCUSTOMCLASS(parametersGoesHere xyz) { creationTime = DateTime.Now; } /// in this case this method will return true /// if the timeSpan between this object and otherObject /// is greater than 4 seconds public bool CheckForInterval(YOURCUSTOMCLASS otherObject) { TimeSpan diff = otherObj.CreationTime.Subtract(creationTime); /// you may replace 4 through any other digit, or even better take /// a const/global var/static ... return diff.TotalSeconds &gt; 4; } /// all the other stuff you need ... } </code></pre> <p>Of course you will <em>loose the functionality of a queue</em> - but you will get an <strong>massive increase in runtime</strong> if your queue containts many elements.</p> <p>hth</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload