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


C# Section.Clear方法代码示例

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


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

示例1: DebugPage

        public void DebugPage()
        {
            TraceHelper.AddMessage("Debug: constructor");

            // render URL and status
            var serviceUrl = new EntryElement("URL", "URL to connect to", WebServiceHelper.BaseUrl);
            var service = new Section("Service")
            {
                serviceUrl,
                new StringElement("Store New Service URL", delegate
                {
                    serviceUrl.FetchValue();
                    // validate that this is a good URL before storing it (a bad URL can hose the phone client)
                    Uri uri = null;
                    if (Uri.TryCreate(serviceUrl.Value, UriKind.RelativeOrAbsolute, out uri) &&
                        (uri.Scheme == "http" || uri.Scheme == "https"))
                        WebServiceHelper.BaseUrl = serviceUrl.Value;
                    else
                        serviceUrl.Value = WebServiceHelper.BaseUrl;
                }),
                new StringElement("Connected", App.ViewModel.LastNetworkOperationStatus.ToString()),
            };

            // render user queue
            var userQueue = new Section("User Queue");
            userQueue.Add(new StringElement(
                "Clear Queue",
                delegate
                {
                    RequestQueue.DeleteQueue(RequestQueue.UserQueue);
                    userQueue.Clear ();
                }));

            List<RequestQueue.RequestRecord> requests = RequestQueue.GetAllRequestRecords(RequestQueue.UserQueue);
            if (requests != null)
            {
                foreach (var req in requests)
                {
                    string typename;
                    string reqtype;
                    string id;
                    string name;
                    RequestQueue.RetrieveRequestInfo(req, out typename, out reqtype, out id, out name);
                    var sse = new StyledStringElement(String.Format("  {0} {1} {2} (id {3})", reqtype, typename, name, id))
                    {
                        Font = UIFont.FromName("Helvetica", UIFont.SmallSystemFontSize),
                    };
                    userQueue.Add (sse);
                }
            }

            // render system queue
            var systemQueue = new Section("System Queue");
            systemQueue.Add(new StringElement(
                "Clear Queue",
                delegate
                {
                    RequestQueue.DeleteQueue(RequestQueue.SystemQueue);
                    systemQueue.Clear ();
                }));

            requests = RequestQueue.GetAllRequestRecords(RequestQueue.SystemQueue);
            if (requests != null)
            {
                foreach (var req in requests)
                {
                    string typename;
                    string reqtype;
                    string id;
                    string name;
                    RequestQueue.RetrieveRequestInfo(req, out typename, out reqtype, out id, out name);
                    var sse = new StyledStringElement(String.Format("  {0} {1} {2} (id {3})", reqtype, typename, name, id))
                    {
                        Font = UIFont.FromName("Helvetica", UIFont.SmallSystemFontSize),
                    };
                    systemQueue.Add (sse);
                }
            }

            var traceMessages = new Section("Trace Messages");
            traceMessages.Add(new StringElement(
                "Clear Trace",
                delegate
                {
                    TraceHelper.ClearMessages();
                    traceMessages.Clear ();
                }));
            traceMessages.Add(new StringElement(
                "Send Trace",
                delegate
                {
                    TraceHelper.SendMessages(App.ViewModel.User);
                }));
            foreach (var m in TraceHelper.GetMessages().Split('\n'))
            {
                // skip empty messages
                if (m == "")
                    continue;

                // create a new (small) string element with a detail indicator which
//.........这里部分代码省略.........
开发者ID:ogazitt,项目名称:zaplify,代码行数:101,代码来源:DebugPage.cs


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