コード例 #1
0
        /// <summary>
        /// Creates a one-dimensional <see cref="T:System.Array">Array</see> instance containing the collection items.
        /// </summary>
        /// <returns>Array of type NodeImage</returns>
        public NodeImage[] ToArray()
        {
            NodeImage[] arr = new NodeImage[List.Count];
            // ERROR: Not supported in C#: ReDimStatement

            CopyTo(arr, 0);

            return(arr);
        }
コード例 #2
0
 /// <summary>
 /// Add an element of the specified <see cref="NodeImage">NodeImage</see> to the end of the collection.
 /// </summary>
 /// <param name="value">An object of type <see cref="NodeImage">NodeImage</see> to add to the collection.</param>
 public int Add(NodeImage value)
 {
     int index = List.Add(value);
     if (m_isTrackingViewState)
     {
         value.TrackViewState();
         value.SetDirty();
     }
     return index;
 }
コード例 #3
0
        /// <summary>
        /// Add an element of the specified <see cref="NodeImage">NodeImage</see> to the end of the collection.
        /// </summary>
        /// <param name="value">An object of type <see cref="NodeImage">NodeImage</see> to add to the collection.</param>
        public int Add(NodeImage value)
        {
            int index = List.Add(value);

            if (m_isTrackingViewState)
            {
                value.TrackViewState();
                value.SetDirty();
            }
            return(index);
        }
コード例 #4
0
        /// <summary>
        /// (IStateManager.LoadViewState)
        /// Loads the NodeImageCollection's previously saved view state.
        /// </summary>
        public void LoadViewState(object state)
        {
            if ((state != null))
            {
                object[] nodeState = (object[])state;
                int      index;
                for (index = 0; index <= nodeState.Length - 1; index++)
                {
                    NodeImage _nodeImage = new NodeImage();
                    Add(_nodeImage);

                    ((IStateManager)_nodeImage).TrackViewState();
                    ((IStateManager)_nodeImage).LoadViewState(nodeState[index]);
                }
            }
        }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NodeImageCollection">NodeImageCollection</see> class containing the specified array of <see cref="NodeImage">NodeImage</see> objects.
 /// </summary>
 /// <param name="value">An array of <see cref="NodeImage">NodeImage</see> objects with which to initialize the collection. </param>
 public NodeImageCollection(NodeImage[] value)
     : base()
 {
     AddRange(value);
 }
コード例 #6
0
        /// <summary>
        /// (IStateManager.LoadViewState)
        /// Loads the NodeImageCollection's previously saved view state.
        /// </summary>
        public void LoadViewState(object state)
        {
            if ((state != null))
            {
                object[] nodeState = (object[])state;
                int index;
                for (index = 0; index <= nodeState.Length - 1; index++)
                {
                    NodeImage _nodeImage = new NodeImage();
                    Add(_nodeImage);

                    ((IStateManager)_nodeImage).TrackViewState();
                    ((IStateManager)_nodeImage).LoadViewState(nodeState[index]);
                }
            }
        }
コード例 #7
0
        /// <summary>
        /// Creates a one-dimensional <see cref="T:System.Array">Array</see> instance containing the collection items.
        /// </summary>
        /// <returns>Array of type NodeImage</returns>
        public NodeImage[] ToArray()
        {
            NodeImage[] arr = new NodeImage[List.Count];
            // ERROR: Not supported in C#: ReDimStatement

            CopyTo(arr, 0);

            return arr;
        }
コード例 #8
0
        //Remove

        /// <summary>
        /// Copies the collection objects to a one-dimensional <see cref="T:System.Array">Array</see> instance beginning at the specified index.
        /// </summary>
        /// <param name="array">The one-dimensional <see cref="T:System.Array">Array</see> that is the destination of the values copied from the collection.</param>
        /// <param name="index">The index of the array at which to begin inserting.</param>
        public void CopyTo(NodeImage[] array, int index)
        {
            List.CopyTo(array, index);
        }
コード例 #9
0
        //Insert

        /// <summary>
        /// Remove the specified object of type <see cref="NodeImage">NodeImage</see> from the collection.
        /// </summary>
        /// <param name="value">An object of type <see cref="NodeImage">NodeImage</see> to remove to the collection.</param>
        public void Remove(NodeImage value)
        {
            List.Remove(value);
        }
コード例 #10
0
 /// <summary>
 /// Add an element of the specified <see cref="NodeImage">NodeImage</see> to the collection at the designated index.
 /// </summary>
 /// <param name="index">An <see cref="system.int32">Integer</see> to indicate the location to add the object to the collection.</param>
 /// <param name="value">An object of type <see cref="NodeImage">NodeImage</see> to add to the collection.</param>
 public void Insert(int index, NodeImage value)
 {
     List.Insert(index, value);
 }
コード例 #11
0
        //IndexOf

        /// <summary>
        /// Gets a value indicating whether the collection contains the specified <see cref="NodeImageCollection">NodeImageCollection</see>.
        /// </summary>
        /// <param name="value">The <see cref="NodeImageCollection">NodeImageCollection</see> to search for in the collection.</param>
        /// <returns><b>true</b> if the collection contains the specified object; otherwise, <b>false</b>.</returns>
        public bool Contains(NodeImage value)
        {
            // If value is not of type NodeImage, this will return false.
            return(GetImage(value.ImageUrl) != null);
            //Return List.Contains(value)
        }
コード例 #12
0
 /// <summary>
 /// Gets the index in the collection of the specified <see cref="NodeImageCollection">NodeImageCollection</see>, if it exists in the collection.
 /// </summary>
 /// <param name="value">The <see cref="NodeImageCollection">NodeImageCollection</see> to locate in the collection.</param>
 /// <returns>The index in the collection of the specified object, if found; otherwise, -1.</returns>
 public int IndexOf(NodeImage value)
 {
     return GetImageIndex(value.ImageUrl);
     //Return List.IndexOf(value)
 }
コード例 #13
0
        //Insert

        /// <summary>
        /// Remove the specified object of type <see cref="NodeImage">NodeImage</see> from the collection.
        /// </summary>
        /// <param name="value">An object of type <see cref="NodeImage">NodeImage</see> to remove to the collection.</param>
        public void Remove(NodeImage value)
        {
            List.Remove(value);
        }
コード例 #14
0
 /// <summary>
 /// Add an element of the specified <see cref="NodeImage">NodeImage</see> to the collection at the designated index.
 /// </summary>
 /// <param name="index">An <see cref="system.int32">Integer</see> to indicate the location to add the object to the collection.</param>
 /// <param name="value">An object of type <see cref="NodeImage">NodeImage</see> to add to the collection.</param>
 public void Insert(int index, NodeImage value)
 {
     List.Insert(index, value);
 }
コード例 #15
0
        //IndexOf

        /// <summary>
        /// Gets a value indicating whether the collection contains the specified <see cref="NodeImageCollection">NodeImageCollection</see>.
        /// </summary>
        /// <param name="value">The <see cref="NodeImageCollection">NodeImageCollection</see> to search for in the collection.</param>
        /// <returns><b>true</b> if the collection contains the specified object; otherwise, <b>false</b>.</returns>
        public bool Contains(NodeImage value)
        {
            // If value is not of type NodeImage, this will return false.
            return (GetImage(value.ImageUrl) != null);
            //Return List.Contains(value)
        }
コード例 #16
0
        //Add

        /// <summary>
        /// Copies the elements of the specified <see cref="NodeImage">NodeImage</see> array to the end of the collection.
        /// </summary>
        /// <param name="value">An array of type <see cref="NodeImage">NodeImage</see> containing the objects to add to the collection.</param>
        public void AddRange(NodeImage[] value)
        {
            for (int i = 0; i <= value.Length - 1; i++)
            {
                Add(value[i]);
            }
        }
コード例 #17
0
 /// <summary>
 /// Gets the index in the collection of the specified <see cref="NodeImageCollection">NodeImageCollection</see>, if it exists in the collection.
 /// </summary>
 /// <param name="value">The <see cref="NodeImageCollection">NodeImageCollection</see> to locate in the collection.</param>
 /// <returns>The index in the collection of the specified object, if found; otherwise, -1.</returns>
 public int IndexOf(NodeImage value)
 {
     return(GetImageIndex(value.ImageUrl));
     //Return List.IndexOf(value)
 }