当前位置: 首页>>代码示例>>C#>>正文


C# DeploymentResult.AddNote方法代码示例

本文整理汇总了C#中DeploymentResult.AddNote方法的典型用法代码示例。如果您正苦于以下问题:C# DeploymentResult.AddNote方法的具体用法?C# DeploymentResult.AddNote怎么用?C# DeploymentResult.AddNote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DeploymentResult的用法示例。


在下文中一共展示了DeploymentResult.AddNote方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VerifyRegistryHivePermissions

		protected void VerifyRegistryHivePermissions(DeploymentResult result)
		{
			if (Hive == RegistryHive.CurrentUser)
			{
				result.AddNote("Elevated permissions not required for Registry Hive '{0}'", Hive.AsRegistryHiveString());
				return;
			}
		}
开发者ID:GorelH,项目名称:dropkick,代码行数:8,代码来源:BaseRegistryTask.cs

示例2: VerifyCanRun

      public override DeploymentResult VerifyCanRun() {
         var result = new DeploymentResult();
         result.AddNote(_reason);

         if(_filesShouldExist.Count > 0) {
            var tmpDR = new DeploymentResult();
            foreach(var filePath in _filesShouldExist) {
               string actualPath = _path.GetFullPath(filePath);
               if(!File.Exists(actualPath)) { tmpDR.AddError("  File '{0}' should exist!.".FormatWith(actualPath)); }
            }
            result.MergedWith(tmpDR);
            //errors show up anyway, give some feedback if everything OK.
            if(!tmpDR.ContainsError()) { result.AddNote("  All {0} files found!".FormatWith(_filesShouldExist.Count)); }
         } else {
            result.AddNote("  No Files that should exist.");
         }

         if(_directoriesShouldExist.Count > 0) {
            var tmpDR = new DeploymentResult();
            foreach(var dirPath in _directoriesShouldExist) {
               string actualPath = _path.GetFullPath(dirPath);
               if(!Directory.Exists(actualPath)) { tmpDR.AddError("  Directory '{0}' should exist".FormatWith(actualPath)); }
            }
            result.MergedWith(tmpDR);
            //errors show up anyway, give some feedback if everything OK.
            if(!tmpDR.ContainsError()) { result.AddNote("  All {0} directories found!".FormatWith(_directoriesShouldExist.Count)); }
         } else {
            result.AddNote("  No Directories that should exist.");
         }

         if(_filesShould_NOT_Exist.Count > 0) {
            var tmpDR = new DeploymentResult();
            foreach(var filePath in _filesShould_NOT_Exist) {
               string actualPath = _path.GetFullPath(filePath);
               if(File.Exists(actualPath)) { tmpDR.AddError("  File '{0}' should NOT exist!.".FormatWith(actualPath)); }
            }
            result.MergedWith(tmpDR);
            if(!tmpDR.ContainsError()) { result.AddNote("  None of the {0} files exist!".FormatWith(_filesShould_NOT_Exist.Count)); }
         } else {
            result.AddNote("  No Files that should NOT exist.");
         }

         if(_directoriesShould_NOT_Exist.Count > 0) {
            var tmpDR = new DeploymentResult();
            foreach(var dirPath in _directoriesShould_NOT_Exist) {
               string actualPath = _path.GetFullPath(dirPath);
               if(Directory.Exists(actualPath)) { tmpDR.AddError("  Directory '{0}' should NOT exist".FormatWith(actualPath)); }
            }
            result.MergedWith(tmpDR);
            if(!tmpDR.ContainsError()) { result.AddNote("  None of the {0} directories exist!".FormatWith(_directoriesShould_NOT_Exist.Count)); }
         } else {
            result.AddNote("  No Directories that should NOT exist.");
         }

         if(_shouldAbortOnError && result.ContainsError()) { result.AddAbort(_reason); }
         return result;
      }
开发者ID:GorelH,项目名称:dropkick,代码行数:57,代码来源:ExistsTasks.cs

示例3: Ex

        void Ex(Action<DeploymentDetail> action)
        {
            var result = new DeploymentResult();
            result.AddNote(Name);

            foreach (var role in _roles)
            {
                result.AddNote(role.Name);

                role.ForEachServerMapped(s =>
                {
                    result.AddNote(s.Name);
                    s.ForEachDetail(d =>
                    {
                        result.AddNote(d.Name);
                        action(d);
                    });
                });
            }
        }
开发者ID:oriacle,项目名称:dropkick,代码行数:20,代码来源:DeploymentPlan.cs

示例4: VerifyCanRun

        public DeploymentResult VerifyCanRun()
        {
            var results = new DeploymentResult();
            results.AddNote(Name);

            //check you can connect to the _instancename
            //check that the path _scriptsLocation exists

            return results;
        }
开发者ID:drusellers,项目名称:dropkick,代码行数:10,代码来源:RoundhousETask.cs

示例5: BuildVirtualDirectory

        void BuildVirtualDirectory(Site site, ServerManager mgr, DeploymentResult result)
        {
            Magnum.Guard.AgainstNull(site, "The site argument is null and should not be");
            var appPath = "/" + VirtualDirectoryPath;

            //this didn't find the application if there is a difference in letter casing like '/MyApplication' and '/Myapplication'. But threw an exception when tried to add it.
               //var application = site.Applications.FirstOrDefault(x => x.Path == appPath);
            var application = site.Applications.FirstOrDefault(x => x.Path.Equals(appPath, StringComparison.OrdinalIgnoreCase));

            if (application == null)
            {
                result.AddAlert("'{0}' doesn't exist. creating.", VirtualDirectoryPath);
                application = site.Applications.Add(appPath, PathOnServer);
                LogFineGrain("[iis7] Created application '{0}'", VirtualDirectoryPath);
            }
            else
            {
                result.AddNote("'{0}' already exists. Updating settings.", VirtualDirectoryPath);
            }

            if (application.ApplicationPoolName != AppPoolName)
            {
                application.ApplicationPoolName = AppPoolName;
                LogFineGrain("[iis7] Set the ApplicationPool for '{0}' to '{1}'", VirtualDirectoryPath, AppPoolName);
            }

            var vdir = application.VirtualDirectories["/"];
            if (vdir.PhysicalPath != PathOnServer)
            {
                vdir.PhysicalPath = PathOnServer;
                LogFineGrain("[iis7] Updated physical path for '{0}' to '{1}'", VirtualDirectoryPath, PathOnServer);
            }

             ConfigureAuthentication(mgr, result, true);
            //result.AddGood("'{0}' was created/updated successfully", VirtualDirectoryPath);
        }
开发者ID:AkosLukacs,项目名称:dropkick,代码行数:36,代码来源:Iis7Task.cs

示例6: VerifyCanRun

        public DeploymentResult VerifyCanRun()
        {
            var results = new DeploymentResult();
            results.AddNote(Name);

            if(_connectionInfo.WillPromptForUserName())
                results.AddAlert("We are going to prompt for a username.");

            if (_connectionInfo.WillPromptForPassword())
                results.AddAlert("We are going to prompt for a password.");

            //check you can connect to the _instancename
            //check that the path _scriptsLocation exists

            return results;
        }
开发者ID:binarymash,项目名称:dropkick,代码行数:16,代码来源:RoundhousETask.cs

示例7: Execute

        public override DeploymentResult Execute()
        {
            var result = new DeploymentResult();

            using (var iisManager = ServerManager.OpenRemote(ServerName))
            {
                var site = iisManager.Sites[SiteName];
                if (site == null)
                    result.AddNote(siteDoesNotExist);
                else
                {
                    checkForElevatedPrivileges(() => Operation.Action(site));
                    iisManager.CommitChanges();
                    result.Add(new DeploymentItem(Operation.ReportingLevel, "Site operation '{0}' executed on '{1}'".FormatWith(Operation.Name, SiteName)));
                }
            }
            return result;
        }
开发者ID:laazyj,项目名称:dropkick,代码行数:18,代码来源:Iis7SiteOperationTask.cs

示例8: checkSiteExists

 private void checkSiteExists(ServerManager iisManager, DeploymentResult result)
 {
     if (!iisManager.Sites.Any(a => a.Name == SiteName)) result.AddNote(siteDoesNotExist);
 }
开发者ID:laazyj,项目名称:dropkick,代码行数:4,代码来源:Iis7SiteOperationTask.cs

示例9: Tracer

 public static DeploymentResult Tracer(Task task)
 {
     var r = new DeploymentResult();
     r.AddNote(task.Name);
     return r;
 }
开发者ID:GorelH,项目名称:dropkick,代码行数:6,代码来源:ProtoTask.cs

示例10: ExecuteOperation

 //todo: there is quite a bit going on in here...this is going to need to be looked at...
 private void ExecuteOperation(ApplicationPool appPool, DeploymentResult result)
 {
     switch (Operation)
     {
         case Iis7ApplicationPoolOperation.StopApplicationPool:
             if (appPool == null)
             {
                 result.AddAlert(ApplicationPoolDoesNotExistError);
             }
             else if (appPool.CanBeStopped())
             {
                 CheckForElevatedPrivileges(appPool.StopAndWaitForCompletion);
                 result.AddGood("Application Pool '{0}' stopped.".FormatWith(ApplicationPool));
             }
             else
             {
                 result.AddNote("Application Pool '{0}' is not running.".FormatWith(ApplicationPool));
             }
             break;
         case Iis7ApplicationPoolOperation.StartApplicationPool:
             if (appPool == null)
             {
                 throw new InvalidOperationException(ApplicationPoolDoesNotExistError);
             }
             else if (appPool.CanBeStarted())
             {
                 IisUtility.WaitForIisToCompleteAnyOperations();
                 CheckForElevatedPrivileges(appPool.StartAndWaitForCompletion);
                 result.AddGood("Application Pool '{0}' started.".FormatWith(ApplicationPool));
             }
             else
             {
                 result.AddGood("Application Pool '{0}' is already running.".FormatWith(ApplicationPool));
             }
             break;
     }
 }
开发者ID:laazyj,项目名称:dropkick,代码行数:38,代码来源:Iis7ApplicationPoolOperationTask.cs

示例11: updateSiteBindings

        void updateSiteBindings(Site site, DeploymentResult result)
        {
            if (Bindings == null)
            {
                result.AddNote("No site bindings specified.");
                return;
            }

            LogFineGrain("Checking certificates on existing HTTPS bindings");
            updateHttpsBindingCertificates(site, result);

            LogFineGrain("Adding new IIS bindings");
            addnewBindings(site, result);

            LogFineGrain("Removing IIS bindings that are no longer required");
            removeOldBindings(site, result);

            result.AddGood("Updated bindings for website '{0}'", WebsiteName);
        }
开发者ID:laazyj,项目名称:dropkick,代码行数:19,代码来源:Iis7Task.cs

示例12: buildVirtualDirectory

        void buildVirtualDirectory(Site site, DeploymentResult result)
        {
            Magnum.Guard.AgainstNull(site, "The site argument is null and should not be");
            var appPath = "/" + VirtualDirectoryPath;
            var application = site.Applications.FirstOrDefault(x => x.Path == appPath);

            if (application == null)
            {
                result.AddAlert("'{0}' doesn't exist. creating.", VirtualDirectoryPath);
                application = site.Applications.Add(appPath, PathOnServer);
                LogFineGrain("[iis7] Created application '{0}'", VirtualDirectoryPath);
            }
            else
            {
                result.AddNote("Virtual Directory '{0}' already exists. Updating settings.", VirtualDirectoryPath ?? "/");
            }

            var apn = AppPoolName ?? DefaultAppPoolName;
            if (application.ApplicationPoolName != apn)
            {
                application.ApplicationPoolName = apn;
                LogFineGrain("[iis7] Set the ApplicationPool for '{0}' to '{1}'", VirtualDirectoryPath, apn);
            }

            var vdir = application.VirtualDirectories["/"];
            var pon = PathOnServer ?? DefaultPathOnServer;
            if (vdir.PhysicalPath != pon)
            {
                vdir.PhysicalPath = pon;
                LogFineGrain("[iis7] Updated physical path for '{0}' to '{1}'", VirtualDirectoryPath, pon);
            }
        }
开发者ID:laazyj,项目名称:dropkick,代码行数:32,代码来源:Iis7Task.cs

示例13: checkForSiteBindingConflict

        static void checkForSiteBindingConflict(ServerManager iisManager, string targetSiteName, IEnumerable<IisSiteBinding> targetBindings, DeploymentResult result)
        {
            if (targetBindings == null || !targetBindings.Any())
            {
                result.AddNote("[iis7] No bindings specified for site '{0}'".FormatWith(targetSiteName));
                return;
            }

            foreach (var targetPort in targetBindings.Select(x => x.Port))
            {
                var conflictSite = iisManager.Sites
                    .FirstOrDefault(x => x.Bindings.Any(b =>
                        b.EndPoint != null &&
                        targetPort == b.EndPoint.Port) &&
                        x.Name != targetSiteName);

                if (conflictSite != null)
                    throw new InvalidOperationException(
                        String.Format("Cannot create site '{0}': port '{1}' is already in use by '{2}'.",
                                      targetSiteName, targetPort, conflictSite.Name));
            }
            result.AddGood("[iis7] No site binding conflicts detected.");
        }
开发者ID:laazyj,项目名称:dropkick,代码行数:23,代码来源:Iis7Task.cs

示例14: BuildVirtualDirectory

        void BuildVirtualDirectory(Site site, ServerManager mgr, DeploymentResult result)
        {
            Magnum.Guard.AgainstNull(site, "The site argument is null and should not be");
            var appPath = "/" + VirtualDirectoryPath;
        	var application = site.Applications.FirstOrDefault(x => x.Path == appPath);

			if (application == null)
			{
				result.AddAlert("'{0}' doesn't exist. creating.", VirtualDirectoryPath);
				application = site.Applications.Add(appPath, PathOnServer);
				LogFineGrain("[iis7] Created application '{0}'", VirtualDirectoryPath);
			}
			else
			{
				result.AddNote("'{0}' already exists. Updating settings.", VirtualDirectoryPath);
			}

			if (application.ApplicationPoolName != AppPoolName)
			{
				application.ApplicationPoolName = AppPoolName;
				LogFineGrain("[iis7] Set the ApplicationPool for '{0}' to '{1}'", VirtualDirectoryPath, AppPoolName);
			}

			var vdir = application.VirtualDirectories["/"];
			if (vdir.PhysicalPath != PathOnServer)
			{
				vdir.PhysicalPath = PathOnServer;
				LogFineGrain("[iis7] Updated physical path for '{0}' to '{1}'", VirtualDirectoryPath, PathOnServer);
			}

         ConfigureAuthentication(mgr, result, true);
            //result.AddGood("'{0}' was created/updated successfully", VirtualDirectoryPath);
		}
开发者ID:GorelH,项目名称:dropkick,代码行数:33,代码来源:Iis7Task.cs

示例15: Execute

        public DeploymentResult Execute()
        {
            var result = new DeploymentResult();

            var psi = new ProcessStartInfo(Command, Args);

            psi.UseShellExecute = false;
            psi.CreateNoWindow = true;
            psi.RedirectStandardOutput = true;

            if (!string.IsNullOrEmpty(WorkingDirectory)) psi.WorkingDirectory = WorkingDirectory;

            psi.FileName = _path.Combine(ExecutableIsLocatedAt, Command);

            string output;
            try
            {
                using (Process p = Process.Start(psi))
                {
                    //what to do here?
                    p.WaitForExit(30.Seconds().Milliseconds);
                    output = p.StandardOutput.ReadToEnd();
                    result.AddNote(output);
                }

                result.AddGood("Command Line Executed");
            }
            catch (Win32Exception ex)
            {
                result.AddError(
                    "An exception occured while attempting to execute the following remote command.  Working Directory:'{0}' Command:'{1}' Args:'{2}'{3}{4}"
                        .FormatWith(WorkingDirectory, Command, Args, Environment.NewLine, ex));
            }

            return result;
        }
开发者ID:GorelH,项目名称:dropkick,代码行数:36,代码来源:LocalCommandLineTask.cs


注:本文中的DeploymentResult.AddNote方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。