public CreateVocabularyPresenter(ICreateVocabularyView createView, IVocabularyController vocabularyController, IScopeTypeController scopeTypeController) : base(createView) { Requires.NotNull("vocabularyController", vocabularyController); Requires.NotNull("scopeTypeController", scopeTypeController); _vocabularyController = vocabularyController; _scopeTypeController = scopeTypeController; View.Save += Save; View.Model.Vocabulary = GetVocabulary(); }
public static IScopeTypeController GetScopeTypeController() { IScopeTypeController ctl = ComponentFactory.GetComponent <IScopeTypeController>(); if (ctl == null) { ctl = new ScopeTypeController(); ComponentFactory.RegisterComponentInstance <IScopeTypeController>(ctl); } return(ctl); }
/// <summary> /// Gets the type of the scope. /// </summary> /// <param name="voc">The voc.</param> /// <param name="scopeTypeId">The scope type id.</param> /// <returns>scope type.</returns> internal static ScopeType GetScopeType(this Vocabulary voc, int scopeTypeId) { IScopeTypeController ctl = Util.GetScopeTypeController(); return(ctl.GetScopeTypes().Where(s => s.ScopeTypeId == scopeTypeId).SingleOrDefault()); }
static internal ScopeType GetScopeType(this Vocabulary voc, int scopeTypeId) { IScopeTypeController ctl = CommonLibrary.Entities.Content.Common.Util.GetScopeTypeController(); return(ctl.GetScopeTypes().Where(s => s.ScopeTypeId == scopeTypeId).SingleOrDefault()); }