System.Func.Invoke(WorkState)

Here are the examples of the csharp api System.Func.Invoke(WorkState) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 Source : RDDCManager.cs
with Apache License 2.0
from cdy816

public bool SwitchTo(WorkState state)
        {
            if (CurrentState == WorkState.Switching) return true;

            LoggerService.Service.Warn("RDDCManager", "will switch to "+ state);

            lock (mLockObj)
            {
                var olds = CurrentState;
                CurrentState = WorkState.Switching;
                if (SwitchWorkStateAction != null)
                {
                    if (SwitchWorkStateAction(state))
                    {
                        CurrentState = state;
                        return true;
                    }
                    else
                    {
                        CurrentState = olds;
                        return false;
                    }
                }
                CurrentState = state;
                return true;
            }
        }