• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forum类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Forum的典型用法代码示例。如果您正苦于以下问题:C# Forum类的具体用法?C# Forum怎么用?C# Forum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Forum类属于命名空间,在下文中一共展示了Forum类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: updateForumsList

        public void updateForumsList(Forum[] forums)
        {
            clearList();

            for (int i = 0; i < forums.Length; i++)
                createNewLine(forums[i].forumName);
        }
开发者ID:nivsto,项目名称:ForumGenerator_Version2,代码行数:7,代码来源:MainViewDialog.cs


示例2: Page_Load

    //页面加载
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            id = Int32.Parse(Request.QueryString["id"]).ToString();
        }
        catch
        {
            Response.Redirect("../Default.aspx");
            return;
        }

        index = Int32.Parse(floor.Value);
        if (Request.QueryString["id"] != null)
        {
            RepeaterDataBind();
            SubjectInfo si = new Forum().GetSubjectById(Convert.ToInt32(Request.QueryString["id"]));
            lbTitle.Text = "主题:" + si.StrTheme;

            UserControl_ThemeOfMsg theme = this.ThemeOfMsg1;
            theme.Subject = si;
        }
        //第一次加载
        if (!IsPostBack)
        {
            //胡媛媛添加,使游客无法发表留言,2010-6-22
            if (Session["UserName"] == null)
            {
                submitMsg.Enabled = false;
            }
            //胡媛媛添加,使游客无法发表留言,2010-6-22
        }
    }
开发者ID:dalinhuang,项目名称:my-project-step,代码行数:34,代码来源:MessageInfo.aspx.cs


示例3: ForumUpdate_WithoutUid_ThrowsError

        public void ForumUpdate_WithoutUid_ThrowsError()
        {
            var commentForum = new Forum { Id = "" };
            var readerCreator = mocks.DynamicMock<IDnaDataReaderCreator>();
            var site = mocks.DynamicMock<ISite>();
            var cacheManager = mocks.DynamicMock<ICacheManager>();
            //readerCreator.Stub(x => x.CreateDnaDataReader("getmoderationclasslist")).Return(reader);


            mocks.ReplayAll();

            var context = new Context(null, readerCreator, cacheManager, null);


            try
            {
                context.UpdateForum(commentForum, site, null);
                throw new Exception("Error not thrown within code");
            }
            catch (ApiException ex)
            {
                Assert.AreEqual("Forum uid is empty, null or exceeds 255 characters.", ex.Message);
                Assert.AreEqual(ErrorType.InvalidForumUid, ex.type);
            }
            readerCreator.AssertWasNotCalled(x => x.CreateDnaDataReader("commentforumcreate"));
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:26,代码来源:ContextTest.cs


示例4: AdminDialog

        public AdminDialog(int forumId, string adderUsrName, string adderPswd, Forum.RegPolicy policy)
        {
            InitializeComponent();
            this.forumId = forumId;
            this.pswd = adderPswd;
            this.usrName = adderUsrName;
            initAddRemoveTab();
            initModeratorPermissionsTab();
            initMessagesTab();
            initCommentsTab();
            initRepliersTab();

            //show confirm option only if this is the forum policy
            if (policy == Forum.RegPolicy.ADMIN_CONFIRMATION)
            {
                initConfirmUsersTab();
            }
            else
            {
                for (int i = 0; i < tabControl1.TabPages.Count; i++)
                {
                    if (tabControl1.TabPages[i].Name.Equals("tabConfirm", StringComparison.OrdinalIgnoreCase))
                    {
                        tabControl1.TabPages.RemoveAt(i);
                        break;
                    }
                }
            }
        }
开发者ID:nivsto,项目名称:ForumGenerator_Version2,代码行数:29,代码来源:AdminDialog.cs


示例5: GetAccessFlag

		public AccessFlag GetAccessFlag(User user, Forum forum) {
			// TODO:
			return AccessFlag.Create | AccessFlag.Delete | AccessFlag.Moderator |
					AccessFlag.Poll | AccessFlag.Priority | AccessFlag.Priority |
					AccessFlag.Read | AccessFlag.Reply | AccessFlag.Update |
					AccessFlag.Upload | AccessFlag.Vote;
		}
开发者ID:razzles67,项目名称:NForum,代码行数:7,代码来源:PermissionService.cs


示例6: Save_Click

    protected void Save_Click(Object sender, EventArgs e)
    {
        if (IsValid)
        {
            Forum _frm = new Forum(this.ConnectionString);
            if (ViewState["forumId"] != null)
            {
                _frm.LitePopulate(ViewState["forumId"], false);
            }

            _frm.Title = txt_Title.Text;
            _frm.Description = txt_Desc.Text;

            _frm.Active = ch_Active.Checked;

            if (_frm.Save())
            {
                this.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", "alert('Record has been updated successfully.');self.location = 'Forums.aspx';", true);
            }
            else
            {
                lbl_Error.Text = "An unexpected error has occurred. Please try again.";
                lbl_Error.Visible = true;
            }
        }
    }
开发者ID:noximus,项目名称:TopOfTheRock,代码行数:26,代码来源:EditForum.aspx.cs


示例7: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            HtmlGenericControl _nc = (HtmlGenericControl)Master.FindControl("navForum");
            _nc.Attributes.Add("class", "active");

            String _forumId = Request.QueryString["forumId"];
            if (!String.IsNullOrEmpty(_forumId))
            {
                ViewState.Add("forumId", _forumId);
                Forum _frm = new Forum(this.ConnectionString);
                _frm.LitePopulate(ViewState["forumId"], false);

                txt_Desc.Text = _frm.Description;
                txt_Title.Text = _frm.Title;
                ch_Active.Checked = _frm.Active;
                lbl_Header.Text = String.Format("{0}", _frm.Title);
            }
            else
            {
                lbl_Header.Text = "Add Forum";
            }

        }
    }
开发者ID:noximus,项目名称:TopOfTheRock,代码行数:26,代码来源:EditForum.aspx.cs


示例8: ChangeTopicForum

        public void ChangeTopicForum(int topicid, int forumid)
        {
            ForumInfo newforum = new Forum().GetById(forumid);

            string updateSql = "UPDATE " + Config.ForumTablePrefix + "TOPICS SET [email protected], [email protected] WHERE [email protected]; ";
            if (newforum.Status == (int)Enumerators.PostStatus.Closed) //forum locked so lock all posts
            {
                updateSql = updateSql + "UPDATE " + Config.ForumTablePrefix + "TOPICS SET T_STATUS=0 WHERE [email protected]; ";
                updateSql = updateSql + "UPDATE " + Config.ForumTablePrefix + "REPLY SET R_STATUS=0 WHERE [email protected]; ";
            }
            else if (newforum.ModerationLevel == (int) Enumerators.Moderation.UnModerated)
            {
                //change status of posts if coming from moderated forum
                updateSql = updateSql + "UPDATE " + Config.ForumTablePrefix + "TOPICS SET T_STATUS=1 WHERE [email protected] AND T_STATUS > 1; ";
                updateSql = updateSql + "UPDATE " + Config.ForumTablePrefix + "REPLY SET R_STATUS=1 WHERE [email protected] AND R_STATUS > 1; ";

            }
            updateSql = updateSql + "UPDATE " + Config.ForumTablePrefix + "REPLY SET [email protected], [email protected] WHERE [email protected]; ";
            List<SqlParameter> parms = new List<SqlParameter>
                {
                    new SqlParameter("@TopicId", SqlDbType.Int) {Value = topicid},
                    new SqlParameter("@ForumId", SqlDbType.Int) {Value = forumid},
                    new SqlParameter("@CatId", SqlDbType.Int) {Value = newforum.CatId}
                };
            SqlHelper.ExecuteNonQuery(SqlHelper.ConnString, CommandType.Text, updateSql, parms.ToArray());
        }
开发者ID:huwred,项目名称:SnitzDotNet,代码行数:26,代码来源:Topic.cs


示例9: About

        public ActionResult About()
        {
            var f = new Forum();
            f.Name = "Hi";
            _forumRepo.Add(f);

            return View();
        }
开发者ID:brendankowitz,项目名称:Samples,代码行数:8,代码来源:HomeController.cs


示例10: SetAvailableShortName

 public void SetAvailableShortName(Forum forum)
 {
     if (forum == null || forum.ShortName == null)
     {
         throw new ArgumentNullException("Forum.ShortName");
     }
     forum.ShortName = _dataAccess.GetAvailableShortName(forum.ShortName);
 }
开发者ID:ramiglez30,项目名称:Forum-Construnario,代码行数:8,代码来源:ForumsService.cs


示例11: GetModeratorLinks

 protected string GetModeratorLinks(Forum forum, string linkStyle, string separator)
 {
     if (forum.Moderators == null || forum.Moderators.Count < 1)
         return "-";
     else
     {
         return GetModeratorLinks(forum.Moderators, linkStyle, separator);
     }
 }
开发者ID:huchao007,项目名称:bbsmax,代码行数:9,代码来源:AppBbsPageBase.cs


示例12: BindData

    protected void BindData()
    {
        Forum _for = new Forum(this.ConnectionString);
        gv_Forum.DataSource = _for.GetForums(true);
        gv_Forum.DataBind();

        gv_ForumNotActive.DataSource = _for.GetForums(false);
        gv_ForumNotActive.DataBind();
    }
开发者ID:noximus,项目名称:TopOfTheRock,代码行数:9,代码来源:Forums.aspx.cs


示例13: HasPermission

 protected bool HasPermission(Forum forum)
 {
     ManageForumPermissionSetNode managePermission = PostBOV5.Instance.GetForumPermissonSet(forum);
     
     
     bool has = managePermission.HasPermissionForSomeone(My, ManageForumPermissionSetNode.ActionWithTarget.DeleteAnyThreads);
     if (IsRecycleBin && has == false)
         has = managePermission.HasPermissionForSomeone(My, ManageForumPermissionSetNode.ActionWithTarget.ApproveThreads);
     return has;
 }
开发者ID:huchao007,项目名称:bbsmax,代码行数:10,代码来源:manage-topic.aspx.cs


示例14: Create

 public Forum Create(string name)
 {
     using (var context = _contextManager.GetContext())
     {
         var forum = new Forum(name);
         context.Add(forum);
         context.SaveChanges();
         return forum;
     }
 }
开发者ID:tangxuehua,项目名称:eventsourcing,代码行数:10,代码来源:ForumService.cs


示例15: GetATopic

        public static Topic GetATopic(Forum forum)
        {
            var topicService = TestHelper.Resolve<ITopicsService>();
            List<Topic> topicList = topicService.GetByForum(forum.Id, 0, 1, null);

            if (topicList.Count == 0)
            {
                Assert.Inconclusive("There is no topic in the db to perform this test.");
            }
            Topic topic = topicService.Get(topicList[0].Id);
            return topic;
        }
开发者ID:jorgebay,项目名称:nearforums,代码行数:12,代码来源:TopicsControllerTest.cs


示例16: Forums_Save

		public int Forums_Save(int PortalId, Forum fi, bool isNew, bool UseGroup)
		{
			try
			{
				var fc = new ForumController();
				return fc.Forums_Save(PortalId, fi, isNew, UseGroup);
			}
			catch (Exception ex)
			{
				return -1;
			}
		}
开发者ID:allanedk,项目名称:ActiveForums,代码行数:12,代码来源:API.cs


示例17: UnFollow

		public void UnFollow(Forum forum) {
			if (forum == null) {
				throw new ArgumentNullException("forum");
			}
			User user = this.userProvider.CurrentUser;
			if (user == null) {
				throw new NoAuthenticatedUserFoundException();
			}
			FollowForum ff = this.forumRepo.ByUserAndForum(forum, user);
			if (ff != null) {
				this.forumRepo.Delete(ff);
			}
		}
开发者ID:razzles67,项目名称:NForum,代码行数:13,代码来源:FollowerService.cs


示例18: GetTrackingInfo

		/// <summary>
		/// 
		/// </summary>
		/// <param name="user"></param>
		/// <param name="forum"></param>
		/// <returns>null, if the user does can not access the forum</returns>
		public ForumTracker GetTrackingInfo(User user, Forum forum) {
			if (user != null) {
				throw new ArgumentNullException("user");
			}
			if (forum != null) {
				throw new ArgumentNullException("forum");
			}
			// Can the user access the forum?
			if (this.permService.HasAccess(user, forum)) {
				return null;
			}
			return this.ftRepo.ByUserAndForum(user, forum);
		}
开发者ID:razzles67,项目名称:NForum,代码行数:19,代码来源:TrackerService.cs


示例19: UserDialog

 public UserDialog(Forum site, String userName)
 {
     this.Build ();
     this.site = site;
     this.userName = userName;
     this.userId = site.getUserId (userName);
     if (!userId.Equals(string.Empty)) {
         this.image2.Pixbuf = new Gdk.Pixbuf (getAvatar ());
         this.labelNumPosts.Text = site.getUserPostCount (userName).ToString ();
         this.labelLastActivity.Text = site.getUserLastActivityTime (userName).ToString ();
         userInfoLoaded = true;
     }
 }
开发者ID:jiceland,项目名称:sharptalk,代码行数:13,代码来源:UserDialog.cs


示例20: Edit

        /// <summary>
        /// Updates the forum
        /// </summary>
        /// <param name="forum"></param>
        /// <param name="userId">User that is updating the forum</param>
        public void Edit(Forum f, int userId)
        {
            DbCommand comm = this.GetCommand("SPForumsUpdate");
            comm.AddParameter(this.Factory, "ForumShortName", DbType.String, f.ShortName);
            comm.AddParameter(this.Factory, "ForumName", DbType.String, f.Name);
            comm.AddParameter(this.Factory, "ForumDescription", DbType.String, f.Description);
            comm.AddParameter(this.Factory, "CategoryId", DbType.String, f.Category.Id);
            comm.AddParameter(this.Factory, "UserId", DbType.Int32, userId);
            comm.AddParameter(this.Factory, "ReadAccessGroupId", DbType.Int16, f.ReadAccessRole);
            comm.AddParameter(this.Factory, "PostAccessGroupId", DbType.Int16, f.PostAccessRole);

            comm.SafeExecuteNonQuery();
        }
开发者ID:jorgebay,项目名称:nearforums,代码行数:18,代码来源:ForumsDataAccess.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ForumBoard类代码示例发布时间:2022-05-24
下一篇:
C# FormattingEngine类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap