public void InitControl(IExtractPanel panel, ArgumentBase arg) { //调整监测分析面板窗体宽度,以显示完整整个控件 if (panel == null) { return; } UCExtractPanel ucPanel = panel as UCExtractPanel; if (ucPanel == null) { return; } IMonitoringSubProduct subProduct = ucPanel.MonitoringSubProduct; if (subProduct == null) { return; } IArgumentProvider arp = subProduct.ArgumentProvider; if (arp != null) { object obj = arp.GetArg("SmartSession"); ISmartSession session = obj as ISmartSession; if (session != null) { ISmartToolWindow wnd = session.SmartWindowManager.SmartToolWindowFactory.GetSmartToolWindow(_extractWindowID); (wnd as DockWindow).TabStrip.SizeInfo.AbsoluteSize = new System.Drawing.Size(_extractWindowWidth, 0); } } InitArgument(); //if (_handler != null) // _handler(GetArgumentValue()); }
public override void Execute() { ISmartViewer v = _smartSession.SmartWindowManager.ActiveViewer; ISmartToolWindow wnd = _smartSession.SmartWindowManager.SmartToolWindowFactory.GetSmartToolWindow(_id); if (wnd != null) { UCLayerManagerPanel layerManeger = new UCLayerManagerPanel(_smartSession); if (v == null) { layerManeger.Apply(null); } if (v is ICanvasViewer) { layerManeger.Apply((v as ICanvasViewer).LayerProvider as ILayersProvider); } else if (v is ILayoutViewer) { layerManeger.Apply((v as ILayoutViewer).LayerProvider as ILayersProvider); } (wnd as ToolWindow).Controls.Add(layerManeger); layerManeger.Dock = DockStyle.Fill; _smartSession.SmartWindowManager.DisplayWindow(wnd, new WindowPosition(DockStyle.Left, false)); (wnd as DockWindow).TabStrip.SizeInfo.AbsoluteSize = new System.Drawing.Size(WND_DEFAULT_WIDTH, 0); } }
public override void Execute() { ISmartToolWindow wnd = _smartSession.SmartWindowManager.SmartToolWindowFactory.GetSmartToolWindow(_id); if (wnd != null) { _smartSession.SmartWindowManager.DisplayWindow(wnd, new WindowPosition(DockStyle.Left, true)); } }
public override void Execute(string argument) { ISmartToolWindow wnd = _smartSession.SmartWindowManager.SmartToolWindowFactory.GetSmartToolWindow(_id); if (wnd != null) { _smartSession.SmartWindowManager.DisplayWindow(wnd, new WindowPosition(DockStyle.Right, false)); (wnd as DockWindow).TabStrip.SizeInfo.AbsoluteSize = new System.Drawing.Size(WND_DEFAULT_WIDTH, 0); } }
/// <summary> /// 选择专题图模版 /// </summary> /// <returns></returns> private string SelectLayoutTheme() { ISmartToolWindow wnd = _smartSession.SmartWindowManager.SmartToolWindowFactory.GetSmartToolWindow(5002); if (wnd == null || string.IsNullOrWhiteSpace((wnd as ThemeTemplateSelectWindow).SelectedTheme)) { _smartSession.CommandEnvironment.Get(5002).Execute();//激活专题图模版选择窗口 return(null); } return((wnd as ThemeTemplateSelectWindow).SelectedTheme); }
public override bool Open(string fname, out bool memoryIsNotEnough) { memoryIsNotEnough = false; ISmartToolWindow toolWindow = _session.SmartWindowManager.SmartToolWindowFactory.GetSmartToolWindow(9005); if (toolWindow != null) { (toolWindow as IStatResultDisplayWindow).Open(fname); _session.SmartWindowManager.DisplayWindow(toolWindow); return(true); } return(false); }
public override void Execute() { ISmartToolWindow wnd = _smartSession.SmartWindowManager.SmartToolWindowFactory.GetSmartToolWindow(_id); if (wnd != null) { Form mainFrm = _smartSession.SmartWindowManager.MainForm as Form; int wndWidth = 260; int wndHeight = 200; int x = mainFrm.Right - wndWidth - 7; int y = mainFrm.Bottom - wndHeight - 8; Rectangle rect = new Rectangle(x, y, wndWidth, wndHeight); _smartSession.SmartWindowManager.DisplayWindow(wnd, new WindowPosition(System.Windows.Forms.DockStyle.None, false), rect); } }
public override void Execute(string argument) { ISmartToolWindow wnd = _smartSession.SmartWindowManager.SmartToolWindowFactory.GetSmartToolWindow(_id); if (wnd != null) { _smartSession.SmartWindowManager.DisplayWindow(wnd, new WindowPosition(System.Windows.Forms.DockStyle.Bottom, false)); } if (!string.IsNullOrEmpty(argument)) { bool isHidden = false; if (bool.TryParse(argument, out isHidden) && isHidden) { (wnd as ToolWindow).DockState = DockState.AutoHide; } } }
public override void Execute() { ISmartToolWindow wnd = _smartSession.SmartWindowManager.SmartToolWindowFactory.GetSmartToolWindow(_id); using (FolderBrowserDialog dlg = new FolderBrowserDialog()) { string dir = AppDomain.CurrentDomain.BaseDirectory + "SystemData\\Scripts"; if (Directory.Exists(dir)) { (wnd as IPythonManagerWindow).SetupWorkspace(dir); } } if (wnd != null) { _smartSession.SmartWindowManager.DisplayWindow(wnd, new WindowPosition(DockStyle.Left, true)); } }
public ISmartToolWindow GetSmartToolWindow(int identify) { if (_openedToolWindows.ContainsKey(identify)) { return(_openedToolWindows[identify]); } if (_registeredToolWindows.ContainsKey(identify)) { ISmartToolWindow wnd = Activator.CreateInstance(_registeredToolWindows[identify]) as ISmartToolWindow; if (wnd == null) { return(null); } wnd.Init(_session); _openedToolWindows.Add(identify, wnd); (wnd as ToolWindow).Disposed += new EventHandler((sender, args) => { _openedToolWindows[identify].Free(); _openedToolWindows.Remove(identify); }); return(wnd); } return(null); }
protected override void DisplayAfter(ISmartToolWindow wnd) { base.DisplayAfter(wnd); }
protected override void DisplayAfter(ISmartToolWindow wnd) { (wnd as DockWindow).TabStrip.SizeInfo.AbsoluteSize = new System.Drawing.Size(250, 0); }
protected virtual void DisplayAfter(ISmartToolWindow wnd) { }
public override void Execute(string argument)/*Left:true:9000*/ { if (string.IsNullOrEmpty(argument)) { Execute(); return; } string[] parts = argument.Split(':'); if (parts.Length != 3 && parts.Length != 2) { Execute(); return; } ISmartToolWindow wnd = _smartSession.SmartWindowManager.SmartToolWindowFactory.GetSmartToolWindow(_id); if (wnd == null) { return; } DockStyle pos = DockStyle.Left; bool isfloat = false; switch (parts[0].ToUpper()) { case "LEFT": pos = DockStyle.Left; break; case "RIGHT": pos = DockStyle.Right; break; case "TOP": pos = DockStyle.Top; break; case "BOTTOM": pos = DockStyle.Bottom; break; case "FILL": pos = DockStyle.Fill; break; case "FLOAT": isfloat = true; break; } bool isSplited = true; bool.TryParse(parts[1], out isSplited); int parentId = 0; if (parts.Length == 3) { int.TryParse(parts[2], out parentId); } if (!isfloat) { _smartSession.SmartWindowManager.DisplayWindow(wnd, new WindowPosition(pos, isSplited)); } else { _smartSession.SmartWindowManager.DisplayWindow(wnd); } DisplayAfter(wnd); }