Ejemplo n.º 1
0
        public IActionResult Edit([FromBody] WhiteLabel vm)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                repository.Update(vm);
                var result = Db.SaveChanges();
                if (result != null)
                {
                    return(Ok(result));
                }
                else
                {
                    return(BadRequest());
                }
            }
            catch (ArgumentException ex)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message));
            }
        }
Ejemplo n.º 2
0
        static Grid CreateDataTemplate()
        {
            var image = new Image
            {
                Source = "Hash",
            };

            var titleLabel = new WhiteLabel(16)
            {
                VerticalTextAlignment = TextAlignment.Start,
                FontAttributes        = FontAttributes.Bold
            };

            titleLabel.SetBinding(Label.TextProperty, nameof(ListPageDataModel.Text));

            var detailLabel = new WhiteLabel(13)
            {
                FontAttributes = FontAttributes.Italic
            };

            detailLabel.SetBinding(Label.TextProperty, nameof(ListPageDataModel.Detail));

            var grid = new Grid
            {
                Margin     = new Thickness(5),
                RowSpacing = 1,

                RowDefinitions =
                {
                    new RowDefinition {
                        Height = new GridLength(20, GridUnitType.Absolute)
                    },
                    new RowDefinition {
                        Height = new GridLength(15, GridUnitType.Absolute)
                    },
                },
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = new GridLength(50, GridUnitType.Absolute)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    }
                }
            };

            grid.Children.Add(image, 0, 0);
            Grid.SetRowSpan(image, 2);

            grid.Children.Add(titleLabel, 1, 0);
            grid.Children.Add(detailLabel, 1, 1);

            return(grid);
        }
Ejemplo n.º 3
0
        private async void StartAnimation()
        {
            int  count          = 0;
            bool animationStart = true;

            while (animationStart)
            {
                await Task.Delay(2000);

                WhiteLabel.FadeTo(0, 2000);
                await Task.Delay(2000);

                WhiteLabel.FadeTo(1, 2000);
                animationStart = count < 3;
                count++;
            }
        }
Ejemplo n.º 4
0
    public Sample2()
    {
        this.Text  = "サンプル";
        this.Width = 400; this.Height = 200;

        WhiteLabel wl1 = new WhiteLabel();

        wl1.Text = "こんにちは";

        WhiteLabel wl2 = new WhiteLabel();

        wl2.Text = "ありがとう";

        wl2.Left = wl1.Left + 150;

        wl1.Parent = this;
        wl2.Parent = this;
    }
Ejemplo n.º 5
0
    public Sample2()
    {
        this.Text   = "sample";
        this.Width  = 400;
        this.Height = 200;

        WhiteLabel w11 = new WhiteLabel();

        w11.Text = "hello";

        WhhiteLabel w12 ~new WhiteLabel();

        w12.Text = "thank you";
        w12.Left = w11.Left + 150;

        w11.Parent = this;
        w12.Parent = this;
    }
Ejemplo n.º 6
0
        public IActionResult Add([FromBody] WhiteLabel vm)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                repository.Add(vm);

                var result = Db.SaveChanges();
                return(Created("", true));
            }
            catch (ArgumentException ex)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message));
            }
        }
Ejemplo n.º 7
0
    public static void Main()
    {
        Form fm = new Form();

        fm.Text  = "サンプル";
        fm.Width = 300; fm.Height = 200;

        WhiteLabel[] wl = new WhiteLabel[2];
        wl[0] = new WhiteLabel();
        wl[1] = new WhiteLabel();

        wl[0].Text = "こんにちは";
        wl[1].Text = "さようなら";

        wl[1].Left = wl[1].Width + 10;

        wl[0].Parent = fm;
        wl[1].Parent = fm;

        Application.Run(fm);
    }