本文整理汇总了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);
}
示例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());
}
示例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)));
}
示例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);
}
}
示例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);
}
示例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");
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}