Пример #1
0
 public virtual Apache.Http.Client.Methods.RequestBuilder SetHeader(Header header)
 {
     if (headergroup == null)
     {
         headergroup = new HeaderGroup();
     }
     this.headergroup.UpdateHeader(header);
     return(this);
 }
Пример #2
0
 public virtual Apache.Http.Client.Methods.RequestBuilder SetHeader(string name, string
                                                                    value)
 {
     if (headergroup == null)
     {
         headergroup = new HeaderGroup();
     }
     this.headergroup.UpdateHeader(new BasicHeader(name, value));
     return(this);
 }
 /// <summary>
 /// Sets the inheritence parent.
 /// </summary>
 /// <param name="inheritNavigator">Source for inheriting.</param>
 public void SetInherit(PaletteNavigator inheritNavigator)
 {
     // Setup inheritance references for storage objects
     base.SetInherit(inheritNavigator);
     PalettePage.SetInherit(inheritNavigator.PalettePage);
     HeaderGroup.SetInherit(inheritNavigator.HeaderGroup);
     CheckButton.SetInherit(inheritNavigator.CheckButton);
     OverflowButton.SetInherit(inheritNavigator.OverflowButton);
     MiniButton.SetInherit(inheritNavigator.MiniButton);
     BorderEdge.SetInherit(inheritNavigator.BorderEdge);
     Separator.SetInherit(inheritNavigator.Separator);
     Tab.SetInherit(inheritNavigator.Tab);
     RibbonTab.SetInherit(inheritNavigator.RibbonTab.TabDraw, inheritNavigator.RibbonTab.TabDraw, inheritNavigator.RibbonTab.Content);
 }
Пример #4
0
 private Apache.Http.Client.Methods.RequestBuilder DoCopy(IHttpRequest request)
 {
     if (request == null)
     {
         return(this);
     }
     method  = request.GetRequestLine().GetMethod();
     version = request.GetRequestLine().GetProtocolVersion();
     if (request is IHttpUriRequest)
     {
         uri = ((IHttpUriRequest)request).GetURI();
     }
     else
     {
         uri = URI.Create(request.GetRequestLine().GetMethod());
     }
     if (headergroup == null)
     {
         headergroup = new HeaderGroup();
     }
     headergroup.Clear();
     headergroup.SetHeaders(request.GetAllHeaders());
     if (request is HttpEntityEnclosingRequest)
     {
         entity = ((HttpEntityEnclosingRequest)request).GetEntity();
     }
     else
     {
         entity = null;
     }
     if (request is Configurable)
     {
         this.config = ((Configurable)request).GetConfig();
     }
     else
     {
         this.config = null;
     }
     this.parameters = null;
     return(this);
 }
Пример #5
0
		private void FetchHotListCompleted(object sender, BaseEventArgs e)
		{
			if (callback == null) return;
			HtmlDocument doc = new HtmlDocument();
			doc.LoadHtml(e.Result as string);
			List<HeaderGroup> hotList = new List<HeaderGroup>();
			var items = doc.DocumentNode.SelectNodes("//tr");
			HeaderGroup grp = null;
			int sid = 0;

			foreach (var i in items)
			{
				if (i.SelectSingleNode("td/img") != null)
				{
					grp = new HeaderGroup(sid++);
					continue;
				}
				if (i.InnerHtml.StartsWith("<td>\n<tr><td colspan=\"2\">"))
				{
					hotList.Add(grp);
					continue;
				}
				MatchCollection matches = RE.Matches(i.InnerHtml);
				foreach (Match m in matches)
				{
					Header h = new Header();
					h.Board = m.Groups[1].ToString();
					h.Pid = int.Parse(m.Groups[2].ToString());
					h.Title = m.Groups[3].ToString();
					grp.Add(h);
					if (i.InnerHtml[m.Index + m.Length] == 'r')
						break;
				}
			}
			hotList.Add(grp);
			callback(this, new BaseEventArgs(hotList));
		}
Пример #6
0
        protected override void OnInitialized()
        {
            _childLayer = new Layer(Layer);

            _dropdown1 = new Dropdown
                         (
                new Title(() => "Top titleZZ 1!"),
                new List <IBit>
            {
                new Link(() => "Link 1!", () => "/"),
                new Link(() => "Link 2!", () => "/"),
                new Link(() => "Link longer than the others!", () => "/"),
                new Arrow(
                    isStatic: false,
                    margin: () => new Size(5),
                    foregroundColor: () => Constants.Yellow_7,
                    fontSize: () => Number
                    ),
                new Heading(
                    () => "H3 heading #1!", Heading.Size.H3, display: () => Display.InlineBlock,
                    margin: () => new Size(5, 10, 15), padding: () => new Size(3, 6),
                    fontWeight: () => 700, backgroundColor: () => Constants.Blue_7,
                    foregroundColor: () => Constants.Blue_7_Text
                    ),
                new Title(
                    () => "Title #1!",
                    margin: () => new Size(5, 10, 15), padding: () => new Size(3, 6),
                    foregroundColor: () => Constants.Blue_7
                    ),
                new Chip(
                    () => "A chip", backgroundColor: () => Constants.Green_4,
                    foregroundColor: () => Constants.Green_4_Text
                    ),
                new Dropdown(
                    new Title(() => "Subtitle 1!"),
                    new List <IBit>
                {
                    new Link(() => "Link 1!", () => "/"),
                    new Link(() => "Link 2!", () => "/"),
                    new Link(() => "Link longer than the others!", () => "/"),
                },
                    true),
            }
                         );

            Button.Color NextColor(Button.Color current)
            {
                return(current == Button.Color.Yellow ? Button.Color.Default : current + 1);
            }

            _colorChangingButton = new Button
                                   (
                () => "Color changing button",
                _ =>
            {
                _colorChangingButtonColor = NextColor(_colorChangingButtonColor);
                StateHasChanged();
            },
                () => _colorChangingButtonColor,
                isStatic: false,
                data: () => new Dictionary <string, BitGetters.DataValue>
            {
                { "next-color", () => NextColor(_colorChangingButtonColor).ToString() },
            }
                                   );

            _buttonGroup = new ButtonGroup(new List <Button>
            {
                new Button(() =>
                {
                    var arrowLeft = new Icon <MaterialIcon>("keyboard_arrow_right");
                    return("Button with content " + arrowLeft.Render().Content());
                }, _ => _modal1.Show(), pixelsHeight: () => 21.5, padding: () => new Size(2, 0, 2, 6)),
                new Button(() => "Button blue!", async _ => await Console.Out.WriteLineAsync("async"),
                           () => Button.Color.Blue),
                new Button(() => "Button green!", _ => { }, () => Button.Color.Green, isDisabled: () => true),
                new Button(() => "Button orange!", _ => { }, () => Button.Color.Orange),
                new Button(() => "Button purple!", _ => { }, () => Button.Color.Purple, isHighlighted: () => true),
                new Button(() => "Button red!", _ => { }, () => Button.Color.Default,
                           tooltip: () => RandomNumberGenerator.GetInt32(100).ToString()),
                new Button(() => "Button yellow!", _ => { }, () => Button.Color.Default),
            });

            // _buttonGroup2 = new ButtonGroup(new List<Button>
            // {
            // new ToggleButton(() => "Toggle #1", async b => await Task.CompletedTask, () => false),
            // });

            _modal1 = new Modal();

            _faker = new Faker <PopperTests.User>()
                     .RuleFor(u => u.ID, (f, u) => f.IndexFaker)
                     .RuleFor(u => u.Name, (f, u) => f.Name.FullName())
                     .RuleFor(u => u.Department, (f, u) => f.Commerce.Department());

            _users   = _faker.Generate(1000);
            _options = _users.Select(v => new PopperTests.Option
            {
                Key           = v.ID.ToString(),
                Value         = v,
                OptionText    = $"{v.Name} - {v.Department}",
                SelectionText = v.Name,
                // Selected      = v.Name.StartsWith("A"),
            }).ToList();

            _multibox1 = new Multibox <PopperTests.User>
                         (
                JSRuntime, () => _options
                         );

            var checkbox1Value = false;

            checkbox1 = new Checkbox(c => checkbox1Value = c, isChecked: () => checkbox1Value,
                                     tooltip: () => checkbox1Value ? "Checkbox is checked" : null);
            checkbox2 = new Checkbox(async c => await Console.Out.WriteLineAsync("async " + c), isChecked: () => true);
            checkbox3 = new Checkbox(c => { }, isDisabled: () => true);
            checkbox4 = new Checkbox(c => { }, isDisabled: () => true, isChecked: () => true);
            checkbox5 = new Checkbox(c => { }, isRequired: () => true);

            _headerGroup = new HeaderGroup(new List <Header>
            {
                new Header(new List <IBit>
                {
                    new Title(() => "Title of primary header"),
                    new Filler(),
                    new Chip(() => "Chip 1"),
                }),
                new Header(new List <IBit>
                {
                    new Title(() => "Title of primary header 2"),
                    new Filler(),
                    new Chip(() => "Chip 2"),
                }),
                new Header(new List <IBit>
                {
                    new TextLine(() => "TextLine of secondary header"),
                    new Filler(),
                    new Chip(() => "Chip 3"),
                }, Header.HeaderType.Secondary),
                new Header(new List <IBit>
                {
                    new TextLine(() => "TextLine of secondary header 2"),
                    new Filler(),
                    new Chip(() => "Chip 4"),
                }, Header.HeaderType.Secondary),
            }, () => 500);

            _combobox = new Combobox <PopperTests.User>(JSRuntime, () => _options);

            _combobox.OnSelect += selected =>
            {
                if (selected != null)
                {
                }
            };
        }