Пример #1
0
        public void SetCanvas(IObjectCanvas Canvas)
        {
            this.Canvas = Canvas;
            Designer    = Canvas.DesignerControl;
            SetObjectManager();
            if (Designer != null)
            {
                if (Designer.Tag == null)
                {
                    Designer.Tag         = 1;
                    Designer.MouseDown  += new System.Windows.Forms.MouseEventHandler(DesignerControl_MouseDown);
                    Designer.MouseMove  += new System.Windows.Forms.MouseEventHandler(DesignerControl_MouseMove);
                    Designer.MouseUp    += new System.Windows.Forms.MouseEventHandler(DesignerControl_MouseUp);
                    Designer.MouseWheel += new MouseEventHandler(Designer_MouseWheel);

                    if (Designer is ChartWinControl)
                    {
                        (Designer as ChartWinControl).ExtraPaint += new NativePaintHandler(ObjectManager_ExtraPaint);
                    }
                    else
                    {
                        Designer.Paint += new System.Windows.Forms.PaintEventHandler(DesignerControl_Paint);
                    }

                    Designer.SizeChanged += new EventHandler(DesignerControl_SizeChanged);
                    Designer.KeyDown     += new KeyEventHandler(Designer_KeyDown);
                }
            }
        }
Пример #2
0
 public static ObjectManager ReadXml(string FileName, IObjectCanvas Canvas)
 {
     using (TextReader reader = new StreamReader(FileName))
     {
         return(ReadXml(reader, Canvas));
     }
 }
Пример #3
0
 public ObjectManager(IObjectCanvas Canvas, PropertyGrid propertyGrid, ObjectToolPanel ToolPanel)
 {
     LoadSettings(ToolPanel);
     SetHandler(Canvas, propertyGrid, ToolPanel);
     if (ToolPanel != null)
     {
         ToolPanel.LoadObjectTool();
     }
 }
Пример #4
0
        public static ObjectManager ReadXml(TextReader reader, IObjectCanvas Canvas)
        {
            XmlSerializer xs = new XmlSerializer(typeof(ObjectManager));
            ObjectManager om = (ObjectManager)xs.Deserialize(reader);

            if (Canvas != null)
            {
                om.SetCanvas(Canvas);
                om.Designer.Invalidate();
            }
            return(om);
        }
Пример #5
0
 public ObjectManager(IObjectCanvas Canvas, PropertyGrid propertyGrid, ObjectToolPanel ToolPanel)
 {
     this.StartPoint = ObjectPoint.Empty;
     this.EndPoint   = ObjectPoint.Empty;
     this.objects    = new Easychart.Finance.Objects.ObjectCollection();
     LoadSettings(ToolPanel);
     this.SetHandler(Canvas, propertyGrid, ToolPanel);
     if (ToolPanel != null)
     {
         ToolPanel.LoadObjectTool();
     }
 }
Пример #6
0
 private void SetHandler(IObjectCanvas Canvas, PropertyGrid propertyGrid, ObjectToolPanel ToolPanel)
 {
     if (Canvas != null)
     {
         SetCanvas(Canvas);
     }
     if (propertyGrid != null)
     {
         SetPropertyGrid(propertyGrid);
     }
     if (ToolPanel != null)
     {
         SetToolPanel(ToolPanel);
         AfterCreateStart    += new ObjectEventHandler(ObjectManager_AfterCreateStart);
         AfterSelect         += new ObjectEventHandler(ObjectManager_AfterSelect);
         AfterCreateFinished += new ObjectEventHandler(ToolPanel.Manager_AfterCreateFinished);
         AfterCreateFinished += new ObjectEventHandler(ObjectManager_AfterCreateFinished);
     }
 }
Пример #7
0
 private void SetHandler(IObjectCanvas Canvas, PropertyGrid propertyGrid, ObjectToolPanel ToolPanel)
 {
     if (Canvas != null)
     {
         this.SetCanvas(Canvas);
     }
     if (propertyGrid != null)
     {
         this.SetPropertyGrid(propertyGrid);
     }
     if (ToolPanel != null)
     {
         this.SetToolPanel(ToolPanel);
         this.AfterCreateStart    = (ObjectEventHandler)Delegate.Combine(this.AfterCreateStart, new ObjectEventHandler(this.ObjectManager_AfterCreateStart));
         this.AfterSelect         = (ObjectEventHandler)Delegate.Combine(this.AfterSelect, new ObjectEventHandler(this.ObjectManager_AfterSelect));
         this.AfterCreateFinished = (ObjectEventHandler)Delegate.Combine(this.AfterCreateFinished, new ObjectEventHandler(ToolPanel.Manager_AfterCreateFinished));
         this.AfterCreateFinished = (ObjectEventHandler)Delegate.Combine(this.AfterCreateFinished, new ObjectEventHandler(this.ObjectManager_AfterCreateFinished));
     }
 }
Пример #8
0
 public void SetCanvas(IObjectCanvas Canvas)
 {
     this.Canvas   = Canvas;
     this.Designer = Canvas.DesignerControl;
     this.SetObjectManager();
     if ((this.Designer != null) && (this.Designer.Tag == null))
     {
         this.Designer.Tag        = 1;
         this.Designer.MouseDown += new MouseEventHandler(this.DesignerControl_MouseDown);
         this.Designer.MouseMove += new MouseEventHandler(this.DesignerControl_MouseMove);
         this.Designer.MouseUp   += new MouseEventHandler(this.DesignerControl_MouseUp);
         if (this.Designer is ChartWinControl)
         {
             (this.Designer as ChartWinControl).ExtraPaint += new NativePaintHandler(this.ObjectManager_ExtraPaint);
         }
         else
         {
             this.Designer.Paint += new PaintEventHandler(this.DesignerControl_Paint);
         }
         this.Designer.SizeChanged += new EventHandler(this.DesignerControl_SizeChanged);
         this.Designer.KeyDown     += new KeyEventHandler(this.Designer_KeyDown);
     }
 }
Пример #9
0
 public ObjectManager(IObjectCanvas Canvas, PropertyGrid propertyGrid, ObjectToolPanel ToolPanel, ObjectTree ObjectTree)
     : this(Canvas, propertyGrid, ToolPanel)
 {
     this.ObjectTree = ObjectTree;
 }
Пример #10
0
 public ObjectManager(IObjectCanvas Canvas) : this(Canvas, null, null)
 {
 }
Пример #11
0
 public ObjectManager(IObjectCanvas Canvas) : this()
 {
     SetCanvas(Canvas);
 }