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


C# Util.SetDefaultButton方法代码示例

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


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

示例1: SavePage

    protected bool SavePage()
    {
        try
        {
            Util util = new Util();
            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];

            util.SetDefaultButton(State, DefaultButtonImage.Text);
            XmlUtil x_util = new XmlUtil();
            //save application
            State["CreatePageMessage"] = null;

            string page_name = State["SelectedAppPage"].ToString();
            State["PageHtml"] = x_util.FilterCanvasOutput(SavedCanvasHtml.Text);
            string html = State["PageHtml"].ToString();

            Hashtable duplicates = x_util.EncodeAppPageToAppXml(State, page_name, html);

            Message.Text = "Page " + page_name + " has been saved. ";
            ShowPage(page_name);

            SavedCanvasHtml.Text = "";

            if (duplicates != null)
            {
                StringBuilder errors = new StringBuilder();
                foreach (string duplicate in duplicates.Keys)
                {
                    errors.Append(duplicate + " internal name in current page also found on " + duplicates[duplicate].ToString() + " page; ");
                }
                Message.Text += errors.ToString() + " Your app will not work with duplicate identifiers. Fix and then save this page again.";
            }

            if (State["EncodeComputeWarnings"] != null)
            {
                Message.Text += " " + State["EncodeComputeWarnings"].ToString();
                State["EncodeComputeWarnings"] = null;
            }

            InitAppPages();

            PagePanel.Style.Value = PagePanelStyle;
            return true;
        }
        catch (Exception ex)
        {
            Util util = new Util();
            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
            util.LogError(State, ex);
            Message.Text = "Internal Error: " + ex.Message + ": " + ex.StackTrace;
            return false;
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:53,代码来源:TabDesignWeb.aspx.cs

示例2: SaveAppInDatabase

    protected bool SaveAppInDatabase(string app, string page_name)
    {
        try
        {
            ClearMessages();
            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
            State["CreatePageMessage"] = null;

            //save application
            Util util = new Util();
            XmlUtil x_util = new XmlUtil();

             State["PageHtml"] = x_util.FilterCanvasOutput(SavedCanvasHtml.Text);
            string html =  State["PageHtml"].ToString();

            if ( State["SelectedDeviceType"] == null /*||  State["SelectedDeviceView"] == null*/)
            {
                 State["SelectedDeviceType"] = Constants.IPHONE;
                DeviceType.Text =  State["SelectedDeviceType"].ToString();
            }

            util.CreateApp(State, page_name, State["SelectedDeviceType"].ToString(), AppDescription.Text);
            util.SetDefaultButton(State, DefaultButtonImage.Text);
            Hashtable duplicates = x_util.EncodeAppPageToAppXml(State, page_name, html);
            if (duplicates != null)
            {
                 State["SelectedApp"] = app;

                util.DeleteApplication(State);

                ResetAppStateVariables();

                UpdateAppLists();
                AppPages.Items.Clear();

                StringBuilder errors = new StringBuilder();
                foreach (string duplicate in duplicates.Keys)
                {
                    errors.Append(duplicate + " internal name in current page also found on " + duplicates[duplicate].ToString() + " page; ");
                }
                Message.Text = errors.ToString() + " This application was not saved because duplicate identifiers are not allowed.";

                return false;
            }
            x_util.SetBackgroundImage(State);

            SetViewForDevice();
            ShowPage(page_name);
            CurrentApp.Items.Add(new RadComboBoxItem(app, app));
            CurrentApp.SelectedIndex = CurrentApp.Items.Count - 1;

            AppPages.Items.Clear();
            AppPages.Items.Add(new RadComboBoxItem(page_name, page_name));
            AppPages.SelectedIndex = 0;
            SavedCanvasHtml.Text = "";
            return true;
        }
        catch (Exception ex)
        {
            Util util = new Util();
            Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
            util.LogError(State, ex);
            Message.Text = "Internal Error: " + ex.Message + ": " + ex.StackTrace;
            return false;
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:66,代码来源:TabDesignWeb.aspx.cs


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