Inheritance: MonoBehaviour
コード例 #1
0
        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
            {
            }
        }
コード例 #2
0
 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);
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: reedcourty/dotnet2014
        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();
        }
コード例 #4
0
ファイル: World.cs プロジェクト: nklinkachev/RayTracer
 public World()
 {
     Camera = null;
     BackgroundColor = new RGBColor();
     Tracer = null;
     AmbientLight=new Ambient();
 }
コード例 #5
0
        /// <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);
        }
コード例 #6
0
ファイル: Tracer.cs プロジェクト: sami1971/MugenMvvmToolkit
 static Tracer()
 {
     Instance = new Tracer();
     var isAttached = Debugger.IsAttached;
     TraceWarning = isAttached;
     TraceError = isAttached;
 }
コード例 #7
0
 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
0
ファイル: Class1.cs プロジェクト: jmfryan/csharp-raytracer
        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));
        }
コード例 #9
0
ファイル: Cursor.cs プロジェクト: j2jensen/ravendb
        /// <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");
        }
コード例 #10
0
ファイル: Class1.cs プロジェクト: jmfryan/csharp-raytracer
        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);
        }
コード例 #11
0
        /// <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);
            }
        }
コード例 #12
0
	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
0
	// 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();
	}
コード例 #14
0
 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);
 }
コード例 #15
0
	// 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>();
	}
コード例 #16
0
 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();
 }
コード例 #17
0
	void Start()
	{
		if (mover == null)
		{
			mover = GetComponent<SimpleMover>();
		}
		if (partnerLink == null)
		{
			partnerLink = GetComponent<PartnerLink>();
		}
		if (tracer == null)
		{
			tracer = GetComponent<Tracer>();
		}
		startSpeed = mover.maxSpeed;
	}
コード例 #18
0
	void Awake()
	{
		if (mover == null)
		{
			mover = GetComponent<SimpleMover>();
		}
		if (tracer == null)
		{
			tracer = GetComponent<Tracer>();
		}
		if (conversationScore == null)
		{
			conversationScore = GetComponent<ConversationScore>();
		}

		partnerLine = GetComponent<LineRenderer>();
	}
コード例 #19
0
        /// <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);
        }
コード例 #20
0
	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;
	}
コード例 #21
0
ファイル: Program.cs プロジェクト: reedcourty/dotnet2014
        static void Main(string[] args)
        {
            // Init:
            Tracer tracer = new Tracer();

            tracer.PutEvent(TraceEventType.Information, 1, "SQLiteMigrator has been started...");

            ConfigManager cm = new ConfigManager(tracer);

            DataManager dm = new DataManager { DB = cm.Configuration.DbFile };
            dm.tracer = tracer;
            dm.createMSSQLDBNoMatterWhat();
            dm.migrateSQLiteToMSSQL();

            Console.ReadLine();

            tracer.Close();
        }
コード例 #22
0
ファイル: Program.cs プロジェクト: plurby/kudu
        private static ITracer GetTracer(IEnvironment env, TraceLevel level)
        {
            if (level > TraceLevel.Off)
            {
                var tracer = new Tracer(Path.Combine(env.TracePath, Constants.TraceFile), level);
                string logFile = System.Environment.GetEnvironmentVariable(Constants.TraceFileEnvKey);
                if (!String.IsNullOrEmpty(logFile))
                {
                    // Kudu.exe is executed as part of git.exe (post-receive), giving its initial depth of 4 indentations
                    string logPath = Path.Combine(env.TracePath, logFile);
                    return new CascadeTracer(tracer, new TextTracer(new FileSystem(), logPath, level, 4));
                }

                return tracer;
            }

            return NullTracer.Instance;
        }
コード例 #23
0
	protected virtual void Start()
	{
		if (mover == null)
		{
			mover = GetComponent<SimpleMover>();
		}
		if (tracer == null)
		{
			tracer = GetComponent<Tracer>();
		}
		if (partnerLink == null)
		{
			partnerLink = GetComponent<PartnerLink>();
		}
		if (tail != null)
		{
			tailTrigger = tail.trigger;
		}
	}
コード例 #24
0
	protected void cmdTestConstructor_Click ( object sender, EventArgs e )
	{
		string result = string.Empty;
		Tracer tracer = new Tracer ();

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

		foreach ( object scriptHelper in tracer.Execute ( null, typeof ( ScriptHelper ), null, FunctionType.Constructor, null, null, null, null,
			new object[][] {
				new object[] { },
				new object[] { ScriptType.JavaScript },
				new object[] { ScriptType.VBScript }
			},
			false
			)
			)
			result += "返回: " + scriptHelper.ToString () + "<br />";

		this.lblResult.Text = result;
	}
コード例 #25
0
	void Start()
	{
		if (mover == null)
		{
			mover = GetComponent<SimpleMover>();
		}
		if (partnerLink == null)
		{
			partnerLink = GetComponent<PartnerLink>();
		}
		if (tracer == null)
		{
			tracer = GetComponent<Tracer>();
		}
		if (conversingSpeed == null)
		{
			conversingSpeed = GetComponent<ConversingSpeed>();
		}
		startSpeed = mover.maxSpeed;
		headFill.transform.localScale = Vector3.zero;
	}
コード例 #26
0
	protected void cmdTestConstructor_Click ( object sender, EventArgs e )
	{
		string result = string.Empty;
		Tracer tracer = new Tracer ();

		result += "测试构造函数 JQuery<br />";

		foreach ( object jQuery in tracer.Execute ( null, typeof ( JQuery ), null, FunctionType.Constructor, null, null, null, null,
			new object[][] {
				new object[] { },
				new object[] { false },
				new object[] { "'body table'" },
				new object[] { "'body table'", false },
				new object[] { "'body table'", "document.body" },
				new object[] { "'body table'", "document.body", false },
			},
			false
			)
			)
			result += "返回: " + jQuery.ToString () + "<br />";
		
		this.lblResult.Text = result;
	}
コード例 #27
0
	protected void cmdTestAlert_Click ( object sender, EventArgs e )
	{
		string result = string.Empty;
		Tracer tracer = new Tracer ();

		ScriptHelper scriptHelper = new ScriptHelper ();

		result += "测试方法 ScriptHelper.Alert(string)<br />";

		foreach ( object code in tracer.Execute ( scriptHelper, null, "Alert", FunctionType.Method, new Type[] { typeof ( string ) }, null, null, null,
			new object[][] {
				new object[] { "'你好1'" },
				new object[] { "'\"你好2\"'" }
			},
			false
			)
			)
			result += "返回: " + code.ToString () + "<br />";

		result += "测试方法 ScriptHelper.Alert(string, bool)<br />";

		foreach ( object code in tracer.Execute ( scriptHelper, null, "Alert", FunctionType.Method, new Type[] { typeof ( string ), typeof ( bool ) }, null, null, null,
			new object[][] {
				new object[] { "'你好1, 追加? true'", true },
				new object[] { "'\"你好2\", 追加? false'", false }
			},
			false
			)
			)
			result += "返回: " + code.ToString () + "<br />";

		result += "scriptHelper.Code = " + scriptHelper.Code + "<br />";

		this.lblResult.Text = result;

		scriptHelper.Build ( this );
	}
コード例 #28
0
        /// <summary>
        /// Processes the data.
        /// </summary>
        /// <param name="printDocuments"></param>
        public void ProcessTheDocument(List <DocumentResult> printDocuments)
        {
            if (_mBootParameters == null)
            {
                return;
            }
            if (string.IsNullOrEmpty(_mBootParameters.DataSet.CollectionId))
            {
                return;
            }
            // Get mapped printer
            _mMappedPrinterToNetwork =
                PrinterManagementBusiness.GetMappedPrinter(
                    new MappedPrinterIdentifierBEO(
                        _mBootParameters.Printer.UniqueIdentifier.Split(Constants.Split).Last(), true));
            // Create folder
            CreateFoldersForTemporaryStorage();


            //Get Dataset and Matter information for a given Collection Id
            _mDataSet = DataSetBO.GetDataSetDetailForCollectionId(_mBootParameters.DataSet.CollectionId);

            //Get DataSet Fields
            _mDataSet.DatasetFieldList.AddRange(
                DataSetBO.GetDataSetDetailForDataSetId(_mDataSet.FolderID).DatasetFieldList);
            // Get Matter information
            _mDataSet.Matter = MatterBO.GetMatterInformation(_mDataSet.FolderID);
            _mDatasetName    = _mDataSet.FolderName;


            var documents = new List <DocumentResult>();
            var documentIdentifierEntities = new List <DocumentIdentifierEntity>();

            foreach (var document in printDocuments)
            {
                try
                {
                    string errorCode;
                    var    separatorSheetFolder = Guid.NewGuid();
                    var    separatorSheet       = Path.Combine(Path.Combine(_mSharedLocation, _mBootParameters.Name),
                                                               Constants.SourceDirectoryPath, separatorSheetFolder.ToString(),
                                                               Constants.separatorHtml);
                    CreateseparatorSheet(separatorSheet, _mBootParameters.DataSet.MatterId,
                                         _mBootParameters.DataSet.CollectionId, document.DocumentID);
                    //Print the document set
                    var jobRunId = (!String.IsNullOrEmpty(PipelineId)) ? Convert.ToInt32(PipelineId) : 0;
                    var jobId    = JobMgmtDAO.GetJobIdFromJobRunId(jobRunId);
                    var status   = PrintDocumentSet(jobId.ToString(CultureInfo.InvariantCulture), _mBootParameters, document,
                                                    separatorSheet, out errorCode);
                    if (status)
                    {
                        document.CreatedDate = DateTime.Now;
                        documents.Add(document);
                        // Log the message using Log worker...
                        LogMessage(document, true, string.Empty);
                    }
                    else
                    {
                        // Log the message using Log worker...
                        LogMessage(document, false, errorCode);
                    }
                    if (_mDataSet != null &&
                        _mDataSet.Matter != null)
                    {
                        var documentIdentifierEntity = new DocumentIdentifierEntity();
                        documentIdentifierEntity.CollectionId        = document.CollectionID;
                        documentIdentifierEntity.Dcn                 = document.DocumentControlNumber;
                        documentIdentifierEntity.DocumentReferenceId = document.DocumentID;
                        documentIdentifierEntity.CollectionName      = _mDataSet.FolderName;
                        documentIdentifierEntities.Add(documentIdentifierEntity);
                    }
                }
                catch (Exception ex)
                {
                    //report to director and continue with other documents if there is error in printing a documents
                    ex.Trace().Swallow();
                    ReportToDirector(ex);
                }
            }
            if (documents.Count > 0)
            {
                Tracer.Info("Print Processing worker - Document Count: {0}",
                            documents.Count.ToString(CultureInfo.InvariantCulture));
                Send(documents);
                if (_mDataSet != null &&
                    _mDataSet.Matter != null
                    )
                {
                    AuditLogFacade.LogDocumentsPrinted(_mDataSet.Matter.FolderID, documentIdentifierEntities);
                }
            }
        }
コード例 #29
0
	private void UnlinkPartner()
	{
		partnerTracer = null;
		canTakeLead = false;
		conversingSpeed.TargetAbsoluteSpeed(startSpeed, breakingChangeRate);
	}
コード例 #30
0
        /// <summary>
        /// 修改日程安排信息
        /// </summary>
        /// <param name="title">标题</param>
        /// <param name="content">内容</param>
        /// <param name="reminderrmodel">计划模式</param>
        /// <param name="reparteminder">提醒周期</param>
        /// <param name="employeeID">员工ID</param>
        /// <param name="ts">时分</param>
        /// <param name="calenderID">日程安排ID</param>
        /// <returns>返回字符串成功为空</returns>
        public string UpdateCalendarInfoForMobile(string title, string content, string reminderrmodel, string reparteminder, string employeeID, string strHourMins, string calenderID)
        {
            string strReturn = string.Empty;

            try
            {
                Tracer.Debug("开始修改日程计划信息");
                Tracer.Debug("title:" + title);
                Tracer.Debug("content:" + content);
                Tracer.Debug("reminderrmodel:" + reminderrmodel);
                Tracer.Debug("reparteminder:" + reparteminder);
                Tracer.Debug("employeeID: " + employeeID);
                Tracer.Debug("strHourMins: " + strHourMins);
                Tracer.Debug("calenderID: " + calenderID);
                strReturn = checkCalendarInfo(title, content, reminderrmodel, reparteminder, employeeID, strHourMins);
                if (!string.IsNullOrEmpty(strReturn))
                {
                    return(strReturn);
                }
                TimeSpan ts = new TimeSpan();
                try
                {
                    ts = TimeSpan.Parse(strHourMins);
                }
                catch (Exception ex)
                {
                    strReturn = "计划时间中时分错误";
                    return(strReturn);
                }
                V_EMPLOYEEVIEW employe = getEmployee(employeeID);
                if (employe == null)
                {
                    strReturn = "没有获取到员工信息";
                    return(strReturn);
                }
                if (string.IsNullOrEmpty(employe.EMPLOYEEID))
                {
                    strReturn = "没有获取到员工信息";
                    return(strReturn);
                }
                T_OA_CALENDAR calendarInfo = new T_OA_CALENDAR();
                var           ents         = from ent in dal.GetObjects <T_OA_CALENDAR>()
                                             where ent.CALENDARID == calenderID
                                             select ent;
                if (ents.Count() == 0)
                {
                    strReturn = "修改的日程安排信息不存在";
                    return(strReturn);
                }
                calendarInfo = ents.FirstOrDefault();

                calendarInfo.REPARTREMINDER = reparteminder;
                calendarInfo.REMINDERRMODEL = reminderrmodel;
                calendarInfo.TITLE          = title;
                calendarInfo.CONTENT        = content;
                V_EMPLOYEEVIEW employee = getEmployee(employeeID);
                strReturn = UpdatePlanTime(ref calendarInfo, "Edit", employe, ts);
                if (string.IsNullOrEmpty(strReturn))
                {
                    int intResult = UpdateCalendarInfo(calendarInfo);
                    if (intResult < 1)
                    {
                        strReturn = "修改日程安排失败";
                        return(strReturn);
                    }
                }
                else
                {
                    return(strReturn);
                }
            }
            catch (Exception ex)
            {
                Tracer.Debug("title:" + title);
                Tracer.Debug("content:" + content);
                Tracer.Debug("reminderrmodel:" + reminderrmodel);
                Tracer.Debug("reparteminder:" + reparteminder);
                Tracer.Debug("employeeID: " + employeeID);
                Tracer.Debug("strHourMins: " + strHourMins);
                Tracer.Debug("calenderID: " + calenderID);
                SMT.Foundation.Log.Tracer.Debug("CalendarManagementBll-UpdateCalendarInfoForMobile出现错误,员工ID:" + employeeID + ".错误信息:" + ex.ToString());
                strReturn = "修改日程安排出现异常";
            }
            return(strReturn);
        }
コード例 #31
0
        /// <summary>
        /// 检查日程安排是否符合要求
        /// </summary>
        /// <param name="title"></param>
        /// <param name="content"></param>
        /// <param name="reminderrmodel"></param>
        /// <param name="reparteminder"></param>
        /// <param name="employeeID"></param>
        /// <returns></returns>
        public string checkCalendarInfo(string title, string content, string reminderrmodel, string reparteminder, string employeeID, string strHourMins)
        {
            string strReturn = string.Empty;

            if (string.IsNullOrEmpty(title))
            {
                strReturn = "标题不能为空";
                return(strReturn);
            }
            if (title.Length > 50)
            {
                strReturn = "标题长度不能超过50个字符";
                return(strReturn);
            }
            if (string.IsNullOrEmpty(content))
            {
                strReturn = "日程详情不能为空";
                return(strReturn);
            }
            if (content.Length > 1000)
            {
                strReturn = "日程详情不能超过1000个字符";
                return(strReturn);
            }
            if (string.IsNullOrEmpty(reminderrmodel))
            {
                strReturn = "提醒时间不能为空";
                return(strReturn);
            }
            if (string.IsNullOrEmpty(reparteminder))
            {
                strReturn = "提醒周期不能为空";
                return(strReturn);
            }
            if (string.IsNullOrEmpty(employeeID))
            {
                strReturn = "员工ID不能为空";
                return(strReturn);
            }
            if (string.IsNullOrEmpty(strHourMins))
            {
                strReturn = "计划时间中时分不能为空";
                return(strReturn);
            }
            if (!(strHourMins.IndexOf(":") > -1))
            {
                strReturn = "计划时间中时分格式不对";
                return(strReturn);
            }
            TimeSpan ts = new TimeSpan();

            try
            {
                ts = TimeSpan.Parse(strHourMins);
            }
            catch (Exception ex)
            {
                Tracer.Debug("strHourMins为:" + strHourMins + ".错误信息为:" + ex.ToString());
                strReturn = "计划时间中时分错误";
                return(strReturn);
            }
            return(strReturn);
        }
コード例 #32
0
 public void Dispose()
 {
     Tracer.Trace("InputManager.Dispose", "Disposing InputManager...");
     FreeDevice();
 }
コード例 #33
0
 public void Tranceive(Messages.Message message)
 {
     Tracer.WriteLineInfo("Sending {0}", message.GetType().Name);
     message.Send(PortStream);
     message.Receive(PortStream);
 }
コード例 #34
0
ファイル: SMS.IEmulator.cs プロジェクト: gocha/BizHawk
        public bool FrameAdvance(IController controller, bool render, bool renderSound)
        {
            _controller = controller;
            _lagged     = true;

            if (!IsGameGear)
            {
                PSG.Set_Panning(Settings.ForceStereoSeparation ? ForceStereoByte : (byte)0xFF);
            }

            if (Tracer.IsEnabled())
            {
                Cpu.TraceCallback = s => Tracer.Put(s);
            }
            else
            {
                Cpu.TraceCallback = null;
            }

            if (IsGameGear_C == false)
            {
                Cpu.NonMaskableInterrupt = controller.IsPressed("Pause");
            }
            else if (!IsGameGear && IsGameGear_C)
            {
                Cpu.NonMaskableInterrupt = controller.IsPressed("P1 Start");
            }

            if (IsGame3D && Settings.Fix3D)
            {
                render = ((Frame & 1) == 0) & render;
            }

            int scanlinesPerFrame = Vdp.DisplayType == DisplayType.NTSC ? 262 : 313;

            Vdp.SpriteLimit = Settings.SpriteLimit;
            for (int i = 0; i < scanlinesPerFrame; i++)
            {
                Vdp.ScanLine = i;

                Vdp.RenderCurrentScanline(render);

                Vdp.ProcessFrameInterrupt();
                Vdp.ProcessLineInterrupt();
                ProcessLineControls();

                for (int j = 0; j < Vdp.IPeriod; j++)
                {
                    Cpu.ExecuteOne();

                    PSG.generate_sound();

                    s_L = PSG.current_sample_L;
                    s_R = PSG.current_sample_R;

                    if (s_L != OldSl)
                    {
                        BlipL.AddDelta(SampleClock, s_L - OldSl);
                        OldSl = s_L;
                    }

                    if (s_R != OldSr)
                    {
                        BlipR.AddDelta(SampleClock, s_R - OldSr);
                        OldSr = s_R;
                    }

                    SampleClock++;
                }

                if (Vdp.ScanLine == scanlinesPerFrame - 1)
                {
                    Vdp.ProcessGGScreen();
                    Vdp.ProcessOverscan();
                }
            }

            if (_lagged)
            {
                _lagCount++;
                _isLag = true;
            }
            else
            {
                _isLag = false;
            }

            _frame++;

            return(true);
        }
コード例 #35
0
 static Tracer()
 {
     Log = new Tracer();
 }
コード例 #36
0
 public void SetLensCenterOffset(string[] args)
 {
     OculusDisplayRenderer.RiftLensCenterOffset = new Vector2(float.Parse(args[0]), float.Parse(args[1]));
     Tracer.i("レンズオフセット:{0}", OculusDisplayRenderer.RiftLensCenterOffset);
 }
コード例 #37
0
 public void ToggleDebugGrid(string[] args)
 {
     _context.DebugGrid.Visibility = !_context.DebugGrid.Visibility;
     Tracer.i("デバッググリッドの表示状態:{0}", _context.DebugGrid.Visibility);
 }
コード例 #38
0
 public void SetJoyStickHendOperationDevice(string[] args)
 {
     _context.PlayerContexts[int.Parse(args[0])].HandOperationChecker = new JoystickHandOperationChecker(_context, int.Parse(args[1]));
     Tracer.i("{0}のジョイスティックを入力デバイスとして選択しました。", int.Parse(args[1]));
 }
コード例 #39
0
 public override void ensurePort()
 {
     Tracer.Trace("ControllerRQAX2850: ensurePort() -- m_portName=" + m_portName);
 }
コード例 #40
0
 public TracerPool(Tracer prefab)
 {
     this.prefab = prefab;
     tracers     = new Pool <Tracer>(Create);
 }
コード例 #41
0
        internal static OpenTracingTracer CreateTracer(Uri agentEndpoint, string defaultServiceName, DelegatingHandler delegatingHandler, bool isDebugEnabled)
        {
            var tracer = Tracer.Create(agentEndpoint, defaultServiceName, isDebugEnabled);

            return(new OpenTracingTracer(tracer));
        }
コード例 #42
0
 /// <inheritdoc />
 protected override BoolResult InitializeCore(OperationContext context)
 {
     // Intentionally doing nothing.
     Tracer.Info(context, "Initializing in-memory content location database.");
     return(BoolResult.Success);
 }
コード例 #43
0
 /// <inheritdoc />
 public void Dispose()
 {
     Tracer.TouchBulkStop(Context, Input, Result);
 }
コード例 #44
0
        /// <summary>
        /// 添加日程安排信息
        /// </summary>
        /// <param name="title">标题</param>
        /// <param name="content">内容</param>
        /// <param name="reminderrmodel">计划模式</param>
        /// <param name="reparteminder">提醒周期</param>
        /// <param name="employeeID">员工ID</param>
        /// <param name="ts">时分</param>
        /// <returns>返回字符串成功为空</returns>
        public string AddCalendarInfoForMobile(string title, string content, string reminderrmodel, string reparteminder, string employeeID, string strHourMins, ref string calenderID)
        {
            string strReturn = string.Empty;

            try
            {
                Tracer.Debug("开始添加日程计划信息");
                Tracer.Debug("title:" + title);
                Tracer.Debug("content:" + content);
                Tracer.Debug("reminderrmodel:" + reminderrmodel);
                Tracer.Debug("reparteminder:" + reparteminder);
                Tracer.Debug("employeeID: " + employeeID);
                Tracer.Debug("strHourMins: " + strHourMins);
                strReturn = checkCalendarInfo(title, content, reminderrmodel, reparteminder, employeeID, strHourMins);
                if (!string.IsNullOrEmpty(strReturn))
                {
                    return(strReturn);
                }
                TimeSpan ts = new TimeSpan();
                try
                {
                    ts = TimeSpan.Parse(strHourMins);
                }
                catch (Exception ex)
                {
                    strReturn = "计划时间中时分错误";
                    return(strReturn);
                }
                V_EMPLOYEEVIEW employe = getEmployee(employeeID);
                if (employe == null)
                {
                    strReturn = "没有获取到员工信息";
                    return(strReturn);
                }
                if (string.IsNullOrEmpty(employe.EMPLOYEEID))
                {
                    strReturn = "没有获取到员工信息";
                    return(strReturn);
                }
                T_OA_CALENDAR calendarInfo = new T_OA_CALENDAR();
                calendarInfo.CALENDARID   = Guid.NewGuid().ToString();
                calendarInfo.CREATEUSERID = employeeID;
                calendarInfo.CREATEDATE   = DateTime.Now;
                calendarInfo.UPDATEUSERID = employeeID;
                calendarInfo.UPDATEDATE   = DateTime.Now;

                calendarInfo.REPARTREMINDER = reparteminder;
                calendarInfo.REMINDERRMODEL = reminderrmodel;
                calendarInfo.TITLE          = title;
                calendarInfo.CONTENT        = content;
                V_EMPLOYEEVIEW employee = getEmployee(employeeID);
                strReturn = UpdatePlanTime(ref calendarInfo, "Add", employe, ts);
                if (string.IsNullOrEmpty(strReturn))
                {
                    bool blResult = AddCalendarInfo(calendarInfo);
                    if (!blResult)
                    {
                        strReturn = "添加日程安排失败";
                        return(strReturn);
                    }
                    calenderID = calendarInfo.CALENDARID;
                }
                else
                {
                    return(strReturn);
                }
            }
            catch (Exception ex)
            {
                Tracer.Debug("title:" + title);
                Tracer.Debug("content:" + content);
                Tracer.Debug("reminderrmodel:" + reminderrmodel);
                Tracer.Debug("reparteminder:" + reparteminder);
                Tracer.Debug("employeeID: " + employeeID);
                Tracer.Debug("strHourMins: " + strHourMins);
                SMT.Foundation.Log.Tracer.Debug("CalendarManagementBll-AddCalendarInfoForMobile出现错误,员工ID:" + employeeID + ".错误信息:" + ex.ToString());
                strReturn = "添加日程安排时出现异常";
            }
            return(strReturn);
        }
コード例 #45
0
 public TracerTest()
 {
     startEndHandler = Mock.Of <IStartEndHandler>();
     traceConfig     = Mock.Of <ITraceConfig>();
     tracer          = new Tracer(new RandomGenerator(), startEndHandler, traceConfig, null);
 }
コード例 #46
0
        protected override void OnNext(string eventName, object arg)
        {
            switch (eventName)
            {
            case "System.Net.Http.HttpRequestOut.Start":
            {
                var request = (HttpRequestMessage)_activityStart_RequestFetcher.Fetch(arg);

                var traceid = "";

                if (request.Headers.Contains("uber-trace-id"))
                {
                    foreach (var t in request.Headers.GetValues("uber-trace-id"))
                    {
                        traceid += $"{WebUtility.UrlDecode(t)},";
                    }
                }
                if (!excludelist.Contains(request.RequestUri.AbsoluteUri))
                {
                    Logger.LogDebug("{eventName} {RequestUri} | {@ubertraceid} at {AppName}", eventName, request.RequestUri, traceid, "OpenTracing.Contrib.NetCore");
                }

                if (IgnoreRequest(request))
                {
                    Logger.LogDebug("Ignoring Request {RequestUri}", request.RequestUri);
                    return;
                }

                string operationName = _options.OperationNameResolver(request);

                ISpan span = Tracer.BuildSpan(operationName)
                             .WithTag(Tags.SpanKind, Tags.SpanKindClient)
                             .WithTag(Tags.Component, _options.ComponentName)
                             .WithTag(Tags.HttpMethod, request.Method.ToString())
                             .WithTag(Tags.HttpUrl, request.RequestUri.ToString())
                             .WithTag(Tags.PeerHostname, request.RequestUri.Host)
                             .WithTag(Tags.PeerPort, request.RequestUri.Port)
                             .Start();

                _options.OnRequest?.Invoke(span, request);

                if (_options.InjectEnabled?.Invoke(request) ?? true)
                {
                    Tracer.Inject(span.Context, BuiltinFormats.HttpHeaders, new HttpHeadersInjectAdapter(request.Headers));

                    if (!excludelist.Contains(request.RequestUri.AbsoluteUri))
                    {
                        Logger.LogDebug("{eventName} Inject {RequestUri} | {@ubertraceid} at {AppName}", eventName, request.RequestUri, traceid, "OpenTracing.Contrib.NetCore");
                    }
                }

                // This throws if there's already an item with the same key. We do this for now to get notified of potential bugs.
                request.Properties.Add(PropertiesKey, span);
            }
            break;

            case "System.Net.Http.Exception":
            {
                var request = (HttpRequestMessage)_exception_RequestFetcher.Fetch(arg);

                if (request.Properties.TryGetValue(PropertiesKey, out object objSpan) && objSpan is ISpan span)
                {
                    var exception = (Exception)_exception_ExceptionFetcher.Fetch(arg);

                    span.SetException(exception);

                    _options.OnError?.Invoke(span, exception, request);
                }
            }
            break;

            case "System.Net.Http.HttpRequestOut.Stop":
            {
                var request = (HttpRequestMessage)_activityStop_RequestFetcher.Fetch(arg);

                var traceid = "";

                if (request.Headers.Contains("uber-trace-id"))
                {
                    foreach (var t in request.Headers.GetValues("uber-trace-id"))
                    {
                        traceid += $"{WebUtility.UrlDecode(t)},";
                    }
                }

                if (!excludelist.Contains(request.RequestUri.AbsoluteUri))
                {
                    Logger.LogDebug("{eventName} {RequestUri} | {@ubertraceid} at {AppName}", eventName, request.RequestUri, traceid, "OpenTracing.Contrib.NetCore");
                }


                if (request.Properties.TryGetValue(PropertiesKey, out object objSpan) && objSpan is ISpan span)
                {
                    var response          = (HttpResponseMessage)_activityStop_ResponseFetcher.Fetch(arg);
                    var requestTaskStatus = (TaskStatus)_activityStop_RequestTaskStatusFetcher.Fetch(arg);

                    if (response != null)
                    {
                        span.SetTag(Tags.HttpStatus, (int)response.StatusCode);
                    }

                    if (requestTaskStatus == TaskStatus.Canceled || requestTaskStatus == TaskStatus.Faulted)
                    {
                        span.SetTag(Tags.Error, true);
                    }

                    span.Finish();

                    request.Properties.Remove(PropertiesKey);
                }
            }
            break;
            }
        }
コード例 #47
0
 public ProtobufNetGrpcServiceEndpoint(string name, TServiceImpl service)
 {
     Tracer   = new Tracer(name + ".Endpoint");
     _service = service;
     LinkLifetime(service);
 }
コード例 #48
0
 public void KillTracer(Tracer tracer)
 {
     tracers.Store(tracer);
     tracer.transform.position = new Vector3(0, -100, 0);
 }
コード例 #49
0
 public MessageTransceiver(PortProvider portSource)
 {
     _portSource = portSource;
     Tracer.WriteLineInfo("Opening connection to card");
     portSource.Port.Open();
 }
コード例 #50
0
ファイル: ApiServer.cs プロジェクト: FluidChains/Nako
 //// This code configures Web API. The ApiServer class is specified as a type
 //// parameter in the WebApp.Start method.
 public ApiServer(NakoApplication nakoApplication, NakoConfiguration nakoConfiguration, Tracer tracer)
 {
     this.configuration = nakoConfiguration;
     this.tracer        = tracer;
     this.application   = nakoApplication;
 }
コード例 #51
0
 public RabbitMQListener(string sourceName, Tracer tracer) : base(sourceName, tracer)
 {
 }
コード例 #52
0
            public HelperFileParser(LoadFileParserWorker parent, string filePath)
            {
                uint lineCount = 0;

                using (var sr = new StreamReader(filePath))
                {
                    var filePaths     = new List <string>();
                    var keyData       = string.Empty;
                    var isFirstRecord = true;
                    FileData = new Dictionary <string, List <string> >();
                    while (!sr.EndOfStream)
                    {
                        var columns = sr.ReadLine().Split(new[] { Delimiter });
                        lineCount++;

                        if (columns.Length < 2)
                        {
                            continue; // Skip empty lines
                        }

                        if (columns.Length != 7)
                        {
                            var errorMessage =
                                String.Format(
                                    "File {0} has unrecognized record at line {1}. 7 columns are expected, but {2} are found.",
                                    filePath, lineCount, columns.Length);
                            parent.LogMessage(false, errorMessage);
                            Tracer.Error(errorMessage);
                            continue;
                        }

                        if (isFirstRecord)
                        {
                            keyData = columns[0];      //Mapping Field Key
                            filePaths.Add(columns[2]); //File Path
                        }


                        if (columns[3].ToUpper().Trim() == Yes && !isFirstRecord)
                        {
                            if (FileData.ContainsKey(keyData))
                            {
                                FileData[keyData].AddRange(filePaths);
                            }
                            else
                            {
                                FileData.Add(keyData, filePaths);
                            }
                            filePaths = new List <string>();
                            keyData   = columns[0];
                        }
                        if (!isFirstRecord)
                        {
                            filePaths.Add(columns[2]);
                        }
                        isFirstRecord = false;
                    }
                    //For Last records
                    if (FileData.ContainsKey(keyData))
                    {
                        FileData[keyData].AddRange(filePaths);
                    }
                    else
                    {
                        FileData.Add(keyData, filePaths);
                    }
                }
            }
コード例 #53
0
    public void SpawnTracer(Vector3 start, Vector3 end, float speed)
    {
        Tracer tracer = tracers.Get();

        tracer.Fire(start, end, speed);
    }
コード例 #54
0
 public void TestInit()
 {
     tracer = new Tracer();
 }
コード例 #55
0
 public void DirectInputEnumDevices(string[] args)
 {
     Tracer.i(_context.DirectInput.deviceTraces);
 }
コード例 #56
0
        /// <summary>
        /// Handle CH Robotics UM6 Orientation Sensor Notification - ProcMag
        /// </summary>
        /// <param name="notification">ProcMag notification</param>
        private void ChrProcMagHandler(chrum6orientationsensor.ProcMagNotification notification)
        {
            Tracer.Trace(string.Format("the UM6 Sensor reported ProcMag: {0}   {1}   {2}   {3}", notification.Body.LastUpdate, notification.Body.x, notification.Body.y, notification.Body.z));

            // not set up in UM6, all we are using is USE_ORIENTATION_UM6 || USE_DIRECTION_UM6_QUATERNION
        }
コード例 #57
0
ファイル: VendorSellGump.cs プロジェクト: uotools/JuicyUO
        public override void OnHtmlInputEvent(string href, MouseEvent e)
        {
            string[] hrefs = href.Split('=');
            bool     isAdd;
            int      index;

            if (hrefs[0] == "add")
            {
                isAdd = true;
            }
            else if (hrefs[0] == "remove")
            {
                isAdd = false;
            }
            else
            {
                Tracer.Error("Bad HREF in VendorBuyGump: {0}", href);
                return;
            }

            // parse item index
            if (!(int.TryParse(hrefs[1], out index)))
            {
                Tracer.Error("Unknown vendor item index in VendorBuyGump: {0}", href);
                return;
            }

            if (e == MouseEvent.Down)
            {
                if (isAdd)
                {
                    AddItem(index);
                }
                else
                {
                    RemoveItem(index);
                }
                m_MouseState       = isAdd ? MouseState.MouseDownOnAdd : MouseState.MouseDownOnRemove;
                m_MouseDownMS      = 0;
                m_MouseDownOnIndex = index;
            }
            else if (e == MouseEvent.Up)
            {
                m_MouseState = MouseState.None;
            }

            UpdateEntryAndCost(index);

            if (isAdd)
            {
                if (m_Items[index].AmountToSell < m_Items[index].AmountTotal)
                {
                    m_Items[index].AmountToSell++;
                }
            }
            else
            {
                if (m_Items[index].AmountToSell > 0)
                {
                    m_Items[index].AmountToSell--;
                }
            }

            UpdateEntryAndCost();
        }
コード例 #58
0
 public TracerTest()
 {
     spanProcessor = new SimpleSpanProcessor(new NoopSpanExporter());
     traceConfig   = TraceConfig.Default;
     tracer        = new Tracer(spanProcessor, traceConfig);
 }
コード例 #59
0
        public void Dispose()
        {
            this.endTime = DateTime.Now;

            if (this.parent != null)
            {
                this.parent.SaveChildData(this.section, this.startTime, this.endTime, childData);

                Current = this.parent;
            }
            else
            {
                var data = new SpeedTracerData { Section = section, StartTime = startTime, EndTime = endTime, Children = childData, ClassName = this.className, MethodName = this.methodName, LineNumber = this.lineNumber };

                HttpContext.Current.Application["Trace:" + HttpContext.Current.Items["TraceId"]] = data;
            }
        }
コード例 #60
0
 public void SetKeyboardHendOperationDevice(string[] args)
 {
     _context.PlayerContexts[int.Parse(args[0])].HandOperationChecker = new KeyboardHandOperationChecker(_context.DirectInput, int.Parse(args[1]));
     Tracer.i("{0}のキーボードデバイスを入力デバイスとして選択しました。", int.Parse(args[0]));
 }