• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Tracer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: TimeoutStream

 public TimeoutStream(Stream innerStream, TimeSpan timeout, Tracer tracer)
 {
     _innerStream = innerStream;
     _timeout = timeout;
     _tracer = tracer;
     _timer = new Timer(_timeout.TotalMilliseconds)
     {
         AutoReset = false
     };
     _timer.Elapsed += (sender, args) =>
     {
         tracer.AsInfo("Timeout of {0} reached.".FormatWith(_timeout));
         Close();
     };
     _timer.Start();
 }
开发者ID:khellang,项目名称:LimitsMiddleware,代码行数:16,代码来源:TimeoutStream.cs


示例17: Start

	void Start()
	{
		if (mover == null)
		{
			mover = GetComponent<SimpleMover>();
		}
		if (partnerLink == null)
		{
			partnerLink = GetComponent<PartnerLink>();
		}
		if (tracer == null)
		{
			tracer = GetComponent<Tracer>();
		}
		startSpeed = mover.maxSpeed;
	}
开发者ID:angl3m3th,项目名称:Conversation_Drawer,代码行数:16,代码来源:ConversationScore.cs


示例18: Awake

	void Awake()
	{
		if (mover == null)
		{
			mover = GetComponent<SimpleMover>();
		}
		if (tracer == null)
		{
			tracer = GetComponent<Tracer>();
		}
		if (conversationScore == null)
		{
			conversationScore = GetComponent<ConversationScore>();
		}

		partnerLine = GetComponent<LineRenderer>();
	}
开发者ID:angl3m3th,项目名称:Conversation_Drawer,代码行数:17,代码来源:PartnerLink.cs


示例19: TracerControl

        /// <summary>
        /// Constructor.
        /// </summary>
        public TracerControl()
        {
            InitializeComponent();
            _tracer = new Tracer();

            listView.VirtualItemsSelectionRangeChanged += new ListViewVirtualItemsSelectionRangeChangedEventHandler(listView_VirtualItemsSelectionRangeChanged);

            lock (listView)
            {
                listView.AdvancedColumnManagementUnsafe.Add(0, new VirtualListViewEx.ColumnManagementInfo() { AutoResizeMode = ColumnHeaderAutoResizeStyle.ColumnContent });
                listView.AdvancedColumnManagementUnsafe.Add(1, new VirtualListViewEx.ColumnManagementInfo() { FillWhiteSpace = true });
            }

            // Search items.
            _searchingMatchStrip = new StringsControlToolStripEx();
            _searchingMatchStrip.Label = "Search";
            // Data source assigned on tracer assignment.
            //toolStripFilters.Items.Add(new ToolStripSeparator());
            WinFormsHelper.MoveToolStripItems(_searchingMatchStrip, toolStripFilters);

            // Mark items.
            _markingMatchStrip = new StringsControlToolStripEx();
            _markingMatchStrip.Label = "Mark";
            _markingMatchStrip.SetDataSource(this, this.GetType().GetProperty("MarkingMatch"));
            toolStripFilters.Items.Add(new ToolStripSeparator());
            WinFormsHelper.MoveToolStripItems(_markingMatchStrip, toolStripFilters);

            // View exclude filtering...
            _viewExcludeStrip = new StringsControlToolStripEx();
            _viewExcludeStrip.Label = "Exclude";
            WinFormsHelper.MoveToolStripItems(_viewExcludeStrip, toolStripFilters);

            // Input filtering...
            ToolStripLabel label = new ToolStripLabel("Filter");
            label.ForeColor = SystemColors.GrayText;
            toolStripFilters.Items.Add(new ToolStripSeparator());
            toolStripFilters.Items.Add(label);

            // Input exlude items.
            _inputExcludeStrip = new StringsControlToolStripEx();
            _inputExcludeStrip.Label = "Exclude";
            // Data source assigned on tracer assignment.
            toolStripFilters.Items.Add(new ToolStripSeparator());
            WinFormsHelper.MoveToolStripItems(_inputExcludeStrip, toolStripFilters);
        }
开发者ID:redrhino,项目名称:DotNetConnectTerminal,代码行数:48,代码来源:TracerControl.cs


示例20: cmdTestConstructor_Click

	protected void cmdTestConstructor_Click ( object sender, EventArgs e )
	{
		string result = string.Empty;
		Tracer tracer = new Tracer ( );

		result += "测试构造函数 DW, 分别使用 空; ScriptType.JavaScript; ScriptType.VBScript;<br />";

		foreach ( object core in tracer.Execute ( null, typeof ( DataWebCore<IDataWeb<PagerSetting>, PagerSetting> ), null, FunctionType.Constructor, null, null, null, null,
			new object[][] {
				new object[] { null, null }
			},
			false
			)
			)
			result += "返回: " + core.ToString ( ) + "<br />";

		this.lblResult.Text = result;
	}
开发者ID:cform-dev,项目名称:zsharedcode,代码行数:18,代码来源:TestDataWebCore.aspx.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Track类代码示例发布时间:2022-05-24
下一篇:
C# TraceSource类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap