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


C# VBox.Clear方法代码示例

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


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

示例1: CreateResult

        /// <summary>
        /// Create result vbox data item.
        /// </summary>
        public void CreateResult(VBox RequestStatus, Font CaptionFont)
        {
            // Clear
            RequestStatus.Clear();

            // Nothing to do!
            if (RequestRemoteResult == null)
            {
                RequestStatus.PackStart(new Label(Director.Properties.Resources.NoResponse)
                {
                    Font = CaptionFont
                });
                return;
            }

            // iterate
            bool first = true;
            foreach (var i in RequestRemoteResult)
            {
                if (i.Type == 1)
                {
                    RequestStatus.PackStart(new Label(i.Data)
                    {
                        Font = CaptionFont,
                        MarginTop = (first) ? 0 : 20
                    }, false, false);
                }
                else if (i.Type == 2)
                {
                    RequestStatus.PackStart(new ListItem(i.Data));
                }
                else
                {
                    TextEntry RequestTextEntry = new TextEntry()
                    {
                        Margin = 10,
                        Text = i.Data,
                        Sensitive = false,
                        MultiLine = true
                    };
                    RequestStatus.PackStart(RequestTextEntry);
                    Button ClipboardButtonReq = new Button(Image.FromResource(DirectorImages.COPY_ICON), "")
                    {
                        WidthRequest = 30,
                        HeightRequest = 30,
                        ExpandHorizontal = false,
                        ExpandVertical = false,
                        MarginRight = 10,
                        TooltipText = Director.Properties.Resources.CopyInClipboard
                    };
                    ClipboardButtonReq.Clicked += delegate
                    {
                        Clipboard.SetText(RequestTextEntry.Text);
                    };
                    RequestStatus.PackStart(ClipboardButtonReq, hpos: WidgetPlacement.End);
                }

                first = false;
            }
        }
开发者ID:KIV-ASWI-PL2014,项目名称:Director,代码行数:63,代码来源:Request.cs

示例2: CreateOverview

        /// <summary>
        /// Create overview!
        /// </summary>
        public void CreateOverview(VBox RequestOverview, Font CaptionFont)
        {
            // Overview clear
            RequestOverview.Clear();

            // Information
            RequestOverview.PackStart(new Label(Director.Properties.Resources.RequestUrl + ":")
            {
                Font = CaptionFont

            }, false, false);

            // Create URL
            RequestOverview.PackStart(new LinkLabel(Url)
            {
                Uri = new Uri(Url),
                MarginLeft = 10
            }, false, false);

            // Method
            RequestOverview.PackStart(new Label(Director.Properties.Resources.RequestMethod + ":")
            {
                Font = CaptionFont,
                MarginTop = 20
            }, false, false);

            // Create URL
            RequestOverview.PackStart(new Label(HTTP_METHOD)
            {
                MarginLeft = 10
            }, false, false);

            // Headers
            if (Headers.Count > 0)
            {
                RequestOverview.PackStart(new Label(Director.Properties.Resources.RequestHeaders + ":")
                {
                    Font = CaptionFont,
                    MarginTop = 20
                }, false, false);
                foreach (var h in Headers)
                    RequestOverview.PackStart(new ListItem(string.Format("{0} - {1}", h.Name, h.Value)));
            }

            // Files
            if (Files.Count > 0)
            {
                RequestOverview.PackStart(new Label(Director.Properties.Resources.RequestFiles + ":")
                {
                    Font = CaptionFont,
                    MarginTop = 20
                }, false, false);
                foreach (var h in Files)
                    RequestOverview.PackStart(new ListItem(h.FileName));
            }

            // Request
            // Request
            if (RequestTemplate != null && RequestTemplate.Length > 0)
            {
                RequestOverview.PackStart(new Label(string.Format("{0} ({1}) :", Director.Properties.Resources.RequestTemplate, RequestTemplateTypeS))
                {
                    Font = CaptionFont,
                    MarginTop = 20
                }, false, false);

                TextEntry RequestTextEntry = new TextEntry()
                {
                    Margin = 10, Sensitive = false, MultiLine = true
                };

                if (RequestTemplateType == ContentType.JSON)
                {
                    RequestTextEntry.Text = JSONFormatter.Format(RequestTemplate);

                    if (RequestTextEntry.Text == null || RequestTextEntry.Text.Trim().Length == 0)
                        RequestTextEntry.Text = RequestTemplate;
                }
                else
                {
                    RequestTextEntry.Text = RequestTemplate;
                }
                RequestOverview.PackStart(RequestTextEntry);

                Button ClipboardButtonReq = new Button(Image.FromResource(DirectorImages.COPY_ICON), "")
                {
                    WidthRequest = 30,
                    HeightRequest = 30,
                    ExpandHorizontal = false,
                    ExpandVertical = false,
                    MarginRight = 10,
                    TooltipText = Director.Properties.Resources.CopyInClipboard
                };
                ClipboardButtonReq.Clicked += delegate
                {
                    Clipboard.SetText(RequestTextEntry.Text);
                };
//.........这里部分代码省略.........
开发者ID:KIV-ASWI-PL2014,项目名称:Director,代码行数:101,代码来源:Request.cs


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