Exemplo n.º 1
0
        public void Setup()
        {
            _List       = new D8ListClass();
            _LayerNames = new[] { "Support Structure", "Surface Structure", "Underground Structure" };

            foreach (var layerName in _LayerNames)
            {
                ID8Layer layer = new D8LayerClass();
                layer.LayerName = layerName;

                string tableName = layerName.Replace(" ", "");
                for (int i = 0; i < _LayerNames.Length; i++)
                {
                    ID8Feature feature = new D8FeatureClass();
                    feature.Name = tableName;

                    ID8GeoAssoc geoAssoc = (ID8GeoAssoc)feature;
                    geoAssoc.OID       = i;
                    geoAssoc.TableName = tableName;

                    ((ID8List)layer).Add((ID8ListItem)feature);
                }

                _List.Add((ID8ListItem)layer);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Adds the error to the internal D8List.
        /// </summary>
        /// <param name="errorMessage">The error message to be added.</param>
        protected void AddError(string errorMessage)
        {
            if (_ErrorList == null)
            {
                _ErrorList = new D8ListClass();
            }

            IMMValidationError error = new MMValidationErrorClass();

            error.Severity     = 8;
            error.BitmapID     = 0;
            error.ErrorMessage = errorMessage;
            _ErrorList.Add((ID8ListItem)error);
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Adds the node as a child to the specified <paramref name="parent" />.
        /// </summary>
        /// <param name="source">The node.</param>
        /// <param name="parent">The parent.</param>
        /// <exception cref="ArgumentNullException">parent</exception>
        public static void Add(this IMMPxNode source, IMMPxNode parent)
        {
            if (source == null)
            {
                return;
            }
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }

            ID8List list = (ID8List)parent;

            ((ID8ListEx)parent).BuildChildren = true;

            list.Add((ID8ListItem)source);
        }
Exemplo n.º 4
0
        /// <summary>
        ///     Performs the queries necessary to build the list.
        /// </summary>
        /// <param name="pList">The list.</param>
        public override void BuildList(ID8List pList)
        {
            if (pList == null)
            {
                return;
            }

            if (!this.Validate((IMMPxNode)pList))
            {
                return;
            }

            foreach (var nodeID in _NodeIDs)
            {
                IMMPxNode node = this.GetNode(nodeID);
                if (node != null)
                {
                    pList.Add((ID8ListItem)node);
                }
            }
        }
Exemplo n.º 5
0
        /// <summary>
        ///     Replaces the source list with the contents of the specified list.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="list">The list that will replace the source.</param>
        public static void Update(this ID8List source, ID8List list)
        {
            source.Clear();

            ((ID8ListItem)source).AllowCoreEvents = false;

            try
            {
                list.Reset();

                ID8ListItem item;
                while ((item = list.Next(false)) != null)
                {
                    source.Add(item);
                }
            }
            finally
            {
                ((ID8ListItem)source).AllowCoreEvents = true;
            }
        }