System.Threading.ManualResetEventSlim.Set C# (CSharp) Method

Set() public method

public Set ( ) : void
return void
        public void Set()
        {
            var stamp = UpdateStateWithOp (true);
            if (handle != null)
                CommitChangeToHandle (stamp);
        }

Usage Example

Example #1
1
        private static void CreateWindowInstance(ControlTestRequest request, ManualResetEventSlim evt) {
            try {
                Window = new Window();

                if (Screen.AllScreens.Length == 1) {
                    Window.Left = 0;
                    Window.Top = 50;
                } else {
                    Screen secondary = Screen.AllScreens.FirstOrDefault(x => !x.Primary);
                    Window.Left = secondary.WorkingArea.Left;
                    Window.Top = secondary.WorkingArea.Top + 50;
                }

                Window.Width = 800;
                Window.Height = 600;

                Component = Activator.CreateInstance(request.ControlType);
                if (Component is Control) {
                    Control = Component as Control;
                } else {
                    Control = Component.GetType().GetProperty("Control").GetValue(Component) as Control;
                }

                Window.Title = "Control - " + request.ControlType;
                Window.Content = Control;
            } finally {
                evt.Set();
            }

            Window.Topmost = true;
            Window.ShowDialog();
        }
All Usage Examples Of System.Threading.ManualResetEventSlim::Set