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


C# HeaderAction类代码示例

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


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

示例1: Page_Load

    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        widgetId = QueryHelper.GetInteger("widgetid", 0);

        Title = "Widget part documentation";

        // Resource string
        btnOk.Text = GetString("General.Ok");

        WidgetInfo wi = WidgetInfoProvider.GetWidgetInfo(widgetId);

        // set Documentation header - "View documentation" + "Generate Documentation"
        if (wi != null)
        {

            HeaderAction action = new HeaderAction();
            action.Text = GetString("webparteditdocumentation.view");
            action.RedirectUrl = "~/CMSModules/Widgets/Dialogs/WidgetDocumentation.aspx?widgetid=" + wi.WidgetID;
            action.Target = "_blank";
            CurrentMaster.HeaderActions.AddAction(action);
        }

        // HTML editor settings
        htmlText.AutoDetectLanguage = false;
        htmlText.DefaultLanguage = Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;
        htmlText.EditorAreaCSS = "";
        htmlText.ToolbarSet = "SimpleEdit";

        // Load data
        if (!RequestHelper.IsPostBack() && (wi != null))
        {
            htmlText.ResolvedValue = wi.WidgetDocumentation;
        }
    }
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:37,代码来源:Widget_Edit_Documentation.aspx.cs

示例2: InitMaster

    /// <summary>
    /// Initializes master page and header actions.
    /// </summary>
    private void InitMaster()
    {
        // Init filter for the first time according to user permissions
        if (!RequestHelper.IsPostBack())
        {
            if (AuthorizedForGlobalPolls && AuthorizedForSitePolls)
            {
                fltSite.SiteID = QueryHelper.GetInteger("siteid", SiteContext.CurrentSiteID);
            }
            else if (AuthorizedForSitePolls)
            {
                // User is authorized for site polls => select site polls
                fltSite.SiteID = SiteContext.CurrentSiteID;
            }
            else
            {
                // User is authorized for global polls => select global polls only
                fltSite.SiteID = UniSelector.US_GLOBAL_RECORD;
            }
        }

        HeaderAction action = new HeaderAction();
        action.Text = GetString("Polls_List.NewItemCaption");
        action.RedirectUrl = ResolveUrl("Polls_New.aspx?siteid=" + fltSite.SiteID);
        hdrActions.AddAction(action);

        // Set the page title
        PageTitle.TitleText = GetString("Polls_List.HeaderCaption");
        CurrentMaster.DisplaySiteSelectorPanel = AuthorizedForSitePolls && AuthorizedForGlobalPolls;
    }
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:33,代码来源:Polls_List.aspx.cs

示例3: InitHeaderActions

    /// <summary>
    /// Initializes header actions.
    /// </summary>
    private void InitHeaderActions()
    {
        if (MembershipContext.AuthenticatedUser.IsAuthorizedPerUIElement("CMS.MVTest", "New"))
        {
            string url = UIContextHelper.GetElementUrl("CMS.MVTest", "New", EditInDialog);

            // Get the alias path of the current node
            if (Node != null)
            {
                // Set NodeID in order to check the access to the document
                listElem.NodeID = Node.NodeID;
                listElem.AliasPath = Node.NodeAliasPath;

                url = URLHelper.AddParameterToUrl(url, "NodeID", Node.NodeID.ToString());
                url = URLHelper.AddParameterToUrl(url, "AliasPath", Node.NodeAliasPath);
            }

            // Set header action
            var action = new HeaderAction
            {
                ResourceName = "CMS.MVTest",
                Permission = "Manage",
                Text = GetString("mvtest.new"),
                RedirectUrl = ResolveUrl(url),
                OpenInDialog = EditInDialog
            };

            CurrentMaster.HeaderActions.AddAction(action);
        }
    }
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:33,代码来源:List.aspx.cs

示例4: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        int projectId = QueryHelper.GetInteger("projectid", 0);

        ProjectInfo pi = ProjectInfoProvider.GetProjectInfo(projectId);
        if (pi != null)
        {
            if (pi.ProjectSiteID != SiteContext.CurrentSiteID)
            {
                RedirectToInformation(GetString("general.notassigned"));
            }
        }

        if (projectId > 0)
        {
            // Display project tasks
            listElem.ProjectID = projectId;
            listElem.OrderByType = ProjectTaskOrderByEnum.ProjectOrder;
            listElem.OrderBy = "TaskPriorityOrder ASC, ProjectTaskDeadline DESC";
        }
        else
        {
            // Display all task (project + ad-hoc tasks)
            listElem.Grid.GridName = "~/CMSModules/ProjectManagement/Controls/UI/ProjectTask/ListAll.xml";
            listElem.OrderBy = "ProjectTaskDisplayName";
            listElem.SiteName = SiteContext.CurrentSiteName;
        }

        HeaderAction action = new HeaderAction();
        action.Text = (projectId > 0) ? GetString("pm.projecttask.new") : GetString("pm.projecttask.newpersonal");
        action.RedirectUrl = ResolveUrl("Edit.aspx" + ((projectId > 0) ? ("?projectid=" + projectId) : ""));
        CurrentMaster.HeaderActions.AddAction(action);
    }
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:33,代码来源:List.aspx.cs

示例5: OnPreRender

    protected override void OnPreRender(EventArgs e)
    {
        if (CurrentWorkflow != null)
        {
            // Only basic workflow without auto-publish can be converted
            if (WorkflowInfoProvider.IsAdvancedWorkflowAllowed() && CurrentWorkflow.IsBasic)
            {
                HeaderAction convert = new HeaderAction()
                {
                    Text = GetString("workflow.convert"),
                    ImageUrl = GetImageUrl("Design/Controls/UniGrid/Actions/convert.png"),
                    OnClientClick = "return confirm(" + ScriptHelper.GetString(GetString("workflow.confirmconversion"), true) + ");",
                    EventName = CONVERT_ACTION
                };

                if (editElem.CurrentWorkflow.WorkflowAutoPublishChanges)
                {
                    convert.ImageUrl = GetImageUrl("Design/Controls/UniGrid/Actions/convertdisabled.png");
                    convert.Tooltip = GetString("workflow.conversionerror.versioningwithoutworkflow");
                    convert.Enabled = false;
                }
                CurrentMaster.HeaderActions.AddAction(convert);
            }
        }
        base.OnPreRender(e);
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:26,代码来源:Workflow_General.aspx.cs

示例6: InitHeaderActions

    /// <summary>
    /// Initializes header actions.
    /// </summary>
    private void InitHeaderActions()
    {
        if (MembershipContext.AuthenticatedUser.IsAuthorizedPerUIElement("CMS.ABTest", "New"))
        {
            string url = UIContextHelper.GetElementUrl("CMS.ABTest", "New", EditInDialog);

            // Get the alias path of the current node, if in content
            if (Node != null)
            {
                listElem.NodeID = Node.NodeID;
                listElem.ShowOriginalPageColumn = false;
                string aliasPath = Node.NodeAliasPath;
                listElem.AliasPath = aliasPath;

                url = URLHelper.AddParameterToUrl(url, "NodeID", Node.NodeID.ToString());
                url = URLHelper.AddParameterToUrl(url, "AliasPath", aliasPath);
            }

            url = ResolveUrl(url);

            // Set header action
            var action = new HeaderAction
            {
                ResourceName = "CMS.ABTest",
                Permission = "Manage",
                Text = GetString("abtesting.abtest.new"),
                RedirectUrl = url,
                OpenInDialog = EditInDialog
            };

            CurrentMaster.HeaderActions.AddAction(action);
        }
    }
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:36,代码来源:List.aspx.cs

示例7: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        int projectId = QueryHelper.GetInteger("projectid", 0);
        groupId = QueryHelper.GetInteger("groupid", 0);

        if (projectId > 0)
        {
            // Display project tasks
            listElem.ProjectID = projectId;
            listElem.OrderByType = ProjectTaskOrderByEnum.ProjectOrder;
        }
        else
        {
            // Display all task (project + ad-hoc tasks)
            listElem.Grid.GridName = URLHelper.ResolveUrl("~/CMSModules/ProjectManagement/Controls/UI/ProjectTask/ListAll.xml");
            listElem.OrderByType = ProjectTaskOrderByEnum.ProjectOrder;
            listElem.OrderBy = "ProjectTaskDisplayName";
        }

        // Set OnCheckPermissions event handler
        listElem.OnCheckPermissionsExtended += new CMSAdminControl.CheckPermissionsExtendedEventHandler(listElem_OnCheckPermissionsExtended);

        listElem.CommunityGroupID = groupId;

        HeaderAction action = new HeaderAction();
        action.Text = GetString("pm.projecttask.new");
        action.RedirectUrl = ResolveUrl("~/CMSModules/Groups/Tools/ProjectManagement/ProjectTask/Edit.aspx?projectid=" + projectId + "&groupid=" + groupId);
        CurrentMaster.HeaderActions.AddAction(action);
    }
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:29,代码来源:List.aspx.cs

示例8: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        // Get poll id from querystring
        pollId = QueryHelper.GetInteger("pollId", 0);
        pi = PollInfoProvider.GetPollInfo(pollId);
        EditedObject = pi;

        // Check global and site read permmision
        CheckPollsReadPermission(pi.PollSiteID);

        if (CheckPollsModifyPermission(pi.PollSiteID, false))
        {
            HeaderAction newItem = new HeaderAction();
            newItem.Text = GetString("Polls_Answer_List.NewItemCaption");
            newItem.RedirectUrl = ResolveUrl("Polls_Answer_Edit.aspx?pollId=" + pollId);
            CurrentMaster.HeaderActions.AddAction(newItem);

            HeaderAction reset = new HeaderAction();
            reset.Text = GetString("Polls_Answer_List.ResetButton");
            reset.OnClientClick = "return confirm(" + ScriptHelper.GetString(GetString("Polls_Answer_List.ResetConfirmation")) + ");";
            reset.CommandName = "btnReset_Click";
            CurrentMaster.HeaderActions.AddAction(reset);
            CurrentMaster.HeaderActions.ActionPerformed += HeaderActions_ActionPerformed;

            AnswerList.AllowEdit = true;
        }

        AnswerList.OnEdit += new EventHandler(AnswerList_OnEdit);
        AnswerList.PollId = pollId;
        AnswerList.IsLiveSite = false;
        AnswerList.AllowEdit = CheckPollsModifyPermission(pi.PollSiteID, false);
    }
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:32,代码来源:Polls_Answer_List.aspx.cs

示例9: Page_Load

    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        // Check permissions
        isAuthorised = (CMSContext.CurrentUser.IsAuthorizedPerResource("CMS.Design", "Design"));

        // Setup device layouts grid
        deviceLayoutsGrid.WhereCondition = "ProfileID IN (SELECT ProfileID FROM CMS_TemplateDeviceLayout WHERE PageTemplateID = " + PageTemplateID + ")";
        deviceLayoutsGrid.OnAction += new OnActionEventHandler(deviceLayoutsGrid_OnAction);

        // "Create device layout" button
        string dialogUrl = URLHelper.ResolveUrl("~/CMSModules/PortalEngine/UI/PageLayouts/PageLayout_CustomDeviceLayout.aspx?dialog=1&templateid=" + PageTemplateID);

        if (isAuthorised)
        {
            // Create header button
            createDeviceLayout = new HeaderAction()
            {
                ControlType = HeaderActionTypeEnum.LinkButton,
                Text = GetString("devicelayout.create"),
                Tooltip = GetString("devicelayout.create.tooltip"),
                OnClientClick = "modalDialog('" + dialogUrl + "', 'createCustomDeviceLayout', 500, 480); return false;",
                ImageUrl = GetImageUrl("Objects/CMS_DeviceProfile/add.png"),
                SmallImageUrl = GetImageUrl("Objects/CMS_DeviceProfile/add.png")
            };

            AddHeaderAction(createDeviceLayout);
        }

        string script = @"
        function GetEditDeviceUrl(deviceProfileId) {
        return '" + URLHelper.ResolveUrl("~/CMSModules/PortalEngine/UI/PageTemplates/DeviceLayout_Frameset.aspx") + "?deviceprofileid=' + deviceProfileId + '&templateid=" + PageTemplateID + "&aliaspath=" + aliasPath + @"';
        }";
        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "editScript", script, true);
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:37,代码来源:PageTemplate_DeviceLayouts.aspx.cs

示例10: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        webpartId = QueryHelper.GetInteger("webpartid", 0);

        Title = "Web part documentation";

        // Resource string
        btnOk.Text = GetString("General.Ok");

        WebPartInfo wpi = WebPartInfoProvider.GetWebPartInfo(webpartId);
        EditedObject = wpi;
        if (wpi != null)
        {
            HeaderAction action = new HeaderAction();
            action.Text = GetString("webparteditdocumentation.view");
            action.RedirectUrl = "~/CMSModules/PortalEngine/UI/WebParts/WebPartDocumentationPage.aspx?webpartid=" + wpi.WebPartName;
            action.Target = "_blank";
            CurrentMaster.HeaderActions.AddAction(action);
        }

        // HTML editor settings
        htmlText.AutoDetectLanguage = false;
        htmlText.DefaultLanguage = Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;
        htmlText.EditorAreaCSS = "";
        htmlText.ToolbarSet = "SimpleEdit";

        // Load data
        if (!RequestHelper.IsPostBack() && (wpi != null))
        {
            htmlText.ResolvedValue = wpi.WebPartDocumentation;
        }
    }
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:32,代码来源:WebPart_Edit_Documentation.aspx.cs

示例11: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        // Get poll id from querystring
        pollId = QueryHelper.GetInteger("pollId", 0);
        groupId = QueryHelper.GetInteger("groupId", 0);

        if (CheckGroupPermissions(groupId, CMSAdminControl.PERMISSION_MANAGE, false))
        {
            HeaderAction newItem = new HeaderAction();
            newItem.Text = GetString("Polls_Answer_List.NewItemCaption");
            newItem.RedirectUrl = ResolveUrl("Polls_Edit_Answer_Edit.aspx?pollId=" + pollId.ToString() + "&groupId=" + groupId);
            CurrentMaster.HeaderActions.AddAction(newItem);

            HeaderAction reset = new HeaderAction();
            reset.Text = GetString("Polls_Answer_List.ResetButton");
            reset.OnClientClick = "return confirm(" + ScriptHelper.GetString(GetString("Polls_Answer_List.ResetConfirmation")) + ");";
            reset.CommandName = "btnReset_Click";
            CurrentMaster.HeaderActions.AddAction(reset);

            CurrentMaster.HeaderActions.ActionPerformed += new CommandEventHandler(HeaderActions_ActionPerformed);

            AnswerList.AllowEdit = true;
        }

        AnswerList.OnEdit += new EventHandler(AnswerList_OnEdit);
        AnswerList.OnCheckPermissions += new CMSAdminControl.CheckPermissionsEventHandler(AnswerList_OnCheckPermissions);
        AnswerList.PollId = pollId;
        AnswerList.GroupId = groupId;
    }
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:29,代码来源:Polls_Edit_Answer_List.aspx.cs

示例12: InitializeMasterPage

 /// <summary>
 /// Initializes the master page elements.
 /// </summary>
 private void InitializeMasterPage()
 {
     HeaderAction action = new HeaderAction();
     action.Text = GetString("board.subscriptions.newitem");
     action.RedirectUrl = "~/CMSModules/Groups/Tools/MessageBoards/Boards/Board_Edit_Subscription_Edit.aspx?boardid=" + boardId.ToString() + "&groupid=" + groupId;
     CurrentMaster.HeaderActions.AddAction(action);
 }
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:10,代码来源:Board_Edit_Subscriptions.aspx.cs

示例13: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        userId = QueryHelper.GetInteger("userId", 0);
        currentUser = MembershipContext.AuthenticatedUser;
        if (userId <= 0 && currentUser != null)
        {
            userId = currentUser.UserID;
        }

        // Check 'read' permissions
        if (!currentUser.IsAuthorizedPerResource("CMS.Friends", "Read") && (currentUser.UserID != userId))
        {
            RedirectToAccessDenied("CMS.Friends", "Read");
        }

        // Check 'manage' permission
        bool friendsManagePermission = currentUser.IsAuthorizedPerResource("CMS.Friends", "Manage") || (currentUser.UserID == userId);

        // Check license
        if (DataHelper.GetNotEmpty(RequestContext.CurrentDomain, string.Empty) != string.Empty)
        {
            LicenseHelper.CheckFeatureAndRedirect(RequestContext.CurrentDomain, FeatureEnum.Friends);
        }

        // Check that only global administrator can edit global administrator's accounts
        if (userId > 0)
        {
            UserInfo ui = UserInfoProvider.GetUserInfo(userId);
            EditedObject = ui;

            if (!CheckGlobalAdminEdit(ui))
            {
                plcTable.Visible = false;
                lblError.Text = GetString("Administration-User_List.ErrorGlobalAdmin");
                lblError.Visible = true;
            }
            else
            {
                ScriptHelper.RegisterDialogScript(this);
                FriendsList.UserID = userId;
                FriendsList.OnCheckPermissions += CheckPermissions;
                FriendsList.ZeroRowsText = GetString("friends.nouserfriends");

                // Request friend link
                string script =
                    "function displayRequest(){ \n" +
                    "modalDialog('" + AuthenticationHelper.ResolveDialogUrl("~/CMSModules/Friends/Dialogs/Friends_Request.aspx") + "?userid=" + userId + "&siteid=" + SiteID + "', 'rejectDialog', 810, 460);}";

                ScriptHelper.RegisterStartupScript(this, GetType(), "displayModalRequest", ScriptHelper.GetScript(script));

                HeaderAction action = new HeaderAction();
                action.Text = GetString("Friends_List.NewItemCaption");
                action.OnClientClick = "displayRequest();";
                action.RedirectUrl = null;
                action.Enabled = friendsManagePermission;
                CurrentMaster.HeaderActions.AddAction(action);
            }
        }
    }
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:59,代码来源:User_Edit_Friends_Approved.aspx.cs

示例14: InitializeMasterPage

 /// <summary>
 /// Initializes the master page elements.
 /// </summary>
 private void InitializeMasterPage()
 {
     // Setup master page action element
     HeaderAction action = new HeaderAction();
     action.Text = GetString("board.subscriptions.newitem");
     action.RedirectUrl = ResolveUrl("~/CMSModules/MessageBoards/Tools/Boards/Board_Edit_Subscription_Edit.aspx?boardid=" + mBoardId.ToString() + "&changemaster=" + changeMaster);
     CurrentMaster.HeaderActions.AddAction(action);
 }
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:11,代码来源:Board_Edit_Subscriptions.aspx.cs

示例15: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        // Get AnswerID and PollID from querystring
        int pollId = QueryHelper.GetInteger("pollid", 0);

        string currentPollAnswer = GetString("Polls_Answer_Edit.NewItemCaption");

        int answerId = QueryHelper.GetInteger("answerId", 0);
        if (QueryHelper.GetInteger("saved", 0) == 1)
        {
            AnswerEdit.Saved = true;
        }
        AnswerEdit.ItemID = answerId;
        AnswerEdit.PollId = pollId;

        if (answerId > 0)
        {
            // Modifying existing answer
            CurrentMaster.Title.HelpTopicName = "answer_edit";
            PollAnswerInfo pollAnswerObj = PollAnswerInfoProvider.GetPollAnswerInfo(answerId);
            EditedObject = pollAnswerObj;
            if (pollAnswerObj != null)
            {
                currentPollAnswer = GetString("Polls_Answer_Edit.AnswerLabel") + " " + pollAnswerObj.AnswerOrder.ToString();
                pollId = pollAnswerObj.AnswerPollID;
            }
        }
        else
        {
            // Creating new answer - check if parent object exists
            EditedObject = PollInfoProvider.GetPollInfo(pollId);
            CurrentMaster.Title.HelpTopicName = "new_answer";
        }

        // Initializes page title control
        string[,] breadcrumbs = new string[2,3];
        breadcrumbs[0, 0] = GetString("Polls_Answer_Edit.ItemListLink");
        breadcrumbs[0, 1] = "~/CMSModules/Polls/Tools/Polls_Answer_List.aspx?pollId=" + pollId;
        breadcrumbs[0, 2] = "";
        breadcrumbs[1, 0] = currentPollAnswer;
        breadcrumbs[1, 1] = "";
        breadcrumbs[1, 2] = "";
        CurrentMaster.Title.Breadcrumbs = breadcrumbs;

        HeaderAction add = new HeaderAction()
        {
            ControlType = HeaderActionTypeEnum.Hyperlink,
            Text = GetString("Polls_Answer_List.NewItemCaption"),
            RedirectUrl = ResolveUrl("Polls_Answer_Edit.aspx?pollId=" + pollId.ToString()),
            ImageUrl = GetImageUrl("CMSModules/CMS_Polls/addanswer.png")
        };

        CurrentMaster.HeaderActions.AddAction(add);

        AnswerEdit.OnSaved += new EventHandler(AnswerEdit_OnSaved);
        AnswerEdit.IsLiveSite = false;
    }
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:57,代码来源:Polls_Answer_Edit.aspx.cs


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