Пример #1
0
        /// <summary>
        ///     Retrieves a specific <see cref="!:SystemMenuModel" /> instance.
        /// </summary>
        /// <param name="id">
        ///     The unique value which distinctly identifies the <see cref="!:SystemMenuModel" /> instance to be returned.
        /// </param>
        /// <returns>
        ///     The <see cref="!:SystemMenuModel" /> instance that matches the specified <paramref name="id" />; or null, if no matching instance can be found.
        /// </returns>
        public static Consensus.UserInterface.SystemMenu FetchById(ConsensusSite site, System.Int32 id)
        {
            IBusinessProvider provider = site.GetService <IBusinessProvider>();

            Consensus.UserInterface.ISystemMenuModel model = provider.UserInterface.SystemMenu.FetchById(id);
            return(model == null ? null : new Consensus.UserInterface.SystemMenu(model));
        }
Пример #2
0
        /// <summary>
        ///     Creates a new <see cref="!:SystemMenuModel" /> instance.
        /// </summary>
        /// <returns>
        ///     A newly instantiated <see cref="!:SystemMenuModel" /> instance.
        /// </returns>
        public static Consensus.UserInterface.SystemMenu Create(ConsensusSite site)
        {
            IBusinessProvider provider = site.GetService <IBusinessProvider>();

            Consensus.UserInterface.ISystemMenuModel model = provider.UserInterface.SystemMenu.Create();
            return(model == null ? null : new Consensus.UserInterface.SystemMenu(model));
        }