Пример #1
0
		public void Initialize(IRenderer renderer, IModel model, IControlPanel panel, Form mainWindow, UserControl viewportWindow)
		{
			m_renderer = renderer;
			m_model = model;
			m_panel = panel;

			m_model.ActionMapAssigned += OnModelActionMapAssigned;
            m_renderer.Model = m_model;

			m_panel.ActionTriggered += OnAction;

			mainWindow.Move += (_,__) =>
				m_model.Input(string.Format("move {0} {1} {2} {3}", mainWindow.Left, mainWindow.Top
																, viewportWindow.Width, viewportWindow.Height));

            mainWindow.Resize += (_,__) => 
                m_renderer.ChangeViewport(viewportWindow.Width, viewportWindow.Height);

			viewportWindow.Load += (_, __) => m_renderer.Start();
			viewportWindow.HandleDestroyed += (_, __) => m_renderer.Stop();

            //HACK: window movement as input for BOUNCE
			m_model.Input(string.Format("move init {0} {1}", mainWindow.Left, mainWindow.Top));

			// init viewport size
            m_renderer.ChangeViewport(viewportWindow.Width, viewportWindow.Height);
		}
Пример #2
0
 public Theme(IThemeWindow window, IControlPanel controls, ThemeType type)
 {
     this.Window   = window;
     this.Controls = controls;
     this.Type     = type;
     this.Active   = false;
 }
Пример #3
0
        protected override void Initialize(IServiceProvider serviceProvider, Microsoft.Web.Management.Server.ModuleInfo moduleInfo)
        {
            base.Initialize(serviceProvider, moduleInfo);
            IControlPanel controlPanel = (IControlPanel)GetService(typeof(IControlPanel));

            controlPanel.RegisterPage(new ModulePageInfo(this, typeof(BlockLinksConfPage), "BlockLinks", "Configuration for the BlockLinks Custom Module."));
        }
 public OpenGLFractalViewPresenter(
     IFractal fractal,
     IControlPanel controlPanel,
     IFractalView fractalView,
     IFractalRenderer renderer) : base(fractal, controlPanel, fractalView, renderer)
 {
 }
        public FractalCalculatorViewPresenter(IFractal fractal,
                                              IDimensionCalculatorFactory dimensionCalculatorFactory,
                                              IFractalCalculatorView fractalCalculatorView,
                                              IControlPanel controlPanel)
        {
            if (fractal == null)
            {
                throw new ArgumentNullException("fractal");
            }
            if (dimensionCalculatorFactory == null)
            {
                throw new ArgumentNullException("dimensionCalculatorFactory");
            }
            if (fractalCalculatorView == null)
            {
                throw new ArgumentNullException("fractalCalculatorView");
            }
            if (controlPanel == null)
            {
                throw new ArgumentNullException("controlPanel");
            }
            _fractal = fractal;
            _dimensionCalculatorFactory = dimensionCalculatorFactory;
            _fractalCalculatorView      = fractalCalculatorView;
            _controlPanel = controlPanel;

            _fractalCalculatorView.ClearPoints        += new EventHandler(_fractalCalculatorView_ClearPoints);
            _fractalCalculatorView.CalculatePoints    += new EventHandler(_fractalCalculatorView_CalculatePoints);
            _fractalCalculatorView.ResetControlPanel  += new EventHandler(_fractalCalculatorView_ResetControlPanel);
            _fractalCalculatorView.CalculateDimension += new EventHandler(_fractalCalculatorView_CalculateDimension);
            _fractalCalculatorView.ValidatingUI       += new Events.ValidatingEventHandler(_fractalCalculatorView_Validating);

            InitValidators();
        }
Пример #6
0
        public void Dispatcher_Tests_Base_SetUp()
        {
            Engine.Cosmogenesis("bang", __factory);

            var atlas  = SourceMe.The <Atlas>();
            var legend = atlas.Legend;

            ttFloor       = legend[TerrainEnum.Floor];
            ttWall        = legend[TerrainEnum.Wall];
            ttDoorOpen    = legend[TerrainEnum.DoorOpen];
            ttDoorClosed  = legend[TerrainEnum.DoorClosed];
            ttSoil        = legend[TerrainEnum.Soil];
            ttSoilTilled  = legend[TerrainEnum.SoilTilled];
            ttSoilPlanted = legend[TerrainEnum.SoilPlanted];

            _gameState     = SourceMe.The <IGameState>();
            _gameState.Map = new CompoundMap
            {
                BeingMap = new BeingMap(),
                RotMap   = new RotMap(),
                SpaceMap = CreateSmallTestMap(),
                ItemMap  = new ItemMap(),
            };

            _controls    = SourceMe.The <IControlPanel>();
            BeingCreator = SourceMe.The <IBeingCreator>();
        }
Пример #7
0
        protected MultiThreadOscilloscope(
            ConstructorTuple <ICanvas <T> > canvas_constructor,
            ConstructorTuple <IPointDrawer> point_drawer_constructor,
            IGraphProducer graph_producer,
            IControlPanel control_panel,
            ConcurrentQueue <T> buffer = null)
        {
            ICanvas <T>  canvas       = canvas_constructor.NewInstance();
            IPointDrawer point_drawer = point_drawer_constructor.NewInstance();

            if (canvas.GraphSize != point_drawer.GraphSize)
            {
                throw new OscillocopeBuildException("canvas and point_drawer have different GraphSize", new DifferentGraphSizeException());
            }
            if (graph_producer.RequireConcurrentDrawer && !point_drawer.IsConcurrent)
            {
                throw new OscillocopeBuildException("graph_producer require multi-thread-safe PointDrawer but point_drawer is not");
            }
            this.canvas_constructor       = canvas_constructor;
            this.point_drawer_constructor = point_drawer_constructor;
            this.graph_producer           = graph_producer;
            this.control_panel            = control_panel;
            if (buffer == null)
            {
                this.buffer = new ConcurrentQueue <T>();
            }
            else
            {
                this.buffer = buffer;
            }
            this.free_canvas.Enqueue(canvas);
            this.free_point_drawer.Enqueue(point_drawer);
        }
Пример #8
0
 public void ShowFractal(IFractal fractal, IControlPanel controlPanel)
 {
     if (MainViewPresenter != null)
     {
         FractalCompositeView2 compositeView = new FractalCompositeView2();
         compositeView.FractalView = MainViewPresenter.RendererAbstractFactory.CreateFractalView();
         InitFractalCompositeView(fractal, compositeView, controlPanel);
         compositeView.Text       = fractal.Name;
         compositeView.Dock       = DockStyle.Fill;
         compositeView.Activated += (s, e) =>
         {
             var dockContent = s as IDockContent;
             if (dockContent == null)
             {
                 return;
             }
             if (fractal != null)
             {
                 OnSelectedChanged(fractal);
             }
         };
         compositeView.FormClosed += compositeViewClosed;
         compositeView.Show(_dockPanel);
         _dockContentFractalDictionary[compositeView] = fractal;
     }
 }
Пример #9
0
        protected override void Initialize(IServiceProvider serviceProvider, ModuleInfo moduleInfo)
        {
            base.Initialize(serviceProvider, moduleInfo);
            IControlPanel  controlPanel   = (IControlPanel)GetService(typeof(IControlPanel));
            ModulePageInfo modulePageInfo = new ModulePageInfo(this, typeof(imageCopyrightUIPage), "Image Copyright", "Image Copyright");

            controlPanel.RegisterPage(modulePageInfo);
        }
Пример #10
0
        protected override void Initialize(IServiceProvider serviceProvider, Microsoft.Web.Management.Server.ModuleInfo moduleInfo)
        {
            base.Initialize(serviceProvider, moduleInfo);

            IControlPanel controlPanel = (IControlPanel)GetService(typeof(IControlPanel));

            controlPanel.RegisterPage(new ModulePageInfo(this, typeof(DemoModuleListPage), "DemoPage"));
        }
Пример #11
0
        protected override void Initialize(IServiceProvider serviceProvider, Microsoft.Web.Management.Server.ModuleInfo moduleInfo)
        {
            base.Initialize(serviceProvider, moduleInfo);

            IControlPanel controlPanel = (IControlPanel)GetService(typeof(IControlPanel));

            controlPanel.RegisterPage(new ModulePageInfo(this, typeof(ConfigModulePage), "HTTP Strict Transport Security", "Enable and configure HTTP Strict Transport Security."));
        }
Пример #12
0
 public TimeCountedOscilloscope(
     ICanvas <T> canvas,
     IPointDrawer point_drawer,
     IGraphProducer graph_producer,
     IControlPanel control_panel)
     : base(canvas, point_drawer, graph_producer, control_panel)
 {
 }
        protected override void Initialize(IServiceProvider serviceProvider, Microsoft.Web.Management.Server.ModuleInfo moduleInfo)
        {
            base.Initialize(serviceProvider, moduleInfo);
            //register the Module Page - RequestPage
            IControlPanel  controlPanel   = (IControlPanel)GetService(typeof(IControlPanel));
            ModulePageInfo modulePageInfo = new ModulePageInfo(this, typeof(RequestPage), "Current Requests", "Displays the current requests in all worker processes");

            controlPanel.RegisterPage(modulePageInfo);
        }
Пример #14
0
        public static ITransformation CreateInverseTransformation(this IControlPanel controlPanel)
        {
            TransformationBuilder transformationBuilder = new TransformationBuilder();
            ITransformation       transformation        = transformationBuilder.
                                                          Translate(-controlPanel.XTranslation, -controlPanel.YTranslation).
                                                          Rotate(controlPanel.RotationPoint, -controlPanel.AnticlockWiseRotation).
                                                          Zoom(controlPanel.ZoomPoint, 1 / controlPanel.Zoom).
                                                          CreateTransformation();

            return(transformation);
        }
Пример #15
0
 public OverloadedWidget(IControlPanel panel)
 {
     this.panel = panel;
     img.Pixbuf = picture;
     img.Sensitive = false;
     HBox hbox = new HBox(false, 2);
     hbox.PackStart(img, false, false, 0);
     hbox.PackStart(new Label("Перегрузка"), false, false, 0);
     Add(hbox);
     Child.ShowAll();
     panel.ElevatorOverloaded += HandleElevatorOverloaded;
 }
Пример #16
0
 public ControlPanelWidget(IControlPanel panel)
 {
     VBox vbox = new VBox(false, 3);
     vbox.BorderWidth = 3;
     vbox.PackStart(new OverloadedWidget(panel), false, false, 0);
     vbox.PackStart(new HSeparator(), false, false, 0);
     vbox.PackStart(new ButtonPanelWidget(panel, 2), false, false, 0);
     vbox.PackStart(new HSeparator(), false, false, 0);
     vbox.PackStart(new ButtonWidget(panel.GoButton), false, false, 0);
     Add(vbox);
     Child.ShowAll();
 }
Пример #17
0
        public override void Render(IFractal fractal, IControlPanel controlPanel)
        {
            lock (_syncRendering)
            {
                int        vbo       = -1;
                RectangleF rectangle = controlPanel.Rectangle;
                try
                {
                    GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
                    GL.MatrixMode(MatrixMode.Modelview);
                    GL.LoadIdentity();
                    GL.EnableVertexAttribArray(0);//Enable vertex array attribute
                    //If points are cached, use them without recreating them
                    var points = fractal.Points;
                    if (points.Count == 0)
                    {
                        return;
                    }
                    if (_chachedVertices == null || _chachedVertices.Length != points.Count ||
                        _chachedVertices[points.Count - 1].X != points[points.Count - 1].X ||
                        _chachedVertices[points.Count - 1].Y != points[points.Count - 1].Y)
                    {
                        //var points = fractal.Points;
                        _chachedVertices = new Vector2[points.Count];
                        int i = 0;
                        foreach (var p in points)
                        {
                            _chachedVertices[i] = new Vector2(p.X, p.Y);
                            i++;
                        }
                    }

                    //Apply trnasformations in OpenGL
                    GL.Scale(controlPanel.Zoom / 1000.0, controlPanel.Zoom / 1000.0, 1);
                    GL.Rotate(controlPanel.AnticlockWiseRotation, Vector3.UnitZ);
                    GL.Translate(controlPanel.XTranslation / 100.0, controlPanel.YTranslation / 100.0, 0);

                    GL.GenBuffers(1, out vbo);
                    GL.BindBuffer(BufferTarget.ArrayBuffer, vbo);
                    GL.BufferData <Vector2>(BufferTarget.ArrayBuffer, new IntPtr(_chachedVertices.Length * Vector2.SizeInBytes),
                                            _chachedVertices, BufferUsageHint.StaticDraw);
                    GL.VertexAttribPointer(0, 2, VertexAttribPointerType.Float, false, 0, 0);
                    GL.DrawArrays(PrimitiveType.Points, 0, _chachedVertices.Length);
                }
                finally
                {
                    GL.DisableVertexAttribArray(0);
                    GL.Flush();
                    GL.DeleteBuffer(vbo);
                }
            }
        }
Пример #18
0
        public MainWindow()
        {
            string address = ControlPanelListener.Address;

            NetNamedPipeBinding binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
            EndpointAddress     ep      = new EndpointAddress(address);

            channel = ChannelFactory <IControlPanel> .CreateChannel(binding, ep);

            Debug.WriteLine("Client Connected");

            InitializeComponent();
        }
Пример #19
0
        protected override void Initialize(IServiceProvider serviceProvider, ModuleInfo moduleInfo)
        {
            base.Initialize(serviceProvider, moduleInfo);

            IControlPanel controlPanel = (IControlPanel)GetService(typeof(IControlPanel));

            Debug.Assert(controlPanel != null, "Couldn't get IControlPanel");

            //PHPInfo page
            ModulePageInfo modulePageInfo = new ModulePageInfo(this,
                                                               typeof(PHPInfoPage), Resources.PHPInfoPageTitle, Resources.PHPInfoPageDescription,
                                                               Resources.PHPLogo16, Resources.PHPLogo32, Resources.PHPInfoPageLongDescription);

            controlPanel.RegisterPage(modulePageInfo);

            //PHP Settings page
            modulePageInfo = new ModulePageInfo(this,
                                                typeof(AllSettingsPage), Resources.AllSettingsPageTitle, Resources.AllSettingsPageDescription,
                                                Resources.PHPLogo16, Resources.PHPLogo32, Resources.AllSettingsPageLongDescription);

            controlPanel.RegisterPage(modulePageInfo);

            modulePageInfo = new ModulePageInfo(this,
                                                typeof(ErrorReportingPage), Resources.ErrorReportingPageTitle, Resources.ErrorReportingPageDescription,
                                                Resources.PHPLogo16, Resources.PHPLogo32, Resources.ErrorReportingPageLongDescription);

            controlPanel.RegisterPage(modulePageInfo);

            modulePageInfo = new ModulePageInfo(this,
                                                typeof(RuntimeLimitsPage), Resources.RuntimeLimitsPageTitle, Resources.RuntimeLimitsPageDescription,
                                                Resources.PHPLogo16, Resources.PHPLogo32, Resources.RuntimeLimitsPageLongDescription);

            controlPanel.RegisterPage(modulePageInfo);

            //PHP Extensions page
            modulePageInfo = new ModulePageInfo(this,
                                                typeof(AllExtensionsPage), Resources.AllExtensionsPageTitle, Resources.AllExtensionsPageDescription,
                                                Resources.PHPLogo16, Resources.PHPLogo32, Resources.AllExtensionsPageLongDescription);

            controlPanel.RegisterPage(modulePageInfo);


            //PHPPage - PHP feature start page
            modulePageInfo = new ModulePageInfo(this,
                                                typeof(PHPPage), Resources.PHPPageTitle, Resources.PHPPageDescription,
                                                Resources.PHPLogo16, Resources.PHPLogo32, Resources.PHPPageLongDescription);

            controlPanel.RegisterPage(ControlPanelCategoryInfo.Iis, modulePageInfo);
            controlPanel.RegisterPage(ControlPanelCategoryInfo.ApplicationDevelopment, modulePageInfo);
        }
Пример #20
0
 public DrivedOscilloscope(
     ConstructorTuple <ICanvas <T> > canvas_constructor,
     ConstructorTuple <IPointDrawer> point_drawer_constructor,
     IGraphProducer graph_producer,
     IControlPanel control_panel,
     ConcurrentQueue <T> buffer = null)
     : base(
         canvas_constructor: canvas_constructor,
         point_drawer_constructor: point_drawer_constructor,
         graph_producer: graph_producer,
         control_panel: control_panel,
         buffer: buffer)
 {
 }
Пример #21
0
        private void RegisterModulePage(IControlPanel controlPanel)
        {
            ModulePageInfo modulePageInfo = new ModulePageInfo(
                this,
                typeof(ManageHostsModulePage),
                Resources.ManageHostsIconTitle,
                Resources.ManageHostsIconDescription,
                Resources.ManageHostsFeatureImage,
                Resources.ManageHostsFeatureImage,
                Resources.ManageHostsIconDescription
                );

            controlPanel.RegisterPage(ControlPanelCategoryInfo.Management, modulePageInfo);
        }
Пример #22
0
        /// <summary>
        /// Called by IIS to register the modulepage
        /// </summary>
        /// <param name="serviceProvider">The service provider</param>
        /// <param name="moduleInfo">The module info</param>
        protected override void Initialize(IServiceProvider serviceProvider, ModuleInfo moduleInfo)
        {
            base.Initialize(serviceProvider, moduleInfo);

            //load the icon
            System.IO.Stream      icoStream = this.GetType().Assembly.GetManifestResourceStream("IISGeoIP2blockModule.resources.geoblock.png");
            System.Drawing.Bitmap ico       = new System.Drawing.Bitmap(icoStream);
            icoStream.Close();

            IControlPanel  controlPanel   = (IControlPanel)GetService(typeof(IControlPanel));
            ModulePageInfo modulePageInfo = new ModulePageInfo(this, typeof(GeoblockModuleDialogPage), "Geoblock Module", "Blocks access by country referenced by client IP address.", ico, ico, "Blocks access by country referenced by client IP address.");

            controlPanel.RegisterPage(ControlPanelCategoryInfo.Security, modulePageInfo);
        }
Пример #23
0
    protected override void Initialize(IServiceProvider serviceProvider,
                                       ModuleInfo moduleInfo)
    {
        base.Initialize(serviceProvider, moduleInfo);

        // Register the control panel category and page with the control panel
        IControlPanel controlPanel =
            (IControlPanel)serviceProvider.GetService(typeof(IControlPanel));

        Debug.Assert(controlPanel != null, "Couldn't get IControlPanel");
        ModulePageInfo customPage =
            new ModulePageInfo(this, typeof(CustomPage),
                               "Custom Section Settings", "Edits the custom settings");

        controlPanel.RegisterPage(ControlPanelCategoryInfo.Server, customPage);
    }
Пример #24
0
        protected override void Initialize(IServiceProvider serviceProvider, Microsoft.Web.Management.Server.ModuleInfo moduleInfo)
        {
            base.Initialize(serviceProvider, moduleInfo);

            IServiceContainer serviceContainer = (IServiceContainer)serviceProvider.GetService(typeof(IServiceContainer));

            this.AddCommonServices(serviceContainer);

            IExtensibilityManager extensibilityManager = (IExtensibilityManager)serviceProvider.GetService(typeof(IExtensibilityManager));

            this.RegisterProtocolProvider(serviceProvider, extensibilityManager);

            IControlPanel controlPanel = (IControlPanel)serviceProvider.GetService(typeof(IControlPanel));

            this.RegisterModulePage(controlPanel);
        }
        public override void Render(IFractal fractal, IControlPanel controlPanel)
        {
            //Copy for the closure
            RectangleF rectangle     = controlPanel.Rectangle;
            PointF     rotationPoint = controlPanel.RotationPoint;
            PointF     zoomPoint     = controlPanel.ZoomPoint;

            ITransformation transformation = controlPanel.CreateTransformation();

            _rendererThread.Enqueue((cancellableArg) =>
            {
                try
                {
                    using (Graphics g = _fractalView.CreateViewGraphic())
                    {
                        g.Clear(Color.White);
                        using (Brush brush = new SolidBrush(Color.Yellow))
                        {
                            PointF p = transformation.Apply(zoomPoint);
                            g.FillRectangle(brush, p.X, p.Y, 5, 5);
                        }
                        using (Brush brush = new SolidBrush(Color.Orange))
                        {
                            PointF p = transformation.Apply(rotationPoint);
                            g.FillRectangle(brush, p.X, p.Y, 5, 5);
                        }
                        using (Brush brush = new SolidBrush(Color.Black))
                        {
                            DrawFractalPoints(brush, transformation, rectangle, fractal, g, cancellableArg);
                        }
                        using (Brush brush = new SolidBrush(Color.Green))
                        {
                            PointF p = transformation.Apply(zoomPoint);
                            g.FillRectangle(brush, p.X, p.Y, 5, 5);
                        }
                        using (Brush brush = new SolidBrush(Color.DarkOrange))
                        {
                            PointF p = transformation.Apply(rotationPoint);
                            g.FillRectangle(brush, p.X, p.Y, 5, 5);
                        }
                    }
                }
                catch (Exception e)//Catching exception in case the view is closed while still drawing in the panel
                {
                }
            });
        }
Пример #26
0
 private void DrawSelectors()
 {
     GUILayout.BeginVertical(HighLogic.Skin.box, GUILayout.Width(225.0f));
     foreach (var panel in panels)
     {
         if (GUILayout.Toggle(this.selectedPanel == panel, panel.Name, this.panelSelectorStyle))
         {
             this.selectedPanel = panel;
         }
     }
     GUILayout.FlexibleSpace();
     if (GUILayout.Button("CLOSE", Button))
     {
         this.enabled = false;
     }
     GUILayout.EndVertical();
 }
Пример #27
0
        protected override void Initialize(IServiceProvider serviceProvider, ModuleInfo moduleInfo)
        {
            base.Initialize(serviceProvider, moduleInfo);

            IControlPanel controlPanel = (IControlPanel)GetService(typeof(IControlPanel));

            Debug.Assert(controlPanel != null, "Couldn't get IControlPanel");

            ModulePageInfo modulePageInfo = new ModulePageInfo(this, typeof(WebAnalyticsPage),
                                                               "Web Analytics Tracking",
                                                               "Manage Web Analytics Tracking settings",
                                                               Resources.WebAnalyticsIcon16,
                                                               Resources.WebAnalyticsIcon32);

            controlPanel.RegisterPage(ControlPanelCategoryInfo.Iis, modulePageInfo);
            controlPanel.RegisterPage(ControlPanelCategoryInfo.CommonHttp, modulePageInfo);
        }
Пример #28
0
 protected SingleThreadOscilloscope(
     ICanvas <T> canvas,
     IPointDrawer point_drawer,
     IGraphProducer graph_producer,
     IControlPanel control_panel)
 {
     if (canvas.GraphSize != point_drawer.GraphSize)
     {
         throw new OscillocopeBuildException("canvas and point_drawer have different GraphSize", new DifferentGraphSizeException());
     }
     if (graph_producer.RequireConcurrentDrawer && !point_drawer.IsConcurrent)
     {
         throw new OscillocopeBuildException("graph_producer require multi-thread-safe PointDrawer but point_drawer is not");
     }
     this.canvas         = canvas;
     this.point_drawer   = point_drawer;
     this.graph_producer = graph_producer;
     this.control_panel  = control_panel;
 }
Пример #29
0
        /// <summary>
        /// Returns the main page for the specified module
        /// </summary>
        private Type GetPageType(string moduleName)
        {
            IControlPanel controlPanel = (IControlPanel)GetService(typeof(IControlPanel));
            Module        module       = (Module)Connection.Modules[moduleName];

            if (module != null)
            {
                ICollection pageInfos = controlPanel.GetPages(module);

                foreach (ModulePageInfo pageInfo in pageInfos)
                {
                    if (pageInfo.IsEnabled && !pageInfo.PageType.IsAssignableFrom(typeof(IModuleChildPage)))
                    {
                        return(pageInfo.PageType);
                    }
                }
            }

            return(null);
        }
        /// <summary>
        ///     On platform change
        /// </summary>
        /// <param name="platformType"></param>
        protected void OnPlatformChanged(PlatformType platformType)
        {
            //change platform by
            switch (platformType)
            {
            case Configuration.PlatformType.Desktop:
                _panelLayer = new KaraokePanelOverlay(_playField)
                {
                    Clock            = new FramedClock(new StopwatchClock(true)),
                    RelativeSizeAxes = Axes.X,
                    Origin           = Anchor.BottomCentre,
                    Anchor           = Anchor.BottomCentre,
                    Scale            = new Vector2(1.0f),
                    Depth            = 10f
                };
                break;

            default:
                _panelLayer = new KaraokeLightPanel(_playField)
                {
                    Clock            = new FramedClock(new StopwatchClock(true)),
                    RelativeSizeAxes = Axes.X,
                    Origin           = Anchor.BottomCentre,
                    Anchor           = Anchor.BottomCentre,
                    Scale            = new Vector2(1.0f),
                    Depth            = 10f
                };
                break;
            }

            //initial key eveht
            _panelLayer.InputAction.BindTo(InputAction);

            //add to child
            Children = new Drawable[]
            {
                _panelLayer as Container
            };
        }
 protected FractalViewPresenterBase(
     IFractal fractal,
     IControlPanel controlPanel,
     IFractalView fractalView,
     IFractalRenderer renderer)
 {
     if (fractal == null)
     {
         throw new ArgumentNullException("fractal");
     }
     if (controlPanel == null)
     {
         throw new ArgumentNullException("controlPanel");
     }
     if (fractalView == null)
     {
         throw new ArgumentNullException("fractalView");
     }
     if (renderer == null)
     {
         throw new ArgumentNullException("renderer");
     }
     _fractal                  = fractal;
     _controlPanel             = controlPanel;
     _fractalView              = fractalView;
     _renderer                 = renderer;
     _fractal.PointsChanged   += new EventHandler(_fractal_PointsChanged);
     _controlPanel.Changed    += new EventHandler(_controlPanel_Changed);
     _fractalView.PaintView   += new System.Windows.Forms.PaintEventHandler(_fractalView_Paint);
     _fractalView.Resize      += new EventHandler(_fractalView_Resize);
     _fractalView.ZoomIn      += new ZoomEventHandler(_fractalView_ZoomIn);
     _fractalView.Translating += new TranslatingEventHandler(_fractalView_Translating);
     _fractalView.SetNumOfCalculatedPoints(_fractal.Points.Count);
     if (_fractal.ExactDimension.HasValue)
     {
         _fractalView.SetSimilarityDimension(_fractal.ExactDimension.Value.ToString());
     }
 }
Пример #32
0
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        if (this.controlPanel is IControlPanel)
        {
            IControlPanel pnl = (IControlPanel)this.controlPanel;
            this.ControlPanelTitle.InnerText = pnl.Title;
        }
        else if (this.controlPanel is Telerik.Web.IControlPanel)
        {
            Telerik.Web.IControlPanel pnl = (Telerik.Web.IControlPanel) this.controlPanel;

            if (pnl is IViewModeControl)
            {
                // Ivan's note: UX does not want the title for the new modules, only breadcrumb
                this.ControlPanelTitle.Visible = false;
            }
            else
            {
                this.ControlPanelTitle.InnerText = pnl.Title;
            }
        }
    }
Пример #33
0
 private void DrawSelectors()
 {
     GUILayout.BeginVertical(HighLogic.Skin.box, GUILayout.Width(225.0f));
     foreach (var panel in panels)
     {
         if (GUILayout.Toggle(this.selectedPanel == panel, panel.Name, this.panelSelectorStyle))
         {
             this.selectedPanel = panel;
         }
     }
     GUILayout.FlexibleSpace();
     if (GUILayout.Button("CLOSE", Button))
     {
         this.enabled = false;
     }
     GUILayout.EndVertical();
 }
Пример #34
0
 internal void Init(IControlPanel controlPanel)
 {
     controlPanel.PropertyChanged += control.ControlPanel_PropertyChanged;
 }
Пример #35
0
 internal void Init(IControlPanel controlpanel)
 {
     if (DataContext != null) throw new Exception("<Testbug>ControlPanel inits twice...");
       DataContext = vm = controlpanel;
 }
 public FractalViewPresenterBase CreateFractalViewPresenter(
     IFractal fractal, IControlPanel controlPanel, IFractalView fractalView,
     IFractalRenderer renderer)
 {
     return(new OpenGLFractalViewPresenter(fractal, controlPanel, fractalView, renderer));
 }