Microsoft.WindowsAzure.Management.CloudService.Model.ServiceSettings.Save C# (CSharp) Метод

Save() публичный Метод

public Save ( string path ) : void
path string
Результат void
        public void Save(string path)
        {
            Validate.ValidateStringIsNullOrEmpty(path, Resources.ServiceSettings);
            Validate.ValidateDirectoryFull(Path.GetDirectoryName(path), Resources.ServiceSettings);

            File.WriteAllText(path, new JavaScriptSerializer().Serialize(this));
        }

Usage Example

        public void SetAzureServiceProjectTestsLocationInvalidFail()
        {
            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                // Create new empty settings file
                //
                ServicePathInfo paths = new ServicePathInfo(files.RootPath);
                ServiceSettings settings = new ServiceSettings();
                settings.Save(paths.Settings);

                Testing.AssertThrows<ArgumentException>(() => new SetAzureServiceProjectCommand().SetAzureServiceProjectProcess("MyHome", null, null, null, paths.Settings), string.Format(Resources.InvalidServiceSettingElement, "Location"));
            }
        }
All Usage Examples Of Microsoft.WindowsAzure.Management.CloudService.Model.ServiceSettings::Save