Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'd recomend checking for an active filter either when a user attempts to select a filter, or when they attempt to save changes (selection makes for a better Ux). In order to determine the active filter you'll need to make sure the time step is not already in use, which can easily be accomplished like this:</p> <p>public static class FilterMonitor { private static Dictionary steps = new Dictionary();</p> <pre><code>public static bool CheckActiveAddIfNew(TimeStep step) { //Assumes synchronization logic bool isActive; if(!steps.TryGetValue(step, out isActive) { steps.Add(step, true); isActive = true; } return isActive; } public static bool ChangeFilter(TimeStep oldSetp, TimeStep newStep) { //Synchronization code bool ableToChange; if(!CheckActiveAddIfNew(newStep)) { steps[newStep] = true; steps[oldStep] = false; ableToChange = true; } return ableToChange; } </code></pre> <p>}</p> <p>Once a user is done with a filter they should release it and allow another user to acquire it if they want. This can be accomplished via something like the ChangeFilter method that only allows them to select the new filter if it has not already been selected by another user. This ensures that only one user can have access to a filter at any one time, preventing the case where multiple users will be adding/removing from the same filter.</p> <p>If however you need multiple users to access the same TimeRange but only want to allow a single user to add/remove records to that range, simply replace the bool in the Dictionary w/ a User object that maps to one and only one user. This changes the logic from being a simple active/Inactive filter to active &amp; owned by User1/ Inactive. Obviously only User1 will be allowed to Add records to that range.</p> <p>Please let me know if you have any questions.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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