internal bool?Edit(InstalationPackageProperties properties) { PackageProperties = properties.GetProperties(); bool?_resulr = ShowDialog(); m_PackageProperties.Modified = DateTime.Now; return(_resulr); }
/// <summary> /// Reads the installation description and ShowDialog. /// </summary> /// <returns></returns> internal bool?Open() { StackPanelButtons.Children.Clear(); StackPanelButtons.Children.Add(ButtonOK); StackPanelButtons.Children.Add(ButtonCancel); // Configure open file dialog box Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.FileName = Properties.Settings.Default.PackageName; // Default file name dlg.DefaultExt = Properties.Settings.Default.PackageExtension; // Default file extension string _filterFormat = "Installation package ({0})|*{0}"; dlg.Filter = String.Format(_filterFormat, Properties.Settings.Default.PackageExtension); // Filter files by extension // Process open file dialog box results if (!dlg.ShowDialog().GetValueOrDefault(false)) { return(false); } FileInfo _location = new FileInfo(dlg.FileName); PackageProperties = InstalationPackageProperties.GetProperties(InstallationPackage.ReadPackageProperties(_location), _location); x_MainGrid.IsEnabled = false; return(this.ShowDialog()); }