/// <summary> /// Set the modify state to the specified state. /// </summary> /// <param name="modifyState">The required modify state.</param> protected override void SetModifyState(ModifyState modifyState) { base.SetModifyState(modifyState); switch (m_ModifyState) { case ModifyState.Configure: Text = Resources.TitleConfigureFaultLogParameters; break; case ModifyState.Edit: Text = Resources.TitleEditFaultLogWorksets; break; case ModifyState.Create: Text = Resources.TitleCreateFaultLogWorkset; break; case ModifyState.Copy: Text = Resources.TitleCopyFaultLogWorkset; break; case ModifyState.Rename: Text = Resources.TitleRenameFaultLogWorkset; break; default: break; } m_NumericUpDownSampleMultiple.Enabled = ModifyEnabled; }
public virtual async Task WinsAsync(ModifyState state, int amount, params SocketGuildUser[] users) { using (var db = new Database()) { var userIds = users.Select(x => x.Id).ToArray(); var players = db.Players.Where(x => x.GuildId == Context.Guild.Id && userIds.Contains(x.UserId)); var responseString = ""; foreach (var player in players) { var original = player.Wins; if (state == ModifyState.Set) { player.Wins = amount; } else if (state == ModifyState.Modify) { player.Wins += amount; } else { throw new InvalidOperationException("Unknown modify state"); } responseString += $"{player.GetDisplayNameSafe()}: {original} => {player.Wins}\n"; } db.UpdateRange(players); db.SaveChanges(); await SimpleEmbedAsync(responseString, Color.Blue); } }
/// <summary> /// Set the modify state to the specified state. /// </summary> /// <param name="modifyState">The required modify state.</param> protected override void SetModifyState(ModifyState modifyState) { base.SetModifyState(modifyState); switch (m_ModifyState) { case ModifyState.Configure: Text = Resources.TitleConfigureChartRecorder; break; case ModifyState.Edit: Text = Resources.TitleEditChartRecorderWorkset; break; case ModifyState.Create: Text = Resources.TitleCreateChartRecorderWorkset; break; case ModifyState.Copy: Text = Resources.TitleCopyChartRecorderWorkset; break; case ModifyState.Rename: Text = Resources.TitleRenameChartRecorderWorkset; break; default: break; } }
private void GetRandomAbilities(int[] abils, ModifyState setting) { switch (setting) { case ModifyState.All: GetRandomAbilities(abils); break; case ModifyState.Two when Rand.Next(100) < Settings.InheritAbilityNeitherChance: GetRandomAbilities(abils, 1); break; case ModifyState.Two when Rand.Next(100) < Settings.InheritAbilityOnlyOneChance: case ModifyState.One when Rand.Next(100) < Settings.InheritAbilityOnlyOneChance: GetRandomAbilities(abils, 2); break; } if (Rand.Next(100) < Settings.SameAbilityChance) { int index = Rand.Next(2); abils[index ^ 1] = abils[index]; } }
public void Setup() { this.gameObject = new GameObject(); this.gameObject.AddComponent <MetaBody>(); this.gameObject.AddComponent <BuildingPlane>(); this.stateContext = new StateContext(); this.modifyState = new ModifyState(this.stateContext, this.gameObject); this.stateContext.SetState(this.modifyState); }
public void btnModify_Click(object sender, EventArgs e) { removeAllManagamentControls(); switch (this.Mantenimiento) { case "Users": ModifyUser modifyUser = new ModifyUser(); Parent.Controls.Add(modifyUser); break; case "Clients": ModifyClient modifyClient = new ModifyClient(); Parent.Controls.Add(modifyClient); break; case "States": ModifyState modifyState = new ModifyState(); Parent.Controls.Add(modifyState); break; case "PaymentMethods": ModifyPaymentMethod modifyPaymentMethod = new ModifyPaymentMethod(); Parent.Controls.Add(modifyPaymentMethod); break; case "MaterialTypes": ModifyMaterialType modifyMaterialType = new ModifyMaterialType(); Parent.Controls.Add(modifyMaterialType); break; case "Materials": ModifyMaterial modifyMaterial = new ModifyMaterial(); Parent.Controls.Add(modifyMaterial); break; case "ProductTypes": ModifyProductType modifyProductType = new ModifyProductType(); Parent.Controls.Add(modifyProductType); break; case "Products": ModifyProduct modifyProduct = new ModifyProduct(); Parent.Controls.Add(modifyProduct); break; case "Providers": EditProvider edP = new EditProvider(); Parent.Controls.Add(edP); break; } }
private void LoadObjects() { try { if (Filter.FilterByPeriod) { if (DateFrom > DateTo) { var date = DateTo; DateTo = DateFrom; DateFrom = date; } } String user = Filter.FilterByUser ? User : String.Empty; String featureClass = Filter.FilterByFeatureClass ? FeatureClass : String.Empty; ModifyState state = Filter.FilterByState ? State : ModifyState.None; Int64 featureFid = Filter.FilterByFid ? FeatureFid : 0; ModificationInfoDTO minfoDTO; if (!Filter.FilterByPeriod) { minfoDTO = _analyzeService.GetModificationInfos(CurrentPage, featureFid, user, featureClass, state); } else { minfoDTO = _analyzeService.GetModificationInfos(DateFrom, DateTo, CurrentPage, featureFid, user, featureClass, state); } TotalCount = minfoDTO.TotalCount; ModificationInfos = new ObservableCollection <ModificationInfo>(minfoDTO.Infos); TotalCount = minfoDTO.TotalCount; TotalPageCount = TotalCount / _analyzeService.PageSize; UpdateNavigate(); } catch (Exception ex) { Messenger.Default.Send(ex); } }
public TradeOperate(T_Question_Collection item, ModifyState isModify) { InitializeComponent(); this.SetViewModelValue("Question_Collection", item); this.SetViewModelValue("ModifyOrAdd", isModify); }
/// <summary> /// Set the modify state to the specified state. /// </summary> /// <param name="modifyState">The required modify state.</param> protected override void SetModifyState(ModifyState modifyState) { // Skip, if the Dispose() method has been called. if (IsDisposed) { return; } base.SetModifyState(modifyState); if (m_ModifyState == ModifyState.Configure) { // Restore the ToolTipText properties of the ToolStripButtons. UpdateFunctionKey(m_TSBEdit, string.Empty, Resources.FunctionKeyToolTipWatchWindowConfigure, null); UpdateFunctionKey(m_TSBNew, string.Empty, Resources.FunctionKeyToolTipWatchWindowCreate, null); UpdateFunctionKey(m_TSBCopy, string.Empty, Resources.FunctionKeyToolTipWatchWindowCopy, null); UpdateFunctionKey(m_TSBRename, string.Empty, Resources.FunctionKeyToolTipWatchWindowRename, null); UpdateFunctionKey(m_TSBDelete, string.Empty, Resources.FunctionKeyToolTipWatchWindowDelete, null); UpdateFunctionKey(m_TSBSetAsDefault, string.Empty, Resources.FunctionKeyToolTipWatchWindowSetAsDefault, null); UpdateFunctionKey(m_TSBOverrideSecurity, string.Empty, Resources.FunctionKeyToolTipWatchWindowOverrideSecurity, null); } else { switch (m_ModifyState) { case ModifyState.Configure: break; case ModifyState.Edit: UpdateFunctionKey(m_TSBEdit, string.Empty, Resources.FunctionKeyToolTipWatchWindowConfigureUndo, null); break; case ModifyState.Create: UpdateFunctionKey(m_TSBNew, string.Empty, Resources.FunctionKeyToolTipWatchWindowCreateUndo, null); break; case ModifyState.Copy: UpdateFunctionKey(m_TSBCopy, string.Empty, Resources.FunctionKeyToolTipWatchWindowCopyUndo, null); break; case ModifyState.Rename: UpdateFunctionKey(m_TSBRename, string.Empty, Resources.FunctionKeyToolTipWatchWindowRenameUndo, null); break; case ModifyState.Delete: UpdateFunctionKey(m_TSBDelete, string.Empty, Resources.FunctionKeyToolTipWatchWindowDeleteUndo, null); break; case ModifyState.SetAsDefault: UpdateFunctionKey(m_TSBSetAsDefault, string.Empty, Resources.FunctionKeyToolTipWatchWindowSetAsDefaultUndo, null); break; case ModifyState.OverrideSecurity: UpdateFunctionKey(m_TSBOverrideSecurity, string.Empty, Resources.FunctionKeyToolTipWatchWindowOverrideSecurityUndo, null); break; default: break; } } }
public ThExamQuestionEdit(TBL_TH_QUESTION_EXT question, ModifyState flag) { InitializeComponent(); this.SetViewModelValue("Question_Trans", question); this.SetViewModelValue("OperateType", flag); }
public ThExamQuestionEdit(ModifyState flag) { InitializeComponent(); this.SetViewModelValue("OperateType", flag); }
public ThQuGroupEdit(TBL_TH_QuGroup_Ext numberinput, ModifyState flag) { InitializeComponent(); this.SetViewModelValue("TBL_TH_QuGroup_Ext", numberinput); this.SetViewModelValue("OperateFlag", flag); }
public ModificationInfo CreateFeatureModificationInfo(String currentUserName, ModifyState state, long fid, string featureClassName, string featureClassCaption) { var modifyInfo = new ModificationInfo { FID = fid, FeatureClass = featureClassName, FeatureClassCaption = featureClassCaption, ModifyTime = DateTime.Now, UserName = currentUserName, State = state }; return(modifyInfo); }
public ThExamEdit(ModifyState flag) { InitializeComponent(); this.SetViewModelValue("OperateFlag", flag); }
public ThQuTypeEdit(TBL_TH_QUTYPE numberinput, ModifyState flag) { InitializeComponent(); this.SetViewModelValue("QuestionTypeName", numberinput); this.SetViewModelValue("OperateType", flag); }
public ModificationInfoDTO GetModificationInfos(DateTime dateFrom, DateTime dateTo, int pageNumber, Int64 featureFid = 0, String user = "", String featureClass = "", ModifyState state = ModifyState.None) { using (var client = new FeatureLogServiceClient("BasicHttpBinding_IFeatureLogService")) { var dto = client.GetFeatureModifyInfosInPeriod(featureFid, user, state, featureClass, dateFrom, dateTo, pageNumber * PageSize, PageSize); return(dto); } }
public TradeFieldPage(T_Trade_Sta_Ext item, ModifyState isModify) { InitializeComponent(); this.SetViewModelValue("Trade_Sta_Ext", item); this.SetViewModelValue("ModifyOrAdd", isModify); }
public SkillExamEdit(TY_SKILLEXAM skillexam, ModifyState flag) { InitializeComponent(); this.SetViewModelValue("OldInfos", skillexam); this.SetViewModelValue("OperateFlag", flag); }
/// <summary> /// Set the modify state to the specified state. /// </summary> /// <param name="modifyState">The required modify state.</param> protected override void SetModifyState(ModifyState modifyState) { // Skip, if the Dispose() method has been called. if (IsDisposed) { return; } base.SetModifyState(modifyState); if (m_ModifyState == ModifyState.Configure) { // Restore the ToolTipText properties of the ToolStripButtons. UpdateFunctionKey(m_TSBEdit, string.Empty, Resources.FunctionKeyToolTipDataStreamConfigure, null); UpdateFunctionKey(m_TSBNew, string.Empty, Resources.FunctionKeyToolTipDataStreamCreate, null); UpdateFunctionKey(m_TSBCopy, string.Empty, Resources.FunctionKeyToolTipDataStreamCopy, null); UpdateFunctionKey(m_TSBRename, string.Empty, Resources.FunctionKeyToolTipDataStreamRename, null); UpdateFunctionKey(m_TSBDelete, string.Empty, Resources.FunctionKeyToolTipDataStreamDelete, null); UpdateFunctionKey(m_TSBSetAsDefault, string.Empty, Resources.FunctionKeyToolTipDataStreamSetAsDefault, null); UpdateFunctionKey(m_TSBOverrideSecurity, string.Empty, Resources.FunctionKeyToolTipDataStreamOverrideSecurity, null); m_NumericUpDownSampleMultiple.Enabled = ModifyEnabled; m_TSBUpload.Enabled = ((ConfigurationModified() == true) && (CommunicationInterface != null)) ? true : false; } else { switch (m_ModifyState) { case ModifyState.Configure: break; case ModifyState.Edit: UpdateFunctionKey(m_TSBEdit, string.Empty, Resources.FunctionKeyToolTipDataStreamConfigureUndo, null); break; case ModifyState.Create: UpdateFunctionKey(m_TSBNew, string.Empty, Resources.FunctionKeyToolTipDataStreamCreateUndo, null); break; case ModifyState.Copy: UpdateFunctionKey(m_TSBCopy, string.Empty, Resources.FunctionKeyToolTipDataStreamCopyUndo, null); break; case ModifyState.Rename: UpdateFunctionKey(m_TSBRename, string.Empty, Resources.FunctionKeyToolTipDataStreamRenameUndo, null); break; case ModifyState.Delete: UpdateFunctionKey(m_TSBDelete, string.Empty, Resources.FunctionKeyToolTipDataStreamDeleteUndo, null); break; case ModifyState.SetAsDefault: UpdateFunctionKey(m_TSBSetAsDefault, string.Empty, Resources.FunctionKeyToolTipDataStreamSetAsDefaultUndo, null); break; case ModifyState.OverrideSecurity: UpdateFunctionKey(m_TSBOverrideSecurity, string.Empty, Resources.FunctionKeyToolTipDataStreamOverrideSecurityUndo, null); break; default: break; } m_NumericUpDownSampleMultiple.Enabled = ModifyEnabled; // Disable the Upload button. m_TSBUpload.Enabled = false; } }
/// <summary> /// Set the modify state to the specified state. /// </summary> /// <remarks>The Enabled property of the menu option that allows the user to modify the Y axis limits of the individual chart recorder channels is linked /// directly to the ModifyEnabled property of the parent class.</remarks> /// <param name="modifyState">The required modify state.</param> protected virtual void SetModifyState(ModifyState modifyState) { m_ModifyState = modifyState; if (m_ModifyState == ModifyState.Configure) { ClearCheckedEditNewCopyRename(); ModifyEnabled = false; SetEnabledEditNewCopyRename(true); // Load the previously selected workset. LoadWorkset(m_SelectedWorkset); // Display the name of the previously selected workset. // Ensure that the TextChanged event is not triggered as a result of specifying the Text property of the TextBox control. m_TextBoxName.TextChanged -= new EventHandler(m_TextBoxName_TextChanged); m_TextBoxName.Text = m_SelectedWorkset.Name; m_TextBoxName.TextChanged += new EventHandler(m_TextBoxName_TextChanged); // Don't allow the user to change the name of the workset. m_TextBoxName.Visible = false; m_TextBoxName.Enabled = false; m_ComboBoxWorkset.Visible = true; // Use the ComboBox as the source of the workset name if it is saved. m_UseTextBoxAsNameSource = false; // Show the security level of the current user. m_TextBoxSecurityLevel.Text = Security.GetSecurityDescription(m_SelectedWorkset.SecurityLevel); if (ConfigurationModified() == true) { m_TSBDownload.Enabled = true; } else { m_TSBDownload.Enabled = false; } } else { // Disable the New, Copy, Edit, Delete and Rename buttons. SetEnabledEditNewCopyRename(false); // Disable the Download button. m_TSBDownload.Enabled = false; // Use the TextBox as the source of the workset name if it is saved. m_UseTextBoxAsNameSource = true; switch (modifyState) { case ModifyState.Rename: m_TSBRename.Checked = true; m_CreateMode = false; ModifyEnabled = false; // Enable the Rename button. m_TSBRename.Enabled = true; // Allow the user to save the name change. m_TSBSave.Enabled = true; // Allow the user to edit the workset name. m_TextBoxName.Visible = true; m_TextBoxName.Enabled = true; m_ComboBoxWorkset.Visible = false; break; case ModifyState.Create: m_TSBNew.Checked = true; m_CreateMode = true; ModifyEnabled = true; // Enable the New button. m_TSBNew.Enabled = true; // Display the default name for a new workset. // Ensure that the TextChanged event is not triggered as a result of specifying the Text property of the TextBox control. m_TextBoxName.TextChanged -= new EventHandler(m_TextBoxName_TextChanged); m_TextBoxName.Text = Resources.NameNewWorksetDefault; m_TextBoxName.TextChanged += new EventHandler(m_TextBoxName_TextChanged); // Allow the user to edit the workset name. m_TextBoxName.Visible = true; m_TextBoxName.Enabled = true; m_ComboBoxWorkset.Visible = false; // Show the security level of the current user. m_TextBoxSecurityLevel.Text = Security.Description; CreateNewWorkset(); break; case ModifyState.Edit: m_TSBEdit.Checked = true; m_CreateMode = false; ModifyEnabled = true; // Enable the Edit button. m_TSBEdit.Enabled = true; // Display the workset name, however, don't allow the user to edit the name. m_TextBoxName.Visible = true; m_ComboBoxWorkset.Visible = false; break; case ModifyState.Copy: m_TSBCopy.Checked = true; m_CreateMode = true; ModifyEnabled = true; // Enable the Copy button. m_TSBCopy.Enabled = true; // Display the default name of the copied workset. // Ensure that the TextChanged event is not triggered as a result of specifying the Text property of the TextBox control. m_TextBoxName.TextChanged -= new EventHandler(m_TextBoxName_TextChanged); m_TextBoxName.Text = string.Format(Resources.NameWorksetCopy, m_SelectedWorkset.Name); m_TextBoxName.TextChanged += new EventHandler(m_TextBoxName_TextChanged); // Allow the user to edit the workset name. m_TextBoxName.Visible = true; m_TextBoxName.Enabled = true; m_ComboBoxWorkset.Visible = false; // Show the security level of the current user. m_TextBoxSecurityLevel.Text = Security.Description; break; default: break; } } // The Enabled property of the menu option that allows the user to modify the Y axis limits of the individual chart recorder channels is linked // directly to the Enabled property of the ModifyEnabled property of the parent class. m_MenuItemChangeChartScaleFactor.Enabled = ModifyEnabled; ClearStatusMessage(); }
public InvEdit(T_INVIGILATE item, ModifyState isModeify) { InitializeComponent(); this.SetViewModelValue("Tbl_Th_Invigilate", item); this.SetViewModelValue("IsModify", isModeify); }
public AddAdmin(T_Administrator adminInfo, ModifyState flag) { InitializeComponent(); this.SetViewModelValue("AdminInfo", adminInfo); this.SetViewModelValue("OperateFlag", flag); }
public ModificationInfo CreateFeatureModificationInfo(String currentUserName, ModifyState state, long fid, string featureClassName, Feature feature) { var modifyInfo = CreateFeatureModificationInfo(currentUserName, state, fid, featureClassName, feature.FeatureClass.Caption); var semanticsInfo = CreateSemanticsModificationInfo(feature); modifyInfo.SemanticsInfo = semanticsInfo.ToArray(); var geometryInfo = CreateGeometryModificationInfo(feature); modifyInfo.GeometryInfo = geometryInfo; return(modifyInfo); }
public virtual async Task WinsAsync(SocketGuildUser user, ModifyState state, int amount) { await WinsAsync(state, amount, user); }
public ThExamEdit(TBL_TH_EXAM thExam, ModifyState flag) { InitializeComponent(); this.SetViewModelValue("ThExamInfo", thExam); this.SetViewModelValue("OperateFlag", flag); }
public ThExamTempEdit(TBL_TH_TEMPLATE item, ModifyState isModeify) { InitializeComponent(); this.SetViewModelValue("Tbl_Th_Template", item); this.SetViewModelValue("IsModify", isModeify); }
public ModificationInfoDTO GetFeatureModifyInfos(long featureFid, String user, ModifyState state, String featureClass, int skipCount, int takeCount) { var modifyInfos = string.IsNullOrEmpty(user) ? _repositoryModificationInfo.FindAll() : _repositoryModificationInfo.FindAll(x => x.UserName == user); if (featureFid > 0) { modifyInfos = modifyInfos.Where(x => x.FID == featureFid); } if (state != ModifyState.None) { modifyInfos = modifyInfos.Where(x => x.State == state); } if (!String.IsNullOrEmpty(featureClass)) { modifyInfos = modifyInfos.Where(x => x.FeatureClass == featureClass); } var count = modifyInfos.Count(); modifyInfos = modifyInfos.OrderByDescending(x => x.ID) .Skip(skipCount) .Take(takeCount); return(new ModificationInfoDTO { TotalCount = count, Infos = modifyInfos.ToList() }); }
public AddAdmin(ModifyState flag) { InitializeComponent(); this.SetViewModelValue("OperateFlag", flag); }