/// <summary> /// Constructor /// </summary> /// <param name="memoDetail">MemoDetail, memo to be displayed in form</param> /// <param name="formState">FormState, describing the current form state</param> public MemoDetailForm(MemoDetail memoDetail, FormState formState) : this() { this.MemoDetail = memoDetail; this.originalMemoXML = TestController.SerializeXML(memoDetail, false); this.SetFormState(formState); switch (formState) { case FormState.NewMemo: { this.ctrlMemoDetail.CurrentMemostate = MemoDetailControl.MemoState.NewMemo; break; } case FormState.ViewMemo: { this.ctrlMemoDetail.CurrentMemostate = MemoDetailControl.MemoState.ViewMemo; break; } case FormState.EditMemo: { this.ctrlMemoDetail.CurrentMemostate = MemoDetailControl.MemoState.EditMemo; break; } } }
public ProductsPresenter(Products view) { productDAO = new productDAO(); cached = new List<Product>(); this.view = view; this.state = FormState.UPDATE_OLD; }
public TaskEditor(MainDataContexts dataContexts,FormState state=FormState.FormView,Guid? workId=null) { InitializeComponent(); _dataContexts = dataContexts; _state = state; _workId = workId.HasValue ? workId.Value : Guid.Empty; }
public AddOrEditClassForm(DBManager dbManag) { InitializeComponent(); mDBManager = dbManag; this.Text = FormTitles.ClassForm.Add; mFormState = FormState.AddingNew; RadListDataItem dropDownItem = new RadListDataItem("1"); dropDownItem.Value = 1; dropDownItem.Selected = true; gradeDropdownlist.Items.Add(dropDownItem); for (int i = 2; i <= 12; ++i) { dropDownItem = new RadListDataItem(i.ToString()); dropDownItem.Value = i; gradeDropdownlist.Items.Add(dropDownItem); } importTeachersFromTheDatabase(); changingHeadteacherReadyButton.Visible = false; teachersDropdownlist.Visible = false; changeHeadTeacherButton.Visible = false; changingHeadteacherReadyButton.Visible = true; teachersDropdownlist.Visible = true; colorPanel.BackColor = RandomColor.GetRandomColor(); gradeDropdownlist.DropDownStyle = RadDropDownStyle.DropDownList; teachersDropdownlist.DropDownStyle = RadDropDownStyle.DropDownList; }
public OptionsForm(FormState state) { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // State = state; ShowParticipant(); if (State == FormState.create) { EnableOK(this, null); } if (Conference.VenueServiceWrapper.VenueService.PrivacyPolicyUrl() != null) { linkPrivacyPolicy.Visible = true; linkPrivacyPolicy.Links.Add(0, 14, Conference.VenueServiceWrapper.VenueService.PrivacyPolicyUrl()); } }
public void FormUpdate(FormState state) { Clients.Client(Context.ConnectionId).formUpdated(state); if(state == FormState.Done) { GetJobsData(); } }
public EditPerson(MainDataContexts dataContexts,FormState state) { InitializeComponent(); _dataContexts = dataContexts; _state = state; if (state != FormState.New) throw new Exception("Invalid use of edit form [EditPerson]"); }
public void SetStateForm(FormState state) { if (state == FormState.inicial) { gvwDatos.Enabled = true; txtIdItemITE.ReadOnly = true; txtDescripcionITE.ReadOnly = true; txtDescripcionWebITE.ReadOnly = true; chkActivoWebITE.Enabled = false; btnBuscar.Enabled = true; btnNuevo.Enabled = true; btnEditar.Enabled = true; btnBorrar.Enabled = true; btnGrabar.Enabled = false; btnCancelar.Enabled = false; btnSalir.Enabled = true; DelEventosValidacion(); insertando = false; editando = false; txtParametros.Focus(); } if (state == FormState.insercion) { gvwDatos.Enabled = false; txtDescripcionITE.ReadOnly = false; txtDescripcionWebITE.ReadOnly = false; txtDescripcionWebITE.Clear(); chkActivoWebITE.Enabled = true; txtDescripcionITE.Clear(); txtDescripcionITE.Focus(); btnBuscar.Enabled = false; btnNuevo.Enabled = false; btnEditar.Enabled = false; btnBorrar.Enabled = false; btnGrabar.Enabled = false; btnCancelar.Enabled = true; btnSalir.Enabled = false; AddEventosValidacion(); insertando = true; } if (state == FormState.edicion) { gvwDatos.Enabled = false; txtDescripcionITE.ReadOnly = false; txtDescripcionWebITE.ReadOnly = false; chkActivoWebITE.Enabled = true; txtDescripcionITE.Focus(); btnBuscar.Enabled = false; btnNuevo.Enabled = false; btnEditar.Enabled = false; btnBorrar.Enabled = false; btnGrabar.Enabled = false; btnCancelar.Enabled = true; btnSalir.Enabled = false; AddEventosValidacion(); editando = true; } }
public void SetState(FormState state) { this.cameraImage = state.Bitmap; this._path = state.Path; Image old = this.cameraView.Image; this.cameraView.Image = state.Bitmap; if (state.Path.Count > 0 || state.RightSide.HasValue || state.LeftSide.HasValue) { Graphics g = Graphics.FromImage(cameraImage); if (state.Path.Count > 0) { Point? last = null; for (int i = 0; i < state.Path.Count; i++) { var p = state.Path[state.Path.Count - i - 1]; if (last != null) { g.DrawLine(_pen, last.Value, p); } if (i == state.Path.Count - 1) { g.FillEllipse(_ptFirstBrush, p.X - 10, p.Y - 10, 20, 20); } else { g.FillEllipse(_ptBrush, p.X - 10, p.Y - 10, 20, 20); } last = p; } } if (state.RightSide.HasValue) { g.FillEllipse(_rightBrush, state.RightSide.Value.X - 10, state.RightSide.Value.Y - 10, 20, 20); } if (state.LeftSide.HasValue) { g.FillEllipse(_leftBrush, state.LeftSide.Value.X - 10, state.LeftSide.Value.Y - 10, 20, 20); } } frames++; TimeSpan ts = DateTime.Now - _lastSecond; if (ts.TotalMilliseconds >= 1000) { fpsLabel.Text = string.Format("FPS: {0}", frames); _lastSecond = DateTime.Now; frames = 0; } // Dispose of the old bitmap to save memory // (It will be garbage collected eventually, but this is faster) if (old != null) { old.Dispose(); } }
public void loadProducts() { cached = productDAO.getList(); view.ClearFields(); view.displayProducts(cached); state = FormState.UPDATE_OLD; }
public EditPerson(MainDataContexts dataContexts, FormState state,Guid editId) { InitializeComponent(); _dataContexts = dataContexts; if (state!=FormState.Edit) throw new Exception("Invalid use of edit form [EditPerson]"); _state = state; _editId = editId; }
public void SetStateForm(FormState state) { if (state == FormState.inicial) { gvwDatos.Enabled = true; txtIdMovETIP.ReadOnly = true; txtIdMovETIP.BackColor = System.Drawing.SystemColors.ActiveCaptionText; txtDescripcionETIP.ReadOnly = true; txtDescripcionETIP.BackColor = System.Drawing.SystemColors.ActiveCaptionText; chkRemuneracionETIP.Enabled = false; if (tblEmpleadosMovTipos.Rows.Count == 0) { btnEditar.Enabled = false; btnBorrar.Enabled = false; } else { btnEditar.Enabled = true; btnBorrar.Enabled = true; } btnNuevo.Enabled = true; btnGrabar.Enabled = false; btnCancelar.Enabled = false; btnSalir.Enabled = true; DelEventosValidacion(); } if (state == FormState.insercion) { gvwDatos.Enabled = false; txtDescripcionETIP.ReadOnly = false; chkRemuneracionETIP.Enabled = true; chkRemuneracionETIP.CheckState = CheckState.Unchecked; txtDescripcionETIP.Clear(); txtDescripcionETIP.Focus(); btnNuevo.Enabled = false; btnEditar.Enabled = false; btnBorrar.Enabled = false; btnGrabar.Enabled = false; btnCancelar.Enabled = true; btnSalir.Enabled = false; AddEventosValidacion(); } if (state == FormState.edicion) { gvwDatos.Enabled = false; txtDescripcionETIP.ReadOnly = false; chkRemuneracionETIP.Enabled = true; txtDescripcionETIP.Focus(); btnNuevo.Enabled = false; btnEditar.Enabled = false; btnBorrar.Enabled = false; btnGrabar.Enabled = false; btnCancelar.Enabled = true; btnSalir.Enabled = false; AddEventosValidacion(); } }
public AddOrEditLessonForm(DBManager aDBManager) { InitializeComponent(); mFormState = FormState.AddingNew; mDBManager = aDBManager; this.Text = FormTitles.LessonForm.Add; addDefaultControlsInformationWhenAddingNew(); }
public Form1() { InitializeComponent(); SetupForm(); SetupHotKey(); var formState = new FormState(this, "KhebbieKeys"); SetupKeys(); SetupTimer(); }
public AddOrEditTeacherForm(DBManager aDBManager) { InitializeComponent(); mDBManager = aDBManager; mFormState = FormState.AddingNew; this.Text = FormTitles.TacherForm.Add; radioButtonFemale.IsChecked = true; groupboxColorPanelColor.BackColor = RandomColor.GetRandomColor(); }
public AddOrEditSubjectForm(DBManager aDBManager) { InitializeComponent(); mDBManager = aDBManager; mFormState = FormState.AddingNew; this.Text = FormTitles.SubjectForm.Add; barComplexity.Maximum = 3; barComplexity.Minimum = 1; barComplexity.TickFrequency = 1; groupboxColorPanelColor.BackColor = RandomColor.GetRandomColor(); }
/// <summary> /// Configure form /// </summary> /// <param name="formState">FormState, state to configure form</param> public void SetFormState(FormState formState) { switch (formState) { case FormState.NewFee: this.btnSave.Visible = true; this.btnSave.Enabled = true; break; case FormState.ViewFee: this.btnSave.Visible = false; this.btnSave.Enabled = false; break; } }
/// <summary> /// Constructor /// </summary> /// <param name="feeDetail"></param> /// <param name="formState"></param> public DocumentInfoFeesForm(FeeDetail feeDetail, FormState formState) : this() { this.FeeDetail = feeDetail; this.SetFormState(formState); switch (formState) { case FormState.NewFee: this.ctrlFeeDetail.SetControlState(FeeDetailControl.ControlState.NewFee); break; case FormState.ViewFee: this.ctrlFeeDetail.SetControlState(FeeDetailControl.ControlState.ViewFee); break; } }
/// <summary> /// Constructor /// </summary> /// <param name="nameDetail"></param> /// <param name="formState"></param> public DocumentInfoNamesForm(NameDetail nameDetail, FormState formState) : this() { this.NameDetail = nameDetail; this.SetFormState(formState); switch (formState) { case FormState.NewName: this.ctrlNameDetail.SetControlState(NameDetailControl.ControlState.NewName); break; case FormState.ViewName: this.ctrlNameDetail.SetControlState(NameDetailControl.ControlState.ViewName); break; } }
public void SetStateForm(FormState state) { if (state == FormState.inicial) { gvwDatos.Enabled = true; txtPorcentajeALI.ReadOnly = true; txtPorcentajeALI.BackColor = System.Drawing.SystemColors.ActiveCaptionText; btnNuevo.Enabled = true; btnEditar.Enabled = true; btnBorrar.Enabled = true; btnGrabar.Enabled = false; btnCancelar.Enabled = false; btnSalir.Enabled = true; DelEventosValidacion(); gvwDatos.Focus(); } if (state == FormState.insercion) { gvwDatos.Enabled = false; txtIdAlicuotaALI.ReadOnly = false; txtPorcentajeALI.ReadOnly = false; txtPorcentajeALI.Clear(); txtIdAlicuotaALI.Focus(); btnNuevo.Enabled = false; btnEditar.Enabled = false; btnBorrar.Enabled = false; btnGrabar.Enabled = false; btnCancelar.Enabled = true; btnSalir.Enabled = false; AddEventosValidacion(); } if (state == FormState.edicion) { gvwDatos.Enabled = false; txtIdAlicuotaALI.ReadOnly = false; txtPorcentajeALI.ReadOnly = false; txtIdAlicuotaALI.Focus(); btnNuevo.Enabled = false; btnEditar.Enabled = false; btnBorrar.Enabled = false; btnGrabar.Enabled = false; btnCancelar.Enabled = true; btnSalir.Enabled = false; AddEventosValidacion(); } }
private async void DoLogin() { if (_currentState == FormState.LoggedOut) { _currentState = FormState.LoggingIn; } else { _currentState = FormState.LoggedOut; _username = ""; _password = ""; PasswordVaultWrapper.Clear(); } NotifyStateChange(); if (_currentState == FormState.LoggingIn) { _errorMessage = ""; bool didSucceed = false; try { didSucceed = await _dataService.LoginAsync(_username, _password); if (!didSucceed) { _errorMessage = (string)Application.Current.Resources["Error_AuthFailed"]; _password = ""; } } catch (RedditApiException) { _errorMessage = (string)Application.Current.Resources["Error_ConnFailed"]; } if (didSucceed) { PasswordVaultWrapper.Store(_username, _password); _currentState = FormState.LoggedIn; } else { _currentState = FormState.LoggedOut; } NotifyStateChange(); } }
public AddOrEditClassroomForm(DBManager dbManage, long aID) { InitializeComponent(); mDBManager = dbManage; mID = aID; this.Text = FormTitles.ClassroomForm.Edit; mFormState = FormState.Editing; var room = from r in mDBManager.Classrooms where r.ID == aID select r; mClassroom = room.FirstOrDefault(); nameTextbox.Text = mClassroom.Name; shortNameTextbox.Text = mClassroom.ShortName; if (mClassroom.Color != Color.Empty) { panelClassroomColor.BackColor = mClassroom.Color; } else { panelClassroomColor.BackColor = RandomColor.GetRandomColor(); } isHomeClassroomCheckbox.Checked = mClassroom.IsHomeClassroom; this.mHomeClassID = mClassroom.HomeClassID; isSpecializedRoomCheckbox.Checked = mClassroom.IsSpecialisated; specialisatedSubjectsIDs = mClassroom.SpecialisatedSubjectsIDs; if (isSpecializedRoomCheckbox.Checked == true) { chooseSubjectsToBeTaughtInThisRoomButton.Visible = true; } else { chooseSubjectsToBeTaughtInThisRoomButton.Visible = false; } if (isHomeClassroomCheckbox.Checked == true) { chooseHeadclassOfThisClassroom.Visible = true; } else { chooseHeadclassOfThisClassroom.Visible = false; } }
public AddOrEditClassroomForm(DBManager dbManage) { InitializeComponent(); mDBManager = dbManage; this.Text = FormTitles.ClassroomForm.Add; mFormState = FormState.AddingNew; chooseHeadclassOfThisClassroom.Visible = false; chooseSubjectsToBeTaughtInThisRoomButton.Visible = false; isSpecializedRoomCheckbox.Checked = false; isHomeClassroomCheckbox.Checked = false; panelClassroomColor.BackColor = RandomColor.GetRandomColor(); }
public void filterWith(String part) { state = FormState.UPDATE_OLD; part = part.ToLower(); List<Product> result = new List<Product>(); foreach (Product p in cached) { if (p.description.ToLower().Contains(part)) { result.Add(p); } } view.ClearFields(); view.displayProducts(result); }
public AddOrEditSubjectForm(DBManager aDBManager, long aID) { InitializeComponent(); mDBManager = aDBManager; mID = aID; mFormState = FormState.Editing; this.Text = FormTitles.SubjectForm.Edit; foreach (var subject in mDBManager.Subjects) { if (subject.ID == aID) { mSubject = subject; break; } } textboxName.Text = mSubject.Name; textboxShortName.Text = mSubject.ShortName; if (mSubject.Color != Color.Empty) { groupboxColorPanelColor.BackColor = mSubject.Color; } else { groupboxColorPanelColor.BackColor = RandomColor.GetRandomColor(); } switch (mSubject.Difficulty) { case RelativeSubjectDifficulty.Low: barComplexity.Value = 1; break; case RelativeSubjectDifficulty.Normal: barComplexity.Value = 2; break; case RelativeSubjectDifficulty.High: barComplexity.Value = 3; break; } barComplexity.Maximum = 3; barComplexity.Minimum = 1; barComplexity.TickFrequency = 1; }
public void SetStateForm(FormState state) { if (state == FormState.inicial) { gvwDatos.Enabled = true; txtDescripcionART.ReadOnly = true; txtDescripcionART.BackColor = System.Drawing.SystemColors.ActiveCaptionText; btnBuscar.Enabled = true; btnNuevo.Enabled = true; btnEditar.Enabled = true; btnBorrar.Enabled = true; btnGrabar.Enabled = false; btnCancelar.Enabled = false; btnSalir.Enabled = true; txtParametros.Focus(); } if (state == FormState.insercion) { gvwDatos.Enabled = false; txtDescripcionART.ReadOnly = false; txtDescripcionART.Clear(); txtDescripcionART.Focus(); btnBuscar.Enabled = false; btnNuevo.Enabled = false; btnEditar.Enabled = false; btnBorrar.Enabled = false; btnGrabar.Enabled = false; btnCancelar.Enabled = true; btnSalir.Enabled = false; } if (state == FormState.edicion) { gvwDatos.Enabled = false; txtDescripcionART.ReadOnly = false; txtDescripcionART.Focus(); btnBuscar.Enabled = false; btnNuevo.Enabled = false; btnEditar.Enabled = false; btnBorrar.Enabled = false; btnGrabar.Enabled = false; btnCancelar.Enabled = true; btnSalir.Enabled = false; } }
public void SetStateForm(FormState state) { if (state == FormState.inicial) { gvwDatos.Enabled = true; txtIdCondicionIvaCIVA.ReadOnly = true; txtDescripcionCIVA.ReadOnly = true; btnNuevo.Enabled = true; btnEditar.Enabled = true; btnBorrar.Enabled = true; btnGrabar.Enabled = false; btnCancelar.Enabled = false; btnSalir.Enabled = true; DelEventosValidacion(); gvwDatos.Focus(); } if (state == FormState.insercion) { gvwDatos.Enabled = false; txtDescripcionCIVA.ReadOnly = false; txtDescripcionCIVA.Clear(); txtDescripcionCIVA.Focus(); btnNuevo.Enabled = false; btnEditar.Enabled = false; btnBorrar.Enabled = false; btnGrabar.Enabled = false; btnCancelar.Enabled = true; btnSalir.Enabled = false; AddEventosValidacion(); } if (state == FormState.edicion) { gvwDatos.Enabled = false; txtDescripcionCIVA.ReadOnly = false; txtDescripcionCIVA.Focus(); btnNuevo.Enabled = false; btnEditar.Enabled = false; btnBorrar.Enabled = false; btnGrabar.Enabled = false; btnCancelar.Enabled = true; btnSalir.Enabled = false; AddEventosValidacion(); } }
private void formStateUpdate(FormState state) { switch (state) { case FormState.Wait: getButton.Text = "获取"; progressPanel.Visible = false; typeCheckedListBox.Enabled = true; quickSelect.Enabled = true; break; case FormState.Running: getButton.Text = "取消"; typeCheckedListBox.Enabled = false; progressPanel.Visible = true; quickSelect.Enabled = false; break; } }
public void SetStateForm(FormState state) { if (state == FormState.inicial) { txtIdRazonSocialRAZ.ReadOnly = true; txtRazonSocialRAZ.ReadOnly = true; txtPuntoVentaRAZ.ReadOnly = true; txtNombreFantasiaRAZ.ReadOnly = true; txtDomicilioRAZ.ReadOnly = true; txtLocalidadRAZ.ReadOnly = true; txtProvinciaRAZ.ReadOnly = true; cmbIdCondicionIvaRAZ.Enabled = false; txtCuitRAZ.ReadOnly = true; txtIngresosBrutosRAZ.ReadOnly = true; txtInicioActividadRAZ.ReadOnly = true; txtCorreoRAZ.ReadOnly = true; cmbIdCondicionIvaRAZ.BackColor = System.Drawing.SystemColors.ActiveCaptionText; btnEditar.Enabled = true; btnGrabar.Enabled = false; btnCancelar.Enabled = false; btnSalir.Enabled = true; } if (state == FormState.edicion) { txtRazonSocialRAZ.ReadOnly = false; txtNombreFantasiaRAZ.ReadOnly = false; txtPuntoVentaRAZ.ReadOnly = false; txtDomicilioRAZ.ReadOnly = false; txtLocalidadRAZ.ReadOnly = false; txtProvinciaRAZ.ReadOnly = false; cmbIdCondicionIvaRAZ.Enabled = true; txtCuitRAZ.ReadOnly = false; txtIngresosBrutosRAZ.ReadOnly = false; txtInicioActividadRAZ.ReadOnly = false; txtCorreoRAZ.ReadOnly = false; btnEditar.Enabled = false; btnGrabar.Enabled = false; btnCancelar.Enabled = true; btnSalir.Enabled = false; txtRazonSocialRAZ.Focus(); } }
public SettingsViewModel(IRedditApi dataService) { _dataService = dataService; if (PasswordVaultWrapper.IsStored()) { _currentState = FormState.LoggedIn; _username = PasswordVaultWrapper.GetUsername(); _password = PasswordVaultWrapper.GetPassword(); } else { _currentState = FormState.LoggedOut; _username = ""; _password = ""; } Login = new RelayCommand(DoLogin, () => { return _currentState != FormState.LoggingIn; }); }