internal void View(InstalationPackageProperties properties) { PackageProperties = properties; x_MainGrid.IsEnabled = false; ButtonCancel.IsEnabled = false; ShowDialog(); }
internal bool?Edit(InstalationPackageProperties properties) { PackageProperties = properties.GetProperties(); bool?_resulr = ShowDialog(); m_PackageProperties.Modified = DateTime.Now; return(_resulr); }
public static InstalationPackageProperties GetProperties(PackageProperties source, FileInfo Location) { InstalationPackageProperties _ret = new InstalationPackageProperties(); _ret.Location = Location; foreach (PropertyInfo _propertyX in typeof(PackageProperties).GetProperties()) { object x = _propertyX.GetValue(source, null); _propertyX.SetValue(_ret, x, null); } return(_ret); }
/// <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()); }