コード例 #1
0
        /// <summary>
        ///     Validate settings.
        /// </summary>
        /// <exception cref="System.InvalidOperationException">Failed to read/write same value from registry.</exception>
        public void Validate()
        {
            if (!Directory.Exists(PickupPath))
                Directory.CreateDirectory(PickupPath);

            if (!Directory.Exists(AppDirectory))
                Directory.CreateDirectory(AppDirectory);

            var config = new RegistryConfigAdapter(CompanyName, ApplicationName);
            config["ConfigTest"] = "hello";
            if (config["ConfigTest"] != "hello")
                throw new InvalidOperationException("Failed to read/write same value from registry.");
        }
コード例 #2
0
        public void Validate()
        {
            if (!Directory.Exists(PickupPath))
            {
                Directory.CreateDirectory(PickupPath);
            }

            if (!Directory.Exists(AppDirectory))
            {
                Directory.CreateDirectory(AppDirectory);
            }

            var config = new RegistryConfigAdapter(CompanyName, ApplicationName);

            config["ConfigTest"] = "hello";
            if (config["ConfigTest"] != "hello")
            {
                throw new InvalidOperationException("Failed to read/write same value from registry.");
            }
        }