private void btnManagers_Click(object sender, EventArgs e) { Hide(); var managerListForm = new ManagerList(); managerListForm.ShowDialog(); Close(); }
private void vlButtonManage_Click(object sender, EventArgs e) { Button button = (Button)sender; ManagerInstance formInstance; ManagerList formList; ManagerDictionary formDictionary; MetaInstanceVariable metaInstanceVariable; switch (this.value.Type.CategoryType) { case ECategoryType.Integral: // can't happen break; case ECategoryType.Enum: // can't happen (for now) break; case ECategoryType.Class: for (int i = 0; i < this.value.Instance.InstanceVariables.Count; i++) { metaInstanceVariable = this.value.Instance.InstanceVariables[i]; if (button.Name == metaInstanceVariable.ToString()) { MetaValue value = metaInstanceVariable.Value; switch (value.Type.CategoryType) { case ECategoryType.Integral: // can't happen break; case ECategoryType.Class: formInstance = new ManagerInstance(this.repository, value.Type, value, metaInstanceVariable.Variable.Nullable); formInstance.Text = metaInstanceVariable.ToString(); formInstance.ShowDialog(); metaInstanceVariable.Value = formInstance.Value; break; case ECategoryType.List: formList = new ManagerList(this.repository, value.Type.SubType1, value.List); formList.Text = metaInstanceVariable.ToString(); formList.ShowDialog(); value.List = formList.ListValues; break; case ECategoryType.Dictionary: formDictionary = new ManagerDictionary(this.repository, value.Type.SubType1, value.Type.SubType2, value.Dictionary); formDictionary.Text = metaInstanceVariable.ToString(); formDictionary.ShowDialog(); value.Dictionary = formDictionary.DictionaryValues; break; } this.RefreshData(); break; } } break; case ECategoryType.List: formList = new ManagerList(this.repository, this.value.Type.SubType1, this.value.List); formList.Text = this.value.Type.GetNameWithModule(); formList.ShowDialog(); this.value.List = formList.ListValues; break; case ECategoryType.Dictionary: formList = new ManagerList(this.repository, this.value.Type.SubType1, this.value.List); formList.Text = this.value.Type.GetNameWithModule(); formList.ShowDialog(); this.value.List = formList.ListValues; break; } }