public void AddSetter()
 {
     if (Setter == null)
     {
         Setter = new InterfacePropertyAccessor(Keywords.Set);
     }
 }
 public void AddGetter()
 {
     if (Getter == null)
     {
         Getter = new InterfacePropertyAccessor(Keywords.Get);
     }
 }
 void mSetter_KeyDown(Block block, System.Windows.Forms.KeyEventArgs e)
 {
     if (e.KeyCode == System.Windows.Forms.Keys.Back || e.KeyCode == System.Windows.Forms.Keys.Delete)
     {
         Setter    = null;
         e.Handled = true;
     }
     if (e.KeyCode == System.Windows.Forms.Keys.G)
     {
         AddGetter();
     }
 }
 void mSetter_Deleted(Block itemChanged)
 {
     using (Redrawer r = new Redrawer(this.Root))
     {
         if (mSetter != null)
         {
             mSetter.Deleted -= mSetter_Deleted;
             mSetter          = null;
         }
         Empty.Hidden = false;
         Empty.SetFocus();
     }
 }
        private void UpdateGetterAndSetter()
        {
            bool getterFound = false;
            bool setterFound = false;

            foreach (Block b in InternalContainer.Children)
            {
                InterfacePropertyAccessor accessor = b as InterfacePropertyAccessor;
                if (accessor != null)
                {
                    if (accessor.Text == Keywords.Get)
                    {
                        getterFound = true;
                        if (mGetter != accessor)
                        {
                            mGetter = accessor;
                        }
                    }
                    else if (accessor.Text == Keywords.Set)
                    {
                        setterFound = true;
                        if (mSetter != accessor)
                        {
                            mSetter = accessor;
                        }
                    }
                }
            }

            if (!getterFound && mGetter != null)
            {
                mGetter = null;
            }
            if (!setterFound && mSetter != null)
            {
                mSetter = null;
            }

            Empty.Hidden = Getter != null && Setter != null;
            InternalContainer.CheckVisibility();
            InternalContainer.MyControl.Redraw();
        }
Пример #6
0
        private void UpdateGetterAndSetter()
        {
            bool getterFound = false;
            bool setterFound = false;

            foreach (Block b in InternalContainer.Children)
            {
                InterfacePropertyAccessor accessor = b as InterfacePropertyAccessor;
                if (accessor != null)
                {
                    if (accessor.Text == Keywords.Get)
                    {
                        getterFound = true;
                        if (mGetter != accessor)
                        {
                            mGetter = accessor;
                        }
                    }
                    else if (accessor.Text == Keywords.Set)
                    {
                        setterFound = true;
                        if (mSetter != accessor)
                        {
                            mSetter = accessor;
                        }
                    }
                }
            }

            if (!getterFound && mGetter != null)
            {
                mGetter = null;
            }
            if (!setterFound && mSetter != null)
            {
                mSetter = null;
            }

            Empty.Hidden = Getter != null && Setter != null;
            InternalContainer.CheckVisibility();
            InternalContainer.MyControl.Redraw();
        }
Пример #7
0
 void MyTextBox_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (e.KeyCode == System.Windows.Forms.Keys.Back)
     {
         if (Getter != null)
         {
             Getter = null;
             e.Handled = true;
         }
         else if (Setter == null)
         {
             this.Delete();
             e.Handled = true;
         }
     }
     if (e.KeyCode == System.Windows.Forms.Keys.Delete)
     {
         if (Setter != null)
         {
             Setter = null;
             e.Handled = true;
         }
         else if (Getter == null)
         {
             this.Delete();
             e.Handled = true;
         }
     }
 }
Пример #8
0
 void mSetter_KeyDown(Block block, System.Windows.Forms.KeyEventArgs e)
 {
     if (e.KeyCode == System.Windows.Forms.Keys.Back || e.KeyCode == System.Windows.Forms.Keys.Delete)
     {
         Setter = null;
         e.Handled = true;
     }
     if (e.KeyCode == System.Windows.Forms.Keys.G)
     {
         AddGetter();
     }
 }
Пример #9
0
 void mSetter_Deleted(Block itemChanged)
 {
     using (Redrawer r = new Redrawer(this.Root))
     {
         if (mSetter != null)
         {
             mSetter.Deleted -= mSetter_Deleted;
             mSetter = null;
         }
         Empty.Hidden = false;
         Empty.SetFocus();
     }
 }
Пример #10
0
 public void AddSetter()
 {
     if (Setter == null)
     {
         Setter = new InterfacePropertyAccessor(Keywords.Set);
     }
 }
Пример #11
0
 public void AddGetter()
 {
     if (Getter == null)
     {
         Getter = new InterfacePropertyAccessor(Keywords.Get);
     }
 }