當前位置: 首頁>>代碼示例>>C#>>正文


C# Business.Module類代碼示例

本文整理匯總了C#中mojoPortal.Business.Module的典型用法代碼示例。如果您正苦於以下問題:C# Module類的具體用法?C# Module怎麽用?C# Module使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Module類屬於mojoPortal.Business命名空間,在下文中一共展示了Module類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: InstallContent

 public void InstallContent(Module module, string configInfo)
 {
     foreach (var node in mysettings)
     {
         ModuleSettings.UpdateModuleSetting(module.ModuleGuid, module.ModuleId, node.Key, node.Value);
     }
 }
開發者ID:vzrus,項目名稱:YAF-and-MojoPortal-Add-Ons,代碼行數:7,代碼來源:YafActiveDiscussionsContentInstaller.cs

示例2: LoadSettings

        private void LoadSettings()
        {
            moduleSettings = ModuleSettings.GetModuleSettings(moduleId);
            config = new BlogConfiguration(moduleSettings);

            blogModule = GetModule(moduleId, Blog.FeatureGuid);

            postList.ModuleId = moduleId;
            postList.PageId = pageId;
            postList.DisplayMode = "ByMonth";
            postList.IsEditable = UserCanEditModule(moduleId, Blog.FeatureGuid);
            postList.Config = config;
            postList.SiteRoot = SiteRoot;
            postList.ImageSiteRoot = ImageSiteRoot;

            if (config.InstanceCssClass.Length > 0) { pnlOuterWrap.SetOrAppendCss(config.InstanceCssClass); }

            LoadSideContent(config.ShowLeftContent, config.ShowRightContent);
            LoadAltContent(BlogConfiguration.ShowTopContent, BlogConfiguration.ShowBottomContent);

            if ((CurrentPage != null) && (CurrentPage.BodyCssClass.Length > 0))
            {
                AddClassToBody(CurrentPage.BodyCssClass);
            }

            AddClassToBody("blogviewarchive");

            if (BlogConfiguration.UseNoIndexFollowMetaOnLists)
            {
                SiteUtils.AddNoIndexFollowMeta(Page);
            }
        }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:32,代碼來源:ViewArchive.aspx.cs

示例3: InstallContent

        public void InstallContent(Module module, string configInfo)
        {
            if (string.IsNullOrEmpty(configInfo)) { return; }

            XmlDocument xml = new XmlDocument();

            using (StreamReader stream = File.OpenText(HostingEnvironment.MapPath(configInfo)))
            {
                xml.LoadXml(stream.ReadToEnd());
            }

            foreach (XmlNode node in xml.DocumentElement.ChildNodes)
            {
                if (node.Name == "moduleSetting")
                {
                    XmlAttributeCollection settingAttributes = node.Attributes;

                    if ((settingAttributes["settingKey"] != null) && (settingAttributes["settingKey"].Value.Length > 0))
                    {
                        string key = settingAttributes["settingKey"].Value;
                        string val = string.Empty;
                        if (settingAttributes["settingValue"] != null)
                        {
                            val = settingAttributes["settingValue"].Value;
                        }

                        ModuleSettings.UpdateModuleSetting(module.ModuleGuid, module.ModuleId, key, val);
                    }
                }
            }
        }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:31,代碼來源:FlickrGalleryContentInstaller.cs

示例4: btnCreateNewContent_Click

        protected void btnCreateNewContent_Click(object sender, EventArgs e)
        {
            Page.Validate("contentcatalog");
            if (!Page.IsValid) { return; }

            int moduleDefID = int.Parse(ddModuleType.SelectedItem.Value, CultureInfo.InvariantCulture);
            ModuleDefinition moduleDefinition = new ModuleDefinition(moduleDefID);

            Module module = new Module();
            module.ModuleTitle = this.txtModuleTitle.Text;
            module.ModuleDefId = moduleDefID;
            module.FeatureGuid = moduleDefinition.FeatureGuid;
            module.Icon = moduleDefinition.Icon;
            module.SiteId = siteSettings.SiteId;
            module.SiteGuid = siteSettings.SiteGuid;
            module.CreatedByUserId = SiteUtils.GetCurrentSiteUser().UserId;
            module.CacheTime = moduleDefinition.DefaultCacheTime;
            module.ShowTitle = WebConfigSettings.ShowModuleTitlesByDefault;
            module.HeadElement = WebConfigSettings.ModuleTitleTag;
            module.Save();
            WebUtils.SetupRedirect(this, SiteRoot
                + "/Admin/ContentManagerPreview.aspx?mid="
                + module.ModuleId.ToInvariantString()
                );
        }
開發者ID:joedavis01,項目名稱:mojoportal,代碼行數:25,代碼來源:ContentCatalog.aspx.cs

示例5: btnSave_Click

        void btnSave_Click(object sender, EventArgs e)
        {
            Module m = new Module(moduleId);

            string newPath = basePath + txtFolderName.Text;
            try
            {
                if (!Directory.Exists(Server.MapPath(newPath)))
                {
                    lblError.Text = FolderGalleryResources.FolderGalleryFolderNotExistsMessage;
                    return;
                }
            }
            catch (HttpException)
            {
                //thrown at Server.MapPath if the path is not a valid virtual path
                txtFolderName.Text = string.Empty;
                lblError.Text = FolderGalleryResources.FolderGalleryFolderNotExistsMessage;
                return;

            }

            ModuleSettings.UpdateModuleSetting(
                m.ModuleGuid,
                m.ModuleId,
                "FolderGalleryRootFolder",
                newPath);

            WebUtils.SetupRedirect(this, SiteUtils.GetCurrentPageUrl());
        }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:30,代碼來源:Edit.aspx.cs

示例6: LoadSettings

        private void LoadSettings()
        {
            moduleId = WebUtils.ParseInt32FromQueryString("mid", moduleId);
            pageId = WebUtils.ParseInt32FromQueryString("pageid", pageId);
            module = GetModule(moduleId, Forum.FeatureGuid);
            settings = ModuleSettings.GetModuleSettings(moduleId);
            config = new ForumConfiguration(settings);

            forumList.Config = config;
            forumList.ModuleId = moduleId;
            forumList.PageId = pageId;
            forumList.SiteRoot = SiteRoot;
            forumList.ImageSiteRoot = ImageSiteRoot;
            //forumList.IsEditable = IsEditable;

            forumListAlt.Config = config;
            forumListAlt.ModuleId = moduleId;
            forumListAlt.PageId = pageId;
            forumListAlt.SiteRoot = SiteRoot;
            forumListAlt.ImageSiteRoot = ImageSiteRoot;
            //forumListAlt.IsEditable = IsEditable;

            if (displaySettings.UseAltForumList)
            {
                forumList.Visible = false;
                forumListAlt.Visible = true;
            }

            AddClassToBody("editforumsubscriptions");
        }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:30,代碼來源:EditSubscriptions.aspx.cs

示例7: DeleteContent

        public override void DeleteContent(int moduleId, Guid moduleGuid)
        {
            if (GalleryConfiguration.DeleteImagesWhenModuleIsDeleted)
            {
                Module m = new Module(moduleId);
                DeleteImages(m.SiteId, moduleId);
            }

            Gallery.DeleteByModule(moduleId);
        }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:10,代碼來源:GalleryContentDeleteHandler.cs

示例8: LoadSettings

        private void LoadSettings()
        {
            pageId = WebUtils.ParseInt32FromQueryString("pageid", pageId);
            moduleId = WebUtils.ParseInt32FromQueryString("mid", moduleId);
            itemId = WebUtils.ParseInt32FromQueryString("ItemID", itemId);
            commentGuid = WebUtils.ParseGuidFromQueryString("c", commentGuid);
            if (commentGuid == Guid.Empty) { return; }

            blog = new Blog(itemId);
            module = GetModule(moduleId, Blog.FeatureGuid);
            commentRepository = new CommentRepository();

            if (blog.ModuleId != module.ModuleId)
            {
                blog = null;
                module = null;
                return;
            }

            comment = commentRepository.Fetch(commentGuid);
            if ((comment.ContentGuid != blog.BlogGuid)||(comment.ModuleGuid != module.ModuleGuid))
            {
                blog = null;
                module = null;
                return;
            }

            moduleSettings = ModuleSettings.GetModuleSettings(moduleId);

            config = new BlogConfiguration(moduleSettings);

            currentUser = SiteUtils.GetCurrentSiteUser();

            userCanEdit = UserCanEditComment();

            commentEditor.SiteGuid = CurrentSite.SiteGuid;
            commentEditor.SiteId = CurrentSite.SiteId;
            commentEditor.SiteRoot = SiteRoot;
            commentEditor.CommentsClosed = false;
            //commentEditor.CommentUrl = Request.RawUrl;
            commentEditor.ContentGuid = blog.BlogGuid;
            //commentEditor.DefaultCommentTitle = defaultCommentTitle;
            commentEditor.FeatureGuid = Blog.FeatureGuid;
            commentEditor.ModuleGuid = module.ModuleGuid;
            //commentEditor.NotificationAddresses = notificationAddresses;
            //commentEditor.NotificationTemplateName = notificationTemplateName;
            commentEditor.RequireCaptcha = false;
            commentEditor.UserCanModerate = userCanEdit;
            //commentEditor.Visible = !commentsClosed;
            commentEditor.CurrentUser = currentUser;
            commentEditor.UserComment = comment;
            commentEditor.ShowRememberMe = false;
            //commentEditor.IncludeIpAddressInNotification = includeIpAddressInNotification;
            //commentEditor.ContainerControl = this;
        }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:55,代碼來源:CommentDialog.aspx.cs

示例9: InstallContent

        public void InstallContent(Module module, string configInfo)
        {
            if (string.IsNullOrEmpty(configInfo)) { return; }

            string basePath = "~/Data/Sites/" + module.SiteId.ToInvariantString() + "/media/FolderGalleries/";

            if(!Directory.Exists(HostingEnvironment.MapPath(basePath)))
            {
                Directory.CreateDirectory(HostingEnvironment.MapPath(basePath));
            }

            IOHelper.CopyFolderContents(HostingEnvironment.MapPath(configInfo), HostingEnvironment.MapPath(basePath));
        }
開發者ID:joedavis01,項目名稱:mojoportal,代碼行數:13,代碼來源:FolderGalleryContentInstaller.cs

示例10: LoadSettings

        private void LoadSettings()
        {
            module = GetModule(moduleId, Link.FeatureGuid);
            moduleSettings = ModuleSettings.GetModuleSettings(moduleId);
            config = new ListConfiguration(moduleSettings);

            theList.Config = config;
            theList.PageId = pageId;
            theList.ModuleId = moduleId;
            theList.IsEditable = UserCanEditModule(moduleId, Link.FeatureGuid);
            theList.SiteRoot = SiteRoot;
            theList.ImageSiteRoot = ImageSiteRoot;

            AddClassToBody("listviewlist");
        }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:15,代碼來源:ViewList.aspx.cs

示例11: GetHtmlModule

        private Module GetHtmlModule()
        {
            if (CurrentSite == null) { return null; }

            Module m = GetModule(moduleId, HtmlContent.FeatureGuid);
            if (m != null) { return m; }

            // these extra checks allow for editing an html instance from modulewrapper
            m = new Module(moduleId);
            if (
                (m.FeatureGuid != HtmlContent.FeatureGuid)
                || (m.SiteId != CurrentSite.SiteId)
                || (m.ModuleId == -1)
                || ((!WebUser.IsInRoles(m.AuthorizedEditRoles)) && (!UserIsAdmin) && (!UserIsContentAdmin) && (!UserIsSiteEditor))
                )
            { m = null; }

            return m;
        }
開發者ID:joedavis01,項目名稱:mojoportal,代碼行數:19,代碼來源:HtmlEditService.aspx.cs

示例12: InstallContent

        public void InstallContent(Module module, string configInfo)
        {
            if (string.IsNullOrEmpty(configInfo)) { return; }

            string basePath = "~/Data/Sites/" + module.SiteId.ToInvariantString() + "/media/";

            if (!Directory.Exists(HostingEnvironment.MapPath(basePath)))
            {
                Directory.CreateDirectory(HostingEnvironment.MapPath(basePath));
            }

            basePath = "~/Data/Sites/" + module.SiteId.ToInvariantString() + "/media/GalleryImages/";

            if (!Directory.Exists(HostingEnvironment.MapPath(basePath)))
            {
                Directory.CreateDirectory(HostingEnvironment.MapPath(basePath));
            }

            basePath = "~/Data/Sites/" + module.SiteId.ToInvariantString() + "/media/GalleryImages/" + module.ModuleId.ToInvariantString() + "/";

            if (!Directory.Exists(HostingEnvironment.MapPath(basePath)))
            {
                Directory.CreateDirectory(HostingEnvironment.MapPath(basePath));
            }

            IOHelper.CopyFolderContents(HostingEnvironment.MapPath(configInfo), HostingEnvironment.MapPath(basePath));

            basePath = "~/Data/Sites/" + module.SiteId.ToInvariantString() + "/media/GalleryImages/" + module.ModuleId.ToInvariantString() + "/FullSizeImages/";

            string[] files = Directory.GetFiles(HostingEnvironment.MapPath(basePath));
            foreach (string file in files)
            {
                GalleryImage img = new GalleryImage();
                img.ModuleGuid = module.ModuleGuid;
                img.ModuleId = module.ModuleId;
                img.ImageFile = Path.GetFileName(file);
                img.ThumbnailFile = img.ImageFile;
                img.WebImageFile = img.ImageFile;
                img.Save();
            }
        }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:41,代碼來源:ImageGalleryContentInstaller.cs

示例13: PopulateControls

        private void PopulateControls()
        {
            //Title = SiteUtils.FormatPageTitle(siteSettings, calendarEvent.Title);

            //if (!UserCanEditModule(moduleId, CalendarEvent.FeatureGuid))
            //{
            //    this.lnkNewEvent.Visible = false;

            //}

            if (moduleId > -1)
            {
                Module module = new Module(moduleId);
                //this.litDate.Text = module.ModuleTitle + " " + this.theDate.ToShortDateString();
                heading.Text = module.ModuleTitle + " " + this.theDate.ToShortDateString();

                Title = SiteUtils.FormatPageTitle(siteSettings, heading.Text);

                if (UserCanEditModule(moduleId, CalendarEvent.FeatureGuid))
                {
                    heading.LiteralExtraMarkup = "<a href='" + SiteRoot + "/EventCalendar/EditEvent.aspx?"
                        + "mid=" + moduleId.ToInvariantString()
                        + "&date=" + Server.UrlEncode(this.theDate.ToString("s"))
                        + "&pageid=" + CurrentPage.PageId.ToInvariantString() + "' class='ModuleEditLink'>" + EventCalResources.EventCalendarAddEventLabel + "</a>";
                }

                //lnkNewEvent.HRef = SiteRoot + "/EventCalendar/EditEvent.aspx?"
                //    + "mid=" + moduleId.ToInvariantString()
                //    + "&date=" + Server.UrlEncode(this.theDate.ToString("s"))
                //    + "&pageid=" + CurrentPage.PageId.ToInvariantString();

                //lnkNewEvent.InnerHtml = Resources.EventCalResources.EventCalendarAddEventLabel;

                DataSet ds = CalendarEvent.GetEvents(this.moduleId, theDate, theDate);
                //				DataView dv = ds.Tables[0].DefaultView;
                //				dv.Sort = "StartTime ASC ";
                this.rptEvents.DataSource = ds;
                this.rptEvents.DataBind();

            }
        }
開發者ID:joedavis01,項目名稱:mojoportal,代碼行數:41,代碼來源:DayView.aspx.cs

示例14: InstallContent

        public void InstallContent(Module module, string configInfo)
        {
            HtmlContent htmlContent = new HtmlContent();
            htmlContent.ModuleId = module.ModuleId;
            if (configInfo.StartsWith("~/"))
            {
                if (File.Exists(HostingEnvironment.MapPath(configInfo)))
                {
                    htmlContent.Body = File.ReadAllText(HostingEnvironment.MapPath(configInfo), Encoding.UTF8);
                }
            }
            else
            {
                htmlContent.Body = ResourceHelper.GetMessageTemplate(CultureInfo.CurrentUICulture, configInfo);
            }

            htmlContent.ModuleGuid = module.ModuleGuid;

            SiteSettings siteSettings = new SiteSettings(module.SiteId);
            SiteUser adminUser = null;
            if (siteSettings.UseEmailForLogin)
            {
                adminUser = new SiteUser(siteSettings, "[email protected]");
                if (adminUser.UserId == -1) { adminUser = null; }
            }
            else
            {
                adminUser = new SiteUser(siteSettings, "admin");
                if (adminUser.UserId == -1) { adminUser = null; }
            }

            if (adminUser != null)
            {
                htmlContent.UserGuid = adminUser.UserGuid;
                htmlContent.LastModUserGuid = adminUser.UserGuid;
            }

            HtmlRepository repository = new HtmlRepository();
            repository.Save(htmlContent);
        }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:40,代碼來源:HtmlContentInstaller.cs

示例15: LoadParams

        private void LoadParams()
        {
            pageId = WebUtils.ParseInt32FromQueryString("pageid", pageId);
            moduleId = WebUtils.ParseInt32FromQueryString("mid", moduleId);
            categoryId = WebUtils.ParseInt32FromQueryString("cat", categoryId);
            blogModule = GetModule(moduleId, Blog.FeatureGuid);

            // an experiment with ASP.NET routing

            //if (Page.RouteData.Values["category"] != null)
            //{
            //    categoryId = Convert.ToInt32(Page.RouteData.Values["category"]);
            //}

            //if (Page.RouteData.Values["pageid"] != null)
            //{
            //    pageId = Convert.ToInt32(Page.RouteData.Values["pageid"]);
            //}

            //if (Page.RouteData.Values["moduleid"] != null)
            //{
            //    moduleId = Convert.ToInt32(Page.RouteData.Values["moduleid"]);
            //}
        }
開發者ID:joedavis01,項目名稱:mojoportal,代碼行數:24,代碼來源:ViewCategory.aspx.cs


注:本文中的mojoPortal.Business.Module類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。