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


C# VisualCollection.Add方法代码示例

本文整理汇总了C#中VisualCollection.Add方法的典型用法代码示例。如果您正苦于以下问题:C# VisualCollection.Add方法的具体用法?C# VisualCollection.Add怎么用?C# VisualCollection.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VisualCollection的用法示例。


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

示例1: AutoCompleteTextBox

        public AutoCompleteTextBox()
        {
            controls = new VisualCollection(this);
            InitializeComponent();

            searchThreshold = 2;        // default threshold to 2 char

            // set up the key press timer
            keypressTimer = new System.Timers.Timer();
            keypressTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimedEvent);

            // set up the text box and the combo box
            comboBox = new ComboBox();
            comboBox.IsSynchronizedWithCurrentItem = true;
            comboBox.IsTabStop = false;
            comboBox.SelectionChanged += new SelectionChangedEventHandler(comboBox_SelectionChanged);

            textBox = new TextBox();
            textBox.TextChanged += new TextChangedEventHandler(textBox_TextChanged);
            textBox.VerticalContentAlignment = VerticalAlignment.Center;

            controls.Add(comboBox);
            controls.Add(textBox);

        }
开发者ID:TrinityCore-Manager,项目名称:TrinityCore-Manager-v3,代码行数:25,代码来源:AutoCompleteTextBox.xaml.cs

示例2: AutoCompleteTextBox

        public AutoCompleteTextBox()
        {
            _controls = new VisualCollection(this);
            InitializeComponent();

            _autoCompletionList = new ObservableCollection<AutoCompleteEntry>();
            _searchThreshold = 2;        // default threshold to 2 char

            // set up the key press timer
            _keypressTimer = new System.Timers.Timer();
            _keypressTimer.Elapsed += OnTimedEvent;

            // set up the text box and the combo box
            ComboBox = new ComboBox
            {
                IsSynchronizedWithCurrentItem = true,
                IsTabStop = false
            };

            ComboBox.SelectionChanged += comboBox_SelectionChanged;

            _textBox = new TextBox();
            _textBox.TextChanged += textBox_TextChanged;
            _textBox.VerticalContentAlignment = VerticalAlignment.Center;

            _controls.Add(ComboBox);
            _controls.Add(_textBox);
        }
开发者ID:atom0s,项目名称:Campah,代码行数:28,代码来源:AutoCompleteTextBox.xaml.cs

示例3: SOMVisual

        public SOMVisual(SOMVisualType type, int size, int width, int height, PictureSOM.SOM s)
        {
            _visualType = type;
            _boardSize = PictureSOM.SOMConstants.NUM_NODES_ACROSS; // assuming that across and down are the same
            _boardWidthFactor = (width - (2 * _border)) / size;
            _boardHeightFactor = (height - (2 * _border)) / size;

            _som = s;

            _children = new VisualCollection(this);
            DrawBoard();
            _children.Add(_boardDrawingVisual); // Render the grid

            if (_visualType == SOMVisualType.COMPETITION_LAYER_MAP)
            {
                CreateDrawingVisual_Text(s);
            }
            else if(_visualType == SOMVisualType.COMPETITION_LAYER_MAP_FIXED)
            {
                CreateDrawingVisual_Text_Fixed(s);
            }
            else if (_visualType == SOMVisualType.ERROR_MAP)
            {
                CreateDrawingVisual_ErrorMap(s);
            }
            _children.Add(_drawingVisual);

            // Add the event handler for MouseLeftButtonUp.
            this.MouseLeftButtonUp += new MouseButtonEventHandler(SOMVisual_MouseLeftButtonUp);
        }
开发者ID:pyephyomaung,项目名称:som-ar,代码行数:30,代码来源:SOMVisual.cs

示例4: MyCanvasAdorner

 public MyCanvasAdorner(UIElement adorned)
     : base(adorned)
 {
     visCollec = new VisualCollection(this);
     visCollec.Add(tl = GetResizeThumb(Cursors.SizeNWSE, HorizontalAlignment.Left, VerticalAlignment.Top));
     visCollec.Add(tr = GetResizeThumb(Cursors.SizeNESW, HorizontalAlignment.Right, VerticalAlignment.Top));
     visCollec.Add(bl = GetResizeThumb(Cursors.SizeNESW, HorizontalAlignment.Left, VerticalAlignment.Bottom));
     visCollec.Add(br = GetResizeThumb(Cursors.SizeNWSE, HorizontalAlignment.Right, VerticalAlignment.Bottom));
     visCollec.Add(mov = GetMoveThumb());
 }
开发者ID:ZoeCheck,项目名称:WpfDemoCodes,代码行数:10,代码来源:MyAdorner.cs

示例5: ModelOperationAdorner

 public ModelOperationAdorner(ModelItem adorned)
     : base(adorned)
 {
     collection = new VisualCollection(this);
     collection.Add(tl = GetResizeThumb("LT"));
     collection.Add(tr = GetResizeThumb("RT"));
     collection.Add(bl = GetResizeThumb("LB"));
     collection.Add(br = GetResizeThumb("RB"));
     collection.Add(handler = GetMoveThumb());
 }
开发者ID:kevinxw,项目名称:CIS681-Pr4,代码行数:10,代码来源:ModelOperationAdorner.cs

示例6: CustomVisualFrameworkElement

        public CustomVisualFrameworkElement()
        {
            // Fill the VisualCollection with a few DrawingVisual objects.
            theVisuals = new VisualCollection(this);
            theVisuals.Add(AddRect());
            theVisuals.Add(AddCircle());

            // Handle the MouseDown event.
            this.MouseDown += MyVisualHost_MouseDown;
        }
开发者ID:usedflax,项目名称:flaxbox,代码行数:10,代码来源:CustomVisualFrameworkElement.cs

示例7: MyVisualHost

        public MyVisualHost()
        {
            _children = new VisualCollection(this);
            _children.Add(CreateDrawingVisualRectangle());
            _children.Add(CreateDrawingVisualText());
            _children.Add(CreateDrawingVisualEllipses());

            // Add the event handler for MouseLeftButtonUp.
            this.MouseLeftButtonUp += new MouseButtonEventHandler(MyVisualHost_MouseLeftButtonUp);
        }
开发者ID:samgonzalezr,项目名称:WPFSamples,代码行数:10,代码来源:MainWindow.xaml.cs

示例8: LayoutVisualHost

 public LayoutVisualHost(double width, double height, int curBatch, bool anotherRun)
 {
     this.width = width;
     this.height = height;
     backOffset = (height - 20) / 8.0;
     frontOffset = (height - 20) / 4.0;
     spotHeight = (height - backOffset - frontOffset) / 9.0;
     spotWidth = spotHeight / 3.0;
     _children = new VisualCollection(this);
     _children.Add(CreateDarkSpots());
     _children.Add(CreateRacks(curBatch,anotherRun));
 }
开发者ID:kingofcrabs,项目名称:BoundaryID,代码行数:12,代码来源:LayoutCanvas.cs

示例9: VisualAdorner

		public VisualAdorner(FrameworkElement adornerElement, UIElement adornedElement)
			: base(adornedElement) {
			children = new VisualCollection(this);
			child = adornerElement;
			children.Add(child);
			AddLogicalChild(child);
		}
开发者ID:rjmurillo,项目名称:Autofac-Visualizer,代码行数:7,代码来源:VisualAdorner.cs

示例10: PasswordBoxHintAdorner

        public PasswordBoxHintAdorner(UIElement adornedElement, string hintText, Style hintStyle, VisibilityDelegate visibilityCallback)
          : base(adornedElement)
        {
            _visibilityCallback = visibilityCallback;

            _label = new Label()
            {
                Content = hintText,
                Style = hintStyle,
            };

            IsHitTestVisible = true;
            Visibility = Visibility.Visible;

            adornedElement.GotFocus += Invalidate;
            adornedElement.LostFocus += Invalidate;
            adornedElement.IsVisibleChanged += Invalidate;

            _visualCollection = new VisualCollection(this);
            _contentPresenter = new ContentPresenter();
            _visualCollection.Add(_contentPresenter);
            _contentPresenter.Content = _label;

            AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(adornedElement);
            adornerLayer?.Add(this);

            IsHitTestVisible = false;
        }
开发者ID:Microsoft,项目名称:Git-Credential-Manager-for-Windows,代码行数:28,代码来源:PasswordBoxHintAdorner.cs

示例11: ElementAdorner

        public ElementAdorner(UIElement adornedElement, IControlBox controlBox)
            : base(adornedElement)
        {
            visualChildren = new VisualCollection(this);

            FrameworkElement box = controlBox as FrameworkElement;
            this.controlBox = box;
            panel.Children.Add(box);
            panel.Orientation = Orientation.Vertical;
            visualChildren.Add(panel);

            // Call a helper method to initialize the Thumbs
            // with a customized cursors.
            BuildAdornerCorner(ref resizeThumb, Cursors.SizeNWSE);

            // Add handlers for resizing.

            resizeThumb.DragDelta += new DragDeltaEventHandler(HandleBottomRight);
            this.ProcessControlBox(controlBox);
            this.MouseEnter += new MouseEventHandler(adornedElement_MouseEnter);
            this.MouseLeave += new MouseEventHandler(adornedElement_MouseLeave);
            this.AdornedElement.MouseEnter += new MouseEventHandler(adornedElement_MouseEnter);
            this.AdornedElement.MouseLeave += new MouseEventHandler(adornedElement_MouseLeave);
            this.Opacity = 0;
        }
开发者ID:GAMP,项目名称:DataInterfaces,代码行数:25,代码来源:BaseAdroner.cs

示例12: AdornerContentPresenter

 public AdornerContentPresenter (UIElement adornedElement)
     : base(adornedElement)
 {
     _Visuals = new VisualCollection(this);
     _ContentPresenter = new ContentPresenter();
     _Visuals.Add(_ContentPresenter);
 }
开发者ID:BdGL3,项目名称:CXPortal,代码行数:7,代码来源:AdornerContentPresenter.cs

示例13: ResizeAdorner

 public ResizeAdorner(UIElement adornedElement)
     : base(adornedElement)
 {
     _visualChildren = new VisualCollection(this);
     _control = new ResizeControl {DataContext = adornedElement};
     _visualChildren.Add(_control);
 }
开发者ID:kib357,项目名称:IDS,代码行数:7,代码来源:ResizeAdorner.cs

示例14: WaveFormVisual

 public WaveFormVisual()
 {
     maxPoints = new List<Point>();
     minPoints = new List<Point>();
     _children = new VisualCollection(this);
     _children.Add(CreateWaveFormVisual());            
 }
开发者ID:ActivePHOENiX,项目名称:NAudio,代码行数:7,代码来源:WaveformVisual.cs

示例15: ResizeAdorner

        public ResizeAdorner(PanelDesigner panelDesigner, UIElement adornedElement)
            : base(adornedElement)
        {
            m_panelDesigner = panelDesigner;
            m_panelDesigner.SelectedElementChanged += m_panelDesigner_SelectedElementChanged;
            m_visualChildren = new VisualCollection(this);

            m_rectangle = new Rectangle();
            m_rectangle.Stroke = m_panelDesigner.SelectedElement == AdornedElement ? Brushes.CornflowerBlue : Brushes.LightBlue;
            m_rectangle.StrokeThickness = 1;
            m_visualChildren.Add(m_rectangle);

            BuildResizeAdorner(ref m_bottom, Cursors.SizeNS);
            BuildResizeAdorner(ref m_bottomLeft, Cursors.SizeNESW);
            BuildResizeAdorner(ref m_bottomRight, Cursors.SizeNWSE);
            BuildResizeAdorner(ref m_left, Cursors.SizeWE);
            BuildResizeAdorner(ref m_right, Cursors.SizeWE);
            BuildResizeAdorner(ref m_top, Cursors.SizeNS);
            BuildResizeAdorner(ref m_topLeft, Cursors.SizeNWSE);
            BuildResizeAdorner(ref m_topRight, Cursors.SizeNESW);

            m_bottom.DragDelta += new DragDeltaEventHandler(HandleBottom);
            m_bottomLeft.DragDelta += new DragDeltaEventHandler(HandleBottomLeft);
            m_bottomRight.DragDelta += new DragDeltaEventHandler(HandleBottomRight);
            m_left.DragDelta += new DragDeltaEventHandler(HandleLeft);
            m_right.DragDelta += new DragDeltaEventHandler(HandleRight);
            m_top.DragDelta += new DragDeltaEventHandler(HandleTop);
            m_topLeft.DragDelta += new DragDeltaEventHandler(HandleTopLeft);
            m_topRight.DragDelta += new DragDeltaEventHandler(HandleTopRight);
        }
开发者ID:nordleif,项目名称:PanelDesigner,代码行数:30,代码来源:ResizeAdorner.cs


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