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


C# TreeNodeAdv类代码示例

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


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

示例1: Draw

		public override void Draw(TreeNodeAdv node, DrawContext context)
		{
			if (node.CanExpand)
			{
				Rectangle r = context.Bounds;
				int dy = (int)Math.Round((float)(r.Height - ImageSize) / 2);

                if (_useVisualStyles)
                {
                    VisualStyleRenderer renderer;

                    if (node.IsExpanded)
                        renderer = _openedRenderer;
                    else
                        renderer = _closedRenderer;

                    renderer.DrawBackground(context.Graphics, new Rectangle(r.X, r.Y + dy, ImageSize, ImageSize));
                }
                else
                {
                    Image img;

                    if (node.IsExpanded)
                        img = this.Minus;
                    else
                        img = this.Plus;

                    context.Graphics.DrawImageUnscaled(img, new Point(r.X, r.Y + dy));
                }
			}
		}
开发者ID:andyvand,项目名称:ProcessHacker,代码行数:31,代码来源:NodePlusMinus.cs

示例2: Draw

        public override void Draw(TreeNodeAdv node, DrawContext context)
        {
            if (context.CurrentEditorOwner == this && node == Parent.CurrentNode)
                return;

            var label = GetLabel(node);
            var textBounds = GetBounds(node, context);
            var focusRect = new Rectangle(textBounds.X, context.Bounds.Y,
                textBounds.Width - 1, context.Bounds.Height - 1);

            Brush backgroundBrush;
            Color textColor;
            Font font;
            CreateBrushes(node, context, label, out backgroundBrush, out textColor, out font, ref label);

            //if (backgroundBrush != null)
            //    context.Graphics.FillRectangle(backgroundBrush, focusRect);

            var focusPen = new Pen(SystemColors.Highlight);
            focusPen.Color = context.DrawSelection == DrawSelectionMode.None ? 
                SystemColors.ControlText : SystemColors.InactiveCaption;

            //focusPen.Color = SystemColors.Highlight;
            //context.Graphics.DrawRectangle(focusPen, focusRect);
            
            if (UseCompatibleTextRendering)
                TextRenderer.DrawText(context.Graphics, label, font, textBounds, textColor, _formatFlags);
            else
                context.Graphics.DrawString(label, font, GetBrush(textColor), textBounds, _format);
        }
开发者ID:subTee,项目名称:Deviare2,代码行数:30,代码来源:NodeCategoryTitle.cs

示例3: GetCheckState

		protected virtual CheckState GetCheckState(TreeNodeAdv node)
		{
			object obj=GetValue(node);
			if(obj is CheckState) return (CheckState)obj;
			else if(obj is bool) return (bool)obj?CheckState.Checked:CheckState.Unchecked;
			else return CheckState.Unchecked;
		}
开发者ID:shintadono,项目名称:Free.Controls.TreeView,代码行数:7,代码来源:NodeCheckBox.cs

示例4: GetToolTip

 public virtual string GetToolTip(TreeNodeAdv node)
 {
     if (ToolTipProvider != null)
         return ToolTipProvider.GetToolTip(node, this);
     else
         return string.Empty;
 }
开发者ID:segafan,项目名称:wme1_jankavan_tlc_edition-repo,代码行数:7,代码来源:NodeControl.cs

示例5: btnOK_Click

        private void btnOK_Click(object sender, EventArgs e)
        {
            var node = new TreeNodeAdv(cmbExistsDB.Text.Trim());
            mainForm.treeView.Nodes.Add(node);

            Close();
        }
开发者ID:codeguru1905,项目名称:MagDUR,代码行数:7,代码来源:OpenBase.cs

示例6: Draw

 public override void Draw(TreeNodeAdv node, DrawContext context)
 {
     Rectangle r = context.Bounds;
     int dy = (int)Math.Round((float)(r.Height - ImageSize) / 2);
     CheckState state = GetCheckState(node);
     if (Application.RenderWithVisualStyles)
     {
         VisualStyleRenderer renderer;
         if (state == CheckState.Indeterminate)
             renderer = new VisualStyleRenderer(VisualStyleElement.Button.CheckBox.MixedNormal);
         else if (state == CheckState.Checked)
             renderer = new VisualStyleRenderer(VisualStyleElement.Button.CheckBox.CheckedNormal);
         else
             renderer = new VisualStyleRenderer(VisualStyleElement.Button.CheckBox.UncheckedNormal);
         renderer.DrawBackground(context.Graphics, new Rectangle(r.X, r.Y + dy, ImageSize, ImageSize));
     }
     else
     {
         Image img;
         if (state == CheckState.Indeterminate)
             img = _unknown;
         else if (state == CheckState.Checked)
             img = _check;
         else
             img = _uncheck;
         context.Graphics.DrawImage(img, new Point(r.X, r.Y + dy));
         //ControlPaint.DrawCheckBox(context.Graphics, r, state2);
     }
 }
开发者ID:KillerGoldFisch,项目名称:GCharp,代码行数:29,代码来源:NodeCheckBox.cs

示例7: Draw

 public override void Draw(TreeNodeAdv node, DrawContext context)
 {
     Rectangle bounds = GetBounds(node, context);
     CheckState state = GetCheckState(node);
     if (Application.RenderWithVisualStyles)
     {
         VisualStyleRenderer renderer;
         if (state == CheckState.Indeterminate)
             renderer = new VisualStyleRenderer(VisualStyleElement.Button.CheckBox.MixedNormal);
         else if (state == CheckState.Checked)
             renderer = new VisualStyleRenderer(VisualStyleElement.Button.CheckBox.CheckedNormal);
         else
             renderer = new VisualStyleRenderer(VisualStyleElement.Button.CheckBox.UncheckedNormal);
         renderer.DrawBackground(context.Graphics, new Rectangle(bounds.X, bounds.Y, ImageSize, ImageSize));
     }
     else
     {
         Image img;
         if (state == CheckState.Indeterminate)
             img = _unknown;
         else if (state == CheckState.Checked)
             img = _check;
         else
             img = _uncheck;
         context.Graphics.DrawImage(img, bounds.Location);
     }
 }
开发者ID:zhuangyy,项目名称:Motion,代码行数:27,代码来源:NodeCheckBox.cs

示例8: DrawEventArgs

 public DrawEventArgs(TreeNodeAdv node, EditableControl control, DrawContext context, string text)
     : base(node)
 {
     _control = control;
     _context = context;
     _text = text;
 }
开发者ID:Tokter,项目名称:TokED,代码行数:7,代码来源:DrawEventArgs.cs

示例9: MeasureSize

 public override Size MeasureSize(TreeNodeAdv node, DrawContext context)
 {
     if (GetValue(node).ToString() == "")
         return new Size(0, 0);
     else
         return new Size(_normal.Width,_normal.Height);
 }
开发者ID:zobo,项目名称:xdebugclient,代码行数:7,代码来源:NodeEllipsisButton.cs

示例10: Draw

 public override void Draw(TreeNodeAdv node, DrawContext context)
 {
     if (node.CanExpand)
     {
         Rectangle r = context.Bounds;
         int dy = (int)Math.Round((float)(r.Height - ImageSize) / 2);
         if (Application.RenderWithVisualStyles)
         {
             VisualStyleRenderer renderer;
             if (node.IsExpanded)
                 renderer = new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Opened);
             else
                 renderer = new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Closed);
             renderer.DrawBackground(context.Graphics, new Rectangle(r.X, r.Y + dy, ImageSize, ImageSize));
         }
         else
         {
             Image img;
             if (node.IsExpanded)
                 img = _minus;
             else
                 img = _plus;
             context.Graphics.DrawImageUnscaled(img, new Point(r.X, r.Y + dy));
         }
     }
 }
开发者ID:Veggie13,项目名称:Genesis,代码行数:26,代码来源:NodePlusMinus.cs

示例11: TreeViewRowDrawEventArgs

 public TreeViewRowDrawEventArgs(Graphics graphics, Rectangle clipRectangle, TreeNodeAdv node, DrawContext context, int row, Rectangle rowRect)
     : base(graphics, clipRectangle)
 {
     _node = node;
     _context = context;
     _row = row;
     _rowRect = rowRect;
 }
开发者ID:timmersuk,项目名称:KSP-Mod-Admin-aOS,代码行数:8,代码来源:TreeViewRowDrawEventArgs.cs

示例12: MeasureSize

 public override Size MeasureSize(TreeNodeAdv node)
 {
     Image image = GetIcon(node);
     if (image != null)
         return image.Size;
     else
         return Size.Empty;
 }
开发者ID:Veggie13,项目名称:Genesis,代码行数:8,代码来源:NodeIcon.cs

示例13: MeasureSize

		public override Size MeasureSize(TreeNodeAdv node, DrawContext context, int rightBoundLastControl)
		{
			Image image=GetIcon(node);
			if(image!=null)
				return image.Size;
			else
				return Size.Empty;
		}
开发者ID:shintadono,项目名称:Free.Controls.TreeView,代码行数:8,代码来源:NodeIcon.cs

示例14: GetValue

 public object GetValue(TreeNodeAdv node)
 {
     PropertyInfo pi = GetPropertyInfo(node);
     if (pi != null && pi.CanRead)
         return pi.GetValue(node.Tag, null);
     else
         return null;
 }
开发者ID:Veggie13,项目名称:Genesis,代码行数:8,代码来源:BindableControl.cs

示例15: MeasureSize

		public override Size MeasureSize(TreeNodeAdv node, DrawContext context)
		{
			Image image = GetIcon(node);
			
            if (image != null)
				return image.Size;
			
            return Size.Empty;
		}
开发者ID:john-peterson,项目名称:processhacker,代码行数:9,代码来源:NodeIcon.cs


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