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); }
public Theme(IThemeWindow window, IControlPanel controls, ThemeType type) { this.Window = window; this.Controls = controls; this.Type = type; this.Active = false; }
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(); }
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>(); }
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); }
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; } }
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); }
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")); }
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.")); }
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); }
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); }
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; }
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(); }
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); } } }
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(); }
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); }
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) { }
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); }
/// <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); }
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); }
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 { } }); }
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(); }
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); }
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; }
/// <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()); } }
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; } } }
internal void Init(IControlPanel controlPanel) { controlPanel.PropertyChanged += control.ControlPanel_PropertyChanged; }
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)); }