コード例 #1
0
        /// <summary>
        /// CTOR
        /// </summary>
        public SystemInfoViewModel()
        {
            this.OperatingSystem = OSVersionInfo.OsVersionCompleteString;
            this.InstalledNetFrameworkVersions = DotNetFrameworkInfo.InstalledDotNetVersions();

            string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            foreach (string dll in Directory.GetFiles(path, "*.dll"))
            {
                if (System.IO.Path.GetFileName(dll).StartsWith("VersatileMediaManager"))
                {
                    var assembly = Assembly.LoadFile(dll);
                    this.ApplicationAssemblies.Add(new ApplicationDll()
                    {
                        Name        = assembly.GetName().Name + ".dll",
                        Version     = assembly.GetName().Version.ToString(),
                        Description = ((AssemblyDescriptionAttribute)assembly.GetCustomAttribute(typeof(AssemblyDescriptionAttribute))).Description
                    });
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// CTOR
        /// </summary>
        /// <param name="unityContainer">The unity container.</param>
        /// <param name="regionManager">The region manager.</param>
        /// <param name="eventAggrgator">The event aggregator.</param>
        public SystemInfoViewModel(IUnityContainer unityContainer, IRegionManager regionManager, IEventAggregator eventAggrgator) :
            base(unityContainer, regionManager, eventAggrgator)
        {
            this.Title = "System-Information";

            this.OperatingSystem = OSVersionInfo.OsVersionCompleteString;
            this.InstalledNetFrameworkVersions = DotNetFrameworkInfo.InstalledDotNetVersions();

            string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            foreach (string dll in Directory.GetFiles(path, "*.dll"))
            {
                if (System.IO.Path.GetFileName(dll).StartsWith("MetroFtpClient"))
                {
                    var assembly = Assembly.LoadFile(dll);
                    this.ApplicationAssemblies.Add(new ApplicationDll()
                    {
                        Name        = assembly.GetName().Name + ".dll",
                        Version     = assembly.GetName().Version.ToString(),
                        Description = ((AssemblyDescriptionAttribute)assembly.GetCustomAttribute(typeof(AssemblyDescriptionAttribute))).Description
                    });
                }
            }
        }