Ejemplo 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)
Ejemplo n.º 2
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)