System.Reflection.TypeInfo.GetDeclaredNestedType C# (CSharp) Method

GetDeclaredNestedType() public method

public GetDeclaredNestedType ( string name ) : TypeInfo
name string
return TypeInfo
		public virtual TypeInfo GetDeclaredNestedType (string name)
		{
			var nested = GetNestedType (name, declaredFlags);
			if (nested != null)
				return new TypeDelegator (nested);
			else
				return null;
		}

Usage Example

Esempio n. 1
0
        private static void InitializeCodeActionWithNestedActionsDataTypeThreadUnsafe()
        {
            System.Reflection.TypeInfo codeActionTypeInfo = typeof(CodeAction).GetTypeInfo();
            var _codeActionWithNestedActionsDataTypeInfo  = codeActionTypeInfo.GetDeclaredNestedType(CodeActionWithNestedActionsTypeName);

            _codeActionWithNestedActionsType = _codeActionWithNestedActionsDataTypeInfo?.AsType();

            if (_codeActionWithNestedActionsType == null)
            {
                return;
            }

            var codeActionWithNestedActionsConstructor = _codeActionWithNestedActionsDataTypeInfo.DeclaredConstructors.FirstOrDefault();

            if (codeActionWithNestedActionsConstructor == null)
            {
                _codeActionWithNestedActionsType = null;
                return;
            }

            var parameters = codeActionWithNestedActionsConstructor.GetParameters();

            switch (parameters?.Length)
            {
            case 3:
                _roslynOldApiUsed = true;
                return;

            case 4:
                _roslynOldApiUsed = false;
                InitializeCodeActionPriorityInstance(codeActionTypeInfo);
                return;

            default:
                _codeActionWithNestedActionsType = null;
                return;
            }
        }
All Usage Examples Of System.Reflection.TypeInfo::GetDeclaredNestedType