示例#1
0
        private void Init()
        {
            InitModifiers();
            MyUniversalControl.CanOffsetCurlies = true;

            NameBlock = new MemberNameBlock();

            HMembers.Add(Modifiers);
            HMembers.Add(NameBlock);
            HMembers.Add(Parameters);
        }
示例#2
0
        public InterfaceBlock()
            : base()
        {
            NameBlock = new TypeNameBlock(2 * ShapeStyle.DefaultFontSize);
            MyUniversalControl.CanOffsetCurlies = true;
            MyUniversalControl.OpenCurlyHasNegativeLowerMargin = false;

            InitModifiers();
            HMembers.Add(Modifiers);

            HMembers.Add(new KeywordLabel("interface"));
            HMembers.Add(NameBlock);
            VMembers.Children.Add(new InterfaceMemberDeclarationBlock());
        }
示例#3
0
        public ClassOrStructBlock(string keyword)
            : base()
        {
            NameBlock = new TypeNameBlock(16);

            //HMembers.Add(new PictureBlock(CSharpPictureLibrary.Instance.TypeClass));
            InitModifiers();
            HMembers.Add(Modifiers);
            HMembers.Add(new KeywordLabel(keyword));
            HMembers.Add(NameBlock);
            VMembers.Children.Add(new EmptyClassMember());

            MyUniversalControl.CanOffsetCurlies = true;
        }
示例#4
0
        protected override void OnKeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            Block nextFocusable = null;

            if (IsMoveUpDown(e))
            {
                e.Handled = true;
                return;
            }

            switch (e.KeyCode)
            {
            case System.Windows.Forms.Keys.Right:
                nextFocusable = this.FindFirstFocusableChild();
                if (nextFocusable == null)
                {
                    nextFocusable = this.FindNextFocusableBlockInChain();
                }
                nextFocusable.SetCursorToTheBeginning();
                e.Handled = true;
                return;

            case System.Windows.Forms.Keys.Down:
                if (VMembers.Visible &&
                    this.MyUniversalControl.LinearLayoutStrategy.Orientation == OrientationType.Vertical)
                {
                    nextFocusable = VMembers.FindFirstFocusableBlock();
                    if (nextFocusable != null)
                    {
                        nextFocusable.SetFocus();
                        e.Handled = true;
                        return;
                    }
                }
                break;

            case System.Windows.Forms.Keys.End:
                nextFocusable = HMembers.FindLastFocusableBlock();
                if (nextFocusable != null)
                {
                    nextFocusable.SetCursorToTheEnd();
                    e.Handled = true;
                    return;
                }
                break;

            default:
                break;
            }

            if (nextFocusable != null && nextFocusable.CanGetFocus)
            {
                nextFocusable.SetFocus();
                e.Handled = true;
            }

            if (!e.Handled)
            {
                base.OnKeyDown(sender, e);
            }
        }
示例#5
0
        protected override void OnKeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            Block nextFocusable = null;

            switch (e.KeyCode)
            {
            case System.Windows.Forms.Keys.Left:
                if (!this.MyControl.Collapsed && this.VMembers.Children.Count > 0)
                {
                    e.Handled = true;
                    this.MyNodeControl.ToggleCollapse(true);
                }
                break;

            case System.Windows.Forms.Keys.Right:
                if (this.MyControl.Collapsed)
                {
                    e.Handled = true;
                    this.MyNodeControl.ToggleCollapse(true);
                }
                else
                {
                    nextFocusable = VMembers.FindFirstFocusableBlock();
                }
                break;

            case System.Windows.Forms.Keys.Down:
                if (VMembers.MyControl.Visible && !VMembers.MyControl.Collapsed)
                {
                    nextFocusable = VMembers.FindFirstFocusableBlock();
                }
                break;

            case System.Windows.Forms.Keys.End:
                nextFocusable = HMembers.FindLastFocusableBlock();
                break;

            case System.Windows.Forms.Keys.Add:
                if (this.MyControl.Collapsed)
                {
                    e.Handled = true;
                    this.MyNodeControl.ToggleCollapse(true);
                }
                break;

            case System.Windows.Forms.Keys.Subtract:
                if (!this.MyControl.Collapsed && this.VMembers.Children.Count > 0)
                {
                    e.Handled = true;
                    this.MyNodeControl.ToggleCollapse(true);
                }
                break;

            case System.Windows.Forms.Keys.Space:
                e.Handled = true;
                this.MyNodeControl.ToggleCollapse(true);
                break;

            case System.Windows.Forms.Keys.Multiply:
                e.Handled = true;
                this.MyNodeControl.CollapseAll(false, true);
                break;

            case System.Windows.Forms.Keys.Divide:
                e.Handled = true;
                this.MyNodeControl.CollapseAll(true, true);
                break;

            case System.Windows.Forms.Keys.Delete:
                this.Delete();
                e.Handled = true;
                break;

            default:
                break;
            }

            if (nextFocusable != null && nextFocusable.CanGetFocus)
            {
                nextFocusable.SetFocus();
                e.Handled = true;
            }

            RaiseKeyDown(e);
        }
示例#6
0
 public TreeViewNode(string Caption)
     : this()
 {
     HMembers.Add(new TreeViewLabelBlock(Caption));
 }