當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。