当前位置: 首页>>代码示例>>C#>>正文


C# Member.XmlGenerate方法代码示例

本文整理汇总了C#中umbraco.cms.businesslogic.member.Member.XmlGenerate方法的典型用法代码示例。如果您正苦于以下问题:C# Member.XmlGenerate方法的具体用法?C# Member.XmlGenerate怎么用?C# Member.XmlGenerate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在umbraco.cms.businesslogic.member.Member的用法示例。


在下文中一共展示了Member.XmlGenerate方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LinkBanMemberClick

        protected void LinkBanMemberClick(object sender, EventArgs e)
        {
            if (CurrentMember.MemberIsAdmin && ProfileMember.MemberId != null)
            {
                string usermessage;
                var cMem = new Member((int)ProfileMember.MemberId);

                if(ProfileMember.MemberIsBanned)
                {
                    //Un ban member
                    cMem.getProperty("forumUserIsBanned").Value = "0";
                    usermessage = library.GetDictionaryItem("MemberIsNowNotBanned");
                }
                else
                {
                    // Ban the member
                    cMem.getProperty("forumUserIsBanned").Value = "1";
                    usermessage = library.GetDictionaryItem("MemberIsNowBanned");
                }

                //Save member
                cMem.Save();

                //Generate member Xml Cache
                cMem.XmlGenerate(new System.Xml.XmlDocument());

                // Redirect to show message
                Response.Redirect(string.Concat(CurrentPageAbsoluteUrl, "?m=", usermessage));
            }
        }
开发者ID:wakkomail,项目名称:community-framework,代码行数:30,代码来源:MemberProfile.ascx.cs

示例2: createMember

        protected void createMember(object sender, EventArgs e)
        {
            if (tb_email.Text != "")
                {
                    m = Member.GetMemberFromEmail(tb_email.Text);
                    if (m == null)
                    {
                        MemberType mt = MemberType.GetByAlias(memberType);
                        m = Member.MakeNew(tb_name.Text, mt, new umbraco.BusinessLogic.User(0));
                        m.Email = tb_email.Text;
                        m.Password = tb_password.Text;
                        m.LoginName = tb_email.Text;

                        //Standard values
                        m.getProperty("reputationTotal").Value = 20;
                        m.getProperty("reputationCurrent").Value = 20;
                        m.getProperty("forumPosts").Value = 0;

                        if (!string.IsNullOrEmpty(Group))
                        {
                            MemberGroup mg = MemberGroup.GetByName(Group);
                            if (mg != null)
                                m.AddGroup(mg.Id);
                        }

                        //set a default avatar
                        Api.CommunityController.SetAvatar(m.Id, "gravatar");

                        m.Save();
                        m.XmlGenerate(new System.Xml.XmlDocument());
                        Member.AddMemberToCache(m);
                        Response.Redirect(umbraco.library.NiceUrl(NextPage));
                    }
                }
        }
开发者ID:larrynPL,项目名称:OurUmbraco,代码行数:35,代码来源:SignupSimple.ascx.cs

示例3: Member_AfterSave

        void Member_AfterSave(Member sender, umbraco.cms.businesslogic.SaveEventArgs e)
        {

            string groups = "";
            foreach (MemberGroup mg in sender.Groups.Values)
            {
                groups += mg.Text + ",";
            }

            sender.getProperty("groups").Value = groups.Trim().Trim(','); ;
            sender.XmlGenerate(new System.Xml.XmlDocument());
        }
开发者ID:ClaytonWang,项目名称:OurUmbraco,代码行数:12,代码来源:memberSave.cs

示例4: Topic_AfterCreate

        void Topic_AfterCreate(object sender, uForum.Businesslogic.CreateEventArgs e)
        {
            uForum.Businesslogic.Topic t = (uForum.Businesslogic.Topic)sender;

            Member mem = new Member(t.MemberId);
            int posts = 0;
            int.TryParse(mem.getProperty("forumPosts").Value.ToString(), out posts);

            mem.getProperty("forumPosts").Value = posts++;
            mem.Save();

            mem.XmlGenerate(new System.Xml.XmlDocument());

            Member.RemoveMemberFromCache(mem.Id);
            Member.AddMemberToCache(mem);
        }
开发者ID:nul800sebastiaan,项目名称:OurUmbraco,代码行数:16,代码来源:NewTopicHandler.cs

示例5: BtnSubmitMessageClick

        protected void BtnSubmitMessageClick(object sender, EventArgs e)
        {
            // Check user isn't spammer by checking flood control settings
            if (Helpers.TimeDifferenceInMinutes(DateTime.Now, CurrentMember.MemberLastPrivateMessageTime) > Settings.PrivateMessagingFloodControlTimeSpan)
            {
                var sb = new StringBuilder();

                var tbMessageSubject = (TextBox)lvPrivateMessage.FindControl("tbMessageSubject");
                var tbMessage = (TextBox)lvPrivateMessage.FindControl("txtPost");

                var replylink = string.Concat(Url(),
                                                "/privatemessage.aspx?mem=" + CurrentMember.MemberId,
                                                "&r=" + Helpers.GetSafeHtml(tbMessageSubject.Text).UrlEncode());

                replylink = string.Format("<a href='{0}'>{0}</a>", replylink);

                sb.AppendFormat(library.GetDictionaryItem("PrivateMessageEmailText"),
                                CurrentMember.MemberLoginName,
                                DateTime.Now.ToShortDateString(),
                                Helpers.GetSafeHtml(tbMessageSubject.Text));

                sb.Append(Helpers.GetSafeHtml(tbMessage.Text).ConvertBbCode());

                sb.AppendFormat("<p><b>{0}</b></p><p>{1}</p>", library.GetDictionaryItem("ClickLinkToReply"), replylink);
                Helpers.SendMail(Settings.EmailNotification, MessageToMember.Email, string.Concat(library.GetDictionaryItem("PrivateMessageOn"), Settings.Name), sb.ToString());

                // Lastly update last private message sent on this user
                var cMem = new Member(Convert.ToInt32(CurrentMember.MemberId));
                cMem.getProperty("forumUserLastPrivateMessage").Value = DateTime.Now;
                cMem.Save();
                cMem.XmlGenerate(new System.Xml.XmlDocument());

                // Show friendly message
                Response.Redirect(string.Concat(CurrentPageAbsoluteUrl, "?m=", library.GetDictionaryItem("MessageSent")));
            }
            else
            {
                // Show friendly message
                Response.Redirect(string.Concat(CurrentPageAbsoluteUrl, "?m=",
                                                string.Format(library.GetDictionaryItem("SorryMustWaitBetween"),
                                                Settings.PrivateMessagingFloodControlTimeSpan)));
            }
        }
开发者ID:wakkomail,项目名称:community-framework,代码行数:43,代码来源:ForumMessageUser.ascx.cs

示例6: SaveUrlAsBuddyIcon

        private static string SaveUrlAsBuddyIcon(string url, Member m)
        {
            var file = m.Id.ToString(CultureInfo.InvariantCulture);
            var path = HttpContext.Current.Server.MapPath("/media/avatar/" + file + ".jpg");

            if (File.Exists(path))
                File.Delete(path);

            var webClient = new System.Net.WebClient();
            webClient.DownloadFile(url, path);

            m.getProperty("avatar").Value = "/media/avatar/" + file + ".jpg";
            m.XmlGenerate(new XmlDocument());
            m.Save();

            Member.RemoveMemberFromCache(m);
            Member.AddMemberToCache(m);

            return "/media/avatar/" + file + ".jpg";
        }
开发者ID:ClaytonWang,项目名称:OurUmbraco,代码行数:20,代码来源:CommunityController.cs

示例7: Topic_AfterCreate

        void Topic_AfterCreate(object sender, uForum.Businesslogic.CreateEventArgs e)
        {
            uForum.Businesslogic.Topic t = (uForum.Businesslogic.Topic)sender;

            //WB added to show these events are firing...
            umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, t.Id, "Topic_AfterCreate in ForumPostsCounter() class is starting");

            Member mem = new Member(t.MemberId);
            int posts = 0;
            int.TryParse(mem.getProperty("forumPosts").Value.ToString(), out posts);

            mem.getProperty("forumPosts").Value = (posts + 1);
            mem.Save();

            mem.XmlGenerate(new System.Xml.XmlDocument());

            //Performs the action NewTopic in case we want to reward people for creating new posts.
            uPowers.BusinessLogic.Action a = new uPowers.BusinessLogic.Action("NewTopic");
            a.Perform(mem.Id, t.Id, "New topic created");

            //WB added to show these events are firing...
            umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, t.Id, "Topic_AfterCreate in ForumPostsCounter() class is finishing");
        }
开发者ID:nul800sebastiaan,项目名称:OurUmbraco,代码行数:23,代码来源:ForumPostsCounter.cs

示例8: saveUrlAsBuddyIcon

        private static string saveUrlAsBuddyIcon(string url, Member m)
        {
            string _file = m.Id.ToString();
            string _path = HttpContext.Current.Server.MapPath("/media/avatar/" + _file + ".jpg");
            string _currentFile = m.getProperty("avatar").Value.ToString();

            if (System.IO.File.Exists(_path))
                System.IO.File.Delete(_path);

            System.Net.WebClient wc = new System.Net.WebClient();
            wc.DownloadFile(url, _path);

            m.getProperty("avatar").Value = "/media/avatar/" + _file + ".jpg";
            m.XmlGenerate(new XmlDocument());
            m.Save();

            Member.RemoveMemberFromCache(m);
            Member.AddMemberToCache(m);

            return "/media/avatar/" + _file + ".jpg";
        }
开发者ID:nul800sebastiaan,项目名称:OurUmbraco,代码行数:21,代码来源:Rest.cs

示例9: createMember

        protected void createMember(object sender, EventArgs e)
        {
            //Member is already logged in, and we just need to save his new data...
            if (m != null) {
                m.Text = tb_name.Text;
                m.Email = tb_email.Text;
                m.LoginName = tb_email.Text;

                if (tb_password.Text != "")
                    m.Password = tb_password.Text;

                //optional..
                m.getProperty("twitter").Value = tb_twitter.Text;
                m.getProperty("flickr").Value = tb_flickr.Text;
                m.getProperty("company").Value = tb_company.Text;
                m.getProperty("profileText").Value = tb_bio.Text;

                //location
                m.getProperty("location").Value = tb_location.Text;
                m.getProperty("latitude").Value = tb_lat.Value;
                m.getProperty("longitude").Value = tb_lng.Value;

                //treshold + newsletter
                m.getProperty("treshold").Value = tb_treshold.Text;
                m.getProperty("bugMeNot").Value = cb_bugMeNot.Checked;

                m.XmlGenerate(new System.Xml.XmlDocument());
                m.Save();

                //Refresh the member cache data
                Member.RemoveMemberFromCache(m);
                Member.AddMemberToCache(m);

                Response.Redirect(umbraco.library.NiceUrl(NextPage));

            } else {
                if (tb_email.Text != "") {
                    m = Member.GetMemberFromEmail(tb_email.Text);
                    if (m == null) {
                        MemberType mt = MemberType.GetByAlias(memberType);
                        m = Member.MakeNew(tb_name.Text, mt, new umbraco.BusinessLogic.User(0));
                        m.Email = tb_email.Text;
                        m.Password = tb_password.Text;
                        m.LoginName = tb_email.Text;

                        //Location
                        m.getProperty("location").Value = tb_location.Text;
                        m.getProperty("latitude").Value = tb_lat.Value;
                        m.getProperty("longitude").Value = tb_lng.Value;

                        //optional..
                        m.getProperty("twitter").Value = tb_twitter.Text;
                        m.getProperty("flickr").Value = tb_flickr.Text;
                        m.getProperty("company").Value = tb_company.Text;
                        m.getProperty("profileText").Value = tb_bio.Text;

                        //treshold + newsletter
                        m.getProperty("treshold").Value = tb_treshold.Text;
                        m.getProperty("bugMeNot").Value = cb_bugMeNot.Checked;

                        //Standard values
                        m.getProperty("reputationTotal").Value = 20;
                        m.getProperty("reputationCurrent").Value = 20;
                        m.getProperty("forumPosts").Value = 0;

                        if (!string.IsNullOrEmpty(Group)) {
                            MemberGroup mg = MemberGroup.GetByName(Group);
                            if (mg != null)
                                m.AddGroup(mg.Id);
                        }

                        //set a default avatar
                        Rest.BuddyIcon.SetAvatar(m.Id, "gravatar");

                        m.Save();
                        m.XmlGenerate(new System.Xml.XmlDocument());
                        Member.AddMemberToCache(m);

                        Response.Redirect(umbraco.library.NiceUrl(NextPage));
                    }
                }
            }
        }
开发者ID:nul800sebastiaan,项目名称:OurUmbraco,代码行数:83,代码来源:Signup.ascx.cs

示例10: createMember

        protected void createMember(object sender, EventArgs e)
        {
            //Member is already logged in, and we just need to save his new data...
            if (m != null)
            {
                m.Text = tb_name.Text;
                m.Email = tb_email.Text;
                m.LoginName = tb_email.Text;

                if (tb_password.Text != "")
                    m.Password = tb_password.Text;

                //optional..
                m.getProperty("twitter").Value = tb_twitter.Text;
                m.getProperty("flickr").Value = tb_flickr.Text;
                m.getProperty("company").Value = tb_company.Text;
                m.getProperty("profileText").Value = tb_bio.Text;

                //location
                m.getProperty("location").Value = tb_location.Text;
                m.getProperty("latitude").Value = tb_lat.Value;
                m.getProperty("longitude").Value = tb_lng.Value;

                //treshold + newsletter
                m.getProperty("treshold").Value = tb_treshold.Text;
                m.getProperty("bugMeNot").Value = cb_bugMeNot.Checked;

                m.XmlGenerate(new System.Xml.XmlDocument());
                m.Save();

                //Refresh the member cache data
                Member.RemoveMemberFromCache(m);
                Member.AddMemberToCache(m);

                Response.Redirect(umbraco.library.NiceUrl(NextPage));

            }
            else
            {
                if (tb_email.Text != "")
                {
                    m = Member.GetMemberFromLoginName(tb_email.Text);
                    if (m == null)
                    {
                        MemberType mt = MemberType.GetByAlias(memberType);

                        // Adding " Temp" is a hack - bizarrely, when you create a member using MakeNew and
                        // the name does not have a space in it (like: Ben) you'll get a YSOD saying the
                        // username already exists. However, create it with a space in it and everything is
                        // fine and dandy! So now we just force the last name to be "Temp" during creation
                        // and then update the member's name immediately after that... -SJ
                        m = Member.MakeNew(tb_name.Text + " Temp", mt, new User(0));
                        m.Text = tb_name.Text;

                        m.Email = tb_email.Text;
                        m.Password = tb_password.Text;
                        m.LoginName = tb_email.Text;

                        //Location
                        m.getProperty("location").Value = tb_location.Text;
                        m.getProperty("latitude").Value = tb_lat.Value;
                        m.getProperty("longitude").Value = tb_lng.Value;

                        //optional..
                        m.getProperty("twitter").Value = tb_twitter.Text;
                        m.getProperty("flickr").Value = tb_flickr.Text;
                        m.getProperty("company").Value = tb_company.Text;
                        m.getProperty("profileText").Value = tb_bio.Text;

                        //treshold + newsletter
                        m.getProperty("treshold").Value = tb_treshold.Text;
                        m.getProperty("bugMeNot").Value = cb_bugMeNot.Checked;

                        //Standard values
                        m.getProperty("reputationTotal").Value = 20;
                        m.getProperty("reputationCurrent").Value = 20;
                        m.getProperty("forumPosts").Value = 0;

                        if (!string.IsNullOrEmpty(Group))
                        {
                            MemberGroup mg = MemberGroup.GetByName(Group);
                            if (mg != null)
                                m.AddGroup(mg.Id);
                        }

                        //set a default avatar
                        BuddyIcon.SetAvatar(m.Id, "gravatar");

                        m.Save();
                        m.XmlGenerate(new XmlDocument());
                        Member.AddMemberToCache(m);

                        Response.Redirect(library.NiceUrl(NextPage));
                    }
                    else
                    {
                        MemberExists.Visible = true;
                        Panel1.Visible = false;
                    }
                }
//.........这里部分代码省略.........
开发者ID:KevinJump,项目名称:OurUmbraco,代码行数:101,代码来源:Signup.ascx.cs

示例11: ThumbsUpPost

        public static string ThumbsUpPost(string postId)
        {
            if (MembershipHelper.IsAuthenticated())
            {
                var m = Member.GetCurrentMember();
                var forumPost = _mapper.MapForumPost(new Node(Convert.ToInt32(postId)));

                // If this current member id owns the post then ignore
                if (forumPost != null)
                {
                    if (m.Id != forumPost.Owner.MemberId)
                    {
                        // Get the member who wrote the post
                        var postMember = new Member(Convert.ToInt32(forumPost.Owner.MemberId));

                        // Get a user to save both documents with
                        var usr = new User(0);

                        // First update the karma on the post and add this logged in user to
                        // list if people who have voted on post
                        var p = new Document(forumPost.Id);
                        var votedUsers = p.getProperty("forumPostUsersVoted").Value.ToString();
                        var formattedMemberId = string.Format("{0}|", m.Id);

                        // Check to make sure they are not fiddling the system
                        if (forumPost.VotedMembersIds == null || !forumPost.VotedMembersIds.Contains(m.Id))
                        {
                            p.getProperty("forumPostKarma").Value = (forumPost.Karma + 1);
                            p.getProperty("forumPostUsersVoted").Value = formattedMemberId + votedUsers;
                            p.Publish(usr);
                            umbraco.library.UpdateDocumentCache(p.Id);
                            var newPostKarma = (forumPost.Karma + 1);

                            // Now update the members karma based on the forum settings
                            forumPost.Karma = Convert.ToInt32(postMember.getProperty("forumUserKarma").Value.ToString());
                            postMember.getProperty("forumUserKarma").Value = (forumPost.Karma + Helpers.MainForumSettings().KarmaPointsAddedForThumbUps);

                            // Save Member details
                            postMember.Save();

                            //Generate member Xml Cache
                            postMember.XmlGenerate(new System.Xml.XmlDocument());

                            return newPostKarma.ToString();
                        }
                    }
                }
            }

            return "0";
        } 
开发者ID:elrute,项目名称:Triphulcas,代码行数:51,代码来源:nForumBaseExtensions.cs

示例12: CreateMember

        protected void CreateMember(object sender, EventArgs e)
        {
            //Member is already logged in, and we just need to save his new data...
            if (_member != null)
            {
                _member.Text = tb_name.Text;
                _member.Email = tb_email.Text;
                _member.LoginName = tb_email.Text;

                if (tb_password.Text != "")
                    _member.Password = tb_password.Text;

                //optional..
                _member.getProperty("twitter").Value = tb_twitter.Text;
                _member.getProperty("flickr").Value = tb_flickr.Text;
                _member.getProperty("company").Value = tb_company.Text;
                _member.getProperty("profileText").Value = tb_bio.Text;

                //location
                _member.getProperty("location").Value = tb_location.Text;
                _member.getProperty("latitude").Value = tb_lat.Value;
                _member.getProperty("longitude").Value = tb_lng.Value;

                //treshold + newsletter
                _member.getProperty("treshold").Value = tb_treshold.Text;
                _member.getProperty("bugMeNot").Value = cb_bugMeNot.Checked;

                _member.XmlGenerate(new XmlDocument());
                _member.Save();

                //Refresh the member cache data
                Member.RemoveMemberFromCache(_member);
                Member.AddMemberToCache(_member);

                uForum.Library.Utills.CheckForSpam(_member);

                Response.Redirect(library.NiceUrl(NextPage));

            }
            else
            {
                if (tb_email.Text != string.Empty && Page.IsValid)
                {
                    _member = Member.GetMemberFromLoginName(tb_email.Text);
                    if (_member == null)
                    {
                        // If spammer then this will stop account creation
                        var spamResult = uForum.Library.Utills.CheckForSpam(tb_email.Text, tb_name.Text, true);
                        if (spamResult != null && spamResult.Blocked)
                            return;

                        var mt = MemberType.GetByAlias(memberType);

                        // Adding " Temp" is a hack - bizarrely, when you create a member using MakeNew and
                        // the name does not have a space in it (like: Ben) you'll get a YSOD saying the
                        // username already exists. However, create it with a space in it and everything is
                        // fine and dandy! So now we just force the last name to be "Temp" during creation
                        // and then update the member's name immediately after that... -SJ
                        _member = Member.MakeNew(tb_name.Text + " Temp", mt, new User(0));
                        _member.Text = tb_name.Text;

                        _member.Email = tb_email.Text;
                        _member.Password = tb_password.Text;
                        _member.LoginName = tb_email.Text;

                        //Location
                        _member.getProperty("location").Value = tb_location.Text;
                        _member.getProperty("latitude").Value = tb_lat.Value;
                        _member.getProperty("longitude").Value = tb_lng.Value;

                        //optional..
                        _member.getProperty("twitter").Value = tb_twitter.Text;
                        _member.getProperty("flickr").Value = tb_flickr.Text;
                        _member.getProperty("company").Value = tb_company.Text;
                        _member.getProperty("profileText").Value = tb_bio.Text;

                        //treshold + newsletter
                        _member.getProperty("treshold").Value = tb_treshold.Text;
                        _member.getProperty("bugMeNot").Value = cb_bugMeNot.Checked;

                        //Standard values
                        _member.getProperty("reputationTotal").Value = 20;
                        _member.getProperty("reputationCurrent").Value = 20;
                        _member.getProperty("forumPosts").Value = 0;

                        if (string.IsNullOrEmpty(Group) == false)
                        {
                            var memberGroup = MemberGroup.GetByName(Group);
                            if (memberGroup != null)
                                _member.AddGroup(memberGroup.Id);
                        }

                        //set a default avatar
                        BuddyIcon.SetAvatar(_member.Id, "gravatar");

                        _member.Save();
                        _member.XmlGenerate(new XmlDocument());
                        Member.AddMemberToCache(_member);

                        if (spamResult == null)
//.........这里部分代码省略.........
开发者ID:Jeavon,项目名称:OurUmbraco,代码行数:101,代码来源:Signup.ascx.cs


注:本文中的umbraco.cms.businesslogic.member.Member.XmlGenerate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。