Ejemplo n.º 1
0
 void Start()
 {
     m_LineRenderer = GetComponent<LineRenderer> ();
     m_Camera = GetComponentInParent<Camera> ();
     m_Control = GetComponentInParent<IControl> ();
     m_PlayerStats = GetComponentInParent<PlayerStats> ();
 }
Ejemplo n.º 2
0
		void IGrid.SetContent(int row, int column, IControl content)
		{
			global::Xamarin.Forms.Grid.SetRow((global::Xamarin.Forms.View) content, row);
			global::Xamarin.Forms.Grid.SetColumn((global::Xamarin.Forms.View) content, column);

			base.Children.Add((global::Xamarin.Forms.View) content);
		}
Ejemplo n.º 3
0
 public DevTools(IControl root)
 {
     InitializeComponent();
     Root = root;
     DataContext = new DevToolsViewModel(root);
     Root.PointerMoved += RootPointerMoved;
 }
Ejemplo n.º 4
0
 public frmContextSearch(IControl parentControl)
 {
     InitializeComponent();
     Parent = parentControl;
     ContextSearchId = parentControl.ContextSearchId;
     contextSearchManager = new ContextSearch(ContextSearchId);
 }
Ejemplo n.º 5
0
        public bool CanAdd( IControl control )
        {
            if ( this._route.IsEmpty() ) { return true; }

            // NOTE This only fake
            return true;
        }
Ejemplo n.º 6
0
        public DevToolsViewModel(IControl root)
        {
            _logicalTree = new TreePageViewModel(LogicalTreeNode.Create(root));
            _visualTree = new TreePageViewModel(VisualTreeNode.Create(root));

            this.WhenAnyValue(x => x.SelectedTab).Subscribe(index =>
            {
                switch (index)
                {
                    case 0:
                        Content = _logicalTree;
                        break;
                    case 1:
                        Content = _visualTree;
                        break;
                }
            });

            _focusedControl = KeyboardDevice.Instance
                .WhenAnyValue(x => x.FocusedElement)
                .Select(x => x?.GetType().Name)
                .ToProperty(this, x => x.FocusedControl);

            _pointerOverElement = root.GetObservable(TopLevel.PointerOverElementProperty)
                .Select(x => x?.GetType().Name)
                .ToProperty(this, x => x.PointerOverElement);
        }
Ejemplo n.º 7
0
        private static bool ExportQuaternionController(IControl control, string property, List<BabylonAnimation> animations)
        {
            IQuat previousQuat = null;

            return ExportController(control, property, animations, 0x2003, BabylonAnimation.DataType.Quaternion,
                (index, keyControl) =>
                {
                    var key = Loader.Global.ILinRotKey.Create();
                    keyControl.GetKey(index, key);
                    var newQuat = key.Val;

                    if (index > 0)
                    {
                        newQuat = previousQuat.Multiply(newQuat);
                    }

                    previousQuat = newQuat;

                    return new BabylonAnimationKey
                    {
                        frame = key.Time / Ticks,
                        values = newQuat.ToArray()
                    };
                });
        }
Ejemplo n.º 8
0
		void IGrid.SetContent(int row, int column, IControl content)
		{
			Grid.SetRow((Windows.UI.Xaml.FrameworkElement) content, row);
			Grid.SetColumn((Windows.UI.Xaml.FrameworkElement) content, column);

			base.Children.Add((Windows.UI.Xaml.FrameworkElement) content);
		}
Ejemplo n.º 9
0
 public virtual void AddControl(string name, IControl ctrl)
 {
     if (_controlHash.ContainsKey(name))
         _controlHash[name] = ctrl;
     else
         _controlHash.Add(name, ctrl);
 }
 public void Add( IControl control )
 {
     lock ( this._lock )
     {
         this._selectedControl.Add( control );
     }
 }
Ejemplo n.º 11
0
 public void MoveToElement(IControl WebElement)
 {
     //Thread.Sleep(10000);
     SeleniumActions.MoveToElement(((SeleniumWebControls)WebElement).aWebElement).Build().Perform();
     //Thread.Sleep(10000);
     //element.Click().Build().Perform();
 }
 public IEnumerable<BuilderAction> Create( IControl control )
 {
     var builder = new Builder();
     yield return new BuilderAction( Order.High, context => builder.Build( context, control ) );
     yield return new BuilderAction( Order.Normal, builder.Connect );
     yield return new BuilderAction( Order.Low, builder.Setup );
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="controlleControl">Controller control interface.</param>
 /// <param name="content">Content manager for this application packaged content.</param>
 /// <param name="device">Current graphics device to use for rendering</param>
 public GameController(IControl controllerControl, ContentManager content, GraphicsDevice device)
 {
     m_control = controllerControl;
     m_content = content;
     m_graphicsDevice = device;
     m_gameView = new GameView(content, device);
     m_gameModel = new GameModel(new Level(Settings.Instance.CurrentLevel), m_gameView);
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Private method to show children controls when parent is loaded
 /// </summary>
 /// <param name="control"></param>
 private void ShowChildrenControls(IControl control)
 {
     foreach (var child in control.ChildrenControls)
     {
         if (child is Form)
             ((Form)child).Show();
     }
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="controlleControl">Controller control interface.</param>
 /// <param name="content">Content manager for this application packaged content.</param>
 /// <param name="device">Current graphics device to use for rendering</param>
 public GameCompleteController(IControl controllerControl, ContentManager content, GraphicsDevice device)
 {
     m_control = controllerControl;
     m_content = content;
     m_graphicsDevice = device;
     m_model = new GameCompleteModel();
     m_view = new GameCompleteView(content, device);
 }
Ejemplo n.º 16
0
 public void UnregisterControl(IControl controlBase)
 {
     if (mainPanel.Controls.Contains((Control)controlBase))
       {
     mainPanel.Controls.Remove((Control)controlBase);
     ((Control)controlBase).Dispose();
       }
 }
Ejemplo n.º 17
0
        public StateDefinition(IControl control)
        {
            if (control == null)
                throw new ArgumentNullException("control");

            States = new Dictionary<State, bool>();
            Image = control;
        }
Ejemplo n.º 18
0
 public override void ApplyTo(IControl control)
 {
     control.RollOn += HandleRollOn;
     control.RollOff += HandleRollOff;
     control.Push += HandlePush;
     control.Click += HandleClick;
     control.EnabledChange += HandleEnabledChange;
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="controlleControl">Controller control interface.</param>
 /// <param name="content">Content manager for this application packaged content.</param>
 /// <param name="device">Current graphics device to use for rendering</param>
 public SplashController(IControl controllerControl, ContentManager content, GraphicsDevice device)
 {
     m_control = controllerControl;
     m_content = content;
     m_graphicsDevice = device;
     m_model = new SplashModel();
     m_view = new SplashView(content, device);
 }
Ejemplo n.º 20
0
 // Use this for initialization
 void Start()
 {
     m_Control = GetComponent<IControl> ();
     m_PlayerController = GetComponent<PlayerController> ();
     m_Camera = GetComponentInChildren<Camera> ().transform;
     //		m_Camera = LevelManager.Instance.GetCamera (gameObject).transform;
     m_Animator = GetComponent<Animator> ();
 }
Ejemplo n.º 21
0
 public void Client(object sender, EventArgs e)
 {
     if (ActiveControl.ValidateControl() && _companyControl.FocusedRow.Usable())
       {
     DetailControl = new ClientControl { Company = _companyControl.FocusedRow };
     _mainView.RegisterControl(DetailControl);
       }
 }
 public void ReplaceWith( IControl control )
 {
     lock ( this._lock )
     {
         this._selectedControl.Clear();
         this._selectedControl.Add( control );
     }
 }
Ejemplo n.º 23
0
    void Start()
    {
        m_Control = GetComponentInParent<IControl> ();
        m_Camera = GetComponent<Camera> ();

        //initially grab the mouse
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible = false;
    }
        public void EndIn( IControl lastControl )
        {
            var roadLane = this.CreateRoadLane();
            this._connectionCommand.Connect( this._lastConnectedControl, roadLane );
            this._connectionCommand.Connect( roadLane, lastControl );

            this._owner.AddChild( roadLane );
            this._lastConnectedControl = null;
        }
Ejemplo n.º 25
0
 public void RegisterControl(IControl controlBase)
 {
     if (!mainPanel.Controls.Contains((Control)controlBase))
       {
     mainPanel.Controls.Add((Control)controlBase);
     controlBase.ReloadControl();
     ((Control)controlBase).BringToFront();
       }
 }
Ejemplo n.º 26
0
        /// <summary>
        /// Adds an entry to the index.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <param name="container">The item container.</param>
        public void Add(object item, IControl container)
        {
            _itemToContainer.Add(item, container);
            _containerToItem.Add(container, item);

            Materialized?.Invoke(
                this, 
                new ItemContainerEventArgs(new ItemContainerInfo(container, item, 0)));
        }
Ejemplo n.º 27
0
 public IControl AddControl(IControl control)
 {
     if (HasControl(control))
         throw new InvalidOperationException("Cannot add a control more than once.");
     control.Enable();
     _controls.Add(control);
     control.Show();
     return control;
 }
Ejemplo n.º 28
0
 private void SoftwareControlValueChanged(IControl control) {
   if (control.ControlMode == ControlMode.Software) {        
     ADLFanSpeedValue adlf = new ADLFanSpeedValue();
     adlf.SpeedType = ADL.ADL_DL_FANCTRL_SPEED_TYPE_PERCENT;
     adlf.Flags = ADL.ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED;
     adlf.FanSpeed = (int)control.SoftwareValue;
     ADL.ADL_Overdrive5_FanSpeed_Set(adapterIndex, 0, ref adlf);
   }
 }
Ejemplo n.º 29
0
        public void SelectControl(IControl control)
        {
            var tree = Content as TreePageViewModel;

            if (tree != null)
            {
                tree.SelectControl(control);
            }
        }
Ejemplo n.º 30
0
 /// <summary>
 /// Adds control
 /// </summary>
 /// <param name="control"></param>
 public void Add(IControl control)
 {
     control.LoadContent(Game);
     _controls.Add(control);
     if (control is SelectableControl)
     {
         _selectableControls++;
     }
 }
Ejemplo n.º 31
0
 int IGrid.GetRowSpan(IControl content)
 {
     return(base.GetRowSpan((System.Windows.Forms.Control)content));
 }
Ejemplo n.º 32
0
 private bool CanFocus(IControl control) => control.Focusable && control.IsEffectivelyEnabled && control.IsVisible;
Ejemplo n.º 33
0
 private Mock <IDrawingContextImpl> GetLayerContext(DeferredRenderer renderer, IControl layerRoot)
 {
     return(Mock.Get(renderer.Layers[layerRoot].Bitmap.Item.CreateDrawingContext(null)));
 }
Ejemplo n.º 34
0
        public static IHtmlString TextAreaFor(this KenticoForm html, IControl control, IControlRenderer customRenderer)
        {
            var renderedControl = customRenderer.Render(control);

            return(MvcHtmlString.Create(renderedControl.ToString()));
        }
Ejemplo n.º 35
0
 public override void Execute <TOwner>(IControl <TOwner> control)
 {
     control.Owner.Driver.ExecuteScript("arguments[0].scrollIntoView(true);", control.Scope);
 }
 /// <summary>
 /// Obtains a reference to a client function that, when invoked, initiates a client call back to server events. The client function for this overloaded method includes a specified control, argument, client script, context, error handler, and Boolean value.
 /// </summary>
 /// <returns>
 /// The name of a client function that invokes the client callback.
 /// </returns>
 /// <param name="control">The server <see cref="T:System.Web.UI.Control"/> that handles the client callback. The control must implement the <see cref="T:System.Web.UI.ICallbackEventHandler"/> interface and provide a <see cref="M:System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent(System.String)"/> method.
 /// </param><param name="argument">An argument passed from the client script to the server <see cref="M:System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent(System.String)"/>  method.
 /// </param><param name="clientCallback">The name of the client event handler that receives the result of the successful server event.
 /// </param><param name="context">Client script that is evaluated on the client prior to initiating the callback. The result of the script is passed back to the client event handler.
 /// </param><param name="clientErrorCallback">The name of the client event handler that receives the result when an error occurs in the server event handler.
 /// </param><param name="useAsync">true to perform the callback asynchronously; false to perform the callback synchronously.
 /// </param><exception cref="T:System.ArgumentNullException">The <see cref="T:System.Web.UI.Control"/> specified is null.
 /// </exception><exception cref="T:System.InvalidOperationException">The <see cref="T:System.Web.UI.Control"/> specified does not implement the <see cref="T:System.Web.UI.ICallbackEventHandler"/> interface.
 /// </exception>
 public string GetCallbackEventReference(
     IControl control, string argument, string clientCallback, string context, string clientErrorCallback, bool useAsync)
 {
     ArgumentUtility.CheckNotNullAndType <Control> ("control", control);
     return(_clientScriptManager.GetCallbackEventReference((Control)control, argument, clientCallback, context, clientErrorCallback, useAsync));
 }
Ejemplo n.º 37
0
 void IGrid.SetRowSpan(int rowSpan, IControl content)
 {
     base.SetRowSpan((System.Windows.Forms.Control)content, rowSpan);
 }
 public void RegisterClientScriptResource(IControl control, Type type, string resourceName)
 {
     ArgumentUtility.CheckNotNullAndType <Control> ("control", control);
     ScriptManager.RegisterClientScriptResource((Control)control, type, resourceName);
 }
 public void RegisterOnSubmitStatement(IControl control, Type type, string key, string script)
 {
     ArgumentUtility.CheckNotNullAndType <Control> ("control", control);
     ScriptManager.RegisterOnSubmitStatement((Control)control, type, key, script ?? string.Empty);
 }
 public void RegisterClientScriptInclude(IControl control, Type type, string key, string url)
 {
     ArgumentUtility.CheckNotNullAndType <Control> ("control", control);
     ScriptManager.RegisterClientScriptInclude((Control)control, type, key, url);
 }
 /// <summary>
 /// Registers a hidden field with the <see cref="ScriptManager"/> control for a control that is inside an <see cref="UpdatePanel"/> control.
 /// </summary>
 /// <param name="control">The control that is registering the hidden field.</param>
 /// <param name="hiddenFieldName">The name of the hidden field to register.
 /// </param><param name="hiddenFieldInitialValue">The initial value of the field to register.
 /// </param>
 /// <exception cref="T:System.ArgumentNullException">
 ///   <paramref name="control"/> is null
 ///   <para>- or -</para>
 ///   <paramref name="hiddenFieldName"/> is null.
 /// </exception>
 /// <seealso cref="ScriptManager.RegisterHiddenField(System.Web.UI.Control,string,string)"/>
 public void RegisterHiddenField(IControl control, string hiddenFieldName, string hiddenFieldInitialValue)
 {
     ArgumentUtility.CheckNotNullAndType <Control> ("control", control);
     ScriptManager.RegisterHiddenField((Control)control, hiddenFieldName, hiddenFieldInitialValue ?? string.Empty);
 }
 public static bool SourceTargetStudy(List <StudyCompareReportData> sourcetargetData)
 {
     try
     {
         foreach (StudyCompareReportData sourcetargetitem in sourcetargetData)
         {
             IControl TargetCodelistTable        = SyncUtilities.FindVisibleElement(By.Id("LabAttributeReference_0_CodeListMappingsReference_0_CodelistMapping_TT"));
             IControl SourceCodelistTable        = SyncUtilities.FindVisibleElement(By.Id("LabAttributeReference_0_CodeListMappingsReference_0_CodelistMapping_ST"));
             ReadOnlyCollection <IControl> srows = null;
             ReadOnlyCollection <IControl> trows = null;
             if (WebTableUtilities.GetRowCount(SourceCodelistTable, out srows) > 0 && WebTableUtilities.GetRowCount(TargetCodelistTable, out trows) > 0)
             {
                 for (int rowIndex = 0; rowIndex < srows.Count; rowIndex++)
                 {
                     bool sfound = false;
                     //WebTable_SearchCriteriaItemList searchList = new WebTable_SearchCriteriaItemList();
                     //searchList.AddSearchItem(new WebTable_SearchCriteriaItem(1, sourcetargetitem.SourceStudy, TableColumnContentType.Text));
                     //IControl row = WebTableUtilities.Table_FindRow(SourceCodelistTable, searchList, 1);
                     IControl sourcecelldata       = WebTableUtilities.GetCell(srows[rowIndex], 1);
                     String   sourceattribureValue = Control_PropertyUtilities.GetAttributeValue(sourcecelldata, "class", out sfound);
                     if (sfound)
                     {
                         ReadOnlyCollection <IControl> targetTablerows = SyncUtilities.FindVisibleElements_Parent(TargetCodelistTable.WebElement, By.TagName("tr"));
                         if (sourceattribureValue.Equals("modified"))
                         {
                             bool     tfound;
                             IControl targetcelldata       = WebTableUtilities.GetCell(targetTablerows[rowIndex], 1);
                             String   targetattribureValue = Control_PropertyUtilities.GetAttributeValue(targetcelldata, "class", out tfound);
                             if (targetattribureValue.Contains("modified-cell"))
                             {
                                 Control_PropertyUtilities.CompareCSSValue(targetcelldata, "background-color", "#fcdc75");
                             }
                         }
                         else if (sourceattribureValue.Equals("deleted"))
                         {
                             bool     tfound;
                             IControl targetcelldata       = WebTableUtilities.GetCell(targetTablerows[rowIndex], 1);
                             String   targetattribureValue = Control_PropertyUtilities.GetAttributeValue(targetcelldata, "class", out tfound);
                             if (targetattribureValue.Equals("removedCell"))
                             {
                                 Control_PropertyUtilities.CompareCSSValue(sourcecelldata, "background-color", "#fcdc75");
                             }
                         }
                     }
                     else if (!sfound)
                     {
                         ReadOnlyCollection <IControl> targetTablerows = SyncUtilities.FindVisibleElements_Parent(TargetCodelistTable.WebElement, By.TagName("tr"));
                         if (sourceattribureValue.Contains("removedCell"))
                         {
                             bool     tfound;
                             IControl targetcelldata       = WebTableUtilities.GetCell(targetTablerows[rowIndex], 1);
                             String   targetattribureValue = Control_PropertyUtilities.GetAttributeValue(targetcelldata, "class", out tfound);
                             if (targetattribureValue.Contains("added"))
                             {
                                 Control_PropertyUtilities.CompareCSSValue(targetcelldata, "background-color", "#fcdc75");
                             }
                         }
                     }
                     else if (!sfound)
                     {
                         ReadOnlyCollection <IControl> targetTablerows = SyncUtilities.FindVisibleElements_Parent(TargetCodelistTable.WebElement, By.TagName("tr"));
                         if (sourceattribureValue.Contains("deleted"))
                         {
                             bool     tfound;
                             IControl targetcelldata       = WebTableUtilities.GetCell(targetTablerows[rowIndex], 1);
                             String   targetattribureValue = Control_PropertyUtilities.GetAttributeValue(targetcelldata, "class", out tfound);
                             if (targetattribureValue.Contains("removedCell"))
                             {
                                 Control_PropertyUtilities.CompareCSSValue(targetcelldata, "background-color", "#fcdc75");
                             }
                         }
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
     }
     return(false);
 }
 /// <summary>
 /// Returns a string to use in a client event to cause postback to the server. The reference string is defined by the specified control that handles the postback and a string argument of additional event information. Optionally, registers the event reference for validation.
 /// </summary>
 /// <returns>
 /// A string that, when treated as script on the client, initiates the postback.
 /// </returns>
 /// <param name="control">The server <see cref="T:System.Web.UI.Control"/> that processes the postback on the server.
 /// </param><param name="argument">A string of optional arguments to pass to <paramref name="control"/>.
 /// </param><param name="registerForEventValidation">true to register the event reference for validation; otherwise, false.
 /// </param><exception cref="T:System.ArgumentNullException">The specified <see cref="T:System.Web.UI.Control"/> is null.
 /// </exception>
 public string GetPostBackEventReference(IControl control, string argument, bool registerForEventValidation)
 {
     ArgumentUtility.CheckNotNullAndType <Control> ("control", control);
     return(_clientScriptManager.GetPostBackEventReference((Control)control, argument, registerForEventValidation));
 }
 /// <summary>
 /// Returns a string that can be used in a client event to cause postback to the server. The reference string is defined by the specified control that handles the postback and a string argument of additional event information.
 /// </summary>
 /// <returns>
 /// A string that, when treated as script on the client, initiates the postback.
 /// </returns>
 /// <param name="control">The server <see cref="T:System.Web.UI.Control"/> that processes the postback on the server.
 /// </param><param name="argument">A string of optional arguments to pass to the control that processes the postback.
 /// </param><exception cref="T:System.ArgumentNullException">The specified <see cref="T:System.Web.UI.Control"/> is null.
 /// </exception>
 public string GetPostBackEventReference(IControl control, string argument)
 {
     ArgumentUtility.CheckNotNullAndType <Control> ("control", control);
     return(_clientScriptManager.GetPostBackEventReference((Control)control, argument));
 }
Ejemplo n.º 45
0
 void IGrid.SetColumnSpan(int columnSpan, IControl content)
 {
     base.SetColumnSpan((System.Windows.Forms.Control)content, columnSpan);
 }
        static IControl PageNumberLink(IControl pager, int pageNumber)
        {
            IControl pageNumbersHost = SyncUtilities.FindElement_Parent(pager.WebElement, By.ClassName("k-pager-numbers"));

            return(SyncUtilities.FindElement_Parent(pageNumbersHost.WebElement, By.LinkText(pageNumber.ToString())));
        }
 public static IControl GetFirstPageIcon(IControl pager)
 {
     return(SyncUtilities.FindElement_Parent(pager.WebElement, By.CssSelector("#gridReferenceRanges > div.k-pager-wrap.k-grid-pager.k-widget.k-floatwrap > a.k-link.k-pager-nav.k-pager-first")));
 }
Ejemplo n.º 48
0
        private void TreeView_Click(object sender, EventArgs e)
        {
            if (!(e is MouseEventArgs m) || m.Button != MouseButtons.Right)
            {
                return;
            }

            NodeControlInfo info = treeView.GetNodeControlInfoAt(new Point(m.X, m.Y));

            treeView.SelectedNode = info.Node;
            if (info.Node != null)
            {
                if (info.Node.Tag is SensorNode node && node.Sensor != null)
                {
                    treeContextMenu.MenuItems.Clear();
                    if (node.Sensor.Parameters.Count > 0)
                    {
                        MenuItem item = new MenuItem("Parameters...");
                        item.Click += delegate
                        {
                            ShowParameterForm(node.Sensor);
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }
                    if (nodeTextBoxText.EditEnabled)
                    {
                        MenuItem item = new MenuItem("Rename");
                        item.Click += delegate
                        {
                            nodeTextBoxText.BeginEdit();
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }
                    if (node.IsVisible)
                    {
                        MenuItem item = new MenuItem("Hide");
                        item.Click += delegate
                        {
                            node.IsVisible = false;
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }
                    else
                    {
                        MenuItem item = new MenuItem("Unhide");
                        item.Click += delegate
                        {
                            node.IsVisible = true;
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }
                    treeContextMenu.MenuItems.Add(new MenuItem("-"));
                    {
                        MenuItem item = new MenuItem("Pen Color...");
                        item.Click += delegate
                        {
                            ColorDialog dialog = new ColorDialog {
                                Color = node.PenColor.GetValueOrDefault()
                            };
                            if (dialog.ShowDialog() == DialogResult.OK)
                            {
                                node.PenColor = dialog.Color;
                            }
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }
                    {
                        MenuItem item = new MenuItem("Reset Pen Color");
                        item.Click += delegate
                        {
                            node.PenColor = null;
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }
                    treeContextMenu.MenuItems.Add(new MenuItem("-"));
                    {
                        MenuItem item = new MenuItem("Show in Tray")
                        {
                            Checked = _systemTray.Contains(node.Sensor)
                        };
                        item.Click += delegate
                        {
                            if (item.Checked)
                            {
                                _systemTray.Remove(node.Sensor);
                            }
                            else
                            {
                                _systemTray.Add(node.Sensor, true);
                            }
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }
                    if (_gadget != null)
                    {
                        MenuItem item = new MenuItem("Show in Gadget")
                        {
                            Checked = _gadget.Contains(node.Sensor)
                        };
                        item.Click += delegate
                        {
                            if (item.Checked)
                            {
                                _gadget.Remove(node.Sensor);
                            }
                            else
                            {
                                _gadget.Add(node.Sensor);
                            }
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }
                    if (node.Sensor.Control != null)
                    {
                        treeContextMenu.MenuItems.Add(new MenuItem("-"));
                        IControl control     = node.Sensor.Control;
                        MenuItem controlItem = new MenuItem("Control");
                        MenuItem defaultItem = new MenuItem("Default")
                        {
                            Checked = control.ControlMode == ControlMode.Default
                        };
                        controlItem.MenuItems.Add(defaultItem);
                        defaultItem.Click += delegate
                        {
                            control.SetDefault();
                        };
                        MenuItem manualItem = new MenuItem("Manual");
                        controlItem.MenuItems.Add(manualItem);
                        manualItem.Checked = control.ControlMode == ControlMode.Software;
                        for (int i = 0; i <= 100; i += 5)
                        {
                            if (i <= control.MaxSoftwareValue &&
                                i >= control.MinSoftwareValue)
                            {
                                MenuItem item = new MenuItem(i + " %")
                                {
                                    RadioCheck = true
                                };
                                manualItem.MenuItems.Add(item);
                                item.Checked = control.ControlMode == ControlMode.Software && Math.Round(control.SoftwareValue) == i;
                                int softwareValue = i;
                                item.Click += delegate
                                {
                                    control.SetSoftware(softwareValue);
                                };
                            }
                        }
                        treeContextMenu.MenuItems.Add(controlItem);
                    }

                    treeContextMenu.Show(treeView, new Point(m.X, m.Y));
                }

                if (info.Node.Tag is HardwareNode hardwareNode && hardwareNode.Hardware != null)
                {
                    treeContextMenu.MenuItems.Clear();

                    if (nodeTextBoxText.EditEnabled)
                    {
                        MenuItem item = new MenuItem("Rename");
                        item.Click += delegate
                        {
                            nodeTextBoxText.BeginEdit();
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }

                    treeContextMenu.Show(treeView, new Point(m.X, m.Y));
                }
            }
        }
Ejemplo n.º 49
0
        /// <summary>
        /// Adds the specified control, specifying its horizontal and vertical position and a control reference.
        /// <para xml:lang="es">Agrega el control especificado, especificando su posicion horizontal y vertical y un control de referencia</para>
        /// </summary>
        /// <param name="control">Control.
        /// <para xml:lang="es">El control a agregar.</para>
        /// </param>
        /// <param name="horizontalContraint">Horizontal contraint.
        /// <para xml:lang="es">Referencia horizontal donde se colocara el control.</para>
        /// </param>
        /// <param name="verticalContraint">Vertical contraint.
        /// <para xml:lang="es">Referencia vertical donde se colocara el control.</para>
        /// </param>
        /// <param name="referenceControl">Reference control.
        /// <para xml:lang="es">Control de referencia.</para>
        /// </param>
        void IRelativePanel.Add(IControl control, RelativePanelHorizontalContraint horizontalContraint, RelativePanelVerticalContraint verticalContraint, IControl referenceControl)
        {
            if (control == null)
            {
                throw new ArgumentNullException(nameof(control));
            }

            //if no reference control is provided, then use this panel as reference
            if (referenceControl == null)
            {
                referenceControl = this;
            }

            base.Controls.Add((NativeControl)control);

            //the anchors at the current control
            string myHorizontalAnchor = "center";
            string myVerticalAnchor   = "center";

            //the anchors at the reference control
            string atHorizontalAnchor = "center";
            string atVerticalAnchor   = "center";

            //the reference control's id
            string of = ((NativeControl)referenceControl).ClientID;

            //horizontal constraint

            switch (horizontalContraint)
            {
            case RelativePanelHorizontalContraint.CenterWith:
                myHorizontalAnchor = "center";
                atHorizontalAnchor = "center";
                break;

            case RelativePanelHorizontalContraint.LeftOf:
                myHorizontalAnchor = "right";
                atHorizontalAnchor = "left";
                break;

            case RelativePanelHorizontalContraint.LeftWith:
                myHorizontalAnchor = "left";
                atHorizontalAnchor = "left";
                break;

            case RelativePanelHorizontalContraint.RightOf:
                myHorizontalAnchor = "left";
                atHorizontalAnchor = "right";
                break;

            case RelativePanelHorizontalContraint.RightWith:
                myHorizontalAnchor = "right";
                atHorizontalAnchor = "right";
                break;
            }

            //vertical constraint

            switch (verticalContraint)
            {
            case RelativePanelVerticalContraint.AboveOf:
                myVerticalAnchor = "bottom";
                atVerticalAnchor = "top";
                break;

            case RelativePanelVerticalContraint.BelowOf:
                myVerticalAnchor = "top";
                atVerticalAnchor = "bottom";
                break;

            case RelativePanelVerticalContraint.BottomWith:
                myVerticalAnchor = "bottom";
                atVerticalAnchor = "bottom";
                break;

            case RelativePanelVerticalContraint.CenterWith:
                myVerticalAnchor = "center";
                atVerticalAnchor = "center";
                break;

            case RelativePanelVerticalContraint.TopWith:
                myVerticalAnchor = "top";
                atVerticalAnchor = "top";
                break;
            }

            string positionJS = string.Format
                                (
                @"
				$('#{0}').position
				(
					{{
						my: '{1} {2}',
						at: '{3} {4}',
						of: '#{5}'
					}}
				);"                ,
                ((NativeControl)control).ClientID, myHorizontalAnchor, myVerticalAnchor, atHorizontalAnchor, atVerticalAnchor, ((NativeControl)referenceControl).ClientID
                                );

            ClientScripts.Add(positionJS);
        }
Ejemplo n.º 50
0
 /// <summary>
 /// constructor de la clase
 /// </summary>
 /// <param name="controlI">interfaz Control</param>
 public ControlController(IControl controlI) => _controlI = controlI;
 public static IControl GetLastPageIcon(IControl pager)
 {
     return(SyncUtilities.FindElement_Parent(pager.WebElement, By.CssSelector("a[title='Go to the last page']")));
 }
Ejemplo n.º 52
0
 private static IObservable <bool> TrackAttachmentToTree(IControl relativeTo, TreeType tree)
 {
     return(tree == TreeType.Visual ? TrackAttachmentToVisualTree(relativeTo) : TrackAttachmentToLogicalTree(relativeTo));
 }
Ejemplo n.º 53
0
 /// <summary>
 /// Clears insets
 /// </summary>
 /// <param name="component">Chart component</param>
 /// <param name="insets">Insets</param>
 public virtual void ClearInsets(IControl component, int[,] insets)
 {
 }
Ejemplo n.º 54
0
        public static IHtmlString TextAreaFor(this KenticoForm html, IControl control)

        {
            return(TextAreaFor(html, control, ControlRendererRegistrar.Resolve(ControlType.TextArea)));
        }
Ejemplo n.º 55
0
        void IRelativePanel.Add(IControl control, RelativePanelHorizontalContraint horizontalContraint, RelativePanelVerticalContraint verticalContraint, IControl referenceControl)
        {
            if (control == null)
            {
                throw new ArgumentNullException(nameof(control));
            }

            //if no reference control is provided, then use this panel as reference
            if (referenceControl == null)
            {
                referenceControl = this;
            }

            NativeControl nativeControl   = (NativeControl)control;
            NativeControl nativeReference = (NativeControl)referenceControl;

            System.Drawing.Point location = new System.Drawing.Point();

            switch (horizontalContraint)
            {
            case RelativePanelHorizontalContraint.CenterWith:
                location.X = nativeReference.Location.X + (nativeReference.Width / 2) - (nativeControl.Width / 2);
                break;

            case RelativePanelHorizontalContraint.LeftOf:
                location.X = nativeReference.Location.X - nativeControl.Width;
                break;

            case RelativePanelHorizontalContraint.LeftWith:
                location.X = nativeReference.Location.X;
                break;

            case RelativePanelHorizontalContraint.RightOf:
                location.X = nativeReference.Location.X + nativeReference.Width + nativeControl.Width;
                break;

            case RelativePanelHorizontalContraint.RightWith:
                location.X = nativeReference.Location.X + nativeReference.Width;
                break;
            }

            //vertical constraint

            switch (verticalContraint)
            {
            case RelativePanelVerticalContraint.AboveOf:
                location.Y = nativeReference.Location.Y - nativeControl.Height;
                break;

            case RelativePanelVerticalContraint.BelowOf:
                location.Y = nativeReference.Location.Y + nativeReference.Height;
                break;

            case RelativePanelVerticalContraint.BottomWith:
                location.Y = nativeReference.Location.Y + nativeReference.Height - nativeControl.Height;
                break;

            case RelativePanelVerticalContraint.CenterWith:
                location.Y = nativeReference.Location.Y + (nativeReference.Height / 2) - (nativeControl.Height / 2);
                break;

            case RelativePanelVerticalContraint.TopWith:
                location.Y = nativeReference.Location.Y;
                break;
            }

            ((NativeControl)control).Location = location;
            base.Controls.Add((NativeControl)control);
        }
Ejemplo n.º 56
0
        private void treeView_Click(object sender, EventArgs e)
        {
            MouseEventArgs m = e as MouseEventArgs;

            if (m == null || m.Button != MouseButtons.Right)
            {
                return;
            }

            NodeControlInfo info = treeView.GetNodeControlInfoAt(
                new Point(m.X, m.Y)
                );

            treeView.SelectedNode = info.Node;
            if (info.Node != null)
            {
                SensorNode node = info.Node.Tag as SensorNode;
                if (node != null && node.Sensor != null)
                {
                    treeContextMenu.MenuItems.Clear();
                    if (node.Sensor.Parameters.Length > 0)
                    {
                        MenuItem item = new MenuItem("Parameters...");
                        item.Click += delegate(object obj, EventArgs args) {
                            ShowParameterForm(node.Sensor);
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }
                    if (nodeTextBoxText.EditEnabled)
                    {
                        MenuItem item = new MenuItem("Rename");
                        item.Click += delegate(object obj, EventArgs args) {
                            nodeTextBoxText.BeginEdit();
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }
                    if (node.IsVisible)
                    {
                        MenuItem item = new MenuItem("Hide");
                        item.Click += delegate(object obj, EventArgs args) {
                            node.IsVisible = false;
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }
                    else
                    {
                        MenuItem item = new MenuItem("Unhide");
                        item.Click += delegate(object obj, EventArgs args) {
                            node.IsVisible = true;
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }
                    treeContextMenu.MenuItems.Add(new MenuItem("-"));
                    {
                        MenuItem item = new MenuItem("Show in Tray");
                        item.Checked = systemTray.Contains(node.Sensor);
                        item.Click  += delegate(object obj, EventArgs args) {
                            if (item.Checked)
                            {
                                systemTray.Remove(node.Sensor);
                            }
                            else
                            {
                                systemTray.Add(node.Sensor, true);
                            }
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }
                    if (gadget != null)
                    {
                        MenuItem item = new MenuItem("Show in Gadget");
                        item.Checked = gadget.Contains(node.Sensor);
                        item.Click  += delegate(object obj, EventArgs args) {
                            if (item.Checked)
                            {
                                gadget.Remove(node.Sensor);
                            }
                            else
                            {
                                gadget.Add(node.Sensor);
                            }
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }
                    if (node.Sensor.Control != null)
                    {
                        treeContextMenu.MenuItems.Add(new MenuItem("-"));
                        IControl control     = node.Sensor.Control;
                        MenuItem controlItem = new MenuItem("Control");
                        MenuItem defaultItem = new MenuItem("Default");
                        defaultItem.Checked = control.ControlMode == ControlMode.Default;
                        controlItem.MenuItems.Add(defaultItem);
                        defaultItem.Click += delegate(object obj, EventArgs args) {
                            control.SetDefault();
                        };
                        MenuItem manualItem = new MenuItem("Manual");
                        controlItem.MenuItems.Add(manualItem);
                        manualItem.Checked = control.ControlMode == ControlMode.Software;
                        for (int i = 0; i <= 100; i += 5)
                        {
                            if (i <= control.MaxSoftwareValue &&
                                i >= control.MinSoftwareValue)
                            {
                                MenuItem item = new MenuItem(i + " %");
                                item.RadioCheck = true;
                                manualItem.MenuItems.Add(item);
                                item.Checked = control.ControlMode == ControlMode.Software &&
                                               Math.Round(control.SoftwareValue) == i;
                                int softwareValue = i;
                                item.Click += delegate(object obj, EventArgs args) {
                                    control.SetSoftware(softwareValue);
                                };
                            }
                        }
                        treeContextMenu.MenuItems.Add(controlItem);
                    }

                    treeContextMenu.Show(treeView, new Point(m.X, m.Y));
                }

                HardwareNode hardwareNode = info.Node.Tag as HardwareNode;
                if (hardwareNode != null && hardwareNode.Hardware != null)
                {
                    treeContextMenu.MenuItems.Clear();

                    if (nodeTextBoxText.EditEnabled)
                    {
                        MenuItem item = new MenuItem("Rename");
                        item.Click += delegate(object obj, EventArgs args) {
                            nodeTextBoxText.BeginEdit();
                        };
                        treeContextMenu.MenuItems.Add(item);
                    }

                    treeContextMenu.Show(treeView, new Point(m.X, m.Y));
                }
            }
        }
        public static void Run()
        {
            //ExStart:ManageActiveXControl
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_ActiveX();

            // Accessing the presentation with  ActiveX controls
            Presentation presentation = new Presentation(dataDir + "ActiveX.pptm");

            // Accessing the first slide in presentation
            ISlide slide = presentation.Slides[0];

            // changing TextBox text
            IControl control = slide.Controls[0];

            if (control.Name == "TextBox1" && control.Properties != null)
            {
                string newText = "Changed text";
                control.Properties["Value"] = newText;

                // changing substitute image. Powerpoint will replace this image during activeX activation, so sometime it's OK to leave image unchanged.

                Bitmap   image    = new Bitmap((int)control.Frame.Width, (int)control.Frame.Height);
                Graphics graphics = Graphics.FromImage(image);
                Brush    brush    = new SolidBrush(Color.FromKnownColor(KnownColor.Window));
                graphics.FillRectangle(brush, 0, 0, image.Width, image.Height);
                brush.Dispose();
                System.Drawing.Font font = new System.Drawing.Font(control.Properties["FontName"], 14);
                brush = new SolidBrush(Color.FromKnownColor(KnownColor.WindowText));
                graphics.DrawString(newText, font, brush, 10, 4);
                brush.Dispose();
                Pen pen = new Pen(Color.FromKnownColor(KnownColor.ControlDark), 1);
                graphics.DrawLines(
                    pen, new System.Drawing.Point[] { new System.Drawing.Point(0, image.Height - 1), new System.Drawing.Point(0, 0), new System.Drawing.Point(image.Width - 1, 0) });
                pen.Dispose();
                pen = new Pen(Color.FromKnownColor(KnownColor.ControlDarkDark), 1);

                graphics.DrawLines(pen, new System.Drawing.Point[] { new System.Drawing.Point(1, image.Height - 2), new System.Drawing.Point(1, 1), new System.Drawing.Point(image.Width - 2, 1) });
                pen.Dispose();
                pen = new Pen(Color.FromKnownColor(KnownColor.ControlLight), 1);
                graphics.DrawLines(pen, new System.Drawing.Point[]
                {
                    new System.Drawing.Point(1, image.Height - 1), new System.Drawing.Point(image.Width - 1, image.Height - 1),
                    new System.Drawing.Point(image.Width - 1, 1)
                });
                pen.Dispose();
                pen = new Pen(Color.FromKnownColor(KnownColor.ControlLightLight), 1);
                graphics.DrawLines(pen, new System.Drawing.Point[] { new System.Drawing.Point(0, image.Height), new System.Drawing.Point(image.Width, image.Height), new System.Drawing.Point(image.Width, 0) });
                pen.Dispose();
                graphics.Dispose();
                control.SubstitutePictureFormat.Picture.Image = presentation.Images.AddImage(image);
            }

            // changing Button caption
            control = slide.Controls[1];

            if (control.Name == "CommandButton1" && control.Properties != null)
            {
                String newCaption = "MessageBox";
                control.Properties["Caption"] = newCaption;

                // changing substitute
                Bitmap   image    = new Bitmap((int)control.Frame.Width, (int)control.Frame.Height);
                Graphics graphics = Graphics.FromImage(image);
                Brush    brush    = new SolidBrush(Color.FromKnownColor(KnownColor.Control));
                graphics.FillRectangle(brush, 0, 0, image.Width, image.Height);
                brush.Dispose();
                System.Drawing.Font font = new System.Drawing.Font(control.Properties["FontName"], 14);
                brush = new SolidBrush(Color.FromKnownColor(KnownColor.WindowText));
                SizeF textSize = graphics.MeasureString(newCaption, font, int.MaxValue);
                graphics.DrawString(newCaption, font, brush, (image.Width - textSize.Width) / 2, (image.Height - textSize.Height) / 2);
                brush.Dispose();
                Pen pen = new Pen(Color.FromKnownColor(KnownColor.ControlLightLight), 1);
                graphics.DrawLines(pen, new System.Drawing.Point[] { new System.Drawing.Point(0, image.Height - 1), new System.Drawing.Point(0, 0), new System.Drawing.Point(image.Width - 1, 0) });
                pen.Dispose();
                pen = new Pen(Color.FromKnownColor(KnownColor.ControlLight), 1);
                graphics.DrawLines(pen, new System.Drawing.Point[] { new System.Drawing.Point(1, image.Height - 2), new System.Drawing.Point(1, 1), new System.Drawing.Point(image.Width - 2, 1) });
                pen.Dispose();
                pen = new Pen(Color.FromKnownColor(KnownColor.ControlDark), 1);
                graphics.DrawLines(pen, new System.Drawing.Point[]
                {
                    new System.Drawing.Point(1, image.Height - 1),
                    new System.Drawing.Point(image.Width - 1, image.Height - 1),
                    new System.Drawing.Point(image.Width - 1, 1)
                });
                pen.Dispose();
                pen = new Pen(Color.FromKnownColor(KnownColor.ControlDarkDark), 1);
                graphics.DrawLines(pen, new System.Drawing.Point[] { new System.Drawing.Point(0, image.Height), new System.Drawing.Point(image.Width, image.Height), new System.Drawing.Point(image.Width, 0) });
                pen.Dispose();
                graphics.Dispose();
                control.SubstitutePictureFormat.Picture.Image = presentation.Images.AddImage(image);
            }

            // Moving ActiveX frames 100 points down
            foreach (Control ctl in slide.Controls)
            {
                IShapeFrame frame = control.Frame;
                control.Frame = new ShapeFrame(
                    frame.X, frame.Y + 100, frame.Width, frame.Height, frame.FlipH, frame.FlipV, frame.Rotation);
            }

            // Save the presentation with Edited ActiveX Controls
            presentation.Save(RunExamples.OutPath + "withActiveX-edited_out.pptm", Aspose.Slides.Export.SaveFormat.Pptm);


            // Now removing controls
            slide.Controls.Clear();

            // Saving the presentation with cleared ActiveX controls
            presentation.Save(RunExamples.OutPath + "withActiveX.cleared_out.pptm", Aspose.Slides.Export.SaveFormat.Pptm);
            //ExEnd:ManageActiveXControl
        }
        static bool HasPages()
        {
            IControl goToFirstPageIcon = DL_Pagination1.GetFirstPageIcon(DL_SiteManagementPage.Pager);

            return(!Control_PropertyUtilities.IsControlNull(goToFirstPageIcon));
        }
 /// <summary>
 /// Registers a name/value pair as a custom (expando) attribute of the specified control given a control ID, an attribute name, an attribute value, and a Boolean value indicating whether to encode the attribute value.
 /// </summary>
 /// <param name="registratorControl">The control registering the attribute.</param>
 /// <param name="controlId">The <see cref="T:System.Web.UI.Control"/> on the page that contains the custom attribute.
 /// </param><param name="attributeName">The name of the custom attribute to register.
 /// </param><param name="attributeValue">The value of the custom attribute.
 /// </param><param name="encode">A Boolean value indicating whether to encode the custom attribute to register.
 /// </param>
 public void RegisterExpandoAttribute(IControl registratorControl, string controlId, string attributeName, string attributeValue, bool encode)
 {
     ArgumentUtility.CheckNotNullAndType <Control> ("registratorControl", registratorControl);
     ScriptManager.RegisterExpandoAttribute(
         (Control)registratorControl, controlId, attributeName, attributeValue ?? string.Empty, encode);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemContainerGenerator"/> class.
 /// </summary>
 /// <param name="owner">The owner control.</param>
 public ItemContainerGenerator(IControl owner)
 {
     Owner = owner ?? throw new ArgumentNullException(nameof(owner));
 }