當前位置: 首頁>>代碼示例>>C#>>正文


C# Utilities.TaskLoggingHelper類代碼示例

本文整理匯總了C#中Microsoft.Build.Utilities.TaskLoggingHelper的典型用法代碼示例。如果您正苦於以下問題:C# TaskLoggingHelper類的具體用法?C# TaskLoggingHelper怎麽用?C# TaskLoggingHelper使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TaskLoggingHelper類屬於Microsoft.Build.Utilities命名空間,在下文中一共展示了TaskLoggingHelper類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetPaths

		public static void GetPaths (out string monoDroidBinDir, out string monoDroidFrameworkDir,
			out string androidSdkPath, out string javaSdkPath, TaskLoggingHelper log)
		{
			monoDroidBinDir = monoDroidFrameworkDir = androidSdkPath = javaSdkPath = null;
			
			GetMonoDroidSdk (out monoDroidBinDir, out monoDroidFrameworkDir);
			
			GetConfiguredSdkLocations (out androidSdkPath, out javaSdkPath, log);
			
			if (!ValidateAndroidSdkLocation (androidSdkPath))
				androidSdkPath = null;
			if (!ValidateJavaSdkLocation (javaSdkPath))
				javaSdkPath = null;
			if (androidSdkPath != null && javaSdkPath != null)
				return;
			
			var path = Environment.GetEnvironmentVariable ("PATH");
			var pathDirs = path.Split (new char[] { Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries);
			
			if (androidSdkPath == null)
				androidSdkPath = FindAndroidSdk (pathDirs);

			if (javaSdkPath == null)
				javaSdkPath = FindJavaSdk (pathDirs);
		}
開發者ID:raufbutt,項目名稱:monodevelop-old,代碼行數:25,代碼來源:MonoDroidSdk.cs

示例2: MsBuildTaskLogger

        public MsBuildTaskLogger(TaskLoggingHelper log)
        {
            if (log == null)
                throw new ArgumentNullException("log");

            _log = log;
        }
開發者ID:uluhonolulu,項目名稱:Emkay.S3,代碼行數:7,代碼來源:MsBuildTaskLogger.cs

示例3: CheckFilePath

        /// <summary>
        /// Checks that the file path is sanitized and follows
        /// all the conventions estabilished by the operating system.
        /// </summary>
        /// <param name="fileName">The input file name to validate.</param>
        /// <param name="log">The current log instance.</param>
        /// <returns>A value indicating whether the action was executed succesfuly.</returns>
        internal static bool CheckFilePath(string fileName, TaskLoggingHelper log)
        {
            bool flag = true;
            string directoryName = string.Empty;
            try
            {
                directoryName = Path.GetDirectoryName(fileName);
            }
            catch (ArgumentException exception)
            {
                directoryName = exception.Message;
                flag = false;
            }
            catch (PathTooLongException exception2)
            {
                directoryName = exception2.Message;
                flag = false;
            }

            if (!flag)
            {
                log.LogErrorFromResources("InvalidPathChars", new object[] { directoryName });
            }

            return flag;
        }
開發者ID:tario,項目名稱:sdctasks,代碼行數:33,代碼來源:TaskHelpers.cs

示例4: SerializeCache

 internal virtual void SerializeCache(string stateFile, TaskLoggingHelper log)
 {
     try
     {
         if ((stateFile != null) && (stateFile.Length > 0))
         {
             if (File.Exists(stateFile))
             {
                 File.Delete(stateFile);
             }
             using (FileStream stream = new FileStream(stateFile, FileMode.CreateNew))
             {
                 new BinaryFormatter().Serialize(stream, this);
             }
         }
     }
     catch (Exception exception)
     {
         if (Microsoft.Build.Shared.ExceptionHandling.NotExpectedException(exception))
         {
             throw;
         }
         log.LogWarningWithCodeFromResources("General.CouldNotWriteStateFile", new object[] { stateFile, exception.Message });
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:25,代碼來源:StateFileBase.cs

示例5: ReferenceTable

 internal ReferenceTable(bool findDependencies, bool findSatellites, bool findSerializationAssemblies, bool findRelatedFiles, string[] searchPaths, string[] allowedAssemblyExtensions, string[] relatedFileExtensions, string[] candidateAssemblyFiles, string[] frameworkPaths, InstalledAssemblies installedAssemblies, System.Reflection.ProcessorArchitecture targetProcessorArchitecture, Microsoft.Build.Shared.FileExists fileExists, Microsoft.Build.Shared.DirectoryExists directoryExists, Microsoft.Build.Tasks.GetDirectories getDirectories, GetAssemblyName getAssemblyName, GetAssemblyMetadata getAssemblyMetadata, GetRegistrySubKeyNames getRegistrySubKeyNames, GetRegistrySubKeyDefaultValue getRegistrySubKeyDefaultValue, OpenBaseKey openBaseKey, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVersion, Version projectTargetFramework, FrameworkName targetFrameworkMoniker, TaskLoggingHelper log, string[] latestTargetFrameworkDirectories, bool copyLocalDependenciesWhenParentReferenceInGac, CheckIfAssemblyInGac checkIfAssemblyIsInGac)
 {
     this.log = log;
     this.findDependencies = findDependencies;
     this.findSatellites = findSatellites;
     this.findSerializationAssemblies = findSerializationAssemblies;
     this.findRelatedFiles = findRelatedFiles;
     this.frameworkPaths = frameworkPaths;
     this.allowedAssemblyExtensions = allowedAssemblyExtensions;
     this.relatedFileExtensions = relatedFileExtensions;
     this.installedAssemblies = installedAssemblies;
     this.targetProcessorArchitecture = targetProcessorArchitecture;
     this.fileExists = fileExists;
     this.directoryExists = directoryExists;
     this.getDirectories = getDirectories;
     this.getAssemblyName = getAssemblyName;
     this.getAssemblyMetadata = getAssemblyMetadata;
     this.getRuntimeVersion = getRuntimeVersion;
     this.projectTargetFramework = projectTargetFramework;
     this.targetedRuntimeVersion = targetedRuntimeVersion;
     this.openBaseKey = openBaseKey;
     this.targetFrameworkMoniker = targetFrameworkMoniker;
     this.latestTargetFrameworkDirectories = latestTargetFrameworkDirectories;
     this.copyLocalDependenciesWhenParentReferenceInGac = copyLocalDependenciesWhenParentReferenceInGac;
     this.checkIfAssemblyIsInGac = checkIfAssemblyIsInGac;
     this.compiledSearchPaths = AssemblyResolution.CompileSearchPaths(searchPaths, candidateAssemblyFiles, targetProcessorArchitecture, frameworkPaths, fileExists, getAssemblyName, getRegistrySubKeyNames, getRegistrySubKeyDefaultValue, openBaseKey, installedAssemblies, getRuntimeVersion, targetedRuntimeVersion);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:27,代碼來源:ReferenceTable.cs

示例6: ConnectionContext

 public ConnectionContext(NetworkStream clientStream, string connString, TcpTestServer3 server, TaskLoggingHelper log)
 {
     this.clientStream = clientStream;
     this.connString = connString;
     this.tcpServer = server;
     this.log = log;
 }
開發者ID:ericlemes,項目名稱:IntegrationTests,代碼行數:7,代碼來源:ConnectionContext.cs

示例7: DataDrivenToolTask

 /// <summary>
 /// Default constructor
 /// </summary>
 protected DataDrivenToolTask(ResourceManager taskResources)
     : base(taskResources)
 {
     logPrivate = new TaskLoggingHelper(this);
     logPrivate.TaskResources = AssemblyResources.PrimaryResources;
     logPrivate.HelpKeywordPrefix = "MSBuild.";
 }
開發者ID:cameron314,項目名稱:msbuild,代碼行數:10,代碼來源:DataDrivenToolTask.cs

示例8: Task

		protected Task(ResourceManager taskResources,
			       string helpKeywordPrefix)
		{
			log = new TaskLoggingHelper (this);
			log.TaskResources = taskResources;
			this.helpKeywordPrefix = helpKeywordPrefix;
		}
開發者ID:ItsVeryWindy,項目名稱:mono,代碼行數:7,代碼來源:Task.cs

示例9: TaskLogger

        public TaskLogger(TaskLoggingHelper taskLoggingHelper)
        {
            if (taskLoggingHelper == null)
                throw new ArgumentNullException("taskLoggingHelper");

            this.taskLoggingHelper = taskLoggingHelper;
        }
開發者ID:dougrathbone,項目名稱:mbunit-v3,代碼行數:7,代碼來源:TaskLogger.cs

示例10: ComReference

 /// <summary>
 /// Internal constructor
 /// </summary>
 /// <param name="taskLoggingHelper">task logger instance used for logging</param>
 /// <param name="silent">true if this task should log only errors, no warnings or messages; false otherwise</param>
 /// <param name="referenceInfo">cached reference information (typelib pointer, original task item, typelib name etc.)</param>
 /// <param name="itemName">reference name (for better logging experience)</param>
 internal ComReference(TaskLoggingHelper taskLoggingHelper, bool silent, ComReferenceInfo referenceInfo, string itemName)
 {
     _referenceInfo = referenceInfo;
     _itemName = itemName;
     _log = taskLoggingHelper;
     _silent = silent;
 }
開發者ID:cameron314,項目名稱:msbuild,代碼行數:14,代碼來源:ComReference.cs

示例11: GetAppBuildOrder

        public IEnumerable<string> GetAppBuildOrder(string sourceDirectory, string startAppPath, string uniqueSourceDirectoryPath, TaskLoggingHelper log)
        {
            _log = log;
            _uniqueSourceDirectoryPath = uniqueSourceDirectoryPath;
            var sourceDirectoryPath = sourceDirectory.Trim('\'', '"');
            var appList = GetAppListWithReferences(sourceDirectoryPath);

            var appPath = startAppPath.Trim('\'', '"');
            var startApps = appPath.Split('|').ToList();
            foreach (var app in startApps)
            {
                if (!string.IsNullOrEmpty(app))
                {
                    _log.LogMessage("Application path: {0}", app);
                    var startApp = appList[Path.GetFullPath(app.ToUpper().Replace(sourceDirectoryPath.ToUpper(), _uniqueSourceDirectoryPath)).ToUpper()];
                    if (startApp == null)
                    {
                        log.LogError("Application {0} could not be found.", app);
                    }
                    else
                    {
                        _orderedAppList.Add(Path.GetFullPath(app.ToUpper().Replace(sourceDirectoryPath.ToUpper(), _uniqueSourceDirectoryPath)).ToUpper());
                        LoopReferences(startApp, appList);
                    }
                }
            }

            _orderedAppList.ForEach(a => _log.LogMessage(a));

            return _orderedAppList;
        }
開發者ID:nickvane,項目名稱:AionMsBuildTasks,代碼行數:31,代碼來源:AppOrderer.cs

示例12: DeserializeCache

 internal static StateFileBase DeserializeCache(string stateFile, TaskLoggingHelper log, Type requiredReturnType)
 {
     StateFileBase o = null;
     try
     {
         if (((stateFile == null) || (stateFile.Length <= 0)) || !File.Exists(stateFile))
         {
             return o;
         }
         using (FileStream stream = new FileStream(stateFile, FileMode.Open))
         {
             object obj2 = new BinaryFormatter().Deserialize(stream);
             o = obj2 as StateFileBase;
             if ((o == null) && (obj2 != null))
             {
                 log.LogMessageFromResources("General.CouldNotReadStateFileMessage", new object[] { stateFile, log.FormatResourceString("General.IncompatibleStateFileType", new object[0]) });
             }
             if ((o != null) && !requiredReturnType.IsInstanceOfType(o))
             {
                 log.LogWarningWithCodeFromResources("General.CouldNotReadStateFile", new object[] { stateFile, log.FormatResourceString("General.IncompatibleStateFileType", new object[0]) });
                 o = null;
             }
         }
     }
     catch (Exception exception)
     {
         log.LogWarningWithCodeFromResources("General.CouldNotReadStateFile", new object[] { stateFile, exception.Message });
     }
     return o;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:30,代碼來源:StateFileBase.cs

示例13: GetTable

 internal static bool GetTable(TaskLoggingHelper log, string parameterName, string[] propertyList, out Hashtable propertiesTable)
 {
     propertiesTable = null;
     if (propertyList != null)
     {
         propertiesTable = new Hashtable(StringComparer.OrdinalIgnoreCase);
         foreach (string str in propertyList)
         {
             string str2 = string.Empty;
             string str3 = string.Empty;
             int index = str.IndexOf('=');
             if (index != -1)
             {
                 str2 = str.Substring(0, index).Trim();
                 str3 = str.Substring(index + 1).Trim();
             }
             if (str2.Length == 0)
             {
                 if (log != null)
                 {
                     log.LogErrorWithCodeFromResources("General.InvalidPropertyError", new object[] { parameterName, str });
                 }
                 return false;
             }
             propertiesTable[str2] = str3;
         }
     }
     return true;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:29,代碼來源:PropertyParser.cs

示例14: CompilerErrorSink

		/// <summary>
		/// Constructor for the error sink
		/// </summary>
		/// <param name="logger">This parameter should be the logger for the task being executed</param>
		public CompilerErrorSink(TaskLoggingHelper/*!*/ logger)
		{
			if (logger == null)
				throw new ArgumentNullException("logger");

			this.logger = logger;
		}
開發者ID:hansdude,項目名稱:Phalanger,代碼行數:11,代碼來源:CompilerErrorSink.cs

示例15: SerializeCache

        /// <summary>
        /// Writes the contents of this object out to the specified file.
        /// </summary>
        /// <param name="stateFile"></param>
        virtual internal void SerializeCache(string stateFile, TaskLoggingHelper log)
        {
            try
            {
                if (!string.IsNullOrEmpty(stateFile))
                {
                    if (File.Exists(stateFile))
                    {
                        File.Delete(stateFile);
                    }

                    using (FileStream s = new FileStream(stateFile, FileMode.CreateNew))
                    {
                        BinaryFormatter formatter = new BinaryFormatter();
                        formatter.Serialize(s, this);
                    }
                }
            }
            catch (Exception e)
            {
                // If there was a problem writing the file (like it's read-only or locked on disk, for
                // example), then eat the exception and log a warning.  Otherwise, rethrow.
                if (ExceptionHandling.NotExpectedSerializationException(e))
                    throw;

                // Not being able to serialize the cache is not an error, but we let the user know anyway.
                // Don't want to hold up processing just because we couldn't read the file.
                log.LogWarningWithCodeFromResources("General.CouldNotWriteStateFile", stateFile, e.Message);
            }
        }
開發者ID:cameron314,項目名稱:msbuild,代碼行數:34,代碼來源:StateFileBase.cs


注:本文中的Microsoft.Build.Utilities.TaskLoggingHelper類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。