/// <summary> /// Open and initialize a new sub-view of the given type using the given sub-model. /// </summary> /// <param name="type">Type of the new sub-view.</param> /// <param name="subModel">Sub-model of the new sub-view.</param> private void OpenView(Model.ChangeType type, ISubModel subModel) { ISubView subView = null; switch (type) { case Model.ChangeType.VCG: subView = new VoterCardGeneratorWindow((VoterCardGenerator)subModel); break; case Model.ChangeType.VBM: subView = new VoterBoxManagerWindow((VoterBoxManager)subModel); break; } subViews.Add(subView); if (SubViewOpened != null) { SubViewOpened(type, subView); } }
/// <summary> /// Open and initialize a new sub-view of the given type using the given sub-model. /// </summary> /// <param name="type">Type of the new sub-view.</param> /// <param name="subModel">Sub-model of the new sub-view.</param> private void OpenView(Model.ChangeType type, ISubModel subModel) { ISubView subView = null; switch (type) { case Model.ChangeType.VCG: subView = new VoterCardGeneratorWindow((VoterCardGenerator)subModel); break; case Model.ChangeType.VBM: subView = new VoterBoxManagerWindow((VoterBoxManager)subModel); break; } subViews.Add(subView); if (SubViewOpened != null) SubViewOpened(type, subView); }