private void OpponentAnimation(int waitTime, Ability abilityChosen) { InfoChange infoChange = new InfoChange(LabelInfoChange); UpdateControl updateControl = new UpdateControl(DoUpdate); UpdateAbility updateAbility = new UpdateAbility(UpdateAbilityChosen); int dots = 0; while (ResourceBarProgressFinished() != true) { string dotString = ""; for (int i = 0; i < 3; i++) { dotString += (i < dots) ? "." : " "; } Invoke(infoChange, new object[] { "Waiting for opponent " + dotString }); dots = (dots + 1) % 4; Thread.Sleep(500); } Invoke(infoChange, new object[] { "" }); Invoke(updateControl); Invoke(updateAbility, new object[] { abilityChosen }); Thread waitForEnablingThread = new Thread(ButtonFinishRoundWaitForEnabling); waitForEnablingThread.Start(); }
protected void ApplyUpdateObjChange(List <UpdateObject> updateList, List <RenderObject> renderList) { if (updateObj != null) { updateObj.Deactivate(); updateList.Remove(updateObj); // have our update object remove its commands from the child controls. for (int indexCard = 0; indexCard < listControls.Count; indexCard++) { IControl control = listControls[indexCard] as IControl; updateObj.RemoveCommandsFromControl(control); } } updateObj = updateObjPending; AttachCommands(); // Keep updatelist from having multiple copies of the same obj. if (!updateList.Contains(updateObj)) { updateList.Add(updateObj); } // updateObj.Activate(); this is only called when hot }
public SingleDrumsControl(UserContext context) { InitializeComponent(); //异步通信初始数据定义 UpdateList += new UpdateControlList(this.listTest); UpdateStatus += new UpdateControl(this.Status); }
public UpdateForm(string viewName, ViewControl control) { contentManager = Program.Context.ContentManager; updateControl = new UpdateControl(viewName, control); this.Controls.Add(updateControl); InitializeComponent(); this.Size = updateControl.Size; }
public LightIndihiangForm(string fileName) { _fileName = fileName; InitializeComponent(); _delegate = UpdateTextMethod; _delegateControl = UpdateControlMethod; }
private void EndGame() { UpdateControl endGameControl = new UpdateControl(EndGameUpdate); while (ResourceBarProgressFinished() != true) { Thread.Sleep(500); } Invoke(endGameControl); }
public UpgradeForm(List <UpdateInfo> info) { InitializeComponent(); if (info != null) { upgradeListDataGridView.DataSource = info; } UpdateControl.EnableElevateIcon(upgradeButton); }
public void PlaceReflex(Object sender, EventArgs args) { Foley.PlayBack(); reflexBlock.Moving = false; UiCursor.ActiveCursor.Parent = this; // switch modes this.updateObjPending = this.updateObjEditReflex; this.renderObj.State = ControlRenderObj.idStateHot; AffixLineNumberToCurrentState(); BokuGame.objectListDirty = true; } // end of PlaceReflex()
public ReflexPanel(Object parent, Reflex reflex, ControlCollection controls) { this.parent = parent; this.reflex = reflex; this.controls = controls; renderPanel = controls.InstanceControlRenderObj(parent, idRow); updateObjEditCards = new UpdateObjEditCards(this); CreateCards(ControlRenderObj.idStateNormal); updateObjPending = updateObjEditCards; }
public void Update() { var Axis = new Vector2( Mathf.Clamp(Input.GetAxisRaw("Horizontal") + (left + right), -1, 1), Mathf.Clamp(Input.GetAxisRaw("Vertical") + (up + down), -1, 1) ); if (Axis != previousAxis) { UpdateControl?.Invoke(Axis); } previousAxis = Axis; }
// private ControlCollection controls; public ReflexHandle(Object parent, Reflex reflex, ControlCollection controls) { this.parent = parent; this.reflex = reflex; // this.controls = controls; renderObj = controls.InstanceControlRenderObj(parent, idHandle); UpdateReflexLineNumber(); updateObjMoveReflex = new UpdateObjMoveReflex(this); updateObjEditReflex = new UpdateObjEditReflex(this); updateObjPending = updateObjEditReflex; }
public void Recompute() { UpdateControl updateFunc = null; if (_neuronUIcontrols.Count == 0) { updateFunc = addNeuron; } else { updateFunc = updateNeuron; } int curOffsetX = (Size.Width - _ann._outputs.Neurons.Count * _neuronWidth) / (_ann._outputs.Neurons.Count + 1); int curOffsetY = (Size.Height - (_ann._innerLayers.Count + 2) * _neuronHeight) / (_ann._innerLayers.Count + 3); int curX = curOffsetX; int curY = curOffsetY; int idxNeuron = 0; foreach (var nn in _ann._outputs.Neurons) { updateFunc(nn, curX + _ann._outputs.Neurons.IndexOf(nn) * _neuronWidth, curY, idxNeuron++); curX += curOffsetX; } foreach (var layer in _ann._innerLayers) { curOffsetX = (Size.Width - layer.Neurons.Count * _neuronWidth) / (layer.Neurons.Count + 1); curX = curOffsetX; curY += _neuronHeight + curOffsetY; foreach (var nn in layer.Neurons) { updateFunc(nn, curX + layer.Neurons.IndexOf(nn) * _neuronWidth, curY, idxNeuron++); curX += curOffsetX; } } curOffsetX = (Size.Width - _ann._inputs.Neurons.Count * _neuronWidth) / (_ann._inputs.Neurons.Count + 1); curX = curOffsetX; curY += _neuronHeight + curOffsetY; foreach (var nn in _ann._inputs.Neurons) { updateFunc(nn, curX + _ann._inputs.Neurons.IndexOf(nn) * _neuronWidth, curY, idxNeuron++); curX += curOffsetX; } }
public static bool Setup() { Console.WriteLine("Sciter " + SciterX.Version); #region Ion if (IonApp.GetStatus() != EIonStatus.ACTIVE || IonApp.IsTrial) { DlgLicense.ShowDialog(); } if (IonApp.GetStatus() != EIonStatus.ACTIVE) { return(false); } UpdateControl.Setup(); #endregion // Create the window AppWindow = new Window(); AppDebugger = new DebuggerHost(); AppHost = new Host(AppWindow); State.Setup(); // Args passing var sv = new SciterValue(); sv["t"] = new SciterValue(App.g_arg_t); sv["r"] = new SciterValue(App.g_arg_r); AppHost.CallFunction("View_Setup", sv); if (!string.IsNullOrEmpty(g_arg_page)) { //MessageBox.ShowMessageBox(AppWindow, g_arg_page); State.LoadURL(g_arg_page); } AppWindow.CenterTopLevelWindow(); AppWindow.Show(); #if DEBUG //AppHost.InvokePost(() => Tests.Run()); #endif return(true); }
protected void ApplyUpdateObjChange(List <UpdateObject> updateList, List <RenderObject> renderList) { if (updateObj != null) { if (State == States.Hot) { updateObj.Deactivate(); } updateList.Remove(updateObj); } updateObj = updateObjPending; updateList.Add(updateObj); if (State == States.Hot) { updateObj.Activate(); } }
} // end of MoveDown() /// <summary> /// Put a reflex and its children into "moving" mode. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> public void MoveReflex(Object sender, EventArgs args) { Foley.PlayPressA(); // Init the Moving block. ReflexPanel panel = this.parent as ReflexPanel; int curIndex = panel.LineNumber - 1; reflexBlock.Init(curIndex); reflexBlock.Moving = true; UiCursor.ActiveCursor.Parent = this; // switch modes this.updateObjPending = this.updateObjMoveReflex; this.renderObj.State = ControlRenderObj.idStateSelected; AffixLineNumberToCurrentState(); BokuGame.objectListDirty = true; } // end of MoveReflex()
private void deleteConfigButton_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure you want to delete OptionsOracle configuration files?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { if (!UpdateControl.ResetConfiguration(UpdateControl.ExitAndRestartModeT.ExitAndRestart)) { string cnfg_dirc = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\OptionsOracle"; statusTextBox.Text += "Conf: Deleting local configuration files...\r\n"; if (!Directory.Exists(cnfg_dirc)) { statusTextBox.Text += "Conf: Error! Config directory '" + cnfg_dirc + "' does not exist.\r\n"; return; } string[] file_list = new string[] { @"config.xml", @"parser.xml", @"wizard.xml", @"plugin.xml" }; foreach (string cnfg_file in file_list) { if (File.Exists(cnfg_dirc + @"\" + cnfg_file)) { try { File.Delete(cnfg_dirc + @"\" + cnfg_file); statusTextBox.Text += "Conf: Config file '" + cnfg_file + "' was deleted.\r\n"; } catch { statusTextBox.Text += "Conf: Error! Failed to delete config file '" + cnfg_file + "'.\r\n"; } } else { statusTextBox.Text += "Conf: Error! Config file '" + cnfg_file + "' does not exist.\r\n"; } } MessageBox.Show("Configuration files were removed, please restart OptionsOracle to create them.", "Completed", MessageBoxButtons.OK, MessageBoxIcon.Information); statusTextBox.Text += "Conf: Config files were deleted successfully.\r\n"; } } }
/* ----------------------------------------------------------------- */ /// /// OnUpdateControl /// /// <summary> /// Update(object) メソッドを通じてコントロールの内容が更新された /// 時に実行されます。 /// </summary> /// /* ----------------------------------------------------------------- */ protected virtual void OnUpdateControl(KeyValueCancelEventArgs <Control, object> e) { UpdateControl?.Invoke(this, e); if (e.Cancel) { return; } switch (e.Key.GetType().Name) { case nameof(Cube.Forms.ColorButton): UpdateColorButton(e.Key as Cube.Forms.ColorButton, e.Value as Color?); break; case nameof(Cube.Forms.FontButton): UpdateFontButton(e.Key as Cube.Forms.FontButton, e.Value as Font); break; case nameof(System.Windows.Forms.CheckBox): UpdateCheckBox(e.Key as System.Windows.Forms.CheckBox, e.Value as bool?); break; case nameof(System.Windows.Forms.ComboBox): UpdateComboBox(e.Key as System.Windows.Forms.ComboBox, e.Value as int?); break; case nameof(System.Windows.Forms.NumericUpDown): UpdateNumericUpDown(e.Key as System.Windows.Forms.NumericUpDown, e.Value as int?); break; case nameof(System.Windows.Forms.RadioButton): UpdateRadioButton(e.Key as System.Windows.Forms.RadioButton, e.Value as bool?); break; case nameof(System.Windows.Forms.TextBox): UpdateTextBox(e.Key as System.Windows.Forms.TextBox, e.Value as string); break; default: break; } }
public AdvanceDiagForm() { InitializeComponent(); UpdateControl.EnableElevateIcon(deleteConfigButton); }
private void updateRecord_Click(object sender, RoutedEventArgs e) { UpdateControl updateControl = new UpdateControl(); MainContentHolder.Content = updateControl; }