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


C# ITypeProvider.GetType方法代码示例

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


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

示例1: GetContextType

        internal static Type GetContextType(ITypeProvider typeProvider, Activity currentActivity)
        {
            Type contextType = null;
            string className = String.Empty;
            Activity rootActivity = null;

            if (Helpers.IsActivityLocked(currentActivity))
            {
                rootActivity = Helpers.GetDeclaringActivity(currentActivity);
            }
            else
            {
                rootActivity = Helpers.GetRootActivity(currentActivity);
            }

            if (rootActivity != null)
            {
                className = rootActivity.GetValue(WorkflowMarkupSerializer.XClassProperty) as string;
                if (!String.IsNullOrEmpty(className))
                    contextType = typeProvider.GetType(className, false);

                if (contextType == null)
                    contextType = typeProvider.GetType(rootActivity.GetType().FullName);

                // If all else fails (likely, we don't have a type provider), it's the root activity type.
                if (contextType == null)
                    contextType = rootActivity.GetType();
            }

            return contextType;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:31,代码来源:Helpers.cs

示例2: ParseTypeName

        internal static Type ParseTypeName(ITypeProvider typeProvider, SupportedLanguages language, string typeName)
        {
            Type returnType = null;

            returnType = typeProvider.GetType(typeName, false);
            if (returnType == null)
            {
                string simpleTypeName = String.Empty;
                string decoratorString = String.Empty;
                string[] parameters = null;
                if (ParseTypeName(typeName, language == SupportedLanguages.CSharp ? ParseTypeNameLanguage.CSharp : ParseTypeNameLanguage.VB, out simpleTypeName, out parameters, out decoratorString))
                {
                    returnType = typeProvider.GetType(simpleTypeName + decoratorString, false);
                }
            }

            return returnType;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:18,代码来源:TypeSystemHelpers.cs

示例3: ParseTypeName

 internal static Type ParseTypeName(ITypeProvider typeProvider, System.Workflow.Activities.Common.SupportedLanguages language, string typeName)
 {
     Type type = null;
     type = typeProvider.GetType(typeName, false);
     if (type == null)
     {
         string str = string.Empty;
         string elemantDecorator = string.Empty;
         string[] parameters = null;
         if (ParseTypeName(typeName, (language == System.Workflow.Activities.Common.SupportedLanguages.CSharp) ? ParseTypeNameLanguage.CSharp : ParseTypeNameLanguage.VB, out str, out parameters, out elemantDecorator))
         {
             type = typeProvider.GetType(str + elemantDecorator, false);
         }
     }
     return type;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:ParseHelpers.cs

示例4: GetContextType

 internal static Type GetContextType(ITypeProvider typeProvider, Activity currentActivity)
 {
     Type type = null;
     string str = string.Empty;
     Activity declaringActivity = null;
     if (System.Workflow.Activities.Common.Helpers.IsActivityLocked(currentActivity))
     {
         declaringActivity = System.Workflow.Activities.Common.Helpers.GetDeclaringActivity(currentActivity);
     }
     else
     {
         declaringActivity = System.Workflow.Activities.Common.Helpers.GetRootActivity(currentActivity);
     }
     if (declaringActivity != null)
     {
         str = declaringActivity.GetValue(WorkflowMarkupSerializer.XClassProperty) as string;
         if (!string.IsNullOrEmpty(str))
         {
             type = typeProvider.GetType(str, false);
         }
         if (type == null)
         {
             type = typeProvider.GetType(declaringActivity.GetType().FullName);
         }
         if (type == null)
         {
             type = declaringActivity.GetType();
         }
     }
     return type;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:31,代码来源:ConditionHelper.cs


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