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


C# ActivityContext.GetExtension方法代码示例

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


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

示例1: VersionControlScope

        public VersionControlScope(VersionControlServer server, ActivityContext context)
        {
            this.Server = server;
            if (context != null)
            {
                this.ActionInvoker = context.GetExtension<ScheduleActionExtension>();
                if (this.ActionInvoker == null)
                {
                    throw new ServiceMissingException(typeof(ScheduleActionExtension));
                }
            }

            this.GettingHandlers = new List<Tuple<string, GettingEventHandler>>();
            this.NonFatalErrorHandlers = new List<Tuple<string, ExceptionEventHandler>>();
            this.NewPendingChangeHandlers = new List<Tuple<string, PendingChangeEventHandler>>();
        }
开发者ID:modulexcite,项目名称:CustomActivities,代码行数:16,代码来源:VersionControlScope.cs

示例2: GetTimerExtension

 private TimerExtension GetTimerExtension(ActivityContext context)
 {
     return context.GetExtension<TimerExtension>();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:Delay.cs

示例3: InitializeChannelCacheEnabledSetting

        internal void InitializeChannelCacheEnabledSetting(ActivityContext context)
        {
            if (!this.channelCacheEnabled.HasValue)
            {
                SendMessageChannelCache channelCacheExtension = context.GetExtension<SendMessageChannelCache>();
                Fx.Assert(channelCacheExtension != null, "channelCacheExtension must exist!");

                InitializeChannelCacheEnabledSetting(channelCacheExtension);
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:10,代码来源:Send.cs

示例4: GetRunInProc

		protected bool GetRunInProc(ActivityContext context)
		{
			bool flag = false;
			bool flag1;
			HostParameterDefaults extension = context.GetExtension<HostParameterDefaults>();
			if (this as PSGeneratedCIMActivity == null)
			{
				IEnumerator enumerator = context.DataContext.GetProperties().GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						PropertyDescriptor current = (PropertyDescriptor)enumerator.Current;
						if (!string.Equals(current.DisplayName, "PSRunInProcessPreference", StringComparison.OrdinalIgnoreCase))
						{
							continue;
						}
						object value = current.GetValue(context.DataContext);
						if (value == null || !LanguagePrimitives.TryConvertTo<bool>(value, CultureInfo.InvariantCulture, out flag))
						{
							continue;
						}
						flag1 = flag;
						return flag1;
					}
					this.psActivityContextImplementationVariable.Get(context);
					PSWorkflowHost workflowHost = PSActivity.GetWorkflowHost(extension);
					return workflowHost.PSActivityHostController.RunInActivityController(this);
				}
				finally
				{
					IDisposable disposable = enumerator as IDisposable;
					if (disposable != null)
					{
						disposable.Dispose();
					}
				}
				return flag1;
			}
			else
			{
				return true;
			}
		}
开发者ID:nickchal,项目名称:pash,代码行数:44,代码来源:PSActivity.cs

示例5: GenerateLogFile

            /// <summary>
            /// Make sure we have a log file in place.
            /// <para></para>
            /// If the user hasn't specified one we will create one for him on
            /// the logs drops folder path.
            /// <para></para>
            /// The file will have the same name as the solution/project being built, plus the
            /// context for configuration and platform with the .log file extension
            /// </summary>
            /// <param name="context">Activity Context</param>
            /// <returns>The location of the log file</returns>
            private string GenerateLogFile(ActivityContext context)
            {
                string finalLogFile = null;

                var buildDetail = context.GetExtension<IBuildDetail>();
                var filePath = this.FilePath.Get(this.ActivityContext);
                var configuration = this.Configuration.Get(this.ActivityContext);
                var platform = this.Platform.Get(this.ActivityContext);

                var fileName = Path.GetFileName(filePath);

                if (fileName != null)
                {
                    string logDirectory = string.IsNullOrEmpty(buildDetail.DropLocation)
                        ? Path.GetDirectoryName(filePath)
                        : Path.Combine(buildDetail.DropLocation, @"logs");

                    if (!Directory.Exists(logDirectory))
                    {
                        Directory.CreateDirectory(logDirectory);
                    }

                    finalLogFile = Path.GetFileNameWithoutExtension(fileName);

                    if (string.IsNullOrWhiteSpace(configuration) == false)
                    {
                        finalLogFile += configuration;
                    }

                    if (string.IsNullOrWhiteSpace(platform) == false)
                    {
                        finalLogFile += platform;
                    }

                    finalLogFile += ".log";

                    finalLogFile = Path.Combine(logDirectory, SanitizeFileName(finalLogFile));
                }

                this.LogBuildMessage(string.Format("Log file {0} will be used.", finalLogFile));

                return finalLogFile;
            }
开发者ID:modulexcite,项目名称:CustomActivities,代码行数:54,代码来源:VSDevEnv.cs

示例6: InitializeChannelCacheEnabledSetting

 internal void InitializeChannelCacheEnabledSetting(ActivityContext context)
 {
     if (!this.channelCacheEnabled.HasValue)
     {
         SendMessageChannelCache extension = context.GetExtension<SendMessageChannelCache>();
         this.InitializeChannelCacheEnabledSetting(extension);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:Send.cs

示例7: GetTimerExtension

 TimerExtension GetTimerExtension(ActivityContext context)
 {
     TimerExtension timerExtension = context.GetExtension<TimerExtension>();
     Fx.Assert(timerExtension != null, "TimerExtension must exist.");
     return timerExtension;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:6,代码来源:Delay.cs

示例8: GenerateLogFile

            /// <summary>
            /// Make sure we have a log file in place.
            /// <para></para>
            /// If the user hasn't specified one we will create one for him on
            /// the logs drops folder path.
            /// <para></para>
            /// The file will have the same name of the solution/project being built, plus the
            /// context for configuration and platform with the .log file extension
            /// </summary>
            /// <param name="context">Activity Context</param>
            /// <returns>The location of the log file</returns>
            private string GenerateLogFile(ActivityContext context)
            {
                string finalLogFile = null;
                string logDirectory;

                var buildDetail = context.GetExtension<IBuildDetail>();

                var fileName = this.LogFilename.Get(context);

                if (fileName == null)
                {
                    return null;
                }

                if (string.IsNullOrEmpty(buildDetail.LogLocation) == false)
                {
                    logDirectory = buildDetail.LogLocation;
                }
                else if (string.IsNullOrEmpty(buildDetail.DropLocation) == false)
                {
                    logDirectory = Path.Combine(buildDetail.DropLocation, @"logs");
                }
                else
                {
                    this.LogBuildWarning("drop location not defined. Will not write to log file");
                    return null;
                }

                if (!Directory.Exists(logDirectory))
                {
                    Directory.CreateDirectory(logDirectory);
                }

                finalLogFile = Path.Combine(logDirectory, SanitizeFileName(fileName));

                this.LogBuildMessage(string.Format("Log file {0} will be used.", finalLogFile));

                return finalLogFile;
            }
开发者ID:modulexcite,项目名称:CustomActivities,代码行数:50,代码来源:BasePuttyActivity.cs


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