//Takes user to test the service
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button            btn      = sender as Button;
            string            name     = btn.Name;
            string            endpoint = DataSingleton.FindEndpoint(name);
            TestServiceWindow testwin  = new TestServiceWindow(this, endpoint);

            testwin.Show();
            this.Hide();
        }
Example #2
0
        public TestServiceWindow(Window call, string api_endpoint)
        {
            InitializeComponent();
            caller = call;

            ser = DataSingleton.FindService(api_endpoint);
            NameLabel.Content = ser.Name;

            //Creates a grid with the required inputs for a service
            ColumnDefinition boxes  = new ColumnDefinition();
            ColumnDefinition labels = new ColumnDefinition();

            Grd.ColumnDefinitions.Add(labels);
            Grd.ColumnDefinitions.Add(boxes);

            for (int ii = 0; ii < ser.Number_Of_Operands; ii++)
            {
                TextBox textbox = new TextBox();
                Label   label   = new Label();

                RowDefinition row = new RowDefinition();
                row.Height = new GridLength(90);
                Grd.RowDefinitions.Add(row);

                label.Content = "Input " + ii.ToString() + ":";
                textbox.Text  = "";
                textbox.Name  = "tb" + ii.ToString();

                Grid.SetRow(label, ii);
                Grid.SetColumn(label, 0);

                Grid.SetRow(textbox, ii);
                Grid.SetColumn(textbox, 1);

                Grd.Children.Add(label);
                Grd.Children.Add(textbox);
            }
        }