当前位置: 首页>>代码示例>>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;未经允许,请勿转载。