DeploymentTracker.App.Windows.PackageDeployment.OpenFileDialog_FileOk C# (CSharp) Метод

OpenFileDialog_FileOk() приватный Метод

Handles the FileOk event of the openFileDialog control.
private OpenFileDialog_FileOk ( object sender, CancelEventArgs e ) : void
sender object The source of the event.
e CancelEventArgs The instance containing the event data.
Результат void
        private void OpenFileDialog_FileOk(object sender, CancelEventArgs e)
        {
            if (e.Cancel)
            {
                return;
            }

            if (openFileDialog.DefaultExt == Constants.AzurePackageExtension)
            {
                this.txtPackagePath.Text = openFileDialog.FileName;
            }
            else if (openFileDialog.DefaultExt == Constants.ServiceConfigurationExtension)
            {
                this.txtConfigPath.Text = openFileDialog.FileName;
            }
            else if (openFileDialog.DefaultExt == Constants.PublishSettingsExtension)
            {
                this.txtPublishSettingsFilePath.Text = openFileDialog.FileName;

                try
                {
                    this.ExtractLoadPubSettingsFile();
                }
                catch (InvalidOperationException exec)
                {
                    this.txtPublishSettingsFilePath.Text = string.Empty;
                    exec.WriteToLog();
                    "Invalid settings file".ShowUIInformation();
                }
                catch (XmlException exec)
                {
                    this.txtPublishSettingsFilePath.Text = string.Empty;
                    exec.WriteToLog();
                    "Invalid settings file".ShowUIInformation();
                }
            }
            else if (openFileDialog.DefaultExt == Constants.ServiceCertificateExtension)
            {
                string files = openFileDialog.FileNames.Where(x => !string.IsNullOrEmpty(x)).Aggregate(string.Empty, (current, item) => string.Concat(current, ";", item));

                this.txtCertificatePaths.Text = files.TrimStart(';');
                this.certsToDeploy = openFileDialog.FileNames.ToList<string>();
            }
        }