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


C# CodeActivityContext.Track方法代码示例

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


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

示例1: Execute

        protected override void Execute(CodeActivityContext context)
        {
            // Create a Lead class and populate it with the input arguments
            Lead l = new Lead();
            l.ContactName = ContactName.Get(context);
            l.ContactPhone = ContactPhone.Get(context);
            l.Interests = Interests.Get(context);
            l.Comments = Notes.Get(context);
            l.WorkflowID = context.WorkflowInstanceId;
            l.Status = "Open";

            // Add this to the work queue to be persisted later
            PersistLead persist = context.GetExtension<PersistLead>();
            persist.AddLead(l, "Insert");

            // Store the request in the OutArgument
            Lead.Set(context, l);

            // Add a custom track record
            CustomTrackingRecord userRecord = new CustomTrackingRecord("New Lead")
            {
                Data = 
                {
                    {"Name", l.ContactName},
                    {"Phone", l.ContactPhone}
                }
            };

            // Emit the custom tracking record
            context.Track(userRecord);
        }
开发者ID:yinqunjun,项目名称:WorkflowFoundation.40.45.Development,代码行数:31,代码来源:CreateLead.cs

示例2: Execute

        protected override void Execute(CodeActivityContext context)
        {
            DateTime startLookup = DateTime.Now;

            string symbol = StockSymbol.Get(context);
            double price = knownSymbols[symbol];
            Value.Set(context, price);

            DateTime endLookup = DateTime.Now;

            TimeSpan lookupTime = endLookup - startLookup;
            CustomTrackingRecord userRecord = new CustomTrackingRecord("QuoteLookupEvent");
            userRecord.Data.Add("LookupTime", lookupTime.TotalMilliseconds);
            userRecord.Data.Add("Units", "Milliseconds");
            context.Track(userRecord);
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:16,代码来源:GetStockPrice.cs

示例3: Execute

        protected override void Execute(CodeActivityContext context)
        {
            // create and set the record data
            CustomTrackingRecord customRecord = new CustomTrackingRecord("ActionExecuted");
            customRecord.Data.Add("HiringRequestId", this.HiringRequestId.Get(context));
            customRecord.Data.Add("State", this.State.Get(context));
            customRecord.Data.Add("Date", DateTime.Now);
            customRecord.Data.Add("Action", this.Action.Get(context));
            customRecord.Data.Add("Comment", this.Comment.Get(context));
            if (this.Employee.Get(context) != null)
            {
                customRecord.Data.Add("EmployeeId", this.Employee.Get(context).Id);
                customRecord.Data.Add("EmployeeName", this.Employee.Get(context).Name);
            }

            // emit the record
            context.Track(customRecord);
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:18,代码来源:SaveActionTrackingInfo.cs

示例4: LogMessage

        /// <summary>
        /// Messages are logged to build log if the user instructed us to log (through the VerboseLogging argument) or if an error occured
        /// </summary>
        private void LogMessage(String message, CodeActivityContext context, bool isError = false)
        {
            bool shouldLog = context.GetValue(this.VerboseLogging);
            if (shouldLog || isError)
            {
                BuildInformationRecord<BuildMessage> record =
                  new BuildInformationRecord<BuildMessage>()
                  {
                      Value = new BuildMessage()
                      {
                          Importance = BuildMessageImportance.High,
                          Message = message,
                      },
                  };

                context.Track(record);
            }
        }
开发者ID:claudiobernardoromao,项目名称:Apprenda-TFS-Integration,代码行数:21,代码来源:ApprendaCodeActivity.cs

示例5: TrackMessage

 private void TrackMessage(CodeActivityContext context, string message)
 {
     context.Track(new BuildInformationRecord<BuildMessage>
     {
         Value = new BuildMessage()
         {
             Importance = BuildMessageImportance.Normal,
             Message = message,
         },
     });
 }
开发者ID:napramirez,项目名称:build-process,代码行数:11,代码来源:SvnActivity.cs

示例6: Execute

        /// <summary>
        /// The execute.
        /// </summary>
        /// <param name="context">
        /// The context.
        /// </param>
        protected override void Execute(CodeActivityContext context)
        {
            var text = context.GetValue(this.Text);

            // Debug.WriteLine(text);
            switch (this.Level)
            {
                case TraceLevel.Error:
                    Trace.TraceError(text);
                    break;
                case TraceLevel.Info:
                    Trace.TraceInformation(text);
                    break;
                case TraceLevel.Verbose:
                    WorkflowTrace.Information(text, this.Category);
                    break;
                case TraceLevel.Warning:
                    Trace.TraceWarning(text);
                    break;
            }

            if (this.Level != TraceLevel.Off)
            {
                var trackRecord = new CustomTrackingRecord(this.Category, this.Level);
                trackRecord.Data.Add("Text", text);
                trackRecord.Data.Add("Category", this.Category);

                context.Track(trackRecord);
            }
        }
开发者ID:IcodeNet,项目名称:cleansolution,代码行数:36,代码来源:DiagnosticTrace.cs

示例7: Execute

            protected override void Execute(CodeActivityContext context)
            {
                Console.WriteLine("In CustomActivity.Execute");
                CustomTrackingRecord customRecord = new CustomTrackingRecord("OrderIn")
                {
                    Data =
                            {
                                {"OrderId", 200},
                                {"OrderDate", "20 Aug 2001"}
                            }
                };

                // Emit CustomTrackingRecord
                context.Track(customRecord);
            }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:15,代码来源:Program.cs

示例8: Execute

        protected override void Execute(CodeActivityContext context)
        {
            string text = context.GetValue(this.Text);

            switch (Level)
            {
                case System.Diagnostics.TraceLevel.Error:
                    Trace.TraceError(text);
                    break;
                case System.Diagnostics.TraceLevel.Info:
                    Trace.TraceInformation(text);
                    break;
                case System.Diagnostics.TraceLevel.Verbose:
                    Trace.WriteLine(text, Category);
                    break;
                case System.Diagnostics.TraceLevel.Warning:
                    Trace.TraceWarning(text);
                    break;
            }

            if (Level != System.Diagnostics.TraceLevel.Off)
            {
                var trackRecord = new CustomTrackingRecord(Category, Level);
                trackRecord.Data.Add("Text", text);
                trackRecord.Data.Add("Category", Category);

                context.Track(trackRecord);
            }
        }
开发者ID:Helen1987,项目名称:edu,代码行数:29,代码来源:DiagnosticTrace.cs

示例9: Execute

 protected override void Execute(CodeActivityContext context)
 {
     context.Track(new TestCustomTrackingRecord("MyRecord") { Value = CustomTrackingTraceTests.TestValue });
 }
开发者ID:IcodeNet,项目名称:cleansolution,代码行数:4,代码来源:TestCustomActivity.cs


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