Ejemplo n.º 1
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// <param name="writer"></param>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [jhenning]	9/21/2005	Created
        /// </history>
        /// -----------------------------------------------------------------------------
        protected void RenderNodeIcon(HtmlTextWriter writer)
        {
            Label oSpan = new Label();

            if (!String.IsNullOrEmpty(m_objNode.CSSIcon))
            {
                oSpan.CssClass = m_objNode.CSSIcon;
            }
            else if (!String.IsNullOrEmpty(m_objNode.DNNMenu.DefaultIconCssClass))
            {
                oSpan.CssClass = m_objNode.DNNMenu.DefaultIconCssClass;
            }
            oSpan.RenderBeginTag(writer);

            if (m_objNode.ImageIndex > -1)
            {
                NodeImage m_objNodeImage = m_objNode.DNNMenu.ImageList[m_objNode.ImageIndex];
                if ((m_objNodeImage != null))
                {
                    Image objImage = new Image();
                    objImage.ImageUrl = m_objNodeImage.ImageUrl;
                    objImage.RenderControl(writer);
                    writer.Write("&nbsp;");
                }
            }
            oSpan.RenderEndTag(writer);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="writer"></param>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [jbrinkman]	5/6/2004	Created
        /// </history>
        protected void RenderNodeIcon(HtmlTextWriter writer)
        {
            Label oSpan = new Label();

            if (_Node.CSSIcon.Length > 0)
            {
                oSpan.CssClass = _Node.CSSIcon;
            }
            else if (_Node.DNNTree.DefaultIconCssClass.Length > 0)
            {
                oSpan.CssClass = _Node.DNNTree.DefaultIconCssClass;
            }
            oSpan.RenderBeginTag(writer);

            if (_Node.ImageIndex > -1)
            {
                NodeImage _NodeImage = _Node.DNNTree.ImageList[_Node.ImageIndex];
                if (!(_NodeImage == null))
                {
                    Image _image = new Image();
                    _image.ImageUrl = _NodeImage.ImageUrl;
                    _image.RenderControl(writer);
                    writer.Write("&nbsp;", null);
                }
            }
            oSpan.RenderEndTag(writer);
        }
Ejemplo n.º 3
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);
        }
		/// <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;
		}
Ejemplo n.º 5
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);
        } //Add
Ejemplo n.º 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);

                    _nodeImage.TrackViewState();
                    _nodeImage.LoadViewState(nodeState[index]);
                }
            }
        }
Ejemplo n.º 7
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);
        } //Remove
Ejemplo n.º 8
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);
 } //Insert
Ejemplo n.º 9
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(!Convert.ToBoolean(GetImage(value.ImageUrl) == null));
            //Return List.Contains(value)
        } //Contains
Ejemplo n.º 10
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)
 } //IndexOf
Ejemplo n.º 11
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)
		}
Ejemplo n.º 12
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);
		}
Ejemplo n.º 13
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)
		}
Ejemplo n.º 14
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]);
			}
		}
Ejemplo n.º 15
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);
		}
Ejemplo n.º 16
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]);
				}
			}
		}
Ejemplo n.º 17
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;
		}
Ejemplo n.º 18
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);
		}
Ejemplo n.º 19
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)
        }
Ejemplo n.º 20
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 !Convert.ToBoolean( GetImage( value.ImageUrl ) == null );
            //Return List.Contains(value)
        } //Contains
Ejemplo n.º 21
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);
		}