Esempio n. 1
0
 public VRelationInfo(ESRI.ArcGIS.Client.FeatureService.Relationship rel)
 {
     relObj  = rel;
     id      = rel.Id;
     name    = rel.Name;
     tableId = rel.RelatedTableId;
     descr   = string.Format("linkID: {0}, linkName: {1}, tableID: {2}", id, name, tableId);
 }         // public VRelationInfo(ESRI.ArcGIS.Client.FeatureService.Relationship rel)
Esempio n. 2
0
        }         // public string getFieldAlias(string fieldname)

        public VRelationInfo getRelation(ESRI.ArcGIS.Client.FeatureService.Relationship rel)
        {
            if (this.relations == null)
            {
                return(null);
            }
            foreach (var ri in this.relations)
            {
                if (ri.id == rel.Id && ri.name == rel.Name && ri.tableId == rel.RelatedTableId)
                {
                    return(ri);
                }
            }
            return(null);
        }         // public VRelationInfo getRelation(ESRI.ArcGIS.Client.FeatureService.Relationship rel)
Esempio n. 3
0
        }         // public VRelationInfo(ESRI.ArcGIS.Client.FeatureService.Relationship rel)

        public VRelationInfo(string description)
        {
            descr   = description;
            relObj  = null;
            id      = -1;
            name    = "";
            tableId = -1;

            string[] parts = descr.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries);
            if (parts.Length != 3)
            {
                throw new Exception("VRelationInfo, malformed relation description" + ": " + descr);
            }
            foreach (var part in parts)
            {
                var items = part.Split(new string[] { ": " }, StringSplitOptions.RemoveEmptyEntries);
                if (items.Length != 2)
                {
                    throw new Exception("VRelationInfo, malformed relation description" + ": " + descr);
                }

                if (items[0] == "linkID")
                {
                    id = Int32.Parse(items[1]);
                }
                else if (items[0] == "linkName")
                {
                    name = items[1];
                }
                else if (items[0] == "tableID")
                {
                    tableId = Int32.Parse(items[1]);
                }
                else
                {
                    throw new Exception("VRelationInfo, malformed relation description" + ": " + descr);
                }
            }
        } // public VRelationInfo(string description)