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


C# Forum类代码示例

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


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


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