示例#1
0
        public static ElementStyle GetFileMenuContainerStyle(Office2007ColorTable table)
        {
            ElementStyle style = new ElementStyle();
            style.Class = ElementStyleClassKeys.RibbonFileMenuContainerKey;
            Rendering.Office2007MenuColorTable mc = table.Menu;

            style.PaddingBottom = 3;
            style.PaddingLeft = 0;
            style.PaddingRight = 0;
            style.PaddingTop = 22;
            style.Border = eStyleBorderType.Solid;
            style.CornerType = eCornerType.Rounded;
            style.BorderWidth = 1;
            style.BorderColor = Color.Transparent;
            style.CornerDiameter = 3;
            BackgroundColorBlend[] blend = new BackgroundColorBlend[mc.FileBackgroundBlend.Count];
            mc.FileBackgroundBlend.CopyTo(blend);
            style.BackColorBlend.Clear();
            style.BackColorBlend.AddRange(blend);
            style.BackColorGradientAngle = 90;
            return style;
        }
		/// <summary>
		/// Returns whether collection contains specified object.
		/// </summary>
		/// <param name="value">Object to look for.</param>
		/// <returns>true if object is part of the collection, otherwise false.</returns>
		public bool Contains(BackgroundColorBlend value) 
		{
			return List.Contains(value);
		}
		/// <summary>
		/// Removes specified object from the collection.
		/// </summary>
		/// <param name="value"></param>
		public void Remove(BackgroundColorBlend value) 
		{
			List.Remove(value);
		}
		/// <summary>
		/// Inserts new object into the collection.
		/// </summary>
		/// <param name="index">Position of the object.</param>
		/// <param name="value">Object to insert.</param>
		public void Insert(int index, BackgroundColorBlend value) 
		{
			List.Insert(index, value);
		}
		/// <summary>
		/// Returns index of the object inside of the collection.
		/// </summary>
		/// <param name="value">Reference to the object.</param>
		/// <returns>Index of the object.</returns>
		public int IndexOf(BackgroundColorBlend value) 
		{
			return List.IndexOf(value);
		}
 /// <summary>
 /// Adds array of new objects to the collection.
 /// </summary>
 /// <param name="items">Array of object to add.</param>
 public void AddRange(BackgroundColorBlend[] items)
 {
     foreach (BackgroundColorBlend item in items)
         this.Add(item);
 }
        /// <summary>
		/// Adds new object to the collection.
		/// </summary>
        /// <param name="item">Object to add.</param>
		/// <returns>Index of newly added object.</returns>
		public int Add(BackgroundColorBlend item)
		{
			return List.Add(item);
		}
		/// <summary>
		/// Copies contained items to the BackgroundColorBlend array.
		/// </summary>
		/// <param name="array">Array to copy to.</param>
		internal void CopyTo(BackgroundColorBlend[] array)
		{
			List.CopyTo(array,0);
		}
        //protected override void OnRemoveComplete(int index,object value)
        //{
        //    base.OnRemoveComplete(index,value);
        //    BackgroundColorBlend me=value as BackgroundColorBlend;
        //}
        //protected override void OnInsertComplete(int index,object value)
        //{
        //    base.OnInsertComplete(index,value);
        //    BackgroundColorBlend me=value as BackgroundColorBlend;
        //}

		/// <summary>
		/// Copies collection into the specified array.
		/// </summary>
		/// <param name="array">Array to copy collection to.</param>
		/// <param name="index">Starting index.</param>
		public void CopyTo(BackgroundColorBlend[] array, int index) 
		{
			List.CopyTo(array, index);
		}
示例#10
0
        public static ElementStyle GetMenuBottomContainer(Office2007ColorTable table)
        {
            ElementStyle style = new ElementStyle();
            style.Class = ElementStyleClassKeys.RibbonFileMenuBottomContainerKey;
            Rendering.Office2007MenuColorTable mc = table.Menu;

            BackgroundColorBlend[] blend = new BackgroundColorBlend[mc.FileBottomContainerBackgroundBlend.Count];
            mc.FileBottomContainerBackgroundBlend.CopyTo(blend);
            style.BackColorBlend.Clear();
            style.BackColorBlend.AddRange(blend);
            style.BackColorGradientAngle = 90;
            return style;
        }