Example #1
0
 private async Task OnSMStarted(object sender,
                                SMProcessArgs eventArgs)
 {
     await Application.Current.Dispatcher.InvokeAsync(() =>
     {
         TbIcon.ToolTipText = $"SuperMemoAssistant - {SMA.Core.SM.Collection.Name}";
         TbIcon.Visibility  = Visibility.Visible;
     });
 }
Example #2
0
        private void OnSMStopped(object sender,
                                 SMProcessArgs e)
        {
            //CleanupUI();

            //if (Window != null)
            //  OnWindowClosed(Window,
            //                 UIAuto.EventLibrary.Window.WindowClosedEvent);
        }
        private async Task OnSMStartedEvent(object sender,
                                            SMProcessArgs e)
        {
            LogTo.Debug($"Initializing {GetType().Name}");

            await Task.Run(() =>
            {
                ElementWdwPtr = SMProcess[SM17Natives.TElWind.InstancePtr];
                ElementWdwPtr.RegisterValueChangedEventHandler <int>(OnWindowCreated);
            });
        }
        private void OnSMStoppedEvent(object sender,
                                      SMProcessArgs e)
        {
            ElementIdPtr.Dispose();

            ElementWdwPtr       = null;
            ElementIdPtr        = null;
            CurrentConceptIdPtr = null;
            CurrentRootIdPtr    = null;
            CurrentHookIdPtr    = null;
        }
        private async Task OnSMStarted(object sender, SMProcessArgs e)
        {
            LogTo.Debug($"Initializing {GetType().Name}");

            DirectoryEx.EnsureExists(SMAFileSystem.PluginPackageDir.FullPath);

            StartIpcServer();
            //StartMonitoringPlugins();

            await RefreshPlugins();
            await StartPlugins();
        }
Example #6
0
        private void OnSMStoppedEvent(object sender, SMProcessArgs e)
        {
            try
            {
                LogTo.Debug($"Cleaning up {GetType().Name}");

                Dispatcher.Invoke(Shutdown);
            }
            finally
            {
                LogTo.Debug($"Cleaning up {GetType().Name}... Done");
            }
        }
        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");
        }
Example #9
0
 private Task Instance_OnSMStoppedEvent(object sender,
                                        SMProcessArgs e)
 {
     return(Dispatcher.InvokeAsync(Shutdown).Task);
 }
Example #10
0
        //public AutomationElementRef AutomationElement => new AutomationElementRef(Window);

        #endregion



        #region Methods

        private void OnSMStarted(object sender,
                                 SMProcessArgs e)
        {
            SMProcess = e.Process;
            //SetupUI();
        }
Example #11
0
 private void OnSMStopped(object sender, SMProcessArgs e)
 {
     base.Cleanup();
 }
        private Task OnSMStartedEvent(object sender, SMProcessArgs eventArgs)
        {
            SMA.Core.SM.UI.ElementWdw.OnAvailable += ElementWdw_OnAvailable;

            return(Task.CompletedTask);
        }
 private void OnSMStartedEvent(object sender,
                               SMProcessArgs e)
 {
     ElementWdwPtr = SMProcess[SMNatives.TElWind.InstancePtr];
     ElementWdwPtr.RegisterValueChangedEventHandler <int>(OnWindowCreated);
 }
Example #14
0
 private void OnSMStarted(object sender, SMProcessArgs e)
 {
     LoadPlugins();
 }
Example #15
0
 private void OnSMStopped(object sender, SMProcessArgs e)
 {
     UnloadPlugins();
 }