Пример #1
0
 protected void OnDelete(BaseComponent obj)
 {
     if (this.Delete != null)
     {
         this.Delete(obj);
     }
 }
Пример #2
0
 protected void OnAdd(BaseComponent obj)
 {
     if (this.Add != null)
     {
         this.Add(obj);
     }
 }
Пример #3
0
 protected void OnSelect(BaseComponent obj)
 {
     if (this.Select != null)
     {
         this.Select(obj);
     }
 }
Пример #4
0
 public void ShowTextEditor(BaseComponent component)
 {
     if (component != null)
     {
         this.component = component;
         this.txtEditor.Visible = true;
         this.txtEditor.Left = (int)((component.CenterPoint.X - this.txtEditor.Width / 2) * ZoomFactor);
         this.txtEditor.Top = (int)((component.CenterPoint.Y - this.txtEditor.Height) * ZoomFactor);
         this.txtEditor.Text = this.component.Text;
         this.txtEditor.Focus();
         this.txtEditor.SelectAll();
     }
 }
Пример #5
0
 internal void RemoveComponent(BaseComponent component)
 {
     this.Model.Items.Remove(component);            
     CommitChange();
 }       
Пример #6
0
 internal void Add(BaseComponent component)
 {
     component.Accept(new ObjectModifyVisitor(this.Model));
     component.Accept(new ViewDirectorVisitor(ViewFactory, this.view.Font));            
     component.Init();
     this.Model.Items.Add(component);
     this.Model.Items = this.Model.Items.OrderBy(x => x.SortOrder).ToList();
     this.view.Invalidate();
     component.Changed += new Action<BaseComponent>(Component_Change);            
     this.SelectedComponent = component;            
     CommitChange();
 }
Пример #7
0
 internal void Component_Change(BaseComponent obj)
 {
     if (this.Changed != null)
     {
         this.Changed(obj);
     }
     CommitChange();
     this.view.Invalidate();
 }
Пример #8
0
 void inputTool_Add(BaseComponent cmp)
 {
     Add(cmp);
     SelectedComponent = cmp;
 }
Пример #9
0
 void inputTool_Delete(BaseComponent obj)
 {
     RemoveComponent(SelectedComponent);
     SelectedComponent = null;   
 }
Пример #10
0
 void inputTool_Select(BaseComponent obj)
 {
     this.SelectedComponent = obj;
 }
Пример #11
0
 void controller_OnSelected(BaseComponent obj)
 {
     propertyGrid1.SelectedObject = obj;
 }
Пример #12
0
 void controller_OnChange(BaseComponent obj)
 {
     if (obj != null && obj.SelectedPoint != null)
     {
         txtStatusText.Text = string.Format("{0} - {1}", obj.SelectedPoint.X, obj.SelectedPoint.Y);
     }
     propertyGrid1.SelectedObject = obj;
 }