当前位置: 首页>>代码示例>>C#>>正文


C# IDrawableContainer类代码示例

本文整理汇总了C#中IDrawableContainer的典型用法代码示例。如果您正苦于以下问题:C# IDrawableContainer类的具体用法?C# IDrawableContainer怎么用?C# IDrawableContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IDrawableContainer类属于命名空间,在下文中一共展示了IDrawableContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BindElement

		public void BindElement(IDrawableContainer dc) {
			DrawableContainer container = dc as DrawableContainer;
			if (container != null && !boundContainers.Contains(container)) {
				boundContainers.Add(container);
				container.ChildrenChanged += delegate {
					UpdateFromBoundElements();
				};
				UpdateFromBoundElements();
			}
		}
开发者ID:logtcn,项目名称:greenshot,代码行数:10,代码来源:FieldAggregator.cs

示例2: AddElement

 /// <summary>
 /// Wrapper for makeUndoable flag which was introduced later, will call AddElement with makeundoable set to true
 /// </summary>
 /// <param name="element">the new element</param>
 public void AddElement(IDrawableContainer element)
 {
     AddElement(element, true);
 }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:8,代码来源:Surface.cs

示例3: DeselectElement

 public void DeselectElement(IDrawableContainer container)
 {
     DrawableContainer element = container as DrawableContainer;
     element.HideGrippers();
     element.Selected = false;
     selectedElements.Remove(element);
     FieldAggregator.UnbindElement(element);
     if (MovingElementChanged != null) {
         MovingElementChanged(this, selectedElements);
     }
 }
开发者ID:modulexcite,项目名称:ZScreen_Google_Code,代码行数:11,代码来源:Surface.cs

示例4: AddElementMemento

 public AddElementMemento(Surface surface, IDrawableContainer drawableContainer)
 {
     _surface = surface;
     _drawableContainer = drawableContainer;
 }
开发者ID:RailTracker,项目名称:ShareX,代码行数:5,代码来源:AddElementMemento.cs

示例5: DrawableContainerBoundsChangeMemento

		public DrawableContainerBoundsChangeMemento(IDrawableContainer drawableContainer) {
			listOfdrawableContainer = new List<IDrawableContainer>();
			listOfdrawableContainer.Add(drawableContainer);
			StoreBounds();
		}
开发者ID:logtcn,项目名称:greenshot,代码行数:5,代码来源:DrawableContainerBoundsChangeMemento.cs

示例6: UnbindElement

		public void UnbindElement(IDrawableContainer dc) {
			if (boundContainers.Contains(dc)) {
				boundContainers.Remove(dc);
				UpdateFromBoundElements();
			}
		}
开发者ID:logtcn,项目名称:greenshot,代码行数:6,代码来源:FieldAggregator.cs

示例7: SelectElement

 /// <summary>
 /// Select the supplied element
 /// </summary>
 /// <param name="container"></param>
 public void SelectElement(IDrawableContainer container)
 {
     if (!selectedElements.Contains(container))
     {
         selectedElements.Add(container);
         container.ShowGrippers();
         container.Selected = true;
         FieldAggregator.BindElement(container);
         if (_movingElementChanged != null)
         {
             SurfaceElementEventArgs eventArgs = new SurfaceElementEventArgs();
             eventArgs.Elements = selectedElements;
             _movingElementChanged(this, eventArgs);
         }
         container.Invalidate();
     }
 }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:21,代码来源:Surface.cs

示例8: CountStepLabels

 /// <summary>
 /// Count all the VISIBLE steplabels in the surface, up to the supplied one
 /// </summary>
 /// <param name="stopAtContainer">can be null, if not the counting stops here</param>
 /// <returns>number of steplabels before the supplied container</returns>
 public int CountStepLabels(IDrawableContainer stopAtContainer)
 {
     int number = 1;
     foreach (var possibleThis in _stepLabels)
     {
         if (possibleThis == stopAtContainer)
         {
             break;
         }
         if (IsOnSurface(possibleThis))
         {
             number++;
         }
     }
     return number;
 }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:21,代码来源:Surface.cs

示例9: RemoveElement

 /// <summary>
 /// Remove an element of the elements list
 /// </summary>
 /// <param name="elementToRemove">Element to remove</param>
 /// <param name="makeUndoable">flag specifying if the remove needs to be undoable</param>
 public void RemoveElement(IDrawableContainer elementToRemove, bool makeUndoable)
 {
     DeselectElement(elementToRemove);
     _elements.Remove(elementToRemove);
     DrawableContainer element = elementToRemove as DrawableContainer;
     if (element != null)
     {
         element.FieldChanged -= element_FieldChanged;
     }
     elementToRemove.PropertyChanged -= ElementPropertyChanged;
     // Do not dispose, the memento should!! element.Dispose();
     Invalidate();
     if (makeUndoable)
     {
         MakeUndoable(new DeleteElementMemento(this, elementToRemove), false);
     }
     _modified = true;
 }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:23,代码来源:Surface.cs

示例10: IsOnSurface

 public bool IsOnSurface(IDrawableContainer container)
 {
     return _elements.Contains(container);
 }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:4,代码来源:Surface.cs

示例11: SelectElement

 public void SelectElement(IDrawableContainer container)
 {
     DrawableContainer element = container as DrawableContainer;
     if(!selectedElements.Contains(element)) {
         selectedElements.Add(element);
         element.ShowGrippers();
         element.Selected = true;
         FieldAggregator.BindElement(element);
         if (MovingElementChanged != null) {
             MovingElementChanged(this, selectedElements);
         }
         element.Invalidate();
     }
 }
开发者ID:modulexcite,项目名称:ZScreen_Google_Code,代码行数:14,代码来源:Surface.cs

示例12: Dispose

        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                Count--;
                LOG.Debug("Disposing surface!");
                if (_buffer != null)
                {
                    _buffer.Dispose();
                    _buffer = null;
                }
                if (_transparencyBackgroundBrush != null)
                {
                    _transparencyBackgroundBrush.Dispose();
                    _transparencyBackgroundBrush = null;
                }

                // Cleanup undo/redo stacks
                while (_undoStack != null && _undoStack.Count > 0)
                {
                    _undoStack.Pop().Dispose();
                }
                while (_redoStack != null && _redoStack.Count > 0)
                {
                    _redoStack.Pop().Dispose();
                }
                foreach (IDrawableContainer container in _elements)
                {
                    container.Dispose();
                }
                if (_undrawnElement != null)
                {
                    _undrawnElement.Dispose();
                    _undrawnElement = null;
                }
                if (_cropContainer != null)
                {
                    _cropContainer.Dispose();
                    _cropContainer = null;
                }
            }
            base.Dispose(disposing);
        }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:43,代码来源:Surface.cs

示例13: ConfirmSelectedConfirmableElements

 /// <summary>
 /// This method is called to confirm/cancel "confirmable" elements, like the crop-container.
 /// Called when pressing enter or using the "check" in the editor.
 /// </summary>
 /// <param name="confirm"></param>
 public void ConfirmSelectedConfirmableElements(bool confirm)
 {
     // create new collection so that we can iterate safely (selectedElements might change due with confirm/cancel)
     List<IDrawableContainer> selectedDCs = new List<IDrawableContainer>(selectedElements);
     foreach (IDrawableContainer dc in selectedDCs)
     {
         if (dc.Equals(_cropContainer))
         {
             DrawingMode = DrawingModes.None;
             // No undo memento for the cropcontainer itself, only for the effect
             RemoveElement(_cropContainer, false);
             if (confirm)
             {
                 ApplyCrop(_cropContainer.Bounds);
             }
             _cropContainer.Dispose();
             _cropContainer = null;
         }
     }
 }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:25,代码来源:Surface.cs

示例14: DeselectElement

 /// <summary>
 /// Deselect the specified element
 /// </summary>
 /// <param name="container"></param>
 public void DeselectElement(IDrawableContainer container)
 {
     container.HideGrippers();
     container.Selected = false;
     selectedElements.Remove(container);
     FieldAggregator.UnbindElement(container);
     if (_movingElementChanged != null)
     {
         SurfaceElementEventArgs eventArgs = new SurfaceElementEventArgs();
         eventArgs.Elements = selectedElements;
         _movingElementChanged(this, eventArgs);
     }
 }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:17,代码来源:Surface.cs

示例15: BindAndUpdateElement

		public void BindAndUpdateElement(IDrawableContainer dc) {
			UpdateElement(dc);
			BindElement(dc);
		}
开发者ID:logtcn,项目名称:greenshot,代码行数:4,代码来源:FieldAggregator.cs


注:本文中的IDrawableContainer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。