protected override RefugeeSite CreateSite(ESRI.ArcGIS.Geodatabase.IFeature feature)
        {
            double sr = double.Parse(feature.get_Value(_idxSr).ToString());
            double lr = double.Parse(feature.get_Value(_idxLr).ToString());
            double dr = double.Parse(feature.get_Value(_idxDr).ToString());

            RefugeeSiteGasCar site = new RefugeeSiteGasCar()
            {
                OID      = feature.OID,
                Location = feature.ShapeCopy as IPoint,
            };

            if (dr == 0 || dr == 1)
            {
                site.Priority = 0;
                return(null);
            }
            else
            {
                double alpha = 0.62, beta = 0.33, gama = 0.05;
                site.Priority = sr * alpha + lr * beta + dr * gama;
                int carPerSite = 1;
                site.ResourceInNeed = carPerSite;
                return(site);
            }
        }
        protected override RefugeeSite CreateSite(ESRI.ArcGIS.Geodatabase.IFeature feature)
        {
            double sw = double.Parse(feature.get_Value(_idxSw).ToString());
            double lw = double.Parse(feature.get_Value(_idxLw).ToString());
            double dw = double.Parse(feature.get_Value(_idxDw).ToString());

            RefugeeSiteWaterFixer site = new RefugeeSiteWaterFixer()
            {
                OID      = feature.OID,
                Location = feature.ShapeCopy as IPoint,
            };

            if (dw == 0 || dw == 1)
            {
                site.Priority = 0;
                return(null);
            }
            else
            {
                double alpha = 0.67, beta = 0.28, gama = 0.05;
                site.Priority = sw * alpha + lw * beta + dw * gama;
                int personPerSite = 8;
                site.ResourceInNeed = personPerSite;
                return(site);
            }
        }
        protected override RefugeeSite CreateSite(ESRI.ArcGIS.Geodatabase.IFeature feature)
        {
            double sc = double.Parse(feature.get_Value(_idxSc).ToString());
            double lc = double.Parse(feature.get_Value(_idxLc).ToString());
            double dc = double.Parse(feature.get_Value(_idxDc).ToString());
            int    x  = int.Parse(feature.get_Value(_idxX).ToString());

            RefugeeSiteCommuFixer site = new RefugeeSiteCommuFixer()
            {
                OID      = feature.OID,
                Location = feature.ShapeCopy as IPoint,
            };

            if (dc == 0 || dc == 1)
            {
                site.Priority = 0;
                return(null);
            }
            else
            {
                double alpha = 0.67, beta = 0.27, gama = 0.06;
                site.Priority = sc * alpha + lc * beta + dc * gama;

                site.ResourceInNeed = (int)Math.Ceiling(Math.Exp(0.833 * Math.Log(x) + 2.0299));
                return(site);
            }
        }
Example #4
0
        public void Load(ESRI.ArcGIS.Geodatabase.IWorkspace Workspace, ESRI.ArcGIS.Geodatabase.IFeature Feature, BaseModel BaseModel, ModelProperty Property)
        {
            object[] _parametros = { (object)Workspace };
            EntityManyToManyFieldAttribute _attribute = (EntityManyToManyFieldAttribute)Property.Attribute;
            BaseModel _mtmField = (BaseModel)Activator.CreateInstance(_attribute.RelateModelType, _parametros);

            string _KeyObj   = Feature.get_Value(Feature.Fields.FindField(BaseModel.KeyField)).ToString();
            Int32  _keyValue = !String.IsNullOrEmpty(_KeyObj) ? Convert.ToInt32(_KeyObj) : 0;

            if (_keyValue > 0)
            {
                var _source = _mtmField.Search(_attribute.FromFieldName + "=" + _keyValue, BaseModel.LoadMethod.Lazy);

                IList _target = (IList)Activator.CreateInstance(typeof(List <>).MakeGenericType(_attribute.TargetModelType));
                foreach (BaseModel _item in _source)
                {
                    BaseModel    _itemTarget   = (BaseModel)Activator.CreateInstance(_attribute.TargetModelType, _parametros);
                    PropertyInfo _entityTarget = _item.ModelProperties.Where(x =>
                    {
                        return(_attribute.ToFieldName.Split('.')[1].Equals(((System.Reflection.MemberInfo)x.Property).Name));
                    }).Single().Property;
                    _itemTarget.Load((int)_entityTarget.GetValue(_item, null));
                    _target.Add(_itemTarget);
                }

                Property.Property.SetValue(BaseModel, _target, null);
            }
        }
Example #5
0
 public void Load(ESRI.ArcGIS.Geodatabase.IWorkspace Workspace, ESRI.ArcGIS.Geodatabase.IFeature Feature, BaseModel BaseModel, ModelProperty Property, BaseModel.LoadMethod ChooseLoadMethod)
 {
     if (BaseModel.LoadMethod.Lazy == ChooseLoadMethod)
     {
         return;
     }
     this.Load(Workspace, Feature, BaseModel, Property);
 }
Example #6
0
        /// <summary>
        /// Constructs a new SpliceableCableWrapper, determining which ends to use by comparing to the other cable
        /// </summary>
        /// <param name="thisFeature">IFeature to wrap</param>
        /// <param name="otherFeature">IFeature with which to compare endpoints</param>
        public SpliceableCableWrapper(ESRI.ArcGIS.Geodatabase.IFeature thisFeature, ESRI.ArcGIS.Geodatabase.IFeature otherFeature)
            : base(thisFeature, true)
        {
            #region Validation
            // We already know thisFeature is not null from the base validation
            if (null == otherFeature)
            {
                throw new ArgumentNullException("otherFeature");
            }
            else if (null == otherFeature.Class)
            {
                throw new ArgumentException("otherFeature.Class cannot be null.");
            }

            ESRI.ArcGIS.Geometry.IPolyline thisPolyline = thisFeature.Shape as ESRI.ArcGIS.Geometry.IPolyline;
            if (null == thisPolyline)
            {
                throw new ArgumentException("thisFeature.Shape must be IPolyline.");
            }

            ESRI.ArcGIS.Geometry.IPolyline otherPolyline = otherFeature.Shape as ESRI.ArcGIS.Geometry.IPolyline;
            if (null == otherPolyline)
            {
                throw new ArgumentException("otherPolyline.Shape must be IPolyline.");
            }
            #endregion

            ESRI.ArcGIS.Geometry.IRelationalOperator thisFrom = thisPolyline.FromPoint as ESRI.ArcGIS.Geometry.IRelationalOperator;
            ESRI.ArcGIS.Geometry.IRelationalOperator thisTo   = thisPolyline.ToPoint as ESRI.ArcGIS.Geometry.IRelationalOperator;
            ESRI.ArcGIS.Geometry.IPoint otherFrom             = otherPolyline.FromPoint;
            ESRI.ArcGIS.Geometry.IPoint otherTo = otherPolyline.ToPoint;

            // Assume it will be the from end of thisFeature and the to end of otherFeature
            base._isThisFromEnd = true;
            _isOtherFromEnd     = false;

            if (thisTo.Equals(otherFrom))
            {
                base._isThisFromEnd = false;
                _isOtherFromEnd     = true;
            }
            else if (thisFrom.Equals(otherFrom))
            {
                _isOtherFromEnd = true;
            }
            else if (thisTo.Equals(otherTo))
            {
                base._isThisFromEnd = false;
            }
        }
        protected override RefugeeSite CreateSite(ESRI.ArcGIS.Geodatabase.IFeature feature)
        {
            int    pop       = int.Parse(feature.get_Value(_idxPop).ToString());
            double density   = double.Parse(feature.get_Value(_idxDensity).ToString());
            int    intensity = int.Parse(feature.get_Value(_idxIntensity).ToString());

            RefugeeSiteRescue site = new RefugeeSiteRescue()
            {
                OID      = feature.OID,
                Location = feature.ShapeCopy as IPoint,
            };

            site.Priority = P(density) + M(pop) + I(intensity);

            site.ResourceInNeed = pop * 20;
            return(site);
        }
        protected override RefugeeSite CreateSite(ESRI.ArcGIS.Geodatabase.IFeature feature)
        {
            double sf       = double.Parse(feature.get_Value(_idxSf).ToString());
            double lf       = double.Parse(feature.get_Value(_idxLf).ToString());
            int    fireArea = int.Parse(feature.get_Value(_idxFireArea).ToString());

            RefugeeSiteFireFighter site = new RefugeeSiteFireFighter()
            {
                OID      = feature.OID,
                Location = feature.ShapeCopy as IPoint,
            };

            site.Priority = 0.6 * lf + 0.4 * lf;

            site.ResourceInNeed = 6 * fireArea / 100;
            return(site);
        }
        // The following CreateBasicXMLItmesForSchematicElt private procedure is used to create the first expected XML items for a XML NodeFeature or LinkFeature
        private void CreateBasicXMLItemsForSchematicElt(ESRI.ArcGIS.Geodatabase.IFeature inFeature,
                                                        ref MSXML2.DOMDocument outDOMDoc,
                                                        ref MSXML2.IXMLDOMElement outXMLElement,
                                                        string inEltTypeName)
        {
            MSXML2.IXMLDOMElement xmlElt_EltTypeName;
            MSXML2.IXMLDOMElement xmlElt_ExternalUID;
            MSXML2.IXMLDOMElement xmlElt_DatasourceName;
            MSXML2.IXMLDOMElement xmlElt_UCID;
            MSXML2.IXMLDOMElement xmlElt_UOID;

            // Specifying its FeatureClassName
            xmlElt_EltTypeName = outDOMDoc.createElement("FeatureClassName");
            outXMLElement.appendChild(xmlElt_EltTypeName);
            if (inFeature.Fields.FindField("Feeder") != -1)
            {
                xmlElt_EltTypeName.nodeTypedValue = inEltTypeName + "sFeeder" + inFeature.get_Value(inFeature.Fields.FindField("Feeder")).ToString();
            }
            else
            {
                xmlElt_EltTypeName.nodeTypedValue = inEltTypeName + "s";
            }

            // Specifying its ExternalUniqueID
            xmlElt_ExternalUID = outDOMDoc.createElement("ExternalUniqueID");
            outXMLElement.appendChild(xmlElt_ExternalUID);
            xmlElt_ExternalUID.nodeTypedValue = inEltTypeName + "-" + inFeature.OID.ToString();

            // Specifying its DatasourceName
            xmlElt_DatasourceName = outDOMDoc.createElement("DatasourceName");
            outXMLElement.appendChild(xmlElt_DatasourceName);
            xmlElt_DatasourceName.nodeTypedValue = "XMLDataSource";

            // Specifying its UCID
            xmlElt_UCID = outDOMDoc.createElement("UCID");
            outXMLElement.appendChild(xmlElt_UCID);
            xmlElt_UCID.nodeTypedValue = inFeature.Class.ObjectClassID;

            // Add UOID to NodeElement
            xmlElt_UOID = outDOMDoc.createElement("UOID");
            outXMLElement.appendChild(xmlElt_UOID);
            xmlElt_UOID.nodeTypedValue = inFeature.OID;
        }
        protected override RefugeeSite CreateSite(ESRI.ArcGIS.Geodatabase.IFeature feature)
        {
            double se     = double.Parse(feature.get_Value(_idxSe).ToString());
            double le     = double.Parse(feature.get_Value(_idxLe).ToString());
            double de     = double.Parse(feature.get_Value(_idxDe).ToString());
            double dmgLen = double.Parse(feature.get_Value(_idxDamagedLen).ToString());
            double coe    = double.Parse(feature.get_Value(_idxCoe).ToString());

            RSElectricity site = new RSElectricity()
            {
                OID      = feature.OID,
                Location = feature.ShapeCopy as IPoint,
            };

            site.Priority = alpha * se + beta * le + gama * de;

            site.ResourceInNeed = (int)(coe * 1.5 * dmgLen);
            return(site);
        }
        /// <summary>
        /// 合并要素图形范围
        /// </summary>
        /// <param name="pFeatureclass">要合并的要素类</param>
        /// <param name="filter">过滤条件</param>
        /// <returns></returns>
        public static IGeometry UnionFeature(ESRI.ArcGIS.Geodatabase.IFeatureClass pFeatureclass, string filter)
        {
            IGeometry geo = null;

            using (ComReleaser comReleaser = new ComReleaser())
            {
                List <IGeometry> geoLst = new List <IGeometry>();
                ESRI.ArcGIS.Geodatabase.IGeoDataset    geoDataset    = pFeatureclass as ESRI.ArcGIS.Geodatabase.IGeoDataset;
                ESRI.ArcGIS.Geodatabase.IFeatureCursor featureCursor = pFeatureclass.Search(new ESRI.ArcGIS.Geodatabase.QueryFilter {
                    WhereClause = filter
                }, false);
                ESRI.ArcGIS.Geodatabase.IFeature pFeature = featureCursor.NextFeature();
                while (pFeature != null)
                {
                    geoLst.Add(pFeature.ShapeCopy);
                    if (geoLst.Count == 50)
                    {
                        geo = UnionGeometry(geoLst, geoDataset.SpatialReference);
                        geoLst.Clear();
                        geoLst.Add(geo);
                    }
                    comReleaser.ManageLifetime(pFeature);
                    pFeature = featureCursor.NextFeature();
                }
                if (geoLst.Count == 1)
                {
                    geo = geoLst[0];
                }
                if (geoLst.Count > 1)
                {
                    geo = UnionGeometry(geoLst, geoDataset.SpatialReference);
                }
                IZAware ipZAware = geo as IZAware;
                if (ipZAware.ZAware == true)
                {
                    ipZAware.ZAware = false;
                }
                comReleaser.ManageLifetime(featureCursor);
                System.Runtime.InteropServices.Marshal.ReleaseComObject(featureCursor);
            }
            return(geo);
        }
        // The following CompleteXMLEltByProperties private procedure is used to create all the expected propertyset properties listed in the input PropertiesArray array
        private void CompleteXMLEltByProperties(ESRI.ArcGIS.Geodatabase.IFeature inFeature,
                                                ref MSXML2.DOMDocument outDOMDoc,
                                                ref MSXML2.IXMLDOMElement outXMLElement,
                                                string[] propertiesArray)
        {
            int i = 0;

            MSXML2.IXMLDOMElement xmlPropertySet;
            MSXML2.IXMLDOMElement xmlPropertyArray;
            MSXML2.IXMLDOMElement xmlPropertySetProperty;
            MSXML2.IXMLDOMElement xmlProperty_Key;
            MSXML2.IXMLDOMElement xmlProperty_Value;

            if (propertiesArray.Length > 0)
            {
                //-------- PropertySet Section START --------
                // Creating the PropertySet element for the input outXMLElement
                xmlPropertySet = outDOMDoc.createElement("PropertySet");
                outXMLElement.appendChild(xmlPropertySet);
                // Creating the PropertyArray element
                xmlPropertyArray = outDOMDoc.createElement("PropertyArray");
                xmlPropertySet.appendChild(xmlPropertyArray);

                while (i < propertiesArray.Length)
                {
                    // Creating the i PropertySetProperty
                    xmlPropertySetProperty = outDOMDoc.createElement("PropertySetProperty");
                    xmlPropertyArray.appendChild(xmlPropertySetProperty);
                    // Specifying the key && value field related to that i PropertySetProperty
                    xmlProperty_Key = outDOMDoc.createElement("Key");
                    xmlPropertySetProperty.appendChild(xmlProperty_Key);
                    xmlProperty_Key.nodeTypedValue = propertiesArray[i].ToString();
                    xmlProperty_Value = outDOMDoc.createElement("Value");
                    xmlPropertySetProperty.appendChild(xmlProperty_Value);
                    xmlProperty_Value.nodeTypedValue = inFeature.get_Value(inFeature.Fields.FindField(propertiesArray[i].ToString()));
                    i += 1;
                }
            }
            //-------- PropertySet Section END --------
        }
        protected override void editor_OnCreateFeature(ESRI.ArcGIS.Geodatabase.IObject obj)
        {
            // Check for bad inputs
            ESRI.ArcGIS.Geodatabase.IFeature feature = obj as ESRI.ArcGIS.Geodatabase.IFeature;
            if (feature == null || feature.Class == null)
            {
                return;
            }

            // Work out type of feature
            ESRI.ArcGIS.Geodatabase.IDataset dataset = (ESRI.ArcGIS.Geodatabase.IDataset)feature.Class;
            string tableName = GdbUtils.ParseTableName(dataset);

            // -----------------------------
            // Fiber
            // -----------------------------
            if (0 == string.Compare(ConfigUtil.FiberCableFtClassName, tableName, true))
            {
                try
                {
                    //FiberCableConfiguration cf =
                    //    ConfigUtil.FiberCableConfigurationFromDisplayName(listView1.SelectedItems[0].Text);
                    if (_fiberConfig != null)
                    {
                        ConfigureCable(feature, _fiberConfig, true);
                    }
                }
                catch (Exception ex)
                {
                    _logHelper.addLogEntry(DateTime.Now.ToString(), "ERROR", "Failed to configure cable.", ex.Message);

                    string message = "Failed to configure cable:" + System.Environment.NewLine +
                                     ex.Message;
                    MessageBox.Show(message, "Configure Fiber Cable", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Example #14
0
        private DataTable SpatialSearch(ESRI.ArcGIS.Geodatabase.IFeatureClass pFtClass, string pWhereClause, IGeometry pGeometry, ESRI.ArcGIS.Geodatabase.esriSpatialRelEnum pSpRel)
        {
            //定义空间查询过滤器对象
            ESRI.ArcGIS.Geodatabase.ISpatialFilter pSpatialFilter = new ESRI.ArcGIS.Geodatabase.SpatialFilterClass();
            //设置sql查询语句
            pSpatialFilter.WhereClause = pWhereClause;
            //设置查询范围
            pSpatialFilter.Geometry = pGeometry;
            //给定范围与查询对象的空间关系
            pSpatialFilter.SpatialRel = pSpRel;

            axMapControl1.Map.ClearSelection(); //清除上次查询结果
            //查询结果以游标的形式返回(下面与属性查询一样)
            ESRI.ArcGIS.Geodatabase.IFeatureCursor pFtCursor = pFtClass.Search(pSpatialFilter, false);

            ESRI.ArcGIS.Geodatabase.IFeature pFt = pFtCursor.NextFeature();
            DataTable DT = new DataTable();

            for (int i = 0; i < pFtCursor.Fields.FieldCount; i++)
            {
                DataColumn dc = new DataColumn(pFtCursor.Fields.get_Field(i).Name,
                                               System.Type.GetType(ParseFieldType((pFtCursor.Fields.get_Field(i).Type))));
                DT.Columns.Add(dc);
            }
            while (pFt != null)
            {
                axMapControl1.Map.SelectFeature(pLayer, pFt); //选择要素
                DataRow dr = DT.NewRow();
                for (int i = 0; i < pFt.Fields.FieldCount; i++)
                {
                    dr[i] = pFt.get_Value(i);
                }
                DT.Rows.Add(dr);
                pFt = pFtCursor.NextFeature();
            }
            return(DT);
        }
 /// <summary>
 /// Constructs a new ConnectableCableWrapper
 /// </summary>
 /// <param name="fiberCableFeature">IFeature to wrap</param>
 /// <param name="isThisFromEnd">Flag of which end of the cable would be connected</param>
 public ConnectableCableWrapper(ESRI.ArcGIS.Geodatabase.IFeature fiberCableFeature, bool isThisFromEnd)
     : base(fiberCableFeature)
 {
     _isThisFromEnd = isThisFromEnd;
 }
Example #16
0
 /// <summary>
 /// Constructs a new SpliceableCableWrapper
 /// </summary>
 /// <param name="fiberCableFeature">IFeature to wrap</param>
 /// <param name="isThisFromEnd">Flag for which end of this cable would be spliced</param>
 /// <param name="isOtherFromEnd">Flag for which end of the other cable would be spliced</param>
 public SpliceableCableWrapper(ESRI.ArcGIS.Geodatabase.IFeature fiberCableFeature, bool isThisFromEnd, bool isOtherFromEnd)
     : base(fiberCableFeature, isThisFromEnd)
 {
     _isOtherFromEnd = isOtherFromEnd;
 }
        /*
         * private String fiberOrBufferColorLookup(int number)
         * {
         *  switch (number)
         *  {
         *      case 1:
         *          return "Blue";
         *      case 2:
         *          return "Orange";
         *      case 3:
         *          return "Green";
         *      case 4:
         *          return "Brown";
         *      case 5:
         *          return "Slate";
         *      case 6:
         *          return "White";
         *      case 7:
         *          return "Red";
         *      case 8:
         *          return "Black";
         *      case 9:
         *          return "Yellow";
         *      case 10:
         *          return "Violet";
         *      case 11:
         *          return "Rose";
         *      case 12:
         *          return "Aqua";
         *      default:
         *          return string.Empty;
         *  }
         * }
         */

        /// <summary>
        /// Generates a number of buffer tubes and fiber records for a fiber cable, given a configuration.
        /// </summary>
        /// <param name="feature">IFeature to generate for</param>
        /// <param name="configuration">Specification of buffer and fiber counts</param>
        /// <param name="progressDialog">Progress dialog for user notification</param>
        /// <param name="trackCancel">TrackCancel used in the progress dialog</param>
        /// <returns>Success</returns>
        private bool GenerateUnits(ESRI.ArcGIS.Geodatabase.IFeature feature, FiberCableConfiguration configuration, ESRI.ArcGIS.Framework.IProgressDialog2 progressDialog, ESRI.ArcGIS.esriSystem.ITrackCancel trackCancel)
        {
            bool isComplete  = false;
            bool isCancelled = false;
            Guid g;

            ESRI.ArcGIS.esriSystem.IStepProgressor stepProgressor = (ESRI.ArcGIS.esriSystem.IStepProgressor)progressDialog;
            ESRI.ArcGIS.Geodatabase.IObjectClass   ftClass        = feature.Class;

            using (ESRI.ArcGIS.ADF.ComReleaser releaser = new ESRI.ArcGIS.ADF.ComReleaser())
            {
                ESRI.ArcGIS.Geodatabase.IRelationshipClass cableHasBuffer = GdbUtils.GetRelationshipClass(ftClass, ConfigUtil.FiberCableToBufferRelClassName);
                releaser.ManageLifetime(cableHasBuffer);
                ESRI.ArcGIS.Geodatabase.IRelationshipClass cableHasFiber = GdbUtils.GetRelationshipClass(ftClass, ConfigUtil.FiberCableToFiberRelClassName);
                releaser.ManageLifetime(cableHasFiber);
                ESRI.ArcGIS.Geodatabase.IRelationshipClass bufferHasFiber = GdbUtils.GetRelationshipClass(ftClass, ConfigUtil.BufferToFiberRelClassName);
                releaser.ManageLifetime(bufferHasFiber);

                ESRI.ArcGIS.Geodatabase.ITable bufferTable = cableHasBuffer.DestinationClass as ESRI.ArcGIS.Geodatabase.ITable;
                ESRI.ArcGIS.Geodatabase.ITable fiberTable  = cableHasFiber.DestinationClass as ESRI.ArcGIS.Geodatabase.ITable;

                // Fields to populate on buffer
                int    bufferIpidIdx      = bufferTable.Fields.FindField(ConfigUtil.IpidFieldName);
                int    fiberCountIdx      = bufferTable.Fields.FindField(ConfigUtil.NumberOfFibersFieldName);
                int    bufferToCableIdx   = bufferTable.Fields.FindField(cableHasBuffer.OriginForeignKey);
                object bufferToCableValue = feature.get_Value(feature.Fields.FindField(cableHasBuffer.OriginPrimaryKey));

                // Fields to populate on fiber
                int    fiberIpidIdx          = fiberTable.Fields.FindField(ConfigUtil.IpidFieldName);
                int    fiberNumberIdx        = fiberTable.Fields.FindField(ConfigUtil.Fiber_NumberFieldName);
                int    fiberColorIdx         = fiberTable.Fields.FindField(ConfigUtil.Fiber_ColorFieldName);
                int    fiberToCableIdx       = fiberTable.Fields.FindField(cableHasFiber.OriginForeignKey);
                object fiberToCableValue     = feature.get_Value(feature.Fields.FindField(cableHasFiber.OriginPrimaryKey));
                int    fiberToBufferIdx      = fiberTable.Fields.FindField(bufferHasFiber.OriginForeignKey);
                int    fiberToBufferValueIdx = bufferTable.Fields.FindField(bufferHasFiber.OriginPrimaryKey);

                // Research using InsertCursor for speed.
                int fiberNumber = 0;
                for (int bufferIdx = 1; bufferIdx <= configuration.BufferCount; bufferIdx++)
                {
                    g = Guid.NewGuid();
                    string bufferId = g.ToString("B").ToUpper();

                    ESRI.ArcGIS.Geodatabase.IRow row = bufferTable.CreateRow();
                    releaser.ManageLifetime(row);

                    row.set_Value(bufferIpidIdx, bufferId);
                    row.set_Value(fiberCountIdx, configuration.FibersPerTube);
                    row.set_Value(bufferToCableIdx, bufferToCableValue);
                    row.Store();

                    object fiberToBufferValue = row.get_Value(fiberToBufferValueIdx);

                    // Research using InsertCursor for speed.
                    for (int fiberIdx = 1; fiberIdx <= configuration.FibersPerTube; fiberIdx++)
                    {
                        fiberNumber++;
                        progressDialog.Description = string.Format("Creating fiber {0} of {1}", fiberNumber, configuration.TotalFiberCount);
                        stepProgressor.Step();

                        g = Guid.NewGuid();
                        ESRI.ArcGIS.Geodatabase.IRow fiberRow = fiberTable.CreateRow();
                        releaser.ManageLifetime(fiberRow);


                        fiberRow.set_Value(fiberIpidIdx, g.ToString("B").ToUpper());
                        fiberRow.set_Value(fiberNumberIdx, fiberNumber);

                        // Dangerous if coded values are altered but while
                        // domain type is int Rather than string coded, this
                        // is quickest way to add this
                        // Dont do for fiber groupings of more than 12
                        if (configuration.FibersPerTube <= 12)
                        {
                            fiberRow.set_Value(fiberColorIdx, fiberIdx);
                        }

                        fiberRow.set_Value(fiberToBufferIdx, fiberToBufferValue);
                        fiberRow.set_Value(fiberToCableIdx, fiberToCableValue);

                        fiberRow.Store();

                        if (!trackCancel.Continue())
                        {
                            isCancelled = true;
                            break;
                        }
                    }

                    if (!trackCancel.Continue())
                    {
                        isCancelled = true;
                        break;
                    }
                }

                if (!isCancelled)
                {
                    isComplete = true;
                }
            }

            return(isComplete);
        }
        /// <summary>
        /// Sets the buffer tube and strand counts based on the given configuration. If IPID and/or CABLEID are null, it also
        /// takes care of them
        /// </summary>
        /// <param name="feature">The FiberCable feature to configure</param>
        /// <param name="configuration">The tube/strand counts</param>
        /// <param name="isExistingOperation">Flag to control whether this method is being called from within an existing
        /// edit operation</param>
        /// <returns>Success</returns>
        protected bool ConfigureCable(ESRI.ArcGIS.Geodatabase.IFeature feature, FiberCableConfiguration configuration, bool isExistingOperation)
        {
            bool isComplete         = false;
            bool isOurOperationOpen = false;

            // The following assignments are defaults for the case where they are not already populated on the feature
            string fiberCableIpid = Guid.NewGuid().ToString("B").ToUpper();

            // The following will be set during Validation
            ESRI.ArcGIS.Geodatabase.IObjectClass ftClass = null;
            ESRI.ArcGIS.Geodatabase.IFields      fields  = null;
            int ipidIdx        = -1;
            int bufferCountIdx = -1;
            int strandCountIdx = -1;

            #region Validation

            if (null == feature)
            {
                throw new ArgumentNullException("feature");
            }

            if (null == configuration)
            {
                throw new ArgumentNullException("configuration");
            }

            if (_editor.EditState == ESRI.ArcGIS.Editor.esriEditState.esriStateNotEditing)
            {
                throw new InvalidOperationException("You must be editing the workspace to perform this operation.");
            }

            ftClass = feature.Class;
            fields  = ftClass.Fields;

            string missingFieldFormat = "Field {0} is missing.";

            ipidIdx = fields.FindField(ConfigUtil.IpidFieldName);
            if (-1 == ipidIdx)
            {
                throw new InvalidOperationException(string.Format(missingFieldFormat, ConfigUtil.IpidFieldName));
            }

            bufferCountIdx = fields.FindField(ConfigUtil.NumberOfBuffersFieldName);
            if (-1 == bufferCountIdx)
            {
                throw new InvalidOperationException(string.Format(missingFieldFormat, ConfigUtil.NumberOfBuffersFieldName));
            }

            strandCountIdx = fields.FindField(ConfigUtil.NumberOfFibersFieldName);
            if (-1 == strandCountIdx)
            {
                throw new InvalidOperationException(string.Format(missingFieldFormat, ConfigUtil.NumberOfFibersFieldName));
            }

            #endregion


            ESRI.ArcGIS.esriSystem.ITrackCancel    trackCancel    = new ESRI.ArcGIS.Display.CancelTrackerClass();
            ESRI.ArcGIS.Framework.IProgressDialog2 progressDialog = _hookHelper.CreateProgressDialog(trackCancel, "Preparing to configure cable...", 1, configuration.TotalFiberCount, 1, "Starting edit operation...", "Fiber Configuration");
            ESRI.ArcGIS.esriSystem.IStepProgressor stepProgressor = (ESRI.ArcGIS.esriSystem.IStepProgressor)progressDialog;

            progressDialog.ShowDialog();
            stepProgressor.Step();

            if (!isExistingOperation)
            {
                _editor.StartOperation();
                isOurOperationOpen = true;
            }

            try
            {
                if (DBNull.Value == feature.get_Value(ipidIdx))
                {
                    feature.set_Value(ipidIdx, fiberCableIpid);
                }
                else
                {
                    fiberCableIpid = feature.get_Value(ipidIdx).ToString();
                }

                feature.set_Value(bufferCountIdx, configuration.BufferCount);
                feature.set_Value(strandCountIdx, configuration.FibersPerTube);

                isComplete = GenerateUnits(feature, configuration, progressDialog, trackCancel);

                progressDialog.Description = "Completing configuration...";
                stepProgressor.Step();

                if (isOurOperationOpen)
                {
                    if (isComplete)
                    {
                        feature.Store();
                        _editor.StopOperation("Configure Fiber");
                    }
                    else
                    {
                        _editor.AbortOperation();
                    }
                }
            }
            catch (Exception e)
            {
                if (isOurOperationOpen)
                {
                    _editor.AbortOperation();
                }
            }

            progressDialog.HideDialog();
            return(isComplete);
        }
        // The following CreateXMLLinkElt private procedure is used to create all the expected XML items for a XML LinkFeature related to a HV_Line or LV_Line simple edge feature
        private void CreateXMLLinkElt(ESRI.ArcGIS.Geodatabase.IFeature inFeature, ref MSXML2.DOMDocument outDOMDoc, ref MSXML2.IXMLDOMElement outXMLElements, string inLinkTypeName)
        {
            if (!inFeature.HasOID)
            {
                MessageBox.Show("No OID");
                return;
            }

            MSXML2.IXMLDOMElement xmlLink;
            MSXML2.IXMLDOMElement xmlLink_FromNode;
            MSXML2.IXMLDOMElement xmlLink_ToNode;
            int    indexListPoints;
            string listPoints;
            int    nbVertices;
            string vertices;

            MSXML2.IXMLDOMElement xmlLink_Vertices;
            MSXML2.IXMLDOMElement xmlLink_Vertex;
            MSXML2.IXMLDOMElement xmlLink_XVertex;
            MSXML2.IXMLDOMElement xmlLink_YVertex;
            string xValue;
            string yValue;

            //-------- Feature Section START related to the "infeature" --------
            // Creating the LinkFeature Feature
            xmlLink = outDOMDoc.createElement("LinkFeature");
            outXMLElements.appendChild(xmlLink);

            // Specifying basic XML items for this LinkFeature
            CreateBasicXMLItemsForSchematicElt(inFeature, ref outDOMDoc, ref xmlLink, inLinkTypeName);
            // Specifying its FromNode
            xmlLink_FromNode = outDOMDoc.createElement("FromNode");
            xmlLink.appendChild(xmlLink_FromNode);
            xmlLink_FromNode.nodeTypedValue = inFeature.get_Value(inFeature.Fields.FindField("FromJunctionType")) + "-" + inFeature.get_Value(inFeature.Fields.FindField("FromJunctionOID"));
            // Specifying its ToNode
            xmlLink_ToNode = outDOMDoc.createElement("ToNode");
            xmlLink.appendChild(xmlLink_ToNode);
            xmlLink_ToNode.nodeTypedValue = inFeature.get_Value(inFeature.Fields.FindField("ToJunctionType")) + "-" + inFeature.get_Value(inFeature.Fields.FindField("ToJunctionOID"));

            //Add Vertices to LinkFeature ---- NEED TO BE COMPLETED
            indexListPoints = inFeature.Fields.FindField("ListPoints");
            if (indexListPoints > 0)
            {
                listPoints = "";
                listPoints = inFeature.get_Value(indexListPoints).ToString();
                if (listPoints != "")
                {
                    int foundChar = listPoints.IndexOf(";", 1);
                    nbVertices = System.Convert.ToInt32(listPoints.Substring(0, foundChar));
                    vertices   = listPoints.Substring(foundChar + 1);
                    if (nbVertices > 0)
                    {
                        // Specifying its Vertices
                        xmlLink_Vertices = outDOMDoc.createElement("Vertices");
                        xmlLink.appendChild(xmlLink_Vertices);

                        int iLoc;
                        for (int i = 1; i <= nbVertices; i++)
                        {
                            xValue = "";
                            yValue = "";
                            iLoc   = vertices.IndexOf(";", 1);
                            if (vertices != "" && (iLoc) > 0)
                            {
                                xValue = vertices.Substring(0, iLoc);
                            }
                            vertices = vertices.Substring(iLoc + 1);
                            iLoc     = vertices.IndexOf(";", 1);
                            if (vertices != ";" && (iLoc) > 0)
                            {
                                yValue = vertices.Substring(0, iLoc);
                            }

                            if (xValue != "" && yValue != "")
                            {
                                xmlLink_Vertex = outDOMDoc.createElement("Vertex");
                                xmlLink_Vertices.appendChild(xmlLink_Vertex);
                                xmlLink_XVertex = outDOMDoc.createElement("X");
                                xmlLink_Vertex.appendChild(xmlLink_XVertex);
                                xmlLink_XVertex.nodeTypedValue = xValue;
                                xmlLink_YVertex = outDOMDoc.createElement("Y");
                                xmlLink_Vertex.appendChild(xmlLink_YVertex);
                                xmlLink_YVertex.nodeTypedValue = yValue;
                                if (vertices.Length - iLoc > 0)
                                {
                                    vertices = vertices.Substring(iLoc + 1);                                     //sVertices.Length - iLoc)
                                }
                                else
                                {
                                    break;
                                }
                            }
                            else
                            {
                                break;
                            }
                        }
                    }
                }
            }
            else
            {            // Retrieving ListPoint from geometry
                ESRI.ArcGIS.Geometry.IPolyline        oPoly   = (ESRI.ArcGIS.Geometry.IPolyline)inFeature.ShapeCopy;
                ESRI.ArcGIS.Geometry.IPointCollection colLink = (ESRI.ArcGIS.Geometry.IPointCollection)oPoly;
                if (colLink != null && colLink.PointCount > 2)
                {
                    ESRI.ArcGIS.Geometry.IPoint oPoint;

                    xmlLink_Vertices = outDOMDoc.createElement("Vertices");
                    xmlLink.appendChild(xmlLink_Vertices);
                    for (int i = 1; i < colLink.PointCount - 1; i++)
                    {
                        oPoint = colLink.get_Point(i);

                        xmlLink_Vertex = outDOMDoc.createElement("Vertex");
                        xmlLink_Vertices.appendChild(xmlLink_Vertex);
                        xmlLink_XVertex = outDOMDoc.createElement("X");
                        xmlLink_Vertex.appendChild(xmlLink_XVertex);
                        xmlLink_XVertex.nodeTypedValue = oPoint.X;
                        xmlLink_YVertex = outDOMDoc.createElement("Y");
                        xmlLink_Vertex.appendChild(xmlLink_YVertex);
                        xmlLink_YVertex.nodeTypedValue = oPoint.Y;
                    }
                }
            }

            //Specifying its properties
            switch (inFeature.Class.AliasName)
            {
            case "LV_Line":
            {
                CompleteXMLEltByProperties(inFeature, ref outDOMDoc, ref xmlLink, m_LVLinesPropertiesArray);
                break;
            }
            }
            //-------- Feature Section END related to the "infeature" --------
        }
 /// <summary>
 /// Constructs a new DeviceWrapper
 /// </summary>
 /// <param name="deviceFeature">IFeature to wrap</param>
 public DeviceWrapper(ESRI.ArcGIS.Geodatabase.IFeature deviceFeature)
     : base(deviceFeature)
 {
     CacheFields();
 }
        // The following CreateXMLLNodeElt private procedure is used to create all the expected
        // XML items for a XML NodeFeature related to a Station or Feeder simple junction feature
        private void CreateXMLNodeElt(ESRI.ArcGIS.Geodatabase.IFeature inFeature, ref MSXML2.DOMDocument outDOMDoc, ref MSXML2.IXMLDOMElement outXMLElements, string inNodeTypeName)
        {
            if (!inFeature.HasOID)
            {
                MessageBox.Show("No OID");
                return;
            }

            MSXML2.IXMLDOMElement xmlNode;
            MSXML2.IXMLDOMElement xmlNode_XCoord;
            MSXML2.IXMLDOMElement xmlNode_YCoord;
            MSXML2.IXMLDOMElement xmlNode_RelatedContainerID;
            bool relatedContainer;

            MSXML2.IXMLDOMNodeList xmlNodeList;
            MSXML2.IXMLDOMElement  xmlDrawing;
            MSXML2.IXMLDOMElement  xmlDrawing_EltTypeName;
            MSXML2.IXMLDOMElement  xmlDrawing_ExternalUID;

            //-------- Feature Section START related to the "infeature" --------
            // Creating the NodeFeature element
            xmlNode = outDOMDoc.createElement("NodeFeature");
            outXMLElements.appendChild(xmlNode);
            // Specifying basic XML items for this NodeFeature
            CreateBasicXMLItemsForSchematicElt(inFeature, ref outDOMDoc, ref xmlNode, inNodeTypeName);

            // Specifying its X && Y when they exist
            if ((inFeature.Fields.FindField("X") > 0) && (inFeature.Fields.FindField("Y") > 0))
            {
                // Specifying InitialX
                xmlNode_XCoord = outDOMDoc.createElement("InitialX");
                xmlNode.appendChild(xmlNode_XCoord);
                xmlNode_XCoord.nodeTypedValue = inFeature.get_Value(inFeature.Fields.FindField("X"));
                // Specifying InitialY
                xmlNode_YCoord = outDOMDoc.createElement("InitialY");
                xmlNode.appendChild(xmlNode_YCoord);
                xmlNode_YCoord.nodeTypedValue = inFeature.get_Value(inFeature.Fields.FindField("Y"));
            }
            else
            {
                // Retrieving initial position from Geometry
                ESRI.ArcGIS.Geometry.IPoint oPoint = (ESRI.ArcGIS.Geometry.IPoint)inFeature.ShapeCopy;

                if (oPoint != null)
                {
                    // Specifying InitialX
                    xmlNode_XCoord = outDOMDoc.createElement("InitialX");
                    xmlNode.appendChild(xmlNode_XCoord);
                    xmlNode_XCoord.nodeTypedValue = oPoint.X;
                    // Specifying InitialY
                    xmlNode_YCoord = outDOMDoc.createElement("InitialY");
                    xmlNode.appendChild(xmlNode_YCoord);
                    xmlNode_YCoord.nodeTypedValue = oPoint.Y;
                }
            }

            xmlNode_RelatedContainerID = outDOMDoc.createElement("RelatedContainerID");
            xmlNode.appendChild(xmlNode_RelatedContainerID);

            // Specifying its properties
            switch (inFeature.Class.AliasName)
            {
            case "Station":
            {
                xmlNode_RelatedContainerID.nodeTypedValue = "Container-" + System.Convert.ToString(inFeature.get_Value(inFeature.Fields.FindField("Feeder")));
                // For Station feature, the field contained in the StationsPropertiesArray will be exported
                CompleteXMLEltByProperties(inFeature, ref outDOMDoc, ref xmlNode, m_stationsPropertiesArray);
                break;
            }

            case "Feeder":
            {
                xmlNode_RelatedContainerID.nodeTypedValue = "Container-" + inFeature.OID.ToString();
                // For Feeder feature, the field contained in the StationsPropertiesArray will be exported
                CompleteXMLEltByProperties(inFeature, ref outDOMDoc, ref xmlNode, m_feedersPropertiesArray);
                break;
            }
            }
            //-------- Feature Section END related to the "infeature" --------

            // Checking the existence of the related container
            xmlNodeList      = outXMLElements.selectNodes("NodeFeature/ExternalUniqueID");
            relatedContainer = false;

            foreach (MSXML2.IXMLDOMNode node in xmlNodeList)
            {
                if (node.text == xmlNode_RelatedContainerID.nodeTypedValue.ToString())
                {
                    relatedContainer = true;
                    break;
                }
            }             // pNode

            // Creating the related container when it doesn//t already exist
            if (!relatedContainer)
            {
                xmlDrawing = outDOMDoc.createElement("NodeFeature");
                outXMLElements.appendChild(xmlDrawing);
                // Specifying its FeatureClassName
                xmlDrawing_EltTypeName = outDOMDoc.createElement("FeatureClassName");
                xmlDrawing.appendChild(xmlDrawing_EltTypeName);
                xmlDrawing_EltTypeName.nodeTypedValue = "Containers";
                // Specifying its ExternalUniqueID
                xmlDrawing_ExternalUID = outDOMDoc.createElement("ExternalUniqueID");
                xmlDrawing.appendChild(xmlDrawing_ExternalUID);
                xmlDrawing_ExternalUID.nodeTypedValue = xmlNode_RelatedContainerID.nodeTypedValue;
            }
        }
        public override void OnMouseDown(int Button, int Shift, int X, int Y)
        {
            // TODO:  Add PolygonsDifference.OnMouseDown implementation
            if (Button != (int)Keys.LButton)
            {
                return;
            }
            ILayer layer = m_engineEditor.TargetLayer;

            if (layer == null)
            {
                return;
            }
            m_activeView = m_hookHelper.ActiveView;
            m_map        = m_hookHelper.FocusMap;
            ESRI.ArcGIS.Geometry.IPoint pPoint = m_activeView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);
            ISelectionEnvironment       pSelectionEnvironment = new SelectionEnvironmentClass(); pSelectionEnvironment.PointSelectionMethod = ESRI.ArcGIS.Geodatabase.esriSpatialRelEnum.esriSpatialRelWithin;

            m_map.SelectByShape(pPoint as ESRI.ArcGIS.Geometry.IGeometry, pSelectionEnvironment, false);
            //if (m_map.SelectionCount != 2)
            //{
            //    MessageBox.Show("选择的多边形个数应该为2!!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //    return;
            //}
            m_activeView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, m_activeView.Extent);
            ESRI.ArcGIS.Geodatabase.IEnumFeature pEnumFeature  = m_map.FeatureSelection as ESRI.ArcGIS.Geodatabase.IEnumFeature;
            ESRI.ArcGIS.Geodatabase.IFeature     firstFeature  = pEnumFeature.Next();
            ESRI.ArcGIS.Geodatabase.IFeature     secondFeature = pEnumFeature.Next();
            bool firstPolygonIsLarge = false;

            ESRI.ArcGIS.Geometry.IGeometry            pGeometry            = null;
            ESRI.ArcGIS.Geometry.IRelationalOperator  pRelOp1              = firstFeature.Shape as ESRI.ArcGIS.Geometry.IRelationalOperator;
            ESRI.ArcGIS.Geometry.IRelationalOperator  pRelOp2              = secondFeature.Shape as ESRI.ArcGIS.Geometry.IRelationalOperator;
            ESRI.ArcGIS.Geometry.ITopologicalOperator pTopologicalOperator = null;
            if (pRelOp1.Contains(secondFeature.Shape))
            {
                pTopologicalOperator = firstFeature.Shape as ESRI.ArcGIS.Geometry.ITopologicalOperator;
                pGeometry            = pTopologicalOperator.Difference(secondFeature.Shape);
                firstPolygonIsLarge  = true;
            }
            else if (pRelOp2.Contains(firstFeature.Shape))
            {
                pTopologicalOperator = secondFeature.Shape as ESRI.ArcGIS.Geometry.ITopologicalOperator;
                pGeometry            = pTopologicalOperator.Difference(firstFeature.Shape);
                firstPolygonIsLarge  = false;
            }
            else
            {
                return;
            }
            bool         deleteInteriorPolygon = false;
            DialogResult pDialogResult         = MessageBox.Show("是否要删除内多边形?", "操作提示", MessageBoxButtons.YesNo);

            if (pDialogResult == DialogResult.Yes)
            {
                deleteInteriorPolygon = true;
            }
            ESRI.ArcGIS.Geodatabase.IFeatureClass  featureClass  = firstFeature.Class as ESRI.ArcGIS.Geodatabase.IFeatureClass;
            ESRI.ArcGIS.Geodatabase.IDataset       dataset       = featureClass as ESRI.ArcGIS.Geodatabase.IDataset;
            ESRI.ArcGIS.Geodatabase.IWorkspaceEdit workspaceEdit = dataset.Workspace as ESRI.ArcGIS.Geodatabase.IWorkspaceEdit;
            if (!(workspaceEdit.IsBeingEdited()))
            {
                return;
            }
            workspaceEdit.StartEditOperation();
            if (firstPolygonIsLarge)
            {
                firstFeature.Shape = pGeometry;
                firstFeature.Store();
                if (deleteInteriorPolygon)
                {
                    secondFeature.Delete();
                }
            }
            else
            {
                secondFeature.Shape = pGeometry;
                secondFeature.Store();
                if (deleteInteriorPolygon)
                {
                    firstFeature.Delete();
                }
            }
            workspaceEdit.StopEditOperation();
            m_map.ClearSelection();
            m_activeView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, m_activeView.Extent);
            m_Mapcontrol.CurrentTool = null;
        }
Example #23
0
 /// <summary>
 /// Constructs a new SpliceableCableWrapper where the display index is already known
 /// </summary>
 /// <param name="fiberCableFeature">IFeature to wrap</param>
 /// <param name="isThisFromEnd">Flag for which end of this cable would be spliced</param>
 /// <param name="isOtherFromEnd">Flag for which end of the other cable would be spliced</param>
 /// <param name="displayFieldIndex">Index of display field</param>
 public SpliceableCableWrapper(ESRI.ArcGIS.Geodatabase.IFeature fiberCableFeature, bool isThisFromEnd, bool isOtherFromEnd, int displayFieldIndex)
     : base(fiberCableFeature, isThisFromEnd, displayFieldIndex)
 {
     _isOtherFromEnd = isOtherFromEnd;
 }
Example #24
0
 /// <summary>
 /// Constructs a new SpliceClosureWrapper where the display index is already known
 /// </summary>
 /// <param name="spClosureFeature">IFeature to wrap</param>
 /// <param name="displayFieldIndex">Index of display field</param>
 public SpliceClosureWrapper(ESRI.ArcGIS.Geodatabase.IFeature spClosureFeature, int displayFieldIndex)
     : base(spClosureFeature, displayFieldIndex)
 {
     CacheFields();
 }
 /// <summary>
 /// Constructs a new ConnectableDeviceWrapper where the display index is already known 
 /// </summary>
 /// <param name="deviceFeature">IFeature to wrap</param>
 /// <param name="isCableFromEnd">Flag for connecting cable's end</param>
 /// <param name="displayFieldIndex">Index of display field</param>
 public ConnectableDeviceWrapper(ESRI.ArcGIS.Geodatabase.IFeature deviceFeature, bool isCableFromEnd, int displayFieldIndex)
     : base(deviceFeature, displayFieldIndex)
 {
     _isCableFromEnd = isCableFromEnd;
 }
Example #26
0
 /// <summary>
 /// Constructs a new SpliceClosureWrapper
 /// </summary>
 /// <param name="spClosureFeature">IFeature to wrap</param>
 public SpliceClosureWrapper(ESRI.ArcGIS.Geodatabase.IFeature spClosureFeature) : base(spClosureFeature)
 {
     CacheFields();
 }
Example #27
0
 public void Save(ESRI.ArcGIS.Geodatabase.IWorkspace Workspace, ESRI.ArcGIS.Geodatabase.IFeature Feature, BaseModel BaseModel, ModelProperty Property)
 {
     this.Save(Workspace, BaseModel, Property);
 }
 /// <summary>
 /// Constructs a new DeviceWrapper where the display index is already known
 /// </summary>
 /// <param name="deviceFeature">IFeature to wrap</param>
 /// <param name="displayFieldIndex">Index of display field</param>
 public DeviceWrapper(ESRI.ArcGIS.Geodatabase.IFeature deviceFeature, int displayFieldIndex)
     : base(deviceFeature, displayFieldIndex)
 {
     CacheFields();
 }
 /// <summary>
 /// Constructs a new ConnectableDeviceWrapper
 /// </summary>
 /// <param name="deviceFeature">IFeature to wrap</param>
 /// <param name="isCableFromEnd">Flag for connecting cable's end</param>
 public ConnectableDeviceWrapper(ESRI.ArcGIS.Geodatabase.IFeature deviceFeature, bool isCableFromEnd)
     : base(deviceFeature)
 {
     _isCableFromEnd = isCableFromEnd;
 }