示例#1
0
 public void Save(DeploymentProfile deploymentProfile)
 {
     var profileDirectory = new DirectoryInfo(DeploymentConfiguration.ProfileFolder);
     if (!profileDirectory.Exists)
     {
         profileDirectory.Create();
     }
     var profileFilename = Path.Combine(profileDirectory.FullName, deploymentProfile.Name + ".xml");
     var serializer = new XmlSerializer(typeof(DeploymentProfile));
     try
     {
         using (var stream = File.Create(profileFilename, 4096, FileOptions.None))
         {
             serializer.Serialize(stream, deploymentProfile);
         }
     }
     catch (InvalidOperationException e)
     {
         throw new DeploymentProfileException("Could not save " + deploymentProfile.Name, e);
     }
 }
 public DeployParameters(string packagePath, DeploymentProfile profile)
 {
     PackagePath = packagePath;
     Profile = profile;
     ValidateAll();
 }
示例#3
0
 public void VerifyNoProfileWithSameName(DeploymentProfile deploymentProfile)
 {
     if (Has(deploymentProfile.Name))
     {
         throw new DeploymentProfileException("Profile " + deploymentProfile.Name + " already exists");
     }
 }
示例#4
0
 public void Add(DeploymentProfile deploymentProfile)
 {
     VerifyNoProfileWithSameName(deploymentProfile);
     _profiles.Add(deploymentProfile.Name, deploymentProfile);
 }
 public ProfileChangedEventArgs(DeploymentProfile profile)
 {
     Profile = profile;
 }