public void checkMyState() { bool fullyEdited = true; bool partlyEdited = false; foreach (FormItem item in FormItemList) { FormItemState state = EnumerationMatcher.StringToFormItemState(item.State); if (state == FormItemState.Edited) { partlyEdited = true; } if (state == FormItemState.Blank && item.Important) { fullyEdited = false; } } if (fullyEdited) { State = FormPageState.FullyEdited.ToString(); } else if (partlyEdited) { State = FormPageState.PartlyEdited.ToString(); } else { State = FormPageState.Disabled.ToString(); } }
public static FormItemState StringToFormItemState(String s) { try { FormItemState state = (FormItemState)Enum.Parse(typeof(FormItemState), s, true); return(state); } catch { Debug.WriteLine("Fehler beim Parsen von String zu FormItemState"); return(FormItemState.Disabled); } }
public FormItem setStateOfFormItem(String id, FormItemState state) { FormItem ItemExist = null; foreach (Form form in FormList) { ItemExist = form.setStateOfFormItem(id, state); if (ItemExist != null) { break; } } return(ItemExist); }
public bool setStateOfFormItem(String id, FormItemState state) { bool ItemExist = false; foreach (Form form in FormList) { ItemExist = form.setStateOfFormItem(id, state); if (ItemExist) { break; } } return(ItemExist); }
public FormItem setStateOfFormItem(String id, FormItemState state) { FormItem ItemExist = null; foreach (FormPage page in FormPageList) { ItemExist = page.setStateOfFormItem(id, state); checkMyState(); if (ItemExist != null) { break; } } return(ItemExist); }
public FormItem setStateOfFormItem(String id, FormItemState state) { FormItem ItemExist = null; foreach (FormItem item in FormItemList) { if (item.ID == id) { ItemExist = item; item.State = state.ToString(); checkMyState(); break; } } return(ItemExist); }
public void SetFillOutState(FormItemState state) { FillOutState = state; if ((Style)App.resources["ListPicker" + state.ToString()] != null) { this.Style = (Style)App.resources["ListPicker" + state.ToString()]; } foreach (TextBlock tb in AllChildren) { if ((Style)App.resources["List" + state.ToString()] != null) { Style style = (Style)App.resources["List" + state.ToString()]; tb.Style = style; foreach (Setter setter in style.Setters) { if (setter.Property == FrameworkElement.HeightProperty) { tb.Height = (double)setter.Value; } } } } }