private bool OnWindowCreated(byte[] newVal) { if (ElementWdwPtr.Read <int>() == 0) { return(false); } ElementIdPtr = SMProcess[SM17Natives.TElWind.ElementIdPtr]; CurrentConceptIdPtr = SMProcess[SM17Natives.Globals.CurrentConceptIdPtr]; CurrentRootIdPtr = SMProcess[SM17Natives.Globals.CurrentRootIdPtr]; CurrentHookIdPtr = SMProcess[SM17Natives.Globals.CurrentHookIdPtr]; ElementIdPtr.RegisterValueChangedEventHandler <int>(OnElementChangedInternal); LastElementId = CurrentElementId; // TODO: ??? This somehow gets delayed and causes all sorts of troubles //OnElementChanged?.Invoke(new SMDisplayedElementChangedArgs(SMA.Instance, // CurrentElement, // null)); OnAvailable?.Invoke(); return(true); }
private bool OnWindowCreated(byte[] newVal) { if (ElementWdwPtr.Read <int>() == 0) { return(false); } ElementIdPtr = SMProcess[Core.Natives.ElWind.ElementIdPtr]; LimitChildrenCountPtr = SMProcess[Core.Natives.Globals.LimitChildrenCountPtr]; CurrentConceptIdPtr = SMProcess[Core.Natives.Globals.CurrentConceptIdPtr]; CurrentConceptGroupIdPtr = SMProcess[Core.Natives.Globals.CurrentConceptGroupIdPtr]; CurrentRootIdPtr = SMProcess[Core.Natives.Globals.CurrentRootIdPtr]; CurrentHookIdPtr = SMProcess[Core.Natives.Globals.CurrentHookIdPtr]; LearningModePtr = SMProcess[Core.Natives.ElWind.LearningModePtr]; ElementIdPtr.RegisterValueChangedEventHandler <int>(OnElementChangedInternal); LastElementId = CurrentElementId; // TODO: ??? This somehow gets delayed and causes all sorts of troubles //OnElementChanged?.Invoke(new SMDisplayedElementChangedEventArgs(SMA.Instance, // CurrentElement, // null)); IsAvailable = true; OnAvailableInternal?.Invoke(); OnAvailable?.InvokeRemote( nameof(OnAvailable), h => OnAvailable -= h ); return(true); }
/// <inheritdoc /> public void Dispose() { LogTo.Debug("Cleaning up {Name}", GetType().Name); _controlGroup?.Dispose(); SMMainWdwPtr?.Dispose(); ElementWdwPtr?.Dispose(); ElementIdPtr?.Dispose(); CurrentConceptIdPtr?.Dispose(); CurrentConceptGroupIdPtr?.Dispose(); CurrentRootIdPtr?.Dispose(); CurrentHookIdPtr?.Dispose(); LearningModePtr?.Dispose(); SMMainWdwPtr = null; ElementWdwPtr = null; ElementIdPtr = null; CurrentConceptIdPtr = null; CurrentConceptGroupIdPtr = null; CurrentRootIdPtr = null; CurrentHookIdPtr = null; LearningModePtr = null; LogTo.Debug("Cleaning up {Name}... Done", GetType().Name); }
private void OnSMStoppedEvent(object sender, SMProcessArgs e) { ElementIdPtr.Dispose(); ElementWdwPtr = null; ElementIdPtr = null; CurrentConceptIdPtr = null; CurrentRootIdPtr = null; CurrentHookIdPtr = null; }
private Task OnSMStoppedEvent(object sender, SMProcessArgs e) { LogTo.Debug($"Cleaning up {GetType().Name}"); ElementIdPtr?.Dispose(); ElementWdwPtr = null; ElementIdPtr = null; CurrentConceptIdPtr = null; CurrentRootIdPtr = null; CurrentHookIdPtr = null; return(TaskConstants.Completed); }
private void OnSMStoppedEvent(object sender, SMProcessArgs e) { LogTo.Debug($"Cleaning up {GetType().Name}"); ElementIdPtr?.Dispose(); SMMainWdwPtr = null; ElementWdwPtr = null; ElementIdPtr = null; CurrentConceptIdPtr = null; CurrentConceptGroupIdPtr = null; CurrentRootIdPtr = null; CurrentHookIdPtr = null; LearningModePtr = null; LogTo.Debug($"Cleaning up {GetType().Name}... Done"); }
public bool QuitSMAUpdateLock(bool updateValue = false) { return(ElementIdPtr.RestartTimer(updateValue)); }
public bool EnterSMAUpdateLock() { return(ElementIdPtr.SuspendTimer()); }