Example #1
0
		/// <summary>
		/// Copies contained items to the Shape array.
		/// </summary>
		/// <param name="array">Array to copy to.</param>
		internal void CopyTo(Shape[] array)
		{
			List.CopyTo(array,0);
		}
Example #2
0
		/// <summary>
		/// Removes specified object from the collection.
		/// </summary>
		/// <param name="value"></param>
		public void Remove(Shape value) 
		{
			List.Remove(value);
		}
Example #3
0
        //protected override void OnRemoveComplete(int index,object value)
        //{
        //    base.OnRemoveComplete(index,value);
        //    Shape me=value as Shape;
        //}
        //protected override void OnInsertComplete(int index,object value)
        //{
        //    base.OnInsertComplete(index,value);
        //    Shape me=value as Shape;
        //}

		/// <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(Shape[] array, int index) 
		{
			List.CopyTo(array, index);
		}
Example #4
0
		/// <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(Shape value) 
		{
			return List.Contains(value);
		}
Example #5
0
		/// <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(Shape value) 
		{
			return List.IndexOf(value);
		}
Example #6
0
		/// <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, Shape value) 
		{
			List.Insert(index, value);
		}
Example #7
0
        /// <summary>
		/// Adds new object to the collection.
		/// </summary>
		/// <param name="Shape">Object to add.</param>
		/// <returns>Index of newly added object.</returns>
		public int Add(Shape shape)
		{
			return List.Add(shape);
		}
Example #8
0
        public override void PaintDialogLauncher(RibbonBarRendererEventArgs e)
        {
            Rectangle r = e.Bounds;
            Graphics g = e.Graphics;
            bool rightToLeft = (e.RibbonBar.RightToLeft == System.Windows.Forms.RightToLeft.Yes);
            Office2007DialogLauncherStateColorTable c = GetColorTable(e);

            if (!c.TopBackground.IsEmpty && !c.BottomBackground.IsEmpty)
            {
                Presentation.Rectangle pr = new Presentation.Rectangle(
                    new Presentation.ShapeBorder(c.OuterBorder), new Presentation.ShapeFill(c.TopBackground));
                pr.Padding = new Presentation.PaddingInfo(1, 1, 1, 1);
                Presentation.Rectangle prb = new Presentation.Rectangle(new Presentation.ShapeFill(c.BottomBackground));
                prb.Size.Height = r.Height / 2;
                pr.Children.Add(prb);
                prb = new Presentation.Rectangle(new Presentation.ShapeBorder(c.InnerBorder));
                pr.Children.Add(prb);
                Presentation.ShapePaintInfo pi = new Presentation.ShapePaintInfo(g, r);
                pr.Paint(pi);
            }

            Size size = new Size(8, 8);

            // Get final dialog launcher bounds
            if (rightToLeft)
                r = new Rectangle(r.X + (r.Width - size.Width) / 2, r.Y + (r.Height - size.Height) / 2, size.Width, size.Height);
            else
                r = new Rectangle(r.X + (r.Width - size.Width)/2, r.Y + (r.Height - size.Height) / 2, size.Width, size.Height);

            SmoothingMode sm = g.SmoothingMode;
            g.SmoothingMode = SmoothingMode.Default;
            
            // Create the dialog launcher shape
            Presentation.ShapeBorder border = new Presentation.ShapeBorder(c.DialogLauncherShade, 1);
            Presentation.ShapeFill fill = new Presentation.ShapeFill(c.DialogLauncherShade);
            Presentation.Shape shape = new Presentation.Shape();

            // Horizontal line
            Presentation.Line line = new Presentation.Line(new Presentation.Location(),
                new Presentation.Location(6, 0), border);
            shape.Children.Add(line);

            // Vertical line
            line = new Presentation.Line(new Presentation.Location(),
                new Presentation.Location(0, 6), border);
            shape.Children.Add(line);

            Presentation.Rectangle rect = new Presentation.Rectangle();
            rect.Fill = fill;
            rect.Location.X = 5;
            rect.Location.Y = 5;
            rect.Size.Width = 3;
            rect.Size.Height = 3;
            shape.Children.Add(rect);

            // Arrow line vertical
            line = new Presentation.Line(new Presentation.Location(7, 4),
                new Presentation.Location(7, 7), border);
            shape.Children.Add(line);
            // Arrow line horizontal
            line = new Presentation.Line(new Presentation.Location(4, 7),
                new Presentation.Location(7, 7), border);
            shape.Children.Add(line);
            // Arrow line cross
            line = new Presentation.Line(new Presentation.Location(4, 4),
                new Presentation.Location(5, 5), border);
            shape.Children.Add(line);

            r.Offset(1, 1);
            Presentation.ShapePaintInfo p = new Presentation.ShapePaintInfo(g, r);
            shape.Paint(p);

            border.Color1 = c.DialogLauncher;
            fill.Color1 = c.DialogLauncher;
            r.Offset(-1, -1);
            p.Bounds = r;
            shape.Paint(p);

            g.SmoothingMode = sm;
        }