Пример #1
0
 protected override void OnKeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (e.KeyCode == System.Windows.Forms.Keys.Up)
     {
         NodeBlock parent = ParentParent as NodeBlock;
         if (Prev == null && parent != null && parent.Parent is XMLRootBlock)
         {
             parent.HMembers.SetDefaultFocus();
             e.Handled = true;
         }
     }
     if (e.KeyCode == System.Windows.Forms.Keys.Return && !e.Control)
     {
         this.AppendBlocks(new EmptyNodeBlock());
         e.Handled = true;
     }
     else if (e.KeyCode == System.Windows.Forms.Keys.Insert ||
              e.KeyCode == System.Windows.Forms.Keys.Return)
     {
         this.PrependBlocks(new EmptyNodeBlock());
         e.Handled = true;
     }
     if (!e.Handled)
     {
         base.OnKeyDown(sender, e);
     }
 }
Пример #2
0
        public bool Indent()
        {
            NodeBlock previous = Prev as NodeBlock;

            if (string.IsNullOrEmpty(this.Text) && previous != null)
            {
                this.Move(previous.VMembers);
                return(true);
            }
            return(false);
        }
Пример #3
0
 public override void Click(CompletionFunctionality hostItemList)
 {
     NodeBlock node = new NodeBlock();
     node.NameBlock.Text = this.Text;
     using (hostItemList.HostBlock.Transaction())
     {
         hostItemList.HostBlock.Replace(node);
         if (Reason.Type == ItemClickSource.KeyPress && Reason.KeyChar == ' ')
         {
             node.Attributes.SetFocus(SetFocusOptions.ToBeginning);
         }
     }
 }
Пример #4
0
        public override void Click(CompletionFunctionality hostItemList)
        {
            NodeBlock node = new NodeBlock();

            node.NameBlock.Text = this.Text;
            using (hostItemList.HostBlock.Transaction())
            {
                hostItemList.HostBlock.Replace(node);
                if (Reason.Type == ItemClickSource.KeyPress && Reason.KeyChar == ' ')
                {
                    node.Attributes.SetFocus(SetFocusOptions.ToBeginning);
                }
            }
        }
Пример #5
0
        protected override void OnKeyDownUp(System.Windows.Forms.KeyEventArgs e)
        {
            NodeBlock parent = ParentParent as NodeBlock;

            if (Prev == null && parent != null && parent.Parent is XMLRootBlock)
            {
                parent.HMembers.SetDefaultFocus();
                e.Handled = true;
            }
            if (!e.Handled)
            {
                base.OnKeyDownUp(e);
            }
        }
Пример #6
0
        protected override void OnKeyDownTab(System.Windows.Forms.KeyEventArgs e)
        {
            if (e.Shift)
            {
                UnIndent();
                e.Handled = true;
                return;
            }
            if (Indent())
            {
                e.Handled = true;
                return;
            }
            NodeBlock n = new NodeBlock();

            n.NameBlock.Text = this.Text;
            this.Replace(n);
            e.Handled = true;
        }
Пример #7
0
 protected override void OnKeyDownTab(System.Windows.Forms.KeyEventArgs e)
 {
     if (e.Shift)
     {
         UnIndent();
         e.Handled = true;
         return;
     }
     if (Indent())
     {
         e.Handled = true;
         return;
     }
     NodeBlock n = new NodeBlock();
     n.NameBlock.Text = this.Text;
     this.Replace(n);
     e.Handled = true;
 }