本文整理汇总了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();
}
示例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();
}
示例3: Tracer
static Tracer()
{
Instance = new Tracer();
var isAttached = Debugger.IsAttached;
TraceWarning = isAttached;
TraceError = isAttached;
}
示例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
{
}
}
示例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);
}
示例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);
}
示例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);
}
示例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");
}
示例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));
}
示例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);
}
}
示例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);
}
示例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;
}
}
示例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);
}
示例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();
}
示例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>();
}