Ejemplo n.º 1
0
 private void RefreshEntries(RefreshManager <UninstallerDataObject> manager, RegistryKey rootKey, string keyName)
 {
     using (RegistryKey hkKey = rootKey.OpenSubKey(keyName, false))
     {
         foreach (string subKeyName in hkKey.GetSubKeyNames())
         {
             string keyPath = string.Format("{0}\\{1}", keyName, subKeyName);
             UninstallerDataObject mdo;
             try
             {
                 if (manager.Contains(subKeyName, out mdo))
                 {
                     mdo.Refresh(rootKey, keyPath, subKeyName);
                 }
                 else
                 {
                     mdo = new UninstallerDataObject(rootKey, keyPath, subKeyName);
                     if (!string.IsNullOrEmpty(mdo.ApplicationName))
                     {
                         manager.Objects.Add(mdo);
                     }
                 }
             }
             catch (Exception e)
             {
                 Log.Error(string.Format("unable to analyse registry key {0}", keyPath), e);
             }
         }
     }
 }
Ejemplo n.º 2
0
 public UninstallerProperties(UninstallerDataObject udo)
 {
     InitializeComponent();
     First = true;
     UDO   = udo;
     ModifiedForeground   = new SolidColorBrush(Colors.Blue);
     UnmodifiedForeground = new SolidColorBrush(Colors.Black);
 }
Ejemplo n.º 3
0
 public UninstallerProperties(UninstallerDataObject udo)
 {
     InitializeComponent();
     First = true;
     UDO = udo;
     ModifiedForeground = new SolidColorBrush(Colors.Blue);
     UnmodifiedForeground = new SolidColorBrush(Colors.Black);
 }
Ejemplo n.º 4
0
        private void RefreshEntries(RefreshManager<UninstallerDataObject> manager, RegistryKey rootKey, string keyName)
        {
            using(RegistryKey hkKey = rootKey.OpenSubKey(keyName,false))
            {
                foreach (string subKeyName in hkKey.GetSubKeyNames())
                {
                    string keyPath = string.Format("{0}\\{1}", keyName, subKeyName);
                    UninstallerDataObject mdo;
                    try
                    {
                        if (manager.Contains(subKeyName, out mdo))
                        {
                            mdo.Refresh(rootKey, keyPath, subKeyName);
                        }
                        else
                        {
                            mdo = new UninstallerDataObject(rootKey, keyPath, subKeyName);
                            if (!string.IsNullOrEmpty(mdo.ApplicationName))
                            {
                                manager.Objects.Add(mdo);
                            }
                        }
                    }
                    catch(Exception e)
                    {
                        Log.Error(string.Format("unable to analyse registry key {0}", keyPath), e);
                    }

                }
            }
        }