//2018-05-10
        //authkey: authkey
        //size: full, tall, compact
        //url: Any HTTPS URL
        //Use: line://app/{liffId}

        public string AddLiffId(string authkey, string size, string url)
        {
            string apiurl = "https://api.line.me/liff/v1/apps";

            using (WebClient wc = new WebClient())
            {
                wc.Headers.Set("Authorization", "Bearer " + authkey);
                wc.Headers.Set("Content-Type", "application/json");

                View lv = new View();
                lv.type = size; //full, tall, compact
                lv.url  = url;

                View2 lv2 = new View2();
                lv2.view = lv;

                string json = JsonConvert.SerializeObject(lv2);

                wc.Encoding = System.Text.Encoding.UTF8;
                string          state = wc.UploadString(apiurl, json);
                LiffViewReceive m     = JsonConvert.DeserializeObject <LiffViewReceive>(state);

                return(m.liffId);
            }
        }
        private void BtnShowView_Click(object sender, RoutedEventArgs e)
        {
            switch (((ComboBoxItem)cbViews.SelectedItem).Tag)
            {
            case "View1":
                View1 view1 = new View1();
                view1.Show();
                break;

            case "View2":
                View2 view2 = new View2(false);
                view2.Show();
                break;

            case "View3":
                View3 view3 = new View3();
                view3.Show();
                break;

            case "ucDemo":
            case "ucDemo2":
                MessageBox.Show("Los user controls no pueden salir en ventanas");
                break;
            }
        }
Esempio n. 3
0
        public void AttributeBasedPresenterDiscoveryStrategy_GetBindings_MultipleViewsWithNoAttributes()
        {
            // Arrange
            var strategy = new AttributeBasedPresenterDiscoveryStrategy();
            var hosts    = new object[0];
            var view1    = new View1();
            var view2    = new View2();
            var views    = new IView[] { view1, view2 };

            // Act
            var results = strategy.GetBindings(hosts, views).ToArray();

            // Assert
            CollectionAssert.AreEqual(new[]
            {
                new PresenterDiscoveryResult
                (
                    new[] { view1 },
                    @"AttributeBasedPresenterDiscoveryStrategy:
- could not find a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithNoAttributes+View1",
                    new PresenterBinding[0]
                ),
                new PresenterDiscoveryResult
                (
                    new[] { view2 },
                    @"AttributeBasedPresenterDiscoveryStrategy:
- could not find a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithNoAttributes+View2",
                    new PresenterBinding[0]
                )
            },
                                      results
                                      );
        }
        public void AttributeBasedPresenterDiscoveryStrategy_GetBindings_MultipleViewsWithNoAttributes()
        {
            // Arrange
            var strategy = new AttributeBasedPresenterDiscoveryStrategy();
            var hosts = new object[0];
            var view1 = new View1();
            var view2 = new View2();
            var views = new IView[] { view1, view2 };

            // Act
            var results = strategy.GetBindings(hosts, views).ToArray();

            // Assert
            CollectionAssert.AreEqual(new[]
                {
                    new PresenterDiscoveryResult
                    (
                        new[] {view1},
                        @"AttributeBasedPresenterDiscoveryStrategy:
- could not find a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithNoAttributes+View1",
                        new PresenterBinding[0]
                    ),
                    new PresenterDiscoveryResult
                    (
                        new[] {view2},
                        @"AttributeBasedPresenterDiscoveryStrategy:
- could not find a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithNoAttributes+View2",
                        new PresenterBinding[0]
                    )
                },
                results
            );
        }
Esempio n. 5
0
    public View GetView()
    {
        View2 view = new View2();

        view.Property4 = Property4.ToString();
        Setup(view);
        return(view);
    }
Esempio n. 6
0
        static void Main(string[] args)
        {
            Model m  = new Model();
            View1 v1 = new View1(m);
            View2 v2 = new View2(m);

            for (int i = 0; i < 10; ++i)
            {
                m.setValue(i);
            }

            System.Console.Read();
        }
Esempio n. 7
0
        public void Initialize()
        {
            IRegion leftRegion = _regionManager.Regions[RegionNames.LeftRegion];
            var view1 = new View1();
            leftRegion.Add( view1 );

            IRegion documentRegion = _regionManager.Regions[RegionNames.DocumentRegion];
            var view2 = new View2();
            documentRegion.Add(view2);

            IRegion bottomRegion = _regionManager.Regions[RegionNames.BottomRegion];
            var view3 = new View3();
            bottomRegion.Add(view3);
        }
    public void TEST()
    {
        var container = new Container(cfg =>
        {
            cfg.Scan(scan =>
            {
                scan.TheCallingAssembly();
                scan.Convention <ViewScanner>();
            });
        });

        var current = new View2();

        IckyStaticMonster.Current = current;

        var view2 = container.GetInstance <View2>();

        view2.ShouldBeTheSameAs(current);
    }
Esempio n. 9
0
        public FrmMain()
        {
            InitializeComponent();
            btnPre.Click    += btnPre_Click;
            btnNext.Click   += btnNext_Click;
            btnCancel.Click += btnCancel_Click;

            view1      = new View1();
            view1.Dock = DockStyle.Fill;
            PanelMain.Controls.Add(view1);

            view2      = new View2();
            view2.Dock = DockStyle.Fill;
            PanelMain.Controls.Add(view2);

            view3            = new View3();
            view3.Assemblies = view1.FileInfos;
            view3.Dock       = DockStyle.Fill;
            PanelMain.Controls.Add(view3);
        }
        public void AttributeBasedPresenterDiscoveryStrategy_GetBindings_MultipleViewsWithSingleAttribute()
        {
            // Arrange
            var strategy = new AttributeBasedPresenterDiscoveryStrategy();
            var hosts = new object[0];
            var view1 = new View1();
            var view2 = new View2();
            var views = new IView[] { view1, view2 };

            // Act
            var results = strategy.GetBindings(hosts, views).ToArray();

            // Assert
            CollectionAssert.AreEqual(new[]
                {
                    new PresenterDiscoveryResult
                    (
                        new[] {view1},
                        @"AttributeBasedPresenterDiscoveryStrategy:
            - found a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithSingleAttribute+View1 (presenter type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithSingleAttribute+Presenter1, view type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithSingleAttribute+View1, binding mode: Default)",
                        new[]
                        {
                            new PresenterBinding(typeof(Presenter1), typeof(View1), BindingMode.Default, new[] {view1}),
                        }
                    ),
                    new PresenterDiscoveryResult
                    (
                        new[] {view2},
                        @"AttributeBasedPresenterDiscoveryStrategy:
            - found a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithSingleAttribute+View2 (presenter type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithSingleAttribute+Presenter2, view type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithSingleAttribute+View2, binding mode: Default)",
                        new[]
                        {
                            new PresenterBinding(typeof(Presenter2), typeof(View2), BindingMode.Default, new[] {view2}),
                        }
                    )
                },
                results
            );
        }
        public void AttributeBasedPresenterDiscoveryStrategy_GetBindings_MultipleViewsWithSingleAttribute()
        {
            // Arrange
            var strategy = new AttributeBasedPresenterDiscoveryStrategy();
            var hosts    = new object[0];
            var view1    = new View1();
            var view2    = new View2();
            var views    = new IView[] { view1, view2 };

            // Act
            var results = strategy.GetBindings(hosts, views).ToArray();

            // Assert
            CollectionAssert.AreEqual(new[]
            {
                new PresenterDiscoveryResult
                (
                    new[] { view1 },
                    @"AttributeBasedPresenterDiscoveryStrategy:
- found a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithSingleAttribute+View1 (presenter type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithSingleAttribute+Presenter1, view type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithSingleAttribute+View1, binding mode: Default)",
                    new[]
                {
                    new PresenterBinding(typeof(Presenter1), typeof(View1), BindingMode.Default, new[] { view1 }),
                }
                ),
                new PresenterDiscoveryResult
                (
                    new[] { view2 },
                    @"AttributeBasedPresenterDiscoveryStrategy:
- found a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithSingleAttribute+View2 (presenter type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithSingleAttribute+Presenter2, view type: WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithSingleAttribute+View2, binding mode: Default)",
                    new[]
                {
                    new PresenterBinding(typeof(Presenter2), typeof(View2), BindingMode.Default, new[] { view2 }),
                }
                )
            },
                                      results
                                      );
        }
 void ReleaseDesignerOutlets()
 {
     if (View1 != null)
     {
         View1.Dispose();
         View1 = null;
     }
     if (View2 != null)
     {
         View2.Dispose();
         View2 = null;
     }
     if (View3 != null)
     {
         View3.Dispose();
         View3 = null;
     }
     if (View4 != null)
     {
         View4.Dispose();
         View4 = null;
     }
 }
Esempio n. 13
0
        public override void UpdateData()
        {
            base.UpdateData();

            BackgroundContainer?.SetBackgroundColor(ColorConstants.BackroundContent);

            View1?.SetBackgroundColor(ColorConstants.SelectorHome);
            View2?.SetBackgroundColor(ColorConstants.SelectorHome);
            View3?.SetBackgroundColor(ColorConstants.SelectorHome);
            View4?.SetBackgroundColor(ColorConstants.SelectorHome);
            View5?.SetBackgroundColor(ColorConstants.SelectorHome);
            View6?.SetBackgroundColor(ColorConstants.SelectorHome);
            View7?.SetBackgroundColor(ColorConstants.SelectorHome);
            View8?.SetBackgroundColor(ColorConstants.SelectorHome);

            ImageQR?.SetImageFromResource(DrawableConstants.QRBlurryIcon);

            if (ImageScan != null)
            {
                ImageScan.Visibility = ViewState.Visible;
                ImageScan?.SetImageFromResource(DrawableConstants.QRWaitIcon);
            }

            if (ConfirmTableText != null)
            {
                ConfirmTableText.Click -= ConfirmTableText_Click;
                ConfirmTableText.Click += ConfirmTableText_Click;

                ConfirmTableText.Text = RCode.ConfirmTable.ToUpperInvariant();
                ConfirmTableText.SetBackgroundColor(ColorConstants.BlackColor);
                ConfirmTableText.SetSelectedColor(ColorConstants.WhiteColor.SelectorTransparence(ColorConstants.Procent50));
                ConfirmTableText.SetTextColor(ColorConstants.WhiteColor);
                ConfirmTableText.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
            }

            if (TitleText != null)
            {
                TitleText.Text = RCode.QrCode;
                TitleText.SetTextColor(ColorConstants.WhiteColor);
                TitleText.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size18);
            }

            if (TableNrText != null)
            {
                TableNrText.Text = RCode.TableNo;
                TableNrText.SetTextColor(ColorConstants.WhiteColor);
                TableNrText.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size18);
            }

            if (TableNrValueText != null)
            {
                TableNrValueText.Visibility = ViewState.Invisible;

                TableNrValueText.Text = string.Empty;
                TableNrValueText.SetTextColor(ColorConstants.SelectorHome);
                TableNrValueText.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size36);
            }

            if (ImageQR.IsNull())
            {
                return;
            }
            ImageQR.Click -= ImageQR_Click;
            ImageQR.Click += ImageQR_Click;
        }
Esempio n. 14
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        for (int i = 1; i <= 23; i++)
        {
            string temp = "RadioButton" + i;

            RadioButton rad = new RadioButton();
            rad = (RadioButton)View1.FindControl(temp);
            if (rad.Checked == true)
            {
                Session["b"] = rad.Text;
            }
        }



        for (int j = 24; j <= 47; j++)
        {
            string temp = "RadioButton" + j;

            RadioButton rad = new RadioButton();
            rad = (RadioButton)View2.FindControl(temp);
            if (rad.Checked == true)
            {
                Session["c"] = rad.Text;
            }
        }


        for (int k = 48; k <= 61; k++)
        {
            string temp = "RadioButton" + k;

            RadioButton rad = new RadioButton();
            rad = (RadioButton)View3.FindControl(temp);
            if (rad.Checked == true)
            {
                Session["d"] = rad.Text;
            }
        }


        for (int k = 62; k <= 77; k++)
        {
            string temp = "RadioButton" + k;

            RadioButton rad = new RadioButton();
            rad = (RadioButton)View4.FindControl(temp);
            if (rad.Checked == true)
            {
                Session["e"] = rad.Text;
            }
        }

        for (int k = 78; k <= 85; k++)
        {
            string temp = "RadioButton" + k;

            RadioButton rad = new RadioButton();
            rad = (RadioButton)View5.FindControl(temp);
            if (rad.Checked == true)
            {
                Session["f"] = rad.Text;
            }
        }


        for (int k = 86; k <= 91; k++)
        {
            string temp = "RadioButton" + k;

            RadioButton rad = new RadioButton();
            rad = (RadioButton)View6.FindControl(temp);
            if (rad.Checked == true)
            {
                Session["g"] = rad.Text;
            }
        }



        Response.Redirect("http://localhost:49347/volcania/CustomizedBooking.aspx");
    }
Esempio n. 15
0
 protected override void OnInitialize()
 {
     this.view = this.AttachView <View2>();
     base.OnInitialize();
 }
Esempio n. 16
0
        // Create a simple table with a row of two clickable,
        // readonly headers and a row with a single column, which
        // is the 'container' to which we'll be adding controls.
        protected override void CreateChildControls()
        {
            // Always start with a clean form
            Controls.Clear();

            // Create a table using the control's declarative properties
            Table t = new Table();

            t.CellSpacing = 1;
            t.BorderStyle = BorderStyle;
            t.Width       = this.Width;
            t.Height      = this.Height;

            // Create the header row
            TableRow tr = new TableRow();

            tr.HorizontalAlign = HorizontalAlign.Center;
            tr.BackColor       = Color.LightBlue;

            // Create the first cell in the header row
            TableCell tc = new TableCell();

            tc.Text  = "View 1";
            tc.Width = new Unit("50%");
            tr.Cells.Add(tc);

            // Create the second cell in the header row
            tc       = new TableCell();
            tc.Text  = "View 2";
            tc.Width = new Unit("50%");
            tr.Cells.Add(tc);

            t.Rows.Add(tr);

            // Create the second row for content
            tr = new TableRow();
            tr.HorizontalAlign = HorizontalAlign.Center;

            // This cell represents our content 'container'
            tc            = new TableCell();
            tc.ColumnSpan = 2;

            // Add the current view content to the cell
            // at run-time
            if (!DesignMode)
            {
                Control containerControl = new Control();
                switch (CurrentView)
                {
                case 0:
                    if (View1 != null)
                    {
                        View1.InstantiateIn(containerControl);
                    }
                    break;

                case 1:
                    if (View2 != null)
                    {
                        View2.InstantiateIn(containerControl);
                    }
                    break;
                }

                tc.Controls.Add(containerControl);
            }

            tr.Cells.Add(tc);

            t.Rows.Add(tr);

            // Add the finished table to the Controls collection
            Controls.Add(t);
        }
        void ReleaseDesignerOutlets()
        {
            if (ConstWidthTopBarButtons != null)
            {
                ConstWidthTopBarButtons.Dispose();
                ConstWidthTopBarButtons = null;
            }

            if (ViewTopBar != null)
            {
                ViewTopBar.Dispose();
                ViewTopBar = null;
            }

            if (Button1 != null)
            {
                Button1.Dispose();
                Button1 = null;
            }

            if (View1 != null)
            {
                View1.Dispose();
                View1 = null;
            }

            if (Button2 != null)
            {
                Button2.Dispose();
                Button2 = null;
            }

            if (View2 != null)
            {
                View2.Dispose();
                View2 = null;
            }

            if (Button3 != null)
            {
                Button3.Dispose();
                Button3 = null;
            }

            if (View3 != null)
            {
                View3.Dispose();
                View3 = null;
            }

            if (ConstViewWidthContainer1 != null)
            {
                ConstViewWidthContainer1.Dispose();
                ConstViewWidthContainer1 = null;
            }

            if (ScrollViewContainers != null)
            {
                ScrollViewContainers.Dispose();
                ScrollViewContainers = null;
            }
        }