当前位置: 首页>>代码示例>>C#>>正文


C# UIDClass类代码示例

本文整理汇总了C#中UIDClass的典型用法代码示例。如果您正苦于以下问题:C# UIDClass类的具体用法?C# UIDClass怎么用?C# UIDClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UIDClass类属于命名空间,在下文中一共展示了UIDClass类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EditorEventsDialogCommand

 public EditorEventsDialogCommand()
 { 
    // SetupDockableWindow();
     UID windowID = new UIDClass();
     windowID.Value = @"ESRI_Employee_Events_EditorEventsDialog";
     m_dockableWindow = ArcMap.DockableWindowManager.GetDockableWindow(windowID);
 }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:7,代码来源:EditorEventsDialogCommand.cs

示例2: OnClick

 protected override void OnClick()
 {
     UID theUid = new UIDClass();
     theUid.Value = ThisAddIn.IDs.Gbdx_Answer_Factory_AnswerFactoryDockableWindow;
     var window = ArcMap.DockableWindowManager.GetDockableWindow(theUid);
     window.Show(!window.IsVisible());
 }
开发者ID:DigitalGlobe,项目名称:DGConnect-ESRI,代码行数:7,代码来源:AnswerFactoryButton.cs

示例3: EditorEventsDialog

        public EditorEventsDialog(object hook)
        {
            InitializeComponent();
            this.Hook = hook;
            e_dockWinForm = this;
            //get a reference to the editor
            UID uid = new UIDClass();
            uid.Value = "esriEditor.Editor";
            m_editor = ArcMap.Application.FindExtensionByCLSID(uid) as ESRI.ArcGIS.Editor.IEditor;

            m_TabControl = e_dockWinForm.tabControl1;
            System.Collections.IEnumerator e = m_TabControl.TabPages.GetEnumerator();
            e.MoveNext();
            m_listenTab = e.Current as TabPage;
            e.MoveNext();
            m_selectTab = e.Current as TabPage;

            CheckedListBox editEventList = m_selectTab.GetNextControl(m_selectTab, true) as CheckedListBox;
            editEventList.ItemCheck += new ItemCheckEventHandler(editEventList_ItemCheck);

            ListBox listEvent = m_listenTab.GetNextControl(m_listenTab, true) as ListBox;
            listEvent.MouseDown += new MouseEventHandler(listEvent_MouseDown);

            eventListener = new EventListener(m_editor);

            eventListener.Changed += new ChangedEventHandler(eventListener_Changed);

            //populate the editor events
            editEventList.Items.AddRange(Enum.GetNames(typeof(EventListener.EditorEvent)));
        }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:30,代码来源:EditorEventsDialog.cs

示例4: ApplyOSMClassExtension

        /// <summary>Apply the OSM Class Extension to the given table</summary>
        /// <remarks>Obtains an exclusive schema lock if possible otherwise throws an exception</remarks>
        public static void ApplyOSMClassExtension(this ITable table)
        {
            if ((table == null) || (table.Extension is IOSMClassExtension))
                return;

            IClassSchemaEdit3 schemaEdit = table as IClassSchemaEdit3;
            if (schemaEdit == null)
                return;

            int osmIDIndex = table.Fields.FindField("OSMID");

            using (SchemaLockManager lockMgr = new SchemaLockManager(table))
            {
                UID osmClassExtensionUID = new UIDClass() { Value = _OSM_CLASS_EXT_GUID };

                IPropertySet extensionPropertSet = null;
                if (osmIDIndex > -1)
                {
                    // at release 2.1 we changed the OSMID field type to string, hence only when we find the string we are assuming version 2
                    if (table.Fields.get_Field(osmIDIndex).Type == esriFieldType.esriFieldTypeString)
                    {
                        extensionPropertSet = new PropertySetClass();
                        extensionPropertSet.SetProperty("VERSION", _OSM_EXTENSION_VERSION);
                    }
                }

                schemaEdit.AlterClassExtensionCLSID(osmClassExtensionUID, extensionPropertSet);
                schemaEdit.AlterClassExtensionProperties(extensionPropertSet);
            }
        }
开发者ID:weepingdog,项目名称:arcgis-osm-editor,代码行数:32,代码来源:OSMClassExtensionManager.cs

示例5: GetDockableWindow

 public IDockableWindow GetDockableWindow(IApplication app, string winName)
 {
     IDockableWindowManager dWinManager = app as IDockableWindowManager;
     UID winID = new UIDClass();
     winID.Value = winName;
     return dWinManager.GetDockableWindow(winID);
 }
开发者ID:usgin,项目名称:arcmap-cswclient,代码行数:7,代码来源:ButtonCSW.cs

示例6: OnActivate

        protected override void OnActivate()
        {
            base.OnActivate();

            try
            {
                if (Painter.ActiveLayer == null)
                {
                    return;
                }

                UID dockWinID = new UIDClass();
                dockWinID.Value = ThisAddIn.IDs.ValueSymbolForm;
                IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
                if (!dockWindow.IsVisible())
                {
                    dockWindow.Show(true);
                }

                IRasterLayer rasterLayer = (IRasterLayer)Painter.ActiveLayer;
                IRasterProps rasterProp = (IRasterProps)rasterLayer.Raster;
                layerExetent = new Envelope(0, rasterProp.Height - 1, 0, rasterProp.Width - 1);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
            }
        }
开发者ID:nazzal88,项目名称:ares,代码行数:28,代码来源:FreeDrawTool.cs

示例7: HasEdits

        public static bool HasEdits(IApplication app, TransactionManager tm)
        {
            try
            {
                IWorkspaceEdit workspace = (IWorkspaceEdit)tm.Current().PGDBConnection;

                bool processQA = false;
                bool hasEdits = false;
                workspace.HasEdits(ref hasEdits);

                UID pUID = new UIDClass();
                pUID.Value = "esriEditor.Editor";
                IEditor editor = (IEditor)app.FindExtensionByCLSID(pUID);
                IEditTask task = editor.CurrentTask;
                IEditTask resetTask = editor.get_Task(0);
                editor.CurrentTask = resetTask;
                editor.CurrentTask = task;

                IEditor2 editor2 = (IEditor2)app.FindExtensionByCLSID(pUID);
                bool hasCachedEdits = editor2.HasEdits();

                return hasCachedEdits || hasEdits;
            }
            catch (Exception e)
            {
                Logger.Write("Error testing if transaction has edits: " + e.Message + " : " + e.StackTrace, Logger.LogLevel.Debug);
                throw new Exception("Error", e);
            }
        }
开发者ID:EAWCS1,项目名称:SUITT,代码行数:29,代码来源:Utils.cs

示例8: setupTrackingEnv

    //Initialize the Tracking Environment, you only need to do this once
    private void setupTrackingEnv()
    {
      if (!m_bInitialized && ArcMap.Application != null)
      {
        IExtensionManager extentionManager = new ExtensionManagerClass();

        UID uid = new UIDClass();
        uid.Value = "esriTrackingAnalyst.TrackingEngineUtil";
        object mapRef = ArcMap.Application;

        ((IExtensionManagerAdmin)extentionManager).AddExtension(uid, ref mapRef);

        ITrackingEnvironment3 trackingEnv = new TrackingEnvironmentClass();
        try
        {
          trackingEnv.Initialize(ref mapRef);
        }
        catch (Exception ex)
        {
        }
        trackingEnv.EnableTemporalDisplayManagement = true;
     
        m_bInitialized = true;
      }
    }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:26,代码来源:AddTemporalLayerButton.cs

示例9: CreateTable

        private static ITable CreateTable(IWorkspace2 workspace, string tableName, IFields fields)
        {
            UID uid = new UIDClass {Value = "esriGeoDatabase.Object"};

            if (workspace == null) return null;

            IFeatureWorkspace featWorkspace = (IFeatureWorkspace) workspace;

            if (workspace.NameExists[esriDatasetType.esriDTTable, tableName])
            {
                using (ComReleaser releaser = new ComReleaser())
                {
                    ITable table = featWorkspace.OpenTable(tableName);
                    releaser.ManageLifetime(table);
                    ((IDataset) table).Delete();
                }
            }


            IFieldChecker fieldChecker = new FieldCheckerClass();
            IEnumFieldError enumFieldError = null;
            IFields validatedFields = null;
            fieldChecker.ValidateWorkspace = workspace as IWorkspace;
            fieldChecker.Validate(fields, out enumFieldError, out validatedFields);

            return featWorkspace.CreateTable(tableName, validatedFields, uid, null, string.Empty);
        }
开发者ID:ApexGIS,项目名称:developer-support,代码行数:27,代码来源:ExecuteInsertCursor.cs

示例10: SaveEdits

        public static bool SaveEdits(IApplication app, TransactionManager tm)
        {
            bool result = false;
            try
            {
                if (HasEdits(app, tm))
                {
                    UID pUID = new UIDClass();
                    pUID.Value = "esriEditor.Editor";
                    IWorkspaceEdit workspace = (IWorkspaceEdit)tm.Current().PGDBConnection;
                    IEditor2 editor2 = (IEditor2)app.FindExtensionByCLSID(pUID);

                    editor2.StopEditing(true);
                    editor2.StartEditing((IWorkspace)workspace);
                    workspace.StopEditing(true);
                    workspace.StartEditing(false);
                }

                result = true;
            }
            catch (Exception e)
            {
                Logger.Write("Error saving edits to PGDB", Logger.LogLevel.Debug);
                MessageBox.Show("An error occured while attempting to save current edits.");
                result = false;
            }
            return result;
        }
开发者ID:EAWCS1,项目名称:SUITT,代码行数:28,代码来源:Utils.cs

示例11: OnActivate

        protected override void OnActivate()
        {
            try
            {
                UID dockWinID = new UIDClass();
                dockWinID.Value = ThisAddIn.IDs.EditForm;
                IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
                if (!dockWindow.IsVisible())
                {
                    dockWindow.Show(true);
                }

                if (Editor.ActiveLayer == null)
                {
                    return;
                }

                IRasterLayer rasterLayer = (IRasterLayer)Editor.ActiveLayer;
                IRasterProps rasterProp = (IRasterProps)rasterLayer.Raster;
                maxIndex = new Position(rasterProp.Width - 1, rasterProp.Height - 1);

                EditForm editForm = AddIn.FromID<EditForm.AddinImpl>(ThisAddIn.IDs.EditForm).UI;
                editForm.SetLayer(Editor.ActiveLayer.Name);
                System.Array noDataValue = (System.Array)rasterProp.NoDataValue;
                editForm.RasterGridView.NoDataValue = Convert.ToDouble(noDataValue.GetValue(0));
                editForm.SetNoDataValue(editForm.RasterGridView.NoDataValue);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
            }

            base.OnActivate();
        }
开发者ID:nazzal88,项目名称:ares,代码行数:34,代码来源:EditTool.cs

示例12: AddLegend

 /// <summary>
 /// 图例
 /// </summary>
 /// <returns></returns>
 public bool AddLegend()
 {
     IGraphicsContainer pGraphicsContainer;
     pGraphicsContainer = mainPage.PageLayout as IGraphicsContainer;
     IMapFrame pFocusMapFrame;
     pFocusMapFrame = pGraphicsContainer.FindFrame(mainPage.ActiveView.FocusMap) as IMapFrame;
     UID u = new UIDClass();
     u.Value = "esriCarto.Legend";
     IMapSurroundFrame pLegendFrame;
     pLegendFrame = pFocusMapFrame.CreateSurroundFrame(u, null);
     IEnvelope pEnvelope;
     pEnvelope = new EnvelopeClass();
     pEnvelope.PutCoords(3, 3, 6, 8);
     IElement pElement;
     pElement = pLegendFrame as IElement;
     pElement.Geometry = pEnvelope;
     ILegendWizard pLegendWizard;
     pLegendWizard = new LegendWizard();
     pLegendWizard.PageLayout = mainPage.PageLayout;
     pLegendWizard.InitialLegendFrame = pLegendFrame;
     bool bOk = pLegendWizard.DoModal(mainPage.hWnd);
     if (bOk == true)
     {
         IElement ele = pLegendWizard.LegendFrame as IElement;
         pGraphicsContainer.AddElement(ele, 0);
         mainPage.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
     }
     return true;
 }
开发者ID:xfgxfg,项目名称:CropWatchField,代码行数:33,代码来源:AddMapSouround-old.cs

示例13: frmBuffer

        public frmBuffer(IMap _pMap)
        {
            InitializeComponent();
            //load all the feature layers in the map to the layers combo
            UID uid = new UIDClass();
            uid.Value = "{40A9E885-5533-11d0-98BE-00805F7CED21}";
            pMap = _pMap;
            layers = pMap.get_Layers(uid, true);
            layers.Reset();
            ILayer layer = null;
            while ((layer = layers.Next()) != null)
            {
                cboLayers.Items.Add(layer.Name);
            }
            //select the first layer
            if (cboLayers.Items.Count > 0)
                cboLayers.SelectedIndex = 0;

            string tempDir = System.IO.Path.GetTempPath();
            txtOutputPath.Text = System.IO.Path.Combine(tempDir, ((string)cboLayers.SelectedItem + "_buffer.shp"));

            //set the default units of the buffer
            int units = Convert.ToInt32(pMap.MapUnits);
            cboUnits.SelectedIndex = units;
        }
开发者ID:lovelll,项目名称:DQHP,代码行数:25,代码来源:frmBuffer.cs

示例14: OnClick

        /// <summary>
        /// The on click.
        /// </summary>
        protected override void OnClick()
        {
            //            if (ArcMap.Application.CurrentTool.Name != ThisAddIn.IDs.Gbdx_Aggregations_AggregationSelector)
            //            {
            //                UID theUid = new UIDClass();
            //                theUid.Value = ThisAddIn.IDs.Gbdx_Aggregations_AggregationWindow;
            //                var window = ArcMap.DockableWindowManager.GetDockableWindow(theUid);
            //                window.Show(!window.IsVisible());
            //            }

            try
            {
                if (ArcMap.Application.CurrentTool.Name != ThisAddIn.IDs.Gbdx_Aggregations_AggregationSelector)
                {
                    UID theUid = new UIDClass();
                    theUid.Value = ThisAddIn.IDs.Gbdx_Aggregations_Aggregations;
                    var window = ArcMap.DockableWindowManager.GetDockableWindow(theUid);
                    window.Show(!window.IsVisible());
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
开发者ID:DigitalGlobe,项目名称:DGConnect-ESRI,代码行数:28,代码来源:AggregationButton.cs

示例15: Invoke

        internal static void Invoke(string tool)
        {
            UID uniqueId = new UIDClass();
            uniqueId.Value = "esriGeoprocessingUI.ArcToolboxExtension";

            var arcToolboxExtension = ArcMap.Application.FindExtensionByCLSID(uniqueId) as IArcToolboxExtension;
            if (arcToolboxExtension == null)
                return;

            IGPTool gpTool = null;
            try
            {
                gpTool = arcToolboxExtension.ArcToolbox.GetToolbyNameString(tool);
            }
            catch (COMException)
            {
                MessageBox.Show(@"Unable to find tool: " + tool + Environment.NewLine + @"in the system toolbox.",
                                @"Configuration Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            if (gpTool == null)
                return;

            IGPToolCommandHelper gpCommandHelper = new GPToolCommandHelper();
            gpCommandHelper.SetTool(gpTool);
            gpCommandHelper.Invoke(null);
        }
开发者ID:regan-sarwas,项目名称:AlaskaPak,代码行数:26,代码来源:ArcToolBox.cs


注:本文中的UIDClass类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。