Beispiel #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.UploadDialog = ((GUI_interflow.UploadWindow)(target));
                return;

            case 2:
                this.OneIndicatorContent = ((System.Windows.Controls.TextBox)(target));
                return;

            case 3:
                this.Button_Import_file = ((System.Windows.Controls.Button)(target));

            #line 11 "..\..\UploadDialog.xaml"
                this.Button_Import_file.Click += new System.Windows.RoutedEventHandler(this.Button_Import_file_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.Button_Upload_Submit = ((System.Windows.Controls.Button)(target));

            #line 12 "..\..\UploadDialog.xaml"
                this.Button_Upload_Submit.Click += new System.Windows.RoutedEventHandler(this.Button_Upload_Submit_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #2
0
        private async void Button_Upload_OneIndicator_Click(object sender, RoutedEventArgs e)
        {
            //make sure the user doesnt try uploading anything with no api key set
            if (APIKey == null)
            {
                return;
            }

            UploadWindow UploadPopup = new UploadWindow();

            UploadPopup.ShowDialog();

            if (UploadPopup.Submit == false)
            {
                return;
            }

            int returnCode = await interflow.interflow.UploadInterflowOneIndicator_async(APIKey, UploadPopup.OneIndicatorJSON);

            if (returnCode == 201)
            {
                MessageBox.Show("OneIndicator upload sucessful!", "Upload Sucess!", MessageBoxButton.OK);
            }
            else if (returnCode == 400)
            {
                MessageBox.Show("The supplied OneIndicator was not valid! Please verify the OneIndicator and try again.", "ERROR!", MessageBoxButton.OK);
            }
            else
            {
                MessageBox.Show("OneIndicator failed with status code: " + returnCode.ToString(), "ERROR!", MessageBoxButton.OK);
            }
        }