public EditorEventsDialogCommand() { // SetupDockableWindow(); UID windowID = new UIDClass(); windowID.Value = @"ESRI_Employee_Events_EditorEventsDialog"; m_dockableWindow = ArcMap.DockableWindowManager.GetDockableWindow(windowID); }
public CurveByInferenceExtension() { //update the dockable window so that it has the correct version UID dockWinID = new UIDClass(); dockWinID.Value = ThisAddIn.IDs.CurveByInferenceWindow; s_CurveByInfrenceWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID); s_CurveByInfrenceWindow.Caption = String.Format("{0} ({1})", s_CurveByInfrenceWindow.Caption, ThisAddIn.Version); }
internal int Add(IDockableWindow content) { #if DEBUG if (DockPane != null) throw new InvalidOperationException(); #endif if (Contains(content)) return IndexOf(content); return InnerList.Add(content); }
protected override void OnShutdown() { Uninitialize(); ArcMap.Events.NewDocument -= ArcMap_NewOpenDocument; ArcMap.Events.OpenDocument -= ArcMap_NewOpenDocument; m_map = null; s_dockWindow = null; s_extension = null; base.OnShutdown(); }
internal void AddAt(IDockableWindow content, int index) { #if DEBUG if (DockPane != null) throw new InvalidOperationException(); #endif if (index < 0 || index > InnerList.Count - 1) return; if (Contains(content)) return; InnerList.Insert(index, content); }
internal static IDockableWindow GetSystemActivityWindowWindow() { if (s_extension == null) GetExtension(); if (s_CurveByInfrenceWindow == null) { UID dockWinID = new UIDClass(); dockWinID.Value = ThisAddIn.IDs.CurveByInferenceWindow; s_CurveByInfrenceWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID); s_CurveByInfrenceWindow.Caption = String.Format("{0} ({1})", s_CurveByInfrenceWindow.Caption, ThisAddIn.Version); } return s_CurveByInfrenceWindow; }
internal static IDockableWindow GetDockWindowHauteurDif() { if (s_extension == null) GetExtension(); // Only get/create the dockable window if they ask for it if (s_dockWindowHauteurDif == null) { // Use GetDockableWindow directly intead of FromID as we want the client IDockableWindow not the internal class UID dockWinID = new UIDClass(); dockWinID.Value = ThisAddIn.IDs.SF10_dckFrmHauteurDif; s_dockWindowHauteurDif = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID); } return s_dockWindowHauteurDif; }
protected override void OnClick() { if (myDock == null) // create a new one { UID dockWinID = new UIDClass(); dockWinID.Value = @"Minnesota_Geospatial_Commons_gDRE_MainWinForm"; myDock = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID); myDock.Show(true); MessageBox.Show("The GDRS Resource editor has launched into a dockable window."); } else { myDock.Show(true); } }
protected override void OnClick() { // // TODO: Sample code showing how to access button host // if (dock == null) { UID dockWinID = new UIDClass(); dockWinID.Value = ThisAddIn.IDs.DockableWindow1; dock = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID); } else { dock.Show(!dock.IsVisible()); } ArcMap.Application.CurrentTool = null; }
private void DrawTab(Graphics g, IDockableWindow content, Rectangle rect) { OnBeginDrawTab(content.DockHandler.DockPaneTab); if (Appearance == DockPane.AppearanceStyle.ToolWindow) DrawTab_ToolWindow(g, content, rect); else DrawTab_Document(g, content, rect); OnEndDrawTab(content.DockHandler.DockPaneTab); }
public DockPane CreateDockPane(IDockableWindow content, Rectangle floatWindowBounds, bool show) { return(new DockPane(content, floatWindowBounds, show)); }
/// <include file='CodeDoc\DockPaneTabCollection.xml' path='//CodeDoc/Class[@name="DockPaneTabCollection"]/Method[@name="IndexOf(IDockContent)"]/*'/>> public int IndexOf(IDockableWindow content) { return DockPane.DisplayingContents.IndexOf(content); }
// Statics //internal static IDockableWindow GetSelectionCountWindow() //{ // if (s_extension == null) // GetExtension(); // // Only get/create the dockable window if they ask for it // if (s_dockWindow == null) // { // // Use GetDockableWindow directly intead of FromID as we want the client IDockableWindow not the internal class // UID dockWinID = new UIDClass(); // dockWinID.Value = ThisAddIn.IDs.SelCountDockWin; // s_dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID); // s_extension.UpdateSelCountDockWin(); // } // return s_dockWindow; //} internal static IDockableWindow GetConfigWindow() { if (s_extension == null) GetExtension(); // Only get/create the dockable window if they ask for it if (s_dockWindow == null) { // Use GetDockableWindow directly intead of FromID as we want the client IDockableWindow not the internal class UID dockWinID = new UIDClass(); dockWinID.Value = ThisAddIn.IDs.iFormConfigurationWindow; s_dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID); //s_extension.UpdateSelCountDockWin(); } return s_dockWindow; }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { if (hook == null) return; m_application = hook as IApplication; //Disable if it is not ArcMap if (hook is IMxApplication) base.m_enabled = true; else base.m_enabled = false; m_mainExtension = SelectionExtension.GetExtension(); if (m_mainExtension != null) m_dockWindow = m_mainExtension.GetSelectionCountWindow; }
internal AutoHideTabVS2003(IDockableWindow content) : base(content) { }
protected override void OnShutdown() { s_dockWindow = null; m_editEvents.OnStartEditing -= m_editEvents_OnStartEditing; m_editEvents2.OnVertexAdded -= OnVertexAdded; }
public DockPane CreateDockPane(IDockableWindow content, FloatWindow floatWindow, bool show) { return(new DockPane(content, floatWindow, show)); }
/// <include file='CodeDoc/DockPaneStripBase.xml' path='//CodeDoc/Class[@name="DockPaneStripBase"]/Method[@name="EnsureTabVisible(IDockContent)"]/*'/> protected internal abstract void EnsureTabVisible(IDockableWindow content);
/// <exclude/> protected override void WndProc(ref Message m) { if (m.Msg == (int)Win32.Msgs.WM_MOUSEMOVE) { int index = GetHitTest(); if (index != -1) { IDockableWindow content = Tabs[index].Content; if (DockPane.ActiveContent != content) { DockPane.ActiveContent = content; DockPane.Activate(); Update(); } if (DockPane.DockPanel.AllowRedocking && DockPane.AllowRedocking && DockPane.ActiveContent.DockHandler.AllowRedocking) { DockPane.DockPanel.DragHandler.BeginDragContent(DockPane.ActiveContent); } } else { base.WndProc(ref m); } return; } else if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDOWN) { int index = GetHitTest(); if (index != -1) { IDockableWindow content = Tabs[index].Content; if (DockPane.ActiveContent != content) { DockPane.ActiveContent = content; DockPane.Activate(); Update(); } if (DockPane.DockPanel.AllowRedocking && DockPane.AllowRedocking && DockPane.ActiveContent.DockHandler.AllowRedocking) { DockPane.DockPanel.DragHandler.BeginDragContent(DockPane.ActiveContent); } } else { base.WndProc(ref m); } return; } else if (m.Msg == (int)Win32.Msgs.WM_RBUTTONDOWN) { int index = GetHitTest(); if (index != -1) { IDockableWindow content = Tabs[index].Content; if (DockPane.ActiveContent != content) { DockPane.ActiveContent = content; } } base.WndProc(ref m); return; } else if (m.Msg == (int)Win32.Msgs.WM_RBUTTONUP) { int index = GetHitTest(); if (index != -1) { IDockableWindow content = Tabs[index].Content; if (content.DockHandler.TabPageContextMenuStrip != null) { content.DockHandler.TabPageContextMenuStrip.Show(this, this.PointToClient(Control.MousePosition)); } else if (content.DockHandler.TabPageContextMenu != null) { content.DockHandler.TabPageContextMenu.Show(this, this.PointToClient(Control.MousePosition)); } } base.WndProc(ref m); return; } else if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDBLCLK) { base.WndProc(ref m); int index = GetHitTest(); if (DockPane.DockPanel.AllowRedocking && index != -1) { IDockableWindow content = Tabs[index].Content; try { content.DockHandler.IsFloat = !content.DockHandler.IsFloat; } catch { } } return; } base.WndProc(ref m); return; }
private void DrawTab(Graphics g, AutoHideTabVS2005 tab) { Rectangle rectTab = GetTabRectangle(tab); if (rectTab.IsEmpty) { return; } DockState dockState = tab.Content.DockHandler.DockState; IDockableWindow content = tab.Content; OnBeginDrawTab(tab); Brush brushTabBackGround = BrushTabBackground; Pen penTabBorder = PenTabBorder; Brush brushTabText = BrushTabText; g.FillRectangle(brushTabBackGround, rectTab); g.DrawLine(penTabBorder, rectTab.Left, rectTab.Top, rectTab.Left, rectTab.Bottom); g.DrawLine(penTabBorder, rectTab.Right, rectTab.Top, rectTab.Right, rectTab.Bottom); if (dockState == DockState.DockTopAutoHide || dockState == DockState.DockRightAutoHide) { g.DrawLine(penTabBorder, rectTab.Left, rectTab.Bottom, rectTab.Right, rectTab.Bottom); } else { g.DrawLine(penTabBorder, rectTab.Left, rectTab.Top, rectTab.Right, rectTab.Top); } // Set no rotate for drawing icon and text Matrix matrixRotate = g.Transform; g.Transform = MatrixIdentity; // Draw the icon Rectangle rectImage = rectTab; rectImage.X += ImageGapLeft; rectImage.Y += ImageGapTop; int imageHeight = rectTab.Height - ImageGapTop - ImageGapBottom; int imageWidth = ImageWidth; if (imageHeight > ImageHeight) { imageWidth = ImageWidth * (imageHeight / ImageHeight); } rectImage.Height = imageHeight; rectImage.Width = imageWidth; rectImage = GetTransformedRectangle(dockState, rectImage); g.DrawIcon(((Form)content).Icon, rectImage); // Draw the text if (content == content.DockHandler.Pane.ActiveContent) { Rectangle rectText = rectTab; rectText.X += ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft; rectText.Width -= ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft; rectText = GetTransformedRectangle(dockState, rectText); if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide) { g.DrawString(content.DockHandler.TabText, Font, brushTabText, rectText, StringFormatTabVertical); } else { g.DrawString(content.DockHandler.TabText, Font, brushTabText, rectText, StringFormatTabHorizontal); } } // Set rotate back g.Transform = matrixRotate; OnEndDrawTab(tab); }
private void DrawTab_Document(Graphics g, IDockableWindow content, Rectangle rect) { Rectangle rectText = rect; if (DockPane.DockPanel.ShowDocumentIcon) { rectText.X += DocumentTextExtraWidth / 2 + DocumentIconWidth + DocumentIconGapLeft; rectText.Width -= DocumentTextExtraWidth + DocumentIconWidth + DocumentIconGapLeft; } else { rectText.X += DocumentTextExtraWidth / 2; rectText.Width -= DocumentTextExtraWidth; } if (DockPane.ActiveContent == content) { g.FillRectangle(ActiveBackBrush, rect); g.DrawLine(OutlineOuterPen, rect.X, rect.Y, rect.X, rect.Y + rect.Height); g.DrawLine(OutlineOuterPen, rect.X, rect.Y, rect.X + rect.Width - 1, rect.Y); g.DrawLine(OutlineInnerPen, rect.X + rect.Width - 1, rect.Y, rect.X + rect.Width - 1, rect.Y + rect.Height - 1); if (DockPane.DockPanel.ShowDocumentIcon) { Icon icon = (content as Form).Icon; Rectangle rectIcon = new Rectangle( rect.X + DocumentIconGapLeft, rect.Y + (rect.Height - DocumentIconHeight) / 2, DocumentIconWidth, DocumentIconHeight); g.DrawIcon((content as Form).Icon, rectIcon); } if (DockPane.IsActiveDocumentPane) { using (Font boldFont = new Font(this.Font, FontStyle.Bold)) { g.DrawString(content.DockHandler.TabText, boldFont, ActiveTextBrush, rectText, DocumentTextStringFormat); } } else { g.DrawString(content.DockHandler.TabText, Font, InactiveTextBrush, rectText, DocumentTextStringFormat); } } else { if (Tabs.IndexOf(DockPane.ActiveContent) != Tabs.IndexOf(content) + 1) { g.DrawLine(TabSeperatorPen, rect.X + rect.Width - 1, rect.Y, rect.X + rect.Width - 1, rect.Y + rect.Height - 1 - DocumentTabGapTop); } if (DockPane.DockPanel.ShowDocumentIcon) { Icon icon = (content as Form).Icon; Rectangle rectIcon = new Rectangle( rect.X + DocumentIconGapLeft, rect.Y + (rect.Height - DocumentIconHeight) / 2, DocumentIconWidth, DocumentIconHeight); g.DrawIcon((content as Form).Icon, rectIcon); } g.DrawString(content.DockHandler.TabText, Font, InactiveTextBrush, rectText, DocumentTextStringFormat); } }
internal AutoHideTabVS2003(IDockableWindow content) : base(content) { }
internal void Remove(IDockableWindow content) { if (DockPane != null) throw new InvalidOperationException(); if (!Contains(content)) return; InnerList.Remove(content); }
/// <include file='CodeDoc\EventArgs.xml' path='//CodeDoc/Class[@name="DockContentEventArgs"]/Constructor[@name="(IDockContent)"]/*'/> public DockContentEventArgs(IDockableWindow content) { m_content = content; }
private int GetIndexOfVisibleContents(IDockableWindow content) { #if DEBUG if (DockPane == null) throw new InvalidOperationException(); #endif if (content == null) return -1; int index = -1; foreach (IDockableWindow c in DockPane.Contents) { if (c.DockHandler.DockState == DockPane.DockState) { index++; if (c == content) return index; } } return -1; }
/// <include file='CodeDoc/DockPaneTab.xml' path='//CodeDoc/Class[@name="DockPaneTab"]/Construct[@name="(IDockContent)"]/*'/> public DockPaneTab(IDockableWindow content) { m_content = content; }
/// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Constructor[@name="(IDockContent, FloatWindow, bool)"]/*'/> public DockPane(IDockableWindow content, FloatWindow floatWindow, bool show) { InternalConstruct(content, DockState.Float, false, Rectangle.Empty, floatWindow.DockList.GetDefaultPrevPane(this), DockAlignment.Right, 0.5, show); }
internal DockPaneTabVS2005(IDockableWindow content) : base(content) { }
internal DockPaneTabVS2003(IDockableWindow content) : base(content) { }
public AutoHideTab CreateAutoHideTab(IDockableWindow content) { return(new AutoHideTabVS2005(content)); }
/// <include file='CodeDoc\EventArgs.xml' path='//CodeDoc/Class[@name="DockContentEventArgs"]/Constructor[@name="(IDockContent)"]/*'/> public DockContentEventArgs(IDockableWindow content) { m_content = content; }
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="Show(DockPane, DockHandler)"]/*'/> public void Show(DockPane pane, IDockableWindow beforeContent) { DockHandler.Show(pane, beforeContent); }
/// <include file='CodeDoc\DockPaneTabCollection.xml' path='//CodeDoc/Class[@name="DockPaneTabCollection"]/Method[@name="Contains(IDockContent)"]/*'/>> public bool Contains(IDockableWindow content) { return (IndexOf(content) != -1); }
private void DrawTab_Document(Graphics g, IDockableWindow content, Rectangle rect) { SmoothingMode mode = g.SmoothingMode; g.SmoothingMode = SmoothingMode.AntiAlias; GraphicsPath gp = new GraphicsPath(); gp.AddLine(rect.X, rect.Bottom, rect.X + (rect.Height / 2), rect.Top + 2); gp.AddLine(rect.X + (rect.Height / 2) + 4, rect.Top, rect.Right - 2, rect.Top); gp.AddLine(rect.Right, rect.Top + 2, rect.Right, rect.Bottom); Rectangle rectText = rect; if (DockPane.DockPanel.ShowDocumentIcon) { rectText.X += DocumentTextExtraWidth / 2 + DocumentIconWidth + DocumentIconGapLeft; rectText.Width -= DocumentTextExtraWidth + DocumentIconWidth + DocumentIconGapLeft; } else { rectText.X += DocumentTextExtraWidth / 2; rectText.Width -= DocumentTextExtraWidth; } rectText.X += (rect.Height/2 ); rectText.Width -= (rect.Height /2); if (DockPane.ActiveContent == content) { /*g.FillRectangle(ActiveBackBrush, rect); g.DrawLine(OutlineOuterPen, rect.X, rect.Y, rect.X, rect.Y + rect.Height); g.DrawLine(OutlineOuterPen, rect.X, rect.Y, rect.X + rect.Width - 1, rect.Y); g.DrawLine(OutlineInnerPen, rect.X + rect.Width - 1, rect.Y, rect.X + rect.Width - 1, rect.Y + rect.Height - 1);*/ LinearGradientBrush lnbr = new LinearGradientBrush(rect,this.ActiveBackColor2, this.ActiveBackColor1, LinearGradientMode.Vertical ); g.FillPath(lnbr, gp); g.DrawPath(OutlineOuterPen, gp); if (DockPane.DockPanel.ShowDocumentIcon) { Icon icon = (content as Form).Icon; Rectangle rectIcon = new Rectangle( rect.X + DocumentIconGapLeft, rect.Y + (rect.Height - DocumentIconHeight) / 2, DocumentIconWidth, DocumentIconHeight); g.DrawIcon((content as Form).Icon, rectIcon); } if (DockPane.IsActiveDocumentPane) { using (Font boldFont = new Font(this.Font, FontStyle.Bold)) { g.DrawString(content.DockHandler.TabText, boldFont, ActiveTextBrush, rectText, DocumentTextStringFormat); } } else g.DrawString(content.DockHandler.TabText, Font, InactiveTextBrush, rectText, DocumentTextStringFormat); g.DrawLine(this.OutlineOuterPen, 0, rect.Bottom - 1, rect.Left, rect.Bottom - 1); } else { LinearGradientBrush lnbr = new LinearGradientBrush(rect, this.ActiveBackColor1, this.ActiveBackColor2, LinearGradientMode.Vertical); g.FillPath(lnbr, gp); g.DrawPath(OutlineOuterPen, gp); //if (Tabs.IndexOf(DockPane.ActiveContent) != Tabs.IndexOf(content) + 1) // g.DrawLine(TabSeperatorPen, // rect.X + rect.Width - 1, rect.Y, // rect.X + rect.Width - 1, rect.Y + rect.Height - 1 - DocumentTabGapTop); if (DockPane.DockPanel.ShowDocumentIcon) { Icon icon = (content as Form).Icon; Rectangle rectIcon = new Rectangle( rect.X + DocumentIconGapLeft, rect.Y + (rect.Height - DocumentIconHeight) / 2, DocumentIconWidth, DocumentIconHeight); g.DrawIcon((content as Form).Icon, rectIcon); } g.DrawString(content.DockHandler.TabText, Font, InactiveTextBrush, rectText, DocumentTextStringFormat); g.DrawLine(this.OutlineOuterPen, rect.Left, rect.Bottom - 1, rect.Right, rect.Bottom - 1); } g.SmoothingMode = mode; }
/// <exclude /> protected internal override void EnsureTabVisible(IDockableWindow content) { if (Appearance != DockPane.AppearanceStyle.Document || !Tabs.Contains(content)) return; Rectangle rectTabStrip = TabsRectangle; Rectangle rectTab = GetTabRectangle(Tabs.IndexOf(content)); if (rectTab.Right > rectTabStrip.Right) { OffsetX -= rectTab.Right - rectTabStrip.Right; rectTab.X -= rectTab.Right - rectTabStrip.Right; } if (rectTab.Left < rectTabStrip.Left) OffsetX += rectTabStrip.Left - rectTab.Left; OnRefreshChanges(); }
/// <include file='CodeDoc\DockContentCollection.xml' path='//CodeDoc/Class[@name="DockContentCollection"]/Method[@name="IndexOf(IDockContent)"]/*'/> public int IndexOf(IDockableWindow content) { if (DockPane == null) { if (!Contains(content)) return -1; else return InnerList.IndexOf(content); } else return GetIndexOfVisibleContents(content); }
private void DrawTab_ToolWindow(Graphics g, IDockableWindow content, Rectangle rect) { GraphicsPath gp = new GraphicsPath(); gp.AddLine(rect.X, rect.Top - 1, rect.Right - 1, rect.Top - 1); gp.AddLine(rect.Right - 1, rect.Top, rect.Right - 1, rect.Bottom - 3); gp.AddLine(rect.Right - 3, rect.Bottom - 1, rect.X + 2, rect.Bottom - 1); gp.AddLine(rect.X, rect.Bottom - 3, rect.X, rect.Top); gp.CloseAllFigures(); Rectangle rectIcon = new Rectangle( rect.X + ToolWindowImageGapLeft, rect.Y + rect.Height - 1 - ToolWindowImageGapBottom - ToolWindowImageHeight, ToolWindowImageWidth, ToolWindowImageHeight); Rectangle rectText = rectIcon; rectText.X += rectIcon.Width + ToolWindowImageGapRight; rectText.Width = rect.Width - rectIcon.Width - ToolWindowImageGapLeft - ToolWindowImageGapRight - ToolWindowTextGapRight; if (DockPane.ActiveContent == content) { LinearGradientBrush lnbr = new LinearGradientBrush(rect, this.ActiveBackColor2, this.ActiveBackColor1, LinearGradientMode.Vertical); g.FillPath(lnbr, gp); g.DrawPath(OutlineOuterPen, gp); /* g.FillRectangle(lnbr, rect); g.DrawLine(OutlineOuterPen, rect.X, rect.Y, rect.X, rect.Y + rect.Height - 1); g.DrawLine(OutlineInnerPen, rect.X, rect.Y + rect.Height - 1, rect.X + rect.Width - 1, rect.Y + rect.Height - 1); g.DrawLine(OutlineInnerPen, rect.X + rect.Width - 1, rect.Y, rect.X + rect.Width - 1, rect.Y + rect.Height - 1);*/ g.DrawString(content.DockHandler.TabText, Font, ActiveTextBrush, rectText, ToolWindowTextStringFormat); } else { if (Tabs.IndexOf(DockPane.ActiveContent) != Tabs.IndexOf(content) + 1) g.DrawLine(TabSeperatorPen, rect.X + rect.Width - 1, rect.Y + ToolWindowTabSeperatorGapTop, rect.X + rect.Width - 1, rect.Y + rect.Height - 1 - ToolWindowTabSeperatorGapBottom); g.DrawString(content.DockHandler.TabText, Font, InactiveTextBrush, rectText, ToolWindowTextStringFormat); } if (rect.Contains(rectIcon)) g.DrawIcon(content.DockHandler.Icon, rectIcon); }
public DockPane CreateDockPane(IDockableWindow content, DockPane prevPane, DockAlignment alignment, double proportion, bool show) { return(new DockPane(content, prevPane, alignment, proportion, show)); }
/// <include file='CodeDoc\DockContentCollection.xml' path='//CodeDoc/Class[@name="DockContentCollection"]/Method[@name="Contains(IDockContent)"]/*'/> public bool Contains(IDockableWindow content) { if (DockPane == null) return InnerList.Contains(content); else return (GetIndexOfVisibleContents(content) != -1); }
protected override void OnClick() { ICadastralEditor pCadEd = (ICadastralEditor)ArcMap.Application.FindExtensionByName("esriCadastralUI.CadastralEditorExtension"); ICadastralFabric pCadFabric = pCadEd.CadastralFabric; ICadastralExtensionManager2 pCadExtMan = (ICadastralExtensionManager2)pCadEd; IParcelEditManager pParcEditorMan = (IParcelEditManager)pCadEd; IParcelConstruction pTrav = pParcEditorMan.ParcelConstruction; //Test for the visibility of the parcel details window IDockableWindowManager pDocWinMgr = (IDockableWindowManager)ArcMap.Application; UID pUID = new UIDClass(); pUID.Value = "{28531B78-7C42-4785-805D-2A7EC8879EA1}";//ArcID.ParcelDetails IDockableWindow pParcelDet = pDocWinMgr.GetDockableWindow(pUID); if (!pParcelDet.IsVisible()) { MessageBox.Show("The Parcel Details window is not visible. \r\nThere is no data to save."); return; } //Make sure the lines grid is selected Utilities UTILS = new Utilities(); UTILS.SelectCadastralPropertyPage((ICadastralExtensionManager)pCadExtMan, "lines"); //test to make sure there is data there to be saved IParcelConstruction3 pConstr = (IParcelConstruction3)pTrav; IGSParcel pParcel = null; // try { pParcel = pTrav.Parcel; } catch (COMException err) { MessageBox.Show(err.Message + Environment.NewLine + "ERROR: Select a parcel or add lines to the grid. \r\nThere is no data to save. "); return; } //define the file that needs to be saved // Display .Net dialog for File saving. SaveFileDialog saveFileDialog = new SaveFileDialog(); // Set File Filter saveFileDialog.Filter = "Comma-delimited(*.csv)|*.csv|All Files|*.*"; saveFileDialog.FilterIndex = 1; saveFileDialog.RestoreDirectory = true; // Warn on overwrite saveFileDialog.OverwritePrompt = true; // Don't need to Show Help saveFileDialog.ShowHelp = false; // Set Dialog Title saveFileDialog.Title = "Save file"; // Display Open File Dialog if (saveFileDialog.ShowDialog() != DialogResult.OK) { saveFileDialog = null; return; } TextWriter tw = null; try { tw = new StreamWriter(saveFileDialog.FileName); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } try { IGSPlan pPlan = pTrav.Parcel.Plan; int iDF = (int)pPlan.DirectionFormat; switch (iDF) { case (int)esriDirectionType.esriDTNorthAzimuth: tw.WriteLine("DT,NA"); break; case (int)esriDirectionType.esriDTPolar: tw.WriteLine("DT,P"); break; case (int)esriDirectionType.esriDTQuadrantBearing: tw.WriteLine("DT,QB"); break; case (int)esriDirectionType.esriDTSouthAzimuth: tw.WriteLine("DT,SA"); break; default: tw.WriteLine("DT,NA"); break; } int iAU = (int)pPlan.AngleUnits; switch (iAU) { case (int)esriDirectionUnits.esriDUDecimalDegrees: tw.WriteLine("DU,DD"); break; case (int)esriDirectionUnits.esriDUDegreesMinutesSeconds: tw.WriteLine("DU,DMS"); break; case (int)esriDirectionUnits.esriDUGons: case (int)esriDirectionUnits.esriDUGradians: tw.WriteLine("DU,G"); break; case (int)esriDirectionUnits.esriDURadians: tw.WriteLine("DU,R"); break; default: tw.WriteLine("DU,R"); break; } ICadastralUnitConversion pUnitConv = new CadastralUnitConversionClass(); double dMetricConversion = pUnitConv.ConvertDouble(1, pPlan.DistanceUnits, esriCadastralDistanceUnits.esriCDUMeter); string sLU = Convert.ToString(dMetricConversion); tw.WriteLine("ToMetricFactor," + sLU); IEnumGSLines pGSLines = pTrav.GetLines(); pGSLines.Reset(); IGSLine pGSLine = null; IGSParcel pGSParcel = null; pGSLines.Next(ref pGSParcel, ref pGSLine); while (pGSLine != null) { int iFromPt = pGSLine.FromPoint; //from point int iToPt = pGSLine.ToPoint; //to point int iLineCat = (int)pGSLine.Category; //line category if (iLineCat == 4) { pGSLines.Next(ref pGSParcel, ref pGSLine); continue; //ignore radial lines } int iLineUserType = pGSLine.LineType; //line user type int iAccCat = pGSLine.Accuracy; //accuracy double dDistance = pGSLine.Distance; //distance double dChord = pGSLine.Distance; //chord double dRadius = pGSLine.Radius; //radius string sLineCat = Convert.ToString(iLineCat); string sLineUserType = Convert.ToString(iLineUserType); if (iLineUserType > 2140000000) { sLineUserType = ""; } string sAccCat = Convert.ToString(iAccCat); string sFromPt = Convert.ToString(iFromPt);//from point //following need conversion string sDirection = NorthAzRadians_2_DirectionString(pGSLine.Bearing, pPlan.DirectionFormat, pPlan.AngleUnits); //direction string sDistance = Convert.ToString(dDistance / dMetricConversion); //distance string sRadius = ""; string sChord = ""; if (dRadius != 123456789) { //circular curve sRadius = Convert.ToString(dRadius / dMetricConversion); //radius sChord = Convert.ToString(dDistance / dMetricConversion); //chord sDistance = ""; //distance is replaced with the chord distance } string sToPt = Convert.ToString(iToPt);//to point //write the line tw.WriteLine(sFromPt + "," + sDirection + "," + sDistance + "," + sRadius + "," + sChord + "," + sToPt + "," + sLineCat + "," + sLineUserType + "," + sAccCat); pGSLines.Next(ref pGSParcel, ref pGSLine); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { tw.Close(); saveFileDialog = null; } }
internal void AddAt(IDockableWindow content, IDockableWindow before) { #if DEBUG if (DockPane != null) throw new InvalidOperationException(); #endif if (!Contains(before)) return; if (Contains(content)) return; AddAt(content, IndexOf(before)); }
/// <include file='CodeDoc\DockContent.xml' path='//CodeDoc/Class[@name="DockContent"]/Method[@name="Show(DockPane, DockHandler)"]/*'/> public void Show(DockPane pane, IDockableWindow beforeContent) { DockHandler.Show(pane, beforeContent); }
internal IDockableWindow[] Select(DockAreas stateFilter) { if (DockPane != null) throw new InvalidOperationException(); int count = 0; foreach (IDockableWindow c in this) if (DockHelper.IsDockStateValid(c.DockHandler.DockState, stateFilter)) count ++; IDockableWindow[] contents = new IDockableWindow[count]; count = 0; foreach (IDockableWindow c in this) if (DockHelper.IsDockStateValid(c.DockHandler.DockState, stateFilter)) contents[count++] = c; return contents; }
public DockPaneTab CreateDockPaneTab(IDockableWindow content) { return(new DockPaneTabVS2005(content)); }
/// <include file='CodeDoc/DockPaneTab.xml' path='//CodeDoc/Class[@name="DockPaneTab"]/Construct[@name="(IDockContent)"]/*'/> public DockPaneTab(IDockableWindow content) { m_content = content; }
public DockPane CreateDockPane(IDockableWindow content, DockState visibleState, bool show) { return(new DockPane(content, visibleState, show)); }
private void SetupDockableWindow() { if (m_dockableWindow == null) { IDockableWindowManager dockWindowManager = m_application as IDockableWindowManager; if (dockWindowManager != null) { UID windowID = new UIDClass(); windowID.Value = DockableWindowGuid; m_dockableWindow = dockWindowManager.GetDockableWindow(windowID); } } }
/// <include file='CodeDoc/AutoHideTab.xml' path='//CodeDoc/Class[@name="AutoHideTab"]/Construct[@name="(IDockContent)"]/*'/> public AutoHideTab(IDockableWindow content) { m_content = content; }