Esempio n. 1
0
        private void PopulateVersionDictionary()
        {
            try
            {
                // use the registry tool to pull out the installed versions of connect
                RegistryTool.Version[] versions = RegistryTool.RegistryTool.GetVersionNames();

                foreach (RegistryTool.Version version in versions)
                {
                    MorphemeVersion morphemeVersion = new MorphemeVersion();
                    morphemeVersion.AppInstall         = version.InstallPath;
                    morphemeVersion.AppExe             = version.FullInstallPath;
                    morphemeVersion.AppSamples         = version.SamplesPath;
                    morphemeVersion.AppLocalSettings   = version.LocalAppPath;
                    morphemeVersion.AppRoamingSettings = string.Empty; // TODO

                    if (!version.DevVersion)
                    {
                        morphemeVersion.MajorVersion = version.Major;
                        morphemeVersion.MinorVersion = version.Minor;
                    }

                    VersionDictionary.Add(version.Name, morphemeVersion);
                }

                VersionDictionary.Add(CustomStr, new MorphemeVersion());
            }
            catch (System.Exception ex)
            {
                OutputLog.Log(LogSeverity.Error, ex.ToString());
            }
        }
 public PackageViewModel(string name)
 {
     Name = name;
     if (VersionDictionary is INotifyCollectionChanged c)
     {
         c.CollectionChanged += (sender, args) =>
         {
             HasVersions = VersionDictionary.Any();
         };
     }
 }