Example #1
0
        public void add(int ClassID, string ClassName, ESRI.ArcGIS.Geometry.IGeometry Geo, int OID, int EID, IFeature pFeat)
        {
            FeatureDetails pFD = new FeatureDetails();

            FieldPairs[] fps    = new FieldPairs[pFeat.Fields.FieldCount - 1];
            int          fldIdx = 0;

            for (int i = 0; i < pFeat.Fields.FieldCount; i++)
            {
                if (pFeat.Fields.get_Field(i).Type == esriFieldType.esriFieldTypeGeometry)
                {
                }
                else
                {
                    FieldPairs fp = new FieldPairs();
                    fp.FieldAlias = pFeat.Fields.get_Field(i).AliasName;
                    fp.FieldName  = pFeat.Fields.get_Field(i).Name;
                    if (pFeat.get_Value(i) == null)
                    {
                        fp.FieldValue = "";
                    }
                    else
                    {
                        fp.FieldValue = pFeat.get_Value(i).ToString();
                    }
                    fps[fldIdx] = fp;

                    fldIdx++;
                }
            }
            pFD.Fields = fps;

            pFD.Geo = Geo;
            pFD.OID = OID;
            pFD.EID = EID;
            TraceResultsClass trRes = TraceResultClassItem(ClassID);

            if (trRes == null)
            {
                trRes           = new TraceResultsClass();
                trRes.ClassID   = ClassID;
                trRes.ClassName = ClassName;
                if (trRes.Features == null)
                {
                    trRes.Features = new ArrayList();
                }

                trRes.Features.Add(pFD);
                m_TraceResultItems.Add(trRes);
            }
            else
            {
                if (trRes.Features == null)
                {
                    trRes.Features = new ArrayList();
                }
                trRes.Features.Add(pFD);
            }
        }
Example #2
0
        public int CompareTo(object obj)
        {
            TraceResultsClass otherTraceRes = obj as TraceResultsClass;

            if (otherTraceRes != null)
            {
                return(this.ClassID.CompareTo(otherTraceRes.ClassID));
            }
            else
            {
                throw new ArgumentException("Object is not a TraceResult");
            }
        }