//private readonly VTRunState _originalRunState; private VTRunScope(VTRunState desiredVTState) { this._desiredRunState = desiredVTState; //this._originalRunState = RTPlugin.Instance.MonitorManager.CharacterState.VTRunning.WaitOne(0) ? VTRunState.On : VTRunState.Off; //RTPlugin.Instance.DebugWriter.WriteLine(this._originalRunState.ToString()); //if (this._desiredRunState == VTRunState.On && this._originalRunState == VTRunState.Off) //{ // RTPlugin.Instance.DebugWriter.WriteLine("Create Run Scope : Starting VT"); // VTActions.StartVT(); //} //else if (this._desiredRunState == VTRunState.Off && this._originalRunState == VTRunState.On) //{ // RTPlugin.Instance.DebugWriter.WriteLine("Create Run Scope : Stopping VT"); // VTActions.StopVT(); //} if (this._desiredRunState == VTRunState.On) { VTActions.StartVT(); } else { VTActions.StopVT(); } }
public static VTRunScope Enter(VTRunState desiredState) { return new VTRunScope(desiredState); }