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>();
}
}