Example #1
0
        private void Window_Closing(object sender, CancelEventArgs e)
        {
            if (null == project)
            {
                project = new Project();
            }
            project.fromLogicalID = tbFromLogicalID.Text;
            project.toLogicalID   = tbToLogicalID.Text;
            project.messageID     = tbMessageID.Text;
            project.BOD           = tbBODMessage.Text;

            project.Save(projectName);

            credentials = null;
            Application.Current.Shutdown();
        }
Example #2
0
        private void btnIONAPI_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                OpenFileDialog ofdDialog = new OpenFileDialog();
                ofdDialog.Filter          = "ION API Files (*.ionapi)|*.ionapi";
                ofdDialog.CheckFileExists = true;

                if (true == ofdDialog.ShowDialog())
                {
                    string fileName = ofdDialog.FileName;

                    tbIONAPIPath.Text = fileName;

                    IONAPIFile ionAPI = IONAPIFile.LoadIONAPI(fileName);

                    if (null != ionAPI && true == string.IsNullOrEmpty(ionAPI.Error))
                    {
                        ionAPI.mainWindow = this;
                        tbTenant.Text     = ionAPI.getTenant();
                        tbCI.Text         = ionAPI.getClientId();
                        credentials       = ionAPI;
                    }
                    else
                    {
                        if (null == ionAPI)
                        {
                            MessageBox.Show("Error failed to read file");
                        }
                        else
                        {
                            MessageBox.Show("Error: " + ionAPI.Error);
                        }
                    }
                }
                ofdDialog = null;
            }
            catch (Exception ex)
            {
            }
        }