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; }
private void CallPanelExtractWithoutUI() { ////注意:创建面板过程中,会将OutIdentify参数设置为子产品的,现在如果是做的实例的话,需要修正回来。 using (ExtractPanelWindowContent ui = new ExtractPanelWindowContent()) { ui.Apply(_session); if (_instanceDef == null && _activeMonitoringSubProduct.Definition.IsDisplayPanel) { ui.Apply(Workspace, _activeMonitoringSubProduct); } else { ui.ApplyWithoutPanel(Workspace, _activeMonitoringSubProduct); } //去掉该设置,使用这种情况下,不加载面板, //if (_instanceDef != null) //{ // _activeMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", _instanceDef.OutFileIdentify); // _activeMonitoringSubProduct.ArgumentProvider.SetArg("SelectedPrimaryFiles", _selectedFiles); //} ui.DoExtract(true); } }