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


C# Tracer类代码示例

本文整理汇总了C#中Tracer的典型用法代码示例。如果您正苦于以下问题:C# Tracer类的具体用法?C# Tracer怎么用?C# Tracer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: World

 public World()
 {
     Camera = null;
     BackgroundColor = new RGBColor();
     Tracer = null;
     AmbientLight=new Ambient();
 }
开发者ID:nklinkachev,项目名称:RayTracer,代码行数:7,代码来源:World.cs

示例2: Main

        static void Main()
        {
            long t;
            NtQuerySystemTime(out t);

            // TODO: Performance Counters
            //      http://msdn.microsoft.com/en-us/library/vstudio/system.diagnostics.performancecounter
            //      http://msdn.microsoft.com/en-us/library/w8f5kw2e(v=vs.110).aspx
            //      http://msdn.microsoft.com/en-us/library/9tyc2s04(v=vs.110).aspx
            //      http://msdn.microsoft.com/en-us/library/w4bz2147(v=vs.110).aspx

            // Init:
            Tracer tracer = new Tracer();

            tracer.PutEvent(TraceEventType.Information, 1, String.Format("Pomodoro has been started at {0}...", DateTime.FromFileTime(t).ToString()));

            ConfigManager cm = new ConfigManager(tracer);

            Thread.CurrentThread.CurrentUICulture = new CultureInfo(cm.Configuration.Language);

            tracer.PutEvent(TraceEventType.Information, 1, String.Format("Language: {0}", cm.Configuration.Language));

            DataManager dm = new DataManager { DB = cm.Configuration.DbFile };
            dm.tracer = tracer;

            dm.createDBOrSkip();

            tracer.PutEvent(TraceEventType.Information, 42, String.Format("Number of tags in DB: {0}", Pomodoro.Stat.SQLDataConnection.tag_num));

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainWindow(dm, cm));

            tracer.Close();
        }
开发者ID:reedcourty,项目名称:dotnet2014,代码行数:35,代码来源:Program.cs

示例3: Tracer

 static Tracer()
 {
     Instance = new Tracer();
     var isAttached = Debugger.IsAttached;
     TraceWarning = isAttached;
     TraceError = isAttached;
 }
开发者ID:sami1971,项目名称:MugenMvvmToolkit,代码行数:7,代码来源:Tracer.cs

示例4: Tracer

        private Tracer(string section)
        {
            this.section = section;

            if (HttpContext.Current.Items["SpeedTracerContext"] == null)
            {
                HttpContext.Current.Items["SpeedTracerContext"] = this;
            }
            else
            {
                this.parent = Current;
                Current = this;
            }

            this.startTime = DateTime.Now;

            try
            {
                var stackTrace = Environment.StackTrace.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

                var regex = new Regex(@"^\s*at\s+(.*)\s+in\s+(.*)\s(\d+)$");

                var rawStack = stackTrace[4];
                var match = regex.Match(rawStack);

                this.methodName = match.Groups[1].Value;
                this.className = match.Groups[2].Value;
                this.lineNumber = match.Groups[3].Value;
            }
            catch
            {
            }
        }
开发者ID:eazel7,项目名称:speedtracer-aspnet,代码行数:33,代码来源:SpeedTracerContext.cs

示例5: RayTracingRenderer

 public RayTracingRenderer(GraphicsDevice graphicsDevice, Scene scene, Camera camera, int windowWidth, int windowHeight)
     : base(graphicsDevice, scene, camera)
 {
     _tracer = new Tracer(windowWidth, windowHeight, scene, camera);
     _spriteBatch = new SpriteBatch(graphicsDevice);
     _target = new Texture2D(graphicsDevice, windowWidth, windowHeight);
 }
开发者ID:tgjones,项目名称:rasteracer,代码行数:7,代码来源:RayTracingRenderer.cs

示例6: TracerHelper

        /// <summary>
        /// Static constructor.
        /// By default the tracer is created and configured with a tracer item keeper sink.
        /// </summary>
        static TracerHelper()
        {
            _tracer = new Tracer();
            _tracer.Add(new TracerItemKeeperSink(_tracer));

            GeneralHelper.ApplicationClosingEvent += new GeneralHelper.DefaultDelegate(GeneralHelper_ApplicationClosingEvent);
        }
开发者ID:redrhino,项目名称:DotNetConnectTerminal,代码行数:11,代码来源:TracerHelper.cs

示例7: Execute

 internal void Execute(RuleExecution ruleExecution)
 {
     Tracer tracer = null;
     if (WorkflowActivityTrace.Rules.Switch.ShouldTrace(TraceEventType.Information))
     {
         tracer = new Tracer(name, ruleExecution.ActivityExecutionContext);
         tracer.StartRuleSet();
     }
     Executor.ExecuteRuleSet(analyzedRules, ruleExecution, tracer, RuleSet.RuleSetTrackingKey + name);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:10,代码来源:RuleEngine.cs

示例8: Cursor

        /// <summary>
        /// Initializes a new instance of the Cursor class.
        /// </summary>
        /// <param name="session">The session to use for the cursor.</param>
        /// <param name="dbid">The database containing the table.</param>
        /// <param name="tablename">The name of the table.</param>
        public Cursor(Session session, JET_DBID dbid, string tablename)
        {
            this.tracer = new Tracer("Cursor", "Esent Cursor object", String.Format("Cursor {0}", tablename));

            this.session = session;
            this.dbid = dbid;
            this.tablename = tablename;

            Api.JetOpenTable(this.session, this.dbid, this.tablename, null, 0, OpenTableGrbit.None, out this.table);
            this.Tracer.TraceVerbose("opened");
        }
开发者ID:j2jensen,项目名称:ravendb,代码行数:17,代码来源:Cursor.cs

示例9: Rendering_empty_scene_should_be_correct_size_and_background_color

        public void Rendering_empty_scene_should_be_correct_size_and_background_color()
        {
            var t = new Tracer(new Scene());
            t.Background = Color.FromArgb(255, 0, 0);

            var result = t.Render();

            for(var y = 0; y < t.Height; y++)
                for (int x = 0; x < t.Width; x++)
                    Assert.AreEqual(t.Background, result.GetPixel(x, y));
        }
开发者ID:jmfryan,项目名称:csharp-raytracer,代码行数:11,代码来源:Class1.cs

示例10: DoTrace

        /// <summary>
        /// Perform actual item tracing.
        /// </summary>
        /// <param name="tracer"></param>
        /// <param name="itemType"></param>
        /// <param name="message"></param>
        public static void DoTrace(Tracer tracer, TracerItem.TypeEnum itemType, TracerItem.PriorityEnum priority, string message)
        {
            if (tracer != null && tracer.Enabled)
            {
                string threadId = Thread.CurrentThread.ManagedThreadId.ToString();
                string threadName = Thread.CurrentThread.Name;

                MethodBase method = ReflectionHelper.GetExternalCallingMethod(3, OwnerTypes);

                MethodTracerItem item = new MethodTracerItem(itemType, priority, message, method);
                tracer.Add(item);
            }
        }
开发者ID:redrhino,项目名称:DotNetConnectTerminal,代码行数:19,代码来源:TracerHelper.cs

示例11: RenderSceneToFile

        private static void RenderSceneToFile(Scene s)
        {
            var t = new Tracer(s);
            //t.Background = Color.Gray;

            var image = t.Render();

            string imageLocation = @"C:\render.png";
            if (File.Exists(imageLocation))
                File.Delete(imageLocation);

            image.Save(imageLocation, ImageFormat.Png);
        }
开发者ID:jmfryan,项目名称:csharp-raytracer,代码行数:13,代码来源:Class1.cs

示例12: Start

	void Start()
	{
		if (mover == null)
		{
			mover = GetComponent<SimpleMover>();
		}
		if (partnerLink == null)
		{
			partnerLink = GetComponent<PartnerLink>();
		}
		if (tracer == null)
		{
			tracer = GetComponent<Tracer>();
		}
		
		if (waypointContainer != null)
		{
			Waypoint[] waypointObjects = waypointContainer.GetComponentsInChildren<Waypoint>();
			int startIndex = -1;
			for (int i = 0; i < waypointObjects.Length && startIndex < 0; i++)
			{
				if (waypointObjects[i].isStart)
				{
					startIndex = i;
				}
			}
			if (startIndex >= 0)
			{
				waypoints = new List<Waypoint>();
				while (waypoints.Count < waypointObjects.Length)
				{
					if (startIndex > 0 && startIndex + waypoints.Count >= waypointObjects.Length)
					{
						startIndex = 0;
					}
					waypoints.Add(waypointObjects[startIndex + waypoints.Count]);
				}
			}
		}
		
		SeekNextWaypoint();
		if (previous >= 0 && previous < waypoints.Count)
		{
			transform.position = waypoints[previous].transform.position;
		}

		for (int i = 0; i < waypoints.Count; i++)
		{
			waypoints[i].renderer.enabled = showWaypoints;
		}
	}
开发者ID:angl3m3th,项目名称:Conversation_Drawer,代码行数:51,代码来源:WaypointSeek.cs

示例13: RuleEngine

 internal RuleEngine(RuleSet ruleSet, RuleValidation validation, ActivityExecutionContext executionContext)
 {
     if (!ruleSet.Validate(validation))
     {
         throw new RuleSetValidationException(string.Format(CultureInfo.CurrentCulture, Messages.RuleSetValidationFailed, new object[] { ruleSet.name }), validation.Errors);
     }
     this.name = ruleSet.Name;
     this.validation = validation;
     Tracer tracer = null;
     if (WorkflowActivityTrace.Rules.Switch.ShouldTrace(TraceEventType.Information))
     {
         tracer = new Tracer(ruleSet.Name, executionContext);
     }
     this.analyzedRules = Executor.Preprocess(ruleSet.ChainingBehavior, ruleSet.Rules, validation, tracer);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:RuleEngine.cs

示例14: Start

	// Use this for initialization
	void Start () {
		if(gameCamera == null)
		{
			gameCamera = Camera.main;
		}
		if (mover == null)
		{
			mover = GetComponent<SimpleMover>();
		}
		if (tracer == null)
		{
			tracer = GetComponent<Tracer>();
		}
		tracer.StartLine();
	}
开发者ID:angl3m3th,项目名称:Conversation_Drawer,代码行数:16,代码来源:CursorSeek.cs

示例15: Start

	// Use this for initialization
	void Start () {
		if (cameraShake == null)
		{
			cameraShake = Camera.main.GetComponent<CameraShake>();
		}
		pSys = (GameObject)Instantiate(particleTrail);
		pSys.particleSystem.enableEmission = false;
		prevPos = transform.position;
		startColor = sprite.renderer.material.color;
		boostColorOne = new Color(0.3f, 0.2f, 0.5f, 1.0f);
		boostColorTwo = new Color(0.3f, 0.6f, 0.3f, 1.0f);
		boostColorThree = new Color(0.95f, 0.5f, 0.0f, 1.0f);
		boostColorFour = new Color(1.0f, 1.0f, 0.0f, 1.0f);
		tracer = GetComponent<Tracer>();
	}
开发者ID:arun-abraham,项目名称:Conversation_Drawer,代码行数:16,代码来源:Feedback.cs


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