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


C# ITracer.Info方法代码示例

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


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

示例1: SyncTargets

        /// <summary>
        /// Synchronizes the targets file on disk with targets file in this version of the toolkit.
        /// </summary>
        internal static void SyncTargets(ITracer tracer, TargetsInfo targetsInfo)
        {
            try
            {
                tracer.Info(Resources.AuthoringPackage_TraceSyncTargetsInitial);

                //Write updated targets file
                WriteUpdatedTargets(tracer, targetsInfo);
            }
            catch (Exception ex)
            {
                tracer.Error(ex, Resources.AuthoringPackage_FailedSyncTargets);
            }
        }
开发者ID:NuPattern,项目名称:NuPattern,代码行数:17,代码来源:VersionHelper.cs

示例2: WriteUpdatedTargets

        private static void WriteUpdatedTargets(ITracer tracer, TargetsInfo targetsInfo)
        {
            tracer.Info(Resources.AuthoringPackage_TraceSyncTargetsWritingNewTargets, targetsInfo.TargetsPath, targetsInfo.ToolkitVersion);

            //Delete file if exists
            if (File.Exists(targetsInfo.TargetsPath))
            {
                File.Delete(targetsInfo.TargetsPath);
            }

            // Ensure directory exists
            var targetsFolder = Path.GetDirectoryName(targetsInfo.TargetsPath);
            if (!Directory.Exists(targetsFolder))
            {
                Directory.CreateDirectory(targetsFolder);
            }

            // Write new targets
            PopulateTargets(targetsInfo);
        }
开发者ID:NuPattern,项目名称:NuPattern,代码行数:20,代码来源:VersionHelper.cs

示例3: Run

        private void Run(ITracer tracer, long repeat)
        {
            var e = new ManualResetEventSlim();
            var watch = Stopwatch.StartNew();

            for (int i = 1; i <= repeat; i++)
            {
                var current = i;
                Task.Factory.StartNew(() =>
                {
                    tracer.Info(Guid.NewGuid());
                    if (current == repeat)
                        e.Set();
                });
            }

            e.Wait();

            Console.WriteLine("{0}: {1}", tracer.GetType().Name, watch.ElapsedTicks / repeat);
        }
开发者ID:tleviathan,项目名称:NuTracer,代码行数:20,代码来源:Speed.cs

示例4: TestInitialize

	public virtual void TestInitialize()
	{
		UIThreadInvoker.Initialize();

		// Causes devenv to initialize
		var devEnv = Clide.DevEnv.Get(new Guid(IntegrationPackage.Constants.PackageGuid));

		this.tracer = Tracer.Get(this.GetType());
		this.strings = new StringBuilder();
		this.listener = new TextWriterTraceListener(new StringWriter(this.strings));

		// Just in case, re-set the tracers.
		Tracer.Manager.SetTracingLevel(TracerManager.DefaultSourceName, SourceLevels.All);
		Tracer.Manager.AddListener(TracerManager.DefaultSourceName, this.listener);

		tracer.Info("Running test from: " + this.TestContext.TestDeploymentDir);

		if (Dte != null)
		{
			Dte.SuppressUI = false;
			Dte.MainWindow.Visible = true;
			Dte.MainWindow.WindowState = EnvDTE.vsWindowState.vsWindowStateNormal;
		}

		var shellEvents = new ShellEvents(ServiceProvider);
		var initialized = shellEvents.IsInitialized;
		while (!initialized)
		{
			System.Threading.Thread.Sleep(10);
		}

		tracer.Info("Shell initialized successfully");
		if (VsIdeTestHostContext.ServiceProvider == null)
			VsIdeTestHostContext.ServiceProvider = new VsServiceProvider();

		cleanupFolders = new List<string>();
	}
开发者ID:MobileEssentials,项目名称:clide,代码行数:37,代码来源:VsHostedSpec.cs

示例5: Initialize

        /// <summary>
        /// Initializes driver with settings object.
        /// </summary>
        /// <param name="tracer">Tracer sink</param>
        /// <param name="settings">Arbitrary settings object, type specific to implementation</param>
        /// <seealso cref="IStorageDriverFactory.Create"/>
        /// <seealso cref="IStorageDriverFactory.GetDriverConfig"/>
        public void Initialize(ITracer tracer, object settings)
        {
            if (m_initialized)
            {
                throw new InvalidOperationException("Already initialized");
            }

            if (tracer == null)
            {
                throw new ArgumentNullException("tracer");
            }

            m_tracer = tracer;
            if (m_tracer.IsDebugEnabled)
            {
                m_tracer.Debug(string.Concat("Initializing RAM storage driver for settings string: ", settings));
            }

            m_changesets = new ConcurrentDictionary<long, RamDriverChangeset>();

            var initString = settings as string;
            if (!string.IsNullOrEmpty(initString))
            {
                m_settings = new RamDriverSettings();
                if (0 == StringComparer.OrdinalIgnoreCase.Compare("demo", initString))
                {
                    m_settings.InitializationCommand = initString;
                }
                else
                {
                    m_settings.StorageRoot = initString;
                }
            }
            else
            {
                m_settings = new RamDriverSettings(settings as RamDriverSettings);
            }

            CheckInitialized();

            if (m_tracer.IsInfoEnabled)
            {
                m_tracer.Info("RAM storage driver ready");
            }
        }
开发者ID:adrobyazko-softheme,项目名称:PQL,代码行数:52,代码来源:RamDriver.cs

示例6: GetDocumentPath

 /// <summary>
 /// Gets the path to the guidance document from the current element.
 /// </summary>
 /// <remarks>
 /// Returns the first artifact link with a *.doc extension of the current element.
 /// </remarks>
 public static string GetDocumentPath(ITracer tracer, IProductElement element, IUriReferenceService uriService)
 {
     // Return path of first reference
     var references = SolutionArtifactLinkReference.GetResolvedReferences(element, uriService);
     if (!references.Any())
     {
         tracer.Warn(String.Format(CultureInfo.CurrentCulture,
             Resources.GuidanceDocumentPathProvider_NoLinksFound, element.InstanceName));
         return string.Empty;
     }
     else
     {
         var reference = references.FirstOrDefault(r => r.PhysicalPath.EndsWith(GuidanceDocumentExtension));
         if (reference == null)
         {
             tracer.Warn(String.Format(CultureInfo.CurrentCulture,
                 Resources.GuidanceDocumentPathProvider_NoDocumentLinkFound, element.InstanceName));
             return string.Empty;
         }
         else
         {
             tracer.Info(String.Format(CultureInfo.CurrentCulture,
                 Resources.GuidanceDocumentPathProvider_LinkFound, element.InstanceName, reference.PhysicalPath));
             return reference.PhysicalPath;
         }
     }
 }
开发者ID:NuPattern,项目名称:NuPattern,代码行数:33,代码来源:GuidanceDocumentHelper.cs


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