public void ConnectToControler(FractalDataHandlerControler Controler)
 {
     Controler.Deactivate += () => { this._isactive = false;
                                     _fractal.CancelParallelCreating(); };
     Controler.SetZoomEvent += (Degree) => { if (_isactive)
                                             {
                                                 GetZoom(Degree);
                                             }
     };
     Controler.GetFractalDataHandlersHasStarted += (Handler, ActiveOnly) => {
         if (ActiveOnly && (!IsActive))
         {
             return;
         }
         Handler.Add(this);
     };
     Controler.GetBack += () => {
         if (!_isactive)
         {
             return;
         }
         Controler.DeactivateHandlers();
         if (this._fractal.GetBack())
         {
             this.Show(_width, _height);
         }
     };
     Controler.ChangeSizeFromSizeEditor += () => { if (_isactive)
                                                   {
                                                       ChangeSizeFromWindow(Controler);
                                                   }
     };
     this.NeedDeactivate += () => { Controler.DeactivateHandlers(); };
 }
        public void CreateInSize(FractalDataHandlerControler Controler)
        {
            SizeEditor se = new SizeEditor("Фрактал джулии");

            se.BuldButtonClick        += (o, size) => { Controler.DeactivateHandlers(); this.Reset(size.Width, size.Height); };
            se.OtherWindowButtonClick += (o, size) => { this.Create_in_other_window(_fractal.GetClone(), size.Width, size.Height, Controler); };
            se.ShowDialog(_owner);
        }
        public void ChangeSizeFromWindow(FractalDataHandlerControler controler)
        {
            SizeEditor se = new SizeEditor("Новый размер");

            se.BuldButtonClick        += (sender, size) => { controler.DeactivateHandlers(); this.ReShow(size.Width, size.Height); };
            se.OtherWindowButtonClick += (sender, size) => { this.Create_in_other_window(_fractal.GetClone(), size.Width, size.Height, 0, 0, _width, _height, controler); };
            se.ShowDialog(_owner);
        }
 public void ConnectShowToMenuItem(ToolStripMenuItem menuitem, FractalDataHandlerControler Deactivator, int Width, int Height)
 {
     _owner.Invoke(SetMenuItemImage, menuitem, _fcm.GetDrawnBitmap(_fractal.GetClone().CreateFractal(Width, Height)));
     menuitem.Click               += (sender, EventArg) => { Deactivator.DeactivateHandlers(); this.Show(); };
     this.FractalChanged          += (sender, fractal) => { _owner.Invoke(SetMenuItemImage, menuitem, _fcm.GetDrawnBitmap(fractal.GetClone().CreateFractal(Width, Height))); };
     this.FractalColorModeChanged += (sender, mode) => { _owner.Invoke(SetMenuItemImage, menuitem, _fcm.GetDrawnBitmap(_fractal.GetClone().CreateFractal(Width, Height))); };
     this.SetNewFractalEvent      += (sender) => { _owner.Invoke(SetMenuItemImage, menuitem, _fcm.GetDrawnBitmap(_fractal.GetClone().CreateFractal(Width, Height))); };
 }
 public void ConnectResetWithSizeFromWindowToMenuItem(ToolStripMenuItem menuitem, FractalDataHandlerControler Controler)
 {
     menuitem.Click += (sender, e) => {
         SizeEditor se = new SizeEditor("Новый фрактал");
         se.BuldButtonClick        += (o, size) => { Controler.DeactivateHandlers(); this.Reset(size.Width, size.Height); };
         se.OtherWindowButtonClick += (o, size) => { this.Create_in_other_window(_fractal.GetClone(), size.Width, size.Height, Controler); };
         se.ShowDialog(_owner);
     };
 }
        private void Create_in_other_window(Fractal Fractal, int Width, int Height, int HorizontalStart, int VerticalStart, int SelectedWidth, int SelectedHeight, FractalDataHandlerControler Controler)
        {
            IsolatedFractalWindowsCreator OtherWindow = new IsolatedFractalWindowsCreator(Fractal, _fcm);

            OtherWindow.FractalToken += (fractal, fap) =>
            {
                Disconnect();
                _fractal = fractal;
                Connect();
                _fap    = fap;
                _width  = fap.Width;
                _height = fap.Height;
                Controler.DeactivateHandlers();
                Show();
            };
            OtherWindow.StartProcess(Width, Height, HorizontalStart, VerticalStart, SelectedWidth, SelectedHeight, UseSafeZoom);
        }
 public void ConnectToControler(FractalDataHandlerControler Controler)
 {
     Controler.Deactivate += () => { this._isactive = false;
     _fractal.CancelParallelCreating();
     };
     Controler.SetZoomEvent += (Degree) => {if(_isactive)GetZoom(Degree);};
     Controler.GetFractalDataHandlersHasStarted += (Handler, ActiveOnly) => {
         if (ActiveOnly && (!IsActive)) return;
         Handler.Add(this);
     };
     Controler.GetBack += () => {
         if (!_isactive) return;
         Controler.DeactivateHandlers();
         if(this._fractal.GetBack())
         this.Show(_width, _height);
     };
     Controler.ChangeSizeFromSizeEditor += () => { if(_isactive)ChangeSizeFromWindow(Controler); };
     this.NeedDeactivate += () => { Controler.DeactivateHandlers(); };
 }
 private void Create_in_other_window(Fractal Fractal, int Width, int Height, int HorizontalStart, int VerticalStart, int SelectedWidth, int SelectedHeight, FractalDataHandlerControler Controler)
 {
     IsolatedFractalWindowsCreator OtherWindow = new IsolatedFractalWindowsCreator(Fractal,_fcm);
     OtherWindow.FractalToken += (fractal, fap) =>
     {
         Disconnect();
         _fractal = fractal;
         Connect();
         _fap = fap;
         _width = fap.Width;
         _height = fap.Height;
         Controler.DeactivateHandlers();
         Show();
     };
     OtherWindow.StartProcess(Width, Height,HorizontalStart,VerticalStart,SelectedWidth,SelectedHeight,UseSafeZoom);
 }
 public void CreateInSize(FractalDataHandlerControler Controler)
 {
     SizeEditor se = new SizeEditor("Фрактал джулии");
     se.BuldButtonClick += (o, size) => { Controler.DeactivateHandlers(); this.Reset(size.Width, size.Height); };
     se.OtherWindowButtonClick += (o, size) => { this.Create_in_other_window(_fractal.GetClone(), size.Width, size.Height, Controler); };
     se.ShowDialog(_owner);
 }
 public void ChangeSizeFromWindow(FractalDataHandlerControler controler)
 {
     SizeEditor se = new SizeEditor("Новый размер");
     se.BuldButtonClick += (sender, size) => { controler.DeactivateHandlers(); this.ReShow(size.Width,size.Height); };
     se.OtherWindowButtonClick += (sender, size) => {this.Create_in_other_window(_fractal.GetClone(),size.Width,size.Height,0,0,_width,_height,controler); };
     se.ShowDialog(_owner);
 }
 public void ConnectResetWithSizeFromWindowToMenuItem(ToolStripMenuItem menuitem, FractalDataHandlerControler Controler)
 {
     menuitem.Click+=(sender,e)=>{
     SizeEditor se = new SizeEditor("Новый фрактал");
     se.BuldButtonClick += (o, size) => { Controler.DeactivateHandlers(); this.Reset(size.Width,size.Height); };
     se.OtherWindowButtonClick += (o, size) => { this.Create_in_other_window(_fractal.GetClone(), size.Width, size.Height, Controler); };
     se.ShowDialog(_owner);
 };
 }
 public void ConnectStandartResetToMenuItem(ToolStripMenuItem menuitem, FractalDataHandlerControler Controler)
 {
     menuitem.Click += (sender, e) => { Controler.DeactivateHandlers();
     this.Reset(960,640);
     };
 }
 public void ConnectShowToMenuItem(ToolStripMenuItem menuitem,FractalDataHandlerControler Deactivator,int Width,int Height)
 {
     _owner.Invoke(SetMenuItemImage, menuitem, _fcm.GetDrawnBitmap(_fractal.GetClone().CreateFractal(Width, Height)));
     menuitem.Click += (sender, EventArg) => { Deactivator.DeactivateHandlers(); this.Show(); };
     this.FractalChanged += (sender, fractal) => { _owner.Invoke(SetMenuItemImage, menuitem,_fcm.GetDrawnBitmap(fractal.GetClone().CreateFractal(Width, Height))); };
     this.FractalColorModeChanged += (sender, mode) => { _owner.Invoke(SetMenuItemImage, menuitem, _fcm.GetDrawnBitmap(_fractal.GetClone().CreateFractal(Width, Height))); };
     this.SetNewFractalEvent += (sender) => { _owner.Invoke(SetMenuItemImage, menuitem, _fcm.GetDrawnBitmap(_fractal.GetClone().CreateFractal(Width, Height))); };
 }
 public void ConnectStandartResetToMenuItem(ToolStripMenuItem menuitem, FractalDataHandlerControler Controler)
 {
     menuitem.Click += (sender, e) => { Controler.DeactivateHandlers();
                                        this.Reset(960, 640); };
 }