public SmartSession(ISmartWindowManager smartWindowManager) { _smartWindowManager = smartWindowManager; _commandEnvironment = new CommandEnvironment(this); _configer = new Configer(); _progressMonitorManager = new ProgressMonitorManager(smartWindowManager.MainForm as Form); _recentFilesManager = new RecentFilesManager(20); _temporalFileManager = new TemporalFileManager(); AttachEvents(); CreatePythonEngine(); CreateMonitoringSession(); }
private static void AttachEvents() { ISmartSessionEvents evts = Session as ISmartSessionEvents; evts.OnSmartSessionLoaded += new SmartSessionLoadedHandler(SmartSessionIsLoaded); evts.OnFileOpended += new FileOpenedHandler(FileOpened); ISmartWindowManager mgr = Session.SmartWindowManager; mgr.OnActiveWindowChanged += new OnActiveWindowChangedHandler(ActiveViewerChanged); IMonitoringSessionEvents msevts = Session.MonitoringSession as IMonitoringSessionEvents; msevts.OnMonitoringProductLoaded += new MonitoringProductLoadedHandler(ProductLoaded); msevts.OnMonitoringSubProductLoaded += new MonitoringSubProductLoadedHandler(SubProductLoaded); }
void ExtractPanelWindow_Disposed(object sender, EventArgs e) { ISmartWindowManager mgr = _session.SmartWindowManager; if (_activeWindowChanged != null) { mgr.OnActiveWindowChanged -= _activeWindowChanged; _activeWindowChanged = null; } if (_extratPanelWindowContent != null) { _extratPanelWindowContent.Dispose(); _extratPanelWindowContent.Free(); _extratPanelWindowContent = null; _session = null; } }
public void Init(ISmartSession session, params object[] arguments) { _session = session; _extratPanelWindowContent = new ExtractPanelWindowContent(); _extratPanelWindowContent.Dock = DockStyle.Fill; this.Controls.Add(_extratPanelWindowContent); //AddFlowPanel(); _activeWindowChanged = ActiveWindowChanged; Disposed += ExtractPanelWindow_Disposed; _extratPanelWindowContent.Apply(session); ISmartWindowManager mgr = _session.SmartWindowManager; mgr.OnActiveWindowChanged += _activeWindowChanged; }