GSF.Threading.WeakAction.Clear C# (CSharp) Method

Clear() public method

Clears Action callback target.
public Clear ( ) : void
return void
        public void Clear()
        {
            //Note, the race condition that exists here would simply cause
            //A static method exit anyway since Target is always null for static 
            //methods.
            m_isStatic = false;
            Target = null;
        }
    }

Usage Example

Beispiel #1
0
 protected void Shutdown()
 {
     if (m_ignoreShutdownHandler)
     {
         return;
     }
     //If the caller did not want to be notified on shutdown
     // or they did but the callback failed.
     // clear all callbacks and initiate a disposal.
     if (!m_disposeOnShutdown && !m_disposeAndWaitCallback.TryInvoke())
     {
         m_callback.Clear();
         m_disposeAndWaitCallback.Clear();
         StartDisposal();
     }
 }
All Usage Examples Of GSF.Threading.WeakAction::Clear