本文整理汇总了C#中IApplication.FindExtensionByCLSID方法的典型用法代码示例。如果您正苦于以下问题:C# IApplication.FindExtensionByCLSID方法的具体用法?C# IApplication.FindExtensionByCLSID怎么用?C# IApplication.FindExtensionByCLSID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IApplication
的用法示例。
在下文中一共展示了IApplication.FindExtensionByCLSID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
示例2: 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;
}
示例3: MapTopologyDefaults
public MapTopologyDefaults(IApplication pApp)
{
try
{
m_pApp = pApp;
UID pUID = new UIDClass();
pUID.Value = "esriEditor.Editor";
m_pEditor = (IEditor)m_pApp.FindExtensionByCLSID(pUID);
pUID.Value = "esriEditorExt.TopologyExtension";
m_pTopologyExt = m_pApp.FindExtensionByCLSID(pUID) as ITopologyExtension;
m_pMapTopology = m_pTopologyExt.MapTopology;
m_pISDUTExt = RestTransactionManager.Instance.BaseTransactionManager.extension(); //(ISDUTExtension)m_pApp.FindExtensionByName("SUITT Extension");
//m_XYTolerance = SetTopoClasses();
m_pTopologyExt.CurrentTopology = m_pMapTopology;
// make sure the specified tolerance is not less than allowable tolerance
if (m_XYTolerance < GetMinXYTolerance)
{
util.Logger.Write("The specified xy cluster tolerance (" + m_XYTolerance.ToString() + ") for the <SUITT Map Topology> defaults was " +
"below the minimum xy tolerance allowed. The value of " + GetMinXYTolerance.ToString() + " will be used instead.");
m_XYTolerance = GetMinXYTolerance;
}
m_pMapTopology.ClusterTolerance = m_XYTolerance;
//m_pMapTopology.Name = "<ISDUT Map Topology>"; // apply the topology name
}
catch(Exception ex)
{
Debug.WriteLine(ex.Message + "\n" + ex.StackTrace);
util.Logger.Write(" Descrip : Setting up the SUITT map topology defaults." +
"\n Message : " + ex.Message +
"\n StackTrc : " + ex.StackTrace, util.Logger.LogLevel.Debug);
}
}
示例4: TraceFindClosest
//.........这里部分代码省略.........
{
pStepPro.Hide();
pProDlg.HideDialog();
pStepPro = null;
pProDlg = null;
pProDFact = null;
return A4LGSharedFunctions.Localizer.GetString("CanceledReturnStatement");
}
startNetFlag = new List<INetFlag>();// null;// Globals.GetJunctionFlag(x, y, map, ref gnList, snapTol, ref gnIdx, out snappedPoint, out EID) as INetFlag;
//if (startNetFlag == null)
pFlagsDisplay = new List<IFlagDisplay>();
if (x != null)
{
for (int l = 0; l < x.Length; l++)
{
startNetFlag.Add(Globals.GetEdgeFlag(x[l], y[l], ref map, ref gnList, snapTol, ref gnIdx, out snappedPoint, out EID, out distanceAlong, out pFlagDisplay, true) as INetFlag);
pFlagsDisplay.Add(pFlagDisplay);
}
}
//Set network to trace
if (gnIdx > -1)
gn = gnList[gnIdx] as IGeometricNetwork;
if (app != null)
{
pID = new UID();
pID.Value = "esriEditorExt.UtilityNetworkAnalysisExt";
pNetAnalysisExt = (INetworkAnalysisExt)app.FindExtensionByCLSID(pID);
if (gn != null)
{
Globals.SetCurrentNetwork(ref pNetAnalysisExt, ref gn);
}
traceFlowSolver = Globals.CreateTraceFlowSolverFromToolbar(ref pNetAnalysisExt, out pEdgeFlags, out pJunctionFlags, out pEdgeElementBarriers, out pJunctionElementBarriers, out pSelectionSetBarriers) as ITraceFlowSolverGEN;
gn = pNetAnalysisExt.CurrentNetwork;
netSolver = traceFlowSolver as INetSolver;
}
else
{
if (gn == null || startNetFlag.Count == 0)
{
return A4LGSharedFunctions.Localizer.GetString("NoFlagReturnStatement");
}
traceFlowSolver = new TraceFlowSolverClass() as ITraceFlowSolverGEN;
netSolver = traceFlowSolver as INetSolver;
netSolver.SourceNetwork = gn.Network;
}
traceFlowSolver.TraceIndeterminateFlow = traceIndeterminate;
pNetFlags = new List<INetFlag>();
if (pEdgeFlags != null)
{
foreach (IEdgeFlag pEdFl in pEdgeFlags)
{
示例5: ToggleOperableStatus
public static IEnvelope ToggleOperableStatus(IApplication app, IPoint point, bool showMessage, string ISOvalveFeatureLayerName, string ISOsourceFeatureLayerName, string ISOoperableFieldNameValves, string ISOoperableFieldNameSources, string[] ISOoperableValues, double SnapTol)
{
//m_ISOsourceFeatureLayerName = ConfigUtil.GetConfigValue("TraceIsolation_Source_FeatureLayer", "");
//m_ISOvalveFeatureLayerName = ConfigUtil.GetConfigValue("TraceIsolation_Valve_FeatureLayer", "");
//m_ISOoperableFieldNameValves = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Field_Valves", "");
//m_ISOoperableFieldNameSources = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Field_Sources", "");
//m_ISOoperableValues = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Values", "").Split('|');
IFeatureCursor fcursor = null;
ICursor ccursor = null;
IFeature feat = null;
UID uID = null;
IEditor editor = null;
IMxDocument mxdoc = null;
IMap map = null;
IFeatureLayer[] valveFLs = null;
IFeatureClass[] valveFCs = null;
IFeatureLayer[] sourceFLs = null;
IFeatureClass[] sourceFCs = null;
IEnvelope retEnv = null;
//IGeometry geom = null;
//IProximityOperator proxOp = null;
IEnvelope env = null;
ISpatialFilter sf = null;
IWorkspace work = null;
IWorkspaceEdit workEdit = null;
IField opField = null;
IPoint pTmpPnt = null;
IEnvelope ptmpEnv = null;
IDisplayExpressionProperties pDEP = null;
IDisplayString pIDS = null;
try
{
//Get editor
uID = new UID();
uID.Value = "esriEditor.Editor";
editor = app.FindExtensionByCLSID(uID) as IEditor;
mxdoc = app.Document as IMxDocument;
map = mxdoc.ActiveView.FocusMap;
string[] strValveFLs = ISOvalveFeatureLayerName.Split('|');
// string[] strOpValues = .Split('|');
valveFLs = new IFeatureLayer[strValveFLs.Length];//(IFeatureLayer)Globals.FindLayer(map, valveFLName);
valveFCs = new IFeatureClass[strValveFLs.Length];
bool lyrFnd = false;
for (int i = 0; i < valveFLs.Length; i++)
{
bool FCorLayerTemp = true;
valveFLs[i] = (IFeatureLayer)Globals.FindLayer(map, strValveFLs[i], ref FCorLayerTemp);
if (valveFLs[i] != null)
{
valveFCs[i] = valveFLs[i].FeatureClass;
lyrFnd = true;
}
}
string[] strSourceFLs = ISOsourceFeatureLayerName.Split('|');
// string[] strOpValues = .Split('|');
sourceFLs = new IFeatureLayer[strSourceFLs.Length];//(IFeatureLayer)Globals.FindLayer(map, valveFLName);
sourceFCs = new IFeatureClass[strSourceFLs.Length];
for (int i = 0; i < sourceFLs.Length; i++)
{
bool FCorLayerTemp = true;
sourceFLs[i] = (IFeatureLayer)Globals.FindLayer(map, strSourceFLs[i], ref FCorLayerTemp);
if (sourceFLs[i] != null)
{
sourceFCs[i] = sourceFLs[i].FeatureClass;
lyrFnd = true;
}
}
if (lyrFnd == false)
{
MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("GeoNetToolsError_12a") + ISOvalveFeatureLayerName + A4LGSharedFunctions.Localizer.GetString("Or") + ISOsourceFeatureLayerName + A4LGSharedFunctions.Localizer.GetString("GeoNetToolsError_12b"), A4LGSharedFunctions.Localizer.GetString("GeoNetToolsError_12c"));
return null;
}
// Globals.ClearSelected(map, false);
foreach (IFeatureLayer valveFLayer in valveFLs)
{
if (point != null)
{
env = new EnvelopeClass();
env.DefineFromPoints(1, ref point);
env.Expand(SnapTol / 2, SnapTol / 2, false);
sf = new SpatialFilterClass();
sf.Geometry = env;
sf.GeometryField = valveFLayer.FeatureClass.ShapeFieldName;
sf.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;
//.........这里部分代码省略.........
示例6: ShowArrows
public static void ShowArrows(IApplication app)
{
INetworkAnalysisExt netExt = null;
UID pUID = null;
IMxDocument pMxDoc = null;
IMap pMap = null;
IActiveView av = null;
List<IGeometricNetwork> gnList = null;
IGeometricNetwork gn = null;
IUtilityNetworkAnalysisExt unetExt = null;
IUtilityNetworkAnalysisExtFlow unetExtArr = null;
try
{
//Get NA Extension in order to update the current network with the first visible network
pUID = new UIDClass();
pUID.Value = "esriEditorExt.UtilityNetworkAnalysisExt";
netExt = app.FindExtensionByCLSID(pUID) as INetworkAnalysisExt;
pMxDoc = app.Document as IMxDocument;
pMap = pMxDoc.FocusMap;
av = pMap as IActiveView;
gnList = Globals.GetGeometricNetworksCurrentlyVisible(ref pMap);
if (gnList.Count > 0 && netExt != null)
{
try
{
unetExt = netExt as IUtilityNetworkAnalysisExt;
if (gnList.Contains(netExt.CurrentNetwork))
{
//Get first visible geometric network
gn = netExt.CurrentNetwork;
if (gn != null && unetExt != null)
{
//netExt.CurrentNetwork = gn;
unetExt = netExt as IUtilityNetworkAnalysisExt;
unetExtArr = unetExt as IUtilityNetworkAnalysisExtFlow;
unetExtArr.ShowFlow = !(unetExtArr.ShowFlow);
av.Refresh();
}
}
else
{
//Get first visible geometric network
gn = gnList[0] as IGeometricNetwork;
if (gn != null && unetExt != null)
{
netExt.CurrentNetwork = gn;
unetExt = netExt as IUtilityNetworkAnalysisExt;
unetExtArr = unetExt as IUtilityNetworkAnalysisExtFlow;
unetExtArr.ShowFlow = !(unetExtArr.ShowFlow);
av.Refresh();
}
}
}
catch (Exception ex)
{
MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("GeoNetToolsLbl_1") + "\n" + ex.Message, ex.Source);
return;
}
}
}
catch (Exception ex)
{
MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("GeoNetToolsLbl_1") + "\n" + ex.Message, ex.Source);
return;
}
finally
{
netExt = null;
pUID = null;
pMxDoc = null;
pMap = null;
av = null;
gnList = null;
gn = null;
unetExt = null;
unetExtArr = null;
}
}
示例7: OnCreate
/// <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;
base.m_category = resourceManager.GetString("OSMEditor_ConflictEditor_category");
base.m_caption = resourceManager.GetString("OSMEditor_ConflictEditor_caption");
base.m_message = resourceManager.GetString("OSMEditor_ConflictEditor_message");
base.m_toolTip = resourceManager.GetString("OSMEditor_ConflictEditor_tooltip");
if (m_osmConflictEditorUI != null)
{
m_osmConflictEditorUI.Text = resourceManager.GetString("OSMEditor_ConflictEditor_formtitle");
}
UID editorUID = new UIDClass();
editorUID.Value = "esriEditor.Editor";
IEditor editor = m_application.FindExtensionByCLSID(editorUID) as IEditor;
base.m_enabled = false;
if (editor != null)
{
IEditEvents_Event editorEvents = editor as IEditEvents_Event;
if (editorEvents != null)
{
editorEvents.OnStartEditing += new IEditEvents_OnStartEditingEventHandler(editorEvents_OnStartEditing);
editorEvents.OnStopEditing += new IEditEvents_OnStopEditingEventHandler(editorEvents_OnStopEditing);
}
if (editor.EditState != esriEditState.esriStateNotEditing)
{
base.m_enabled = true;
}
}
}
示例8: OnCreate
/// <summary>
/// Occurs when this tool is created
/// </summary>
/// <param name="hook">Instance of the application</param>
public override void OnCreate(object hook)
{
m_application = hook as IApplication;
//get the editor
UID editorUid = new UID();
editorUid.Value = "esriEditor.Editor";
m_editor = m_application.FindExtensionByCLSID(editorUid) as IEditor3;
m_editEvents = m_editor as IEditEvents_Event;
m_editEvents5 = m_editor as IEditEvents5_Event;
}
示例9: TracePath
public static string TracePath(double[] Xs, double[] Ys, string GeoNetName, IApplication app, IMap map, bool traceIndeterminate,
double snapTol, bool selectEdges, out IEnumNetEID juncEIDs, out IEnumNetEID edgeEIDs, out IGeometricNetwork gn)
{
gn = null;
juncEIDs = null;
edgeEIDs = null;
List<INetFlag> pNetFlags = null;
IFlagDisplay pFlagDisplay = null;
IJunctionFlag[] junctionFlags = null;
IEdgeFlag[] edgeFlags = null;
ITraceFlowSolverGEN traceFlowSolver = null;
List<IEdgeFlag> pEdgeFlags = null;
List<IJunctionFlag> pJunctionFlags = null;
INetElementBarriers pEdgeElementBarriers;
INetElementBarriers pJunctionElementBarriers;
ISelectionSetBarriers pSelectionSetBarriers;
List<IGeometricNetwork> gnList = null;
INetworkAnalysisExt pNetAnalysisExt = null;
UID pID = null;
try
{
gnList = Globals.GetGeometricNetworks(ref map);
if (gnList == null)
{
MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("GeoNetToolsError_17a"));
return "";
}
int gnIdx = -1;
gnIdx = Globals.GetGeometricNetwork(ref gnList, GeoNetName);
if (gnIdx != -1)
{
gn = (IGeometricNetwork)gnList[gnIdx];
}
pNetFlags = new List<INetFlag>();
// INetFlag[] netFlags = new INetFlag[Xs.Length];
for (int i = 0; i < Xs.Length; i++)
{
IPoint snappedPoint = null; int EID = -1;
if (gn == null)
{
pNetFlags.Add(Globals.GetJunctionFlag(Xs[i], Ys[i], ref map, ref gnList, snapTol, ref gnIdx,
out snappedPoint, out EID, out pFlagDisplay, true) as INetFlag);
//Set network to trace
if (gnIdx > -1)
gn = gnList[gnIdx] as IGeometricNetwork;
}
else
{
pNetFlags.Add(Globals.GetJunctionFlagWithGN(Xs[i], Ys[i], ref map, ref gn, ref snapTol, out snappedPoint, out EID, out pFlagDisplay, true) as INetFlag);
}
}
if (gn == null || pNetFlags.Count < 1)
{
return (A4LGSharedFunctions.Localizer.GetString("GeoNetToolsError_17b"));
}
if (app != null)
{
pID = new UID();
pID.Value = "esriEditorExt.UtilityNetworkAnalysisExt";
pNetAnalysisExt = (INetworkAnalysisExt)app.FindExtensionByCLSID(pID);
Globals.SetCurrentNetwork(ref pNetAnalysisExt, ref gn);
traceFlowSolver = Globals.CreateTraceFlowSolverFromToolbar(ref pNetAnalysisExt, out pEdgeFlags, out pJunctionFlags, out pEdgeElementBarriers, out pJunctionElementBarriers, out pSelectionSetBarriers) as ITraceFlowSolverGEN;
}
else
{
traceFlowSolver = new TraceFlowSolverClass() as ITraceFlowSolverGEN;
INetSolver netSolver = traceFlowSolver as INetSolver;
netSolver.SourceNetwork = gn.Network;
}
traceFlowSolver.TraceIndeterminateFlow = traceIndeterminate;
if (pEdgeFlags != null)
{
foreach (IEdgeFlag pEdFl in pEdgeFlags)
{
pNetFlags.Add((INetFlag)pEdFl);
//.........这里部分代码省略.........
示例10: Initialize
private void Initialize()
{
// If the extension hasn't been started yet or it's been turned off, bail
if (s_extension == null || this.State != ExtensionState.Enabled)
return;
m_pApp = ArcMap.Application;
m_pDoc = ArcMap.Document;
SF10_clsBase.p_tNAIPF_EssPourc_1 = new SF10_clsBase.tNAIPF_EssPourc[7];
SF10_clsBase.p_tNAIPF_EssPourc_2 = new SF10_clsBase.tNAIPF_EssPourc[7];
for (int i = 0; i < 7; i++)
{
SF10_clsBase.p_tNAIPF_EssPourc_1[i] = new SF10_clsBase.tNAIPF_EssPourc();
SF10_clsBase.p_tNAIPF_EssPourc_2[i] = new SF10_clsBase.tNAIPF_EssPourc();
}
m_Parametres = SF10_clsParametres.SF10_clsParametresDefData();
try
{
UID editorUid = new UIDClass();
editorUid.Value = "esriEditor.Editor";
IEditor m_pEditor = m_pApp.FindExtensionByCLSID(editorUid) as IEditor;
m_editorEvents = m_pEditor as IEditEvents_Event;
IEditEvents_OnSelectionChangedEventHandler editEvents_OnSelectionChangedEventHandler = new IEditEvents_OnSelectionChangedEventHandler(this.Editor_OnSelectionChanged);
m_editorEvents.OnSelectionChanged += editEvents_OnSelectionChangedEventHandler;
m_activeViewEvents = ArcMap.Document.FocusMap as IActiveViewEvents_Event;
IActiveViewEvents_AfterDrawEventHandler activeViewEvents_AfterDrawEventHandler = new IActiveViewEvents_AfterDrawEventHandler(this.ActiveView_OnAfterDraw);
m_activeViewEvents.AfterDraw += activeViewEvents_AfterDrawEventHandler;
IActiveViewEvents_ViewRefreshedEventHandler activeViewEvents_ViewRefreshedEventHandler = new IActiveViewEvents_ViewRefreshedEventHandler(this.ActiveView_OnViewRefreshed);
m_activeViewEvents.ViewRefreshed += activeViewEvents_ViewRefreshedEventHandler;
UID uid = new UIDClass();
uid.Value = ThisAddIn.IDs.SF10_btnHauteurMin;
uid.SubType = 0;
m_pApp.Document.Accelerators.Add(uid, (System.Int32)System.Windows.Forms.Keys.D1, true, false, false);
uid = new UIDClass();
uid.Value = ThisAddIn.IDs.SF10_btnHauteurMax;
uid.SubType = 0;
m_pApp.Document.Accelerators.Add(uid, (System.Int32)System.Windows.Forms.Keys.D2, true, false, false);
}
catch
{
}
}
示例11: OnCreate
public override void OnCreate(object hook)
{
if (hook != null)
{
if (hook is IMxApplication)
{
m_app = (IApplication) hook;
try
{
m_pISDUTExt = RestTransactionManager.Instance.BaseTransactionManager.extension(); //(ISDUTExtension)m_app.FindExtensionByName("SUITT Extension");
}
catch
{ }
UID pUID;
pUID = new UIDClass();
pUID.Value = "esriEditor.Editor";
m_pEditor = (IEditor)m_app.FindExtensionByCLSID(pUID);
pUID.Value = "esriEditor.TraverseWindow";
m_pTraverseWindow = (ITraverseWindow)m_pEditor.FindExtension(pUID);
}
}
}
示例12: CreateBusinessFeaturesForm
// form constructor -> sets some class level variables and an editing event listener
public CreateBusinessFeaturesForm(IApplication pApp)
{
try
{
InitializeComponent();
m_pApp = pApp;
UID pUID;
pUID = new UIDClass();
pUID.Value = "esriEditor.Editor";
m_pEditor = (IEditor)m_pApp.FindExtensionByCLSID(pUID);
//try
//{
// m_pISDUTExt = RestTransactionManager.Instance.BaseTransactionManager.extension(); //(ISDUTExtension)m_pApp.FindExtensionByName("SUITT Extension");
// this.ISDUTschema = m_pISDUTExt.get_SystemValue("db.isdut.schema") + ".";
// if (m_pISDUTExt.TransactionManager.Current().OperationalDatasetName.ToUpper() == "TANT")
// {
// this.OSDBschema = m_pISDUTExt.get_SystemValue("db.tant.schema") + ".";
// }
// else if(m_pISDUTExt.TransactionManager.Current().OperationalDatasetName.ToUpper() == "FADM")
// {
// this.OSDBschema = m_pISDUTExt.get_SystemValue("db.fadm.schema") + ".";
// }
//}
//catch
//{}
//try
//{
// m_pISDUTExt.ISDUTState_Event += new ISDUTState(ISDUTState_Event);
//}
//catch { }
// Create delegate instances of editor events
m_OnStopEditing = new IEditEvents_OnStopEditingEventHandler(OnStopEditing);
//and delgates to the appropriate events to enable listening
((IEditEvents_Event)m_pEditor).OnStopEditing += m_OnStopEditing;
// try to connect to ISDUT db and cache the business features table
//if (CacheBusinessFeatures() == false)
//{
// MessageBox.Show("Could not read Business Features table: \n" +
// ISDUTschema + ISDUT_SDELAYERS + "\n" +
// "Please check your Transation Manager Connections", "SUITT Warning");
// this.Visible = false;
// this.Dispose();
// return;
//}
//implement the column sorter on lvBF
m_columnSorter = new ColumnSorter();
lvBF.ListViewItemSorter = m_columnSorter;
m_columnSorter.ColumnToSort = 1;
m_columnSorter.SortOrder = SortOrder.Ascending;
lvBF.Sort();
}
catch(Exception ex)
{
Debug.WriteLine(ex.Message + "\n" + ex.StackTrace);
util.Logger.Write(" Descrip : Constructing the business feature form." +
"\n Message : " + ex.Message +
"\n StackTrc : " + ex.StackTrace,util.Logger.LogLevel.Debug);
}
}
示例13: OnCreate
public override void OnCreate(object hook)
{
try
{
if (hook != null)
{
if (hook is IMxApplication)
{
// create / access core AO variables.
m_app = (IApplication) hook;
UID pUID;
pUID = new UIDClass();
pUID.Value = "esriEditor.Editor";
m_pEditor = (IEditor)m_app.FindExtensionByCLSID(pUID);
try
{
m_pISDUTExt = RestTransactionManager.Instance.BaseTransactionManager.extension(); //(ISDUTExtension)m_app.FindExtensionByName("SUITT Extension");
this.TemplateFolder = m_pISDUTExt.get_SystemValue("tools.mapping.templatefolder");
try
{
string scales = m_pISDUTExt.get_SystemValue("tools.mapping.scales");
m_scales = scales.Split(",".ToCharArray());
}
catch{}
}
catch
{
throw new Exception("SUITT Extension not found.");
}
}
}
}
catch(Exception ex)
{
util.Logger.Write(" Descrip : Creating command and accessing SUITT extension." +
"\n Message : " + ex.Message +
"\n StackTrc : " + ex.StackTrace,util.Logger.LogLevel.Debug);
}
}
示例14: TraceFlow
//.........这里部分代码省略.........
if (gnIdx > -1)
gn = gnList[gnIdx] as IGeometricNetwork;
// Stop if user point was not on a visible network feature, old trace results and selection are cleared
if (gn == null || startNetFlag == null)
{
return;
}
pStepPro.Message = A4LGSharedFunctions.Localizer.GetString("GeoNetToolsMess_14b");
pStepPro.Step();
boolCont = pTrkCan.Continue();
if (!boolCont)
{
pStepPro.Hide();
pProDlg.HideDialog();
pStepPro = null;
pProDlg = null;
pProDFact = null;
return;
}
//Setup trace solver
// ITraceFlowSolverGEN traceFlowSolver = new TraceFlowSolverClass() as ITraceFlowSolverGEN;
// ITraceFlowSolver traceFlowSolver = Globals.CreateTraceFlowSolverFromToolbar(gn);
if (app != null)
{
pID = new UID();
pID.Value = "esriEditorExt.UtilityNetworkAnalysisExt";
pNetAnalysisExt = (INetworkAnalysisExt)app.FindExtensionByCLSID(pID);
Globals.SetCurrentNetwork(ref pNetAnalysisExt, ref gn);
traceFlowSolver = Globals.CreateTraceFlowSolverFromToolbar(ref pNetAnalysisExt, out pEdgeFlags, out pJunctionFlags, out pEdgeElementBarriers, out pJunctionElementBarriers, out pSelectionSetBarriers) as ITraceFlowSolverGEN;
pID = null;
}
else
{
traceFlowSolver = new TraceFlowSolverClass() as ITraceFlowSolverGEN;
netSolver = traceFlowSolver as INetSolver;
netSolver.SourceNetwork = gn.Network;
netSolver = null;
}
traceFlowSolver.TraceIndeterminateFlow = traceIndeterminate;
pStepPro.Message = A4LGSharedFunctions.Localizer.GetString("GeoNetToolsMess_14c");
pStepPro.Step();
boolCont = pTrkCan.Continue();
if (!boolCont)
{
pStepPro.Hide();
pProDlg.HideDialog();
pStepPro = null;
pProDlg = null;
pProDFact = null;
return;
}
//Add the flag to the trace solver
示例15: GetNAXConfiguration
public static IExtensionConfig GetNAXConfiguration(IApplication app)
{
IExtensionConfig extConfig = null;
try
{
if (app != null)
{
UID extCLSID = new UIDClass();
extCLSID.Value = "{C967BD39-1118-42EE-AAAB-B31642C89C3E}"; // Network Analyst
extConfig = app.FindExtensionByCLSID(extCLSID) as IExtensionConfig;
}
}
catch
{
extConfig = null;
}
return extConfig;
}