Exemple #1
0
 internal void View(InstalationPackageProperties properties)
 {
     PackageProperties      = properties;
     x_MainGrid.IsEnabled   = false;
     ButtonCancel.IsEnabled = false;
     ShowDialog();
 }
Exemple #2
0
        internal bool?Edit(InstalationPackageProperties properties)
        {
            PackageProperties = properties.GetProperties();
            bool?_resulr = ShowDialog();

            m_PackageProperties.Modified = DateTime.Now;
            return(_resulr);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        /// <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());
        }