static void ActiveViewerChanged(object sender, ISmartWindow oldWindow, ISmartWindow newWindow) { if (newWindow == null || !(newWindow is ICanvasViewer)) { return; } if (newWindow == oldWindow) { return; } ICanvasViewer viewer = newWindow as ICanvasViewer; if (viewer.ActiveObject == null) //{GeoDo.RSS.Core.RasterDrawing.RasterDrawing} { return; } IRasterDrawing draw = viewer.ActiveObject as IRasterDrawing; if (draw == null) { return; } if (draw.RgbProcessorStack != null && draw.RgbProcessorStack.Count > 0) //已经应用过的不再加载方案 { return; } ApplyImageEnhancor(); }
public void ActivateWindow(ISmartWindow wnd) { if (wnd != null) { _radDock.ActivateWindow(wnd as DockWindow); } }
private void ViewIsChanged(object sender, ISmartWindow oldV, ISmartWindow newV) { if (newV == null) { (this.Controls[0] as UCLayerManagerPanel).Apply(null); return; } if (newV is ICanvasViewer) { ICanvasViewer v = newV as ICanvasViewer; if (v == null) { return; } IVectorHostLayer host = v.Canvas.LayerContainer.VectorHost; if (host == null) { return; } (this.Controls[0] as UCLayerManagerPanel).Apply(v.LayerProvider as ILayersProvider); } else if (newV is ILayoutViewer) { ILayoutViewer v = newV as ILayoutViewer; if (v == null) { return; } (this.Controls[0] as UCLayerManagerPanel).Apply(v.LayerProvider as ILayersProvider); } }
private void UnattachEvent(ISmartWindow oldWindow) { ICanvasViewer cv = oldWindow as ICanvasViewer; if (cv != null) { cv.Canvas.OnEnvelopeChanged -= _viewerEnvelopeChanged; } }
public void TryRefreshLayerManager() { ISmartWindow layerManager = _smartSession.SmartWindowManager.GetSmartWindow((wnd) => { return(wnd is ILayerManager); }); if (layerManager != null) { (layerManager as ILayerManager).Update(); } }
void _radDock_DockWindowClosed(object sender, DockWindowEventArgs e) { //触发注册在视窗上的关闭事件 ISmartWindow smartWindow = e.DockWindow as ISmartWindow; if (smartWindow != null) { if (smartWindow.OnWindowClosed != null) { smartWindow.OnWindowClosed(smartWindow, e); } } // if (e.DockWindow.Equals(_activeViewer)) { _activeViewer = null; } // if (e.DockWindow.Equals(_newestCreatedCanvasViewer)) { _newestCreatedCanvasViewer = null; } // _linkableViewerManager.Unlink(e.DockWindow as ILinkableViewer); e.DockWindow.Dispose(); /* * 以下1行释放Telerik不能释放的资源 */ if (e.DockWindow is Telerik.WinControls.IGeoDoFree) { (e.DockWindow as Telerik.WinControls.IGeoDoFree).Free(); } if (e.DockWindow is ISmartWindow) { (e.DockWindow as ISmartWindow).Free(); } /* * 以下三行释放视图资源(CanvasViewer,LayoutViewer) */ ISmartViewer smartViewer = e.DockWindow as ISmartViewer; if (smartViewer != null) { smartViewer.DisposeViewer(); // SetActiveViewer(null, smartViewer is ICanvasViewer); } /* * 以下一句解决LayoutEventArgs引用DocumentTabStrip对象导致对象不释放的问题 */ _radDock.MainDocumentContainer.PerformLayout(); // GC.Collect(); }
public void AddDocument(ISmartWindow window) { HandleRepeatedName(window); ISmartWindow wnd = GetSmartWindow((w) => { return(w.Equals(window)); }); if (wnd == null) { _radDock.AddDocument(window as DockWindow, DockPosition.Fill); } }
public override void Execute() { ISmartWindow smartWindow = _smartSession.SmartWindowManager.GetSmartWindow((w) => { return(w.GetType() == typeof(frmSmoothToolWindows)); }); if (smartWindow == null) { smartWindow = new frmSmoothToolWindows(); } _smartSession.SmartWindowManager.DisplayWindow(smartWindow); }
private void CloseToolExecute(int toolWndID) { ISmartWindow wnd = _session.SmartWindowManager.SmartToolWindowFactory.GetSmartToolWindow(toolWndID); if (wnd != null) { (wnd as DockWindow).Select(); (wnd as DockWindow).Close(); (wnd as DockWindow).Dispose(); } }
private void InitIceWnd(string defaultBand) { ISmartWindow window = _smartSession.SmartWindowManager.GetSmartWindow((w) => { return(w.GetType() == typeof(IceFeatureListWnd)); }); if (window == null) { return; } IceFeatureListWnd iceWnd = window as IceFeatureListWnd; iceWnd.InitIce(defaultBand); }
public override void Execute(string argument) { ISmartWindow smartWindow = _smartSession.SmartWindowManager.GetSmartWindow((w) => { return(w.GetType() == typeof(pageSearchCondition)); }); if (smartWindow == null) { smartWindow = new pageSearchCondition(); (smartWindow as ToolWindowBase).Init(_smartSession); } (smartWindow as pageSearchCondition).SetArgument(argument); _smartSession.SmartWindowManager.DisplayWindow(smartWindow, new WindowPosition(System.Windows.Forms.DockStyle.Left, false)); }
public override void Execute(string argument) { ISmartWindow smartWindow = _smartSession.SmartWindowManager.GetSmartWindow((w) => { return(w.GetType() == typeof(toDbPage)); }); if (smartWindow == null) { smartWindow = new toDbPage(); } _smartSession.SmartWindowManager.DisplayWindow(smartWindow); (smartWindow as toDbPage).UpdateSession(_smartSession); _smartSession.SmartWindowManager.DisplayWindow(smartWindow); }
public override void Execute(string argument) { ISmartWindow smartWindow = _smartSession.SmartWindowManager.GetSmartWindow((w) => { return(w.GetType() == typeof(queryPage)); }); if (smartWindow == null) { smartWindow = new queryPage(_smartSession); } _smartSession.SmartWindowManager.DisplayWindow(smartWindow); (smartWindow as queryPage).SetQuery(argument); _smartSession.SmartWindowManager.DisplayWindow(smartWindow); }
/// <summary> /// /// </summary> /// <param name="argument"> /// 格式"*#*"冒号前面部分表示文件名称,冒号后面部分表示所选投影坐标的Wkt格式字符串 /// </param> public override void Execute(string argument) { ISmartWindow smartWindow = _smartSession.SmartWindowManager.GetSmartWindow((w) => { return(w.GetType() == typeof(firstPage)); }); if (smartWindow == null) { smartWindow = new firstPage(_smartSession); _smartSession.SmartWindowManager.DisplayWindow(smartWindow); } else { _smartSession.SmartWindowManager.DisplayWindow(smartWindow); } }
void ActiveWindowChanged(object sender, ISmartWindow oldWindow, ISmartWindow newWindow) { UnattachEvent(oldWindow); if (newWindow == null || !(newWindow is ICanvasViewer)) { FreeBuffer(); this.Refresh(); return; } FreeBuffer(); ICanvasViewer cv = newWindow as ICanvasViewer; cv.Canvas.OnEnvelopeChanged += _viewerEnvelopeChanged; this.Invalidate(); }
public override void Execute() { ISmartWindow smartWindow = _smartSession.SmartWindowManager.GetSmartWindow((w) => { return(w.GetType() == typeof(dockHist)); }); if (smartWindow == null) { smartWindow = new dockHist(_smartSession); _smartSession.SmartWindowManager.DisplayWindow(smartWindow); } else { _smartSession.SmartWindowManager.DisplayWindow(smartWindow); } return; }
public void DisplayWindow(ISmartWindow window, WindowPosition position, params object[] options) { if (position == null || position.DockStyle == DockStyle.Fill) { DisplayWindow(window); return; } if ((window as DockWindow).DockState == DockState.Hidden) { (window as DockWindow).DockState = DockState.Docked; return; } if (position.DockStyle == DockStyle.None) { if (options != null && options.Length > 0) { Rectangle rect = (Rectangle)options[0]; _radDock.FloatWindow(window as DockWindow, rect); } else { _radDock.FloatWindow(window as DockWindow); } return; } DockPosition dockPosition = GetDockPosition(position); if (position.IsSharePanel) { DockWindow edgeDockwindow = GetEdgeDockwindow(dockPosition); if (edgeDockwindow == null) { _radDock.DockWindow(window as DockWindow, dockPosition); _edgeDockwindows.Add((DockPosition)dockPosition, window as DockWindow); } else { _edgeDockwindows.Remove(dockPosition); _edgeDockwindows.Add(dockPosition, window as DockWindow); _radDock.DockWindow(window as DockWindow, edgeDockwindow.DockTabStrip, DockPosition.Top); } } else { _radDock.DockWindow(window as DockWindow, dockPosition); } }
public bool IsExist(ISmartWindow window) { var result = _radDock.GetWindows <DockWindow>(); if (result == null || result.Count() == 0) { return(false); } foreach (DockWindow wnd in result) { if (wnd.Equals(window)) { return(true); } } return(false); }
void ActiveWindowChanged(object sender, ISmartWindow oldWindow, ISmartWindow newWindow) { //解决第一次打开判识面板打不开的问题 if (newWindow != null && newWindow.Equals(oldWindow)) { return; } ICanvasViewer cv = _session.SmartWindowManager.ActiveCanvasViewer; IMonitoringSession msession = _session.MonitoringSession as IMonitoringSession; if (cv == null || !cv.Equals(msession.CurrentCanvasViewer)) { if (!IsKeepUserControl) { this.Close(); } } }
private void Init() { _layoutControl = new LayoutControl(); _host = new LayoutHost(_layoutControl); this.Controls.Add(_layoutControl); _layoutControl.Dock = DockStyle.Fill; //默认活动工具为选择元素工具 _host.CurrentTool = new ArrowTool(); //注册元素被拖入的事件(用于刷新图层管理器) _host.OnElementIsDragDroped += new EventHandler((eles, e) => { TryInitFeatureLements(eles); ISmartWindow layerManager = _session.SmartWindowManager.GetSmartWindow((wnd) => { return(wnd is ILayerManager); }); if (layerManager != null) { (layerManager as ILayerManager).Update(); } }); }
public void DisplayWindow(ISmartWindow window) { HandleRepeatedName(window); ISmartWindow wnd = GetSmartWindow((w) => { return(w.Equals(window)); }); if (wnd == null) { _radDock.AddDocument(window as DockWindow, DockPosition.Fill); //_radDock.AddDocument(window as DockWindow, _radDock.GetDefaultDocumentTabStrip(false), DockPosition.Fill); _radDock.ActivateWindow(window as DockWindow); } else { if (wnd != null) { _radDock.ActivateWindow(wnd as DockWindow); } } }
public override void Execute() { try { ISmartWindow smartWindow = _smartSession.SmartWindowManager.GetSmartWindow((w) => { return(w.GetType() == typeof(CloudsatProfilePage)); }); if (smartWindow == null) { smartWindow = new CloudsatProfilePage(_smartSession); _smartSession.SmartWindowManager.DisplayWindow(smartWindow, new WindowPosition(DockStyle.Left, false), null); } else { _smartSession.SmartWindowManager.DisplayWindow(smartWindow); } } catch (Exception ex) { MessageBox.Show(ex.Message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// 全球火点修正 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void mhiCorrect_Click(object sender, EventArgs e) { try { ISmartWindow smartWindow = _session.SmartWindowManager.GetSmartWindow((w) => { return(w.GetType() == typeof(masGbalFireCorrectPage)); }); if (smartWindow == null) { smartWindow = new masGbalFireCorrectPage(_session); _session.SmartWindowManager.DisplayWindow(smartWindow); SetArgsPanelWidth(smartWindow); } else { _session.SmartWindowManager.DisplayWindow(smartWindow); } } catch (Exception ex) { MessageBox.Show(ex.Message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public override void Execute() { try { base.Execute(); ISmartWindow smartWindow = _smartSession.SmartWindowManager.GetSmartWindow((w) => { return(w.GetType() == typeof(frmDataMoasic)); }); if (smartWindow == null) { smartWindow = new frmDataMoasic(_smartSession); _smartSession.SmartWindowManager.DisplayWindow(smartWindow); } else { _smartSession.SmartWindowManager.DisplayWindow(smartWindow); } } catch (Exception ex) { MessageBox.Show(ex.Message, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void HandleRepeatedName(ISmartWindow window) { var wnds = _radDock.GetWindows <DockWindow>(); if (wnds == null || wnds.Count() == 0) { return; } DockWindow dockWnd = window as DockWindow; if (dockWnd == null) { return; } foreach (DockWindow wnd in wnds) { if (wnd.Name == dockWnd.Name) { dockWnd.Name = Guid.NewGuid().ToString(); break; } } }
public ISmartWindow[] GetSmartWindows(Func <ISmartWindow, bool> where) { var result = _radDock.GetWindows <DockWindow>(); if (result == null || result.Count() == 0) { return(null); } List <ISmartWindow> wnds = new List <ISmartWindow>(); foreach (DockWindow wnd in result) { ISmartWindow swnd = wnd as ISmartWindow; if (swnd == null) { continue; } if (swnd != null && where (swnd)) { wnds.Add(swnd); } } return(wnds.Count > 0 ? wnds.ToArray() : null); }
private ICanvasViewer _activeViewer = null;//用于统计的窗口windows。 /// <summary> /// 窗口切换 /// </summary> /// <param name="sender"></param> /// <param name="oldWindow"></param> /// <param name="newWindow"></param> void ActiveWindowChanged(object sender, ISmartWindow oldWindow, ISmartWindow newWindow) { _extractedPixels = null; if (newWindow == null || !(newWindow is ICanvasViewer)) { return; } if (_activeViewer == newWindow) { return; } if (_filters != null) { _filters.Clear(); } if (_activeViewer != null) { if (oldWindow != null && oldWindow is ICanvasViewer) { ClearFeature(oldWindow as ICanvasViewer); } else { ClearFeature(_activeViewer); } _activeViewer.Canvas.Refresh(enumRefreshType.VectorLayer); } _activeViewer = newWindow as ICanvasViewer; _activeViewer.OnWindowClosed = (wSender, e) => { Free(); _activeViewer = null; }; StatContent statContent = null; GeoDo.RSS.Core.DrawEngine.ILayer[] layers = _activeViewer.Canvas.LayerContainer.Layers.ToArray(); foreach (GeoDo.RSS.Core.DrawEngine.ILayer layer in layers) { if (layer is BinaryBitmapLayer)//二值图层 { IExtractingSession se = (_session.MonitoringSession as MonitoringSession).ExtractingSession; _extractedPixels = se.GetBinaryValuesMapper(se.CurrentProduct.Identify, se.CurrentSubProduct.Identify); if (_extractedPixels == null) { continue; } string layerName = layer.Name; statContent = FeatureListStatConfig.MatchStatContent(layerName); } else if (layer is IRasterLayer) { IRasterLayer rasterLayer = layer as IRasterLayer; if (rasterLayer == null) { continue; } IRasterDrawing rasterDrawing = rasterLayer.Drawing as IRasterDrawing; if (rasterDrawing == null) { continue; } string layerName = layer.Name; statContent = FeatureListStatConfig.MatchStatContent(layerName); } } if (statContent != null) { Dictionary <string, Func <short, bool> > filters = new Dictionary <string, Func <short, bool> >(); Dictionary <string, int> sataItems = statContent.StatItems; string[] statKeys = sataItems.Keys.ToArray(); int[] statValues = sataItems.Values.ToArray(); for (int i = 0; i < statKeys.Length; i++) { string key = statKeys[i]; int value = statValues[i]; filters.Add(key, (val) => { return(val == value); }); } InitStatContent(filters); } if (_filters == null || _filters.Count == 0) { SataSimpleArea(); } else { StatFilterAreas(); } }
private void SetArgsPanelWidth(ISmartWindow smartWindow) { masGbalFireCorrectPage window = smartWindow as masGbalFireCorrectPage; window.SetArgsPanelWidth((int)(window.Width / 4.5f)); }
public void Show(ISmartWindow window) { (window as DockWindow).DockState = DockState.Docked; }
public void Hide(ISmartWindow window) { (window as DockWindow).DockState = DockState.Hidden; }