static private IEnumerable <LibrarySettings> InstanceLibrarySettings() { return(Types.GetFilteredTypes( Filterer_Type.CanBeTreatedAs <LibrarySettings>(), Filterer_Type.IsConcreteClass() ).Convert(t => t.CreateInstance <LibrarySettings>())); }
static private IEnumerable <Type> GetAllCustomPropertyDrawerTypes() { return(Types.GetFilteredTypes( Filterer_Type.CanBeTreatedAs <PropertyDrawer>(), Filterer_Type.HasCustomAttributeOfType <CustomPropertyDrawer>(false) )); }
private IEnumerable <Type> GetApplicationEXMarkedTypes() { return(Types.GetFilteredTypes( Filterer_Type.HasCustomAttributeOfType <ApplicationEXSatelliteAttribute>(false), Filterer_Type.IsStaticClass() )); }
public override IEnumerable <Type> GetTypes() { return(Types.GetFilteredTypes( Filterer_Type.CanBeTreatedAs <EphemeralPrefab>(), Filterer_Type.CanBeTreatedAs <MonoBehaviour>() )); }
public Type GetParentType() { return(Types.GetFilteredTypes( Filterer_Type.IsNamed(GetTypeName()) ).GetFirst() .AssertNotNull(() => new CmlRuntimeError_InvalidIdException("parent type", GetTypeName()))); }
public virtual Type ResolveTypeAsNormal(string id) { return(Types.GetFilteredTypes( Filterer_Type.IsBasicNamed(id), Filterer_Type.IsNonGenericClass() ).GetFirst() .AssertNotNull(() => new CMinorCompileException("Unable to resolve type " + id))); }
static private IEnumerable <TyonSettingsComponent> CreateComponents() { return(Types.GetFilteredTypes( Filterer_Type.CanBeTreatedAs <TyonSettingsComponent>(), Filterer_Type.IsConcreteClass(), Filterer_Type.HasCustomAttributeOfType <ATTRIBUTE_TYPE>(false) ).Convert(t => t.CreateInstance <TyonSettingsComponent>())); }
static public Type GetEditorSceneElementEditGadgetInstanceType(this AttachEditGadgetAttribute item) { return(Types.GetFilteredTypes( Filterer_Type.IsConcreteClass(), Filterer_Type.CanBeTreatedAs <EditorSceneElement_EditGadgetInstance>(), Filterer_Type.IsNamed("EditorSceneElement_EditGadgetInstance_" + item.GetEditorSceneElementEditGadgetInstanceTypeName()) ).GetFirst()); }
static private IEnumerable <Type> GetInternalCustomAssetTypes(Type field_type) { return(Types.GetFilteredTypes( Filterer_Type.CanBeTreatedAs(field_type), Filterer_Type.CanBeTreatedAs <CustomAsset>(), Filterer_Type.IsConcreteClass() )); }
public virtual Type ResolveTypeAsTemplated(string id, IEnumerable <Type> generic_arguments) { Type[] arguments = generic_arguments.ToArray(); string display = id + "<" + arguments.ToString(", ") + ">"; return(Types.GetFilteredTypes( Filterer_Type.IsBasicNamed(id), Filterer_Type.IsGenericClass(), Filterer_Type.CanGenericParametersHold(arguments) ).GetFirst() .AssertNotNull(() => new CMinorCompileException("Unable to resolve the generic type " + display)) .MakeGenericType(arguments)); }
public FragmentLibrary() { fragment_providers = new List <FragmentProvider>(); manual_fragments = Types.GetFilteredTypes( Filterer_Type.CanBeTreatedAs <CmlFragment_BuiltIn>(), Filterer_Type.IsConcreteClass() ).CreateInstances <CmlFragment>() .ToDictionaryValues(f => f.GetName()); fragment_cache = new OperationCache <CmlFragment, string>("fragment_cache", delegate(string name) { return(manual_fragments.GetValue(name) ?? fragment_providers.Convert(p => p.GetFragment(name)).GetFirstNonNull()); }); }
public override Type GetSystemType(TyonHydraterBase hydrater) { IEnumerable <Filterer <Type> > filters = new Filterer <Type>[] { Filterer_Type.IsNamed(GetName()), Filterer_Type.IsNonNestedClass(), Filterer_Type.IsNonGenericClass() }; return(Types.GetFilteredTypes( filters.AppendIf( HasNamespace(), Filterer_Type.IsNamespace(GetNamespace()) ) ).GetFirst() .ChainIfNull(t => hydrater.LogMissingType(GetId()))); }
protected override EditorGUIElement PushState() { EditTarget value; EditProperty_Single_Object property = GetEditPropertyObject(); EditorGUIElement_Container_Auto container = new EditorGUIElement_Container_Auto_Simple_VerticalStrip(); if (property.HasCustomAttributeOfType <PolymorphicFieldAttribute>(true)) { EditorGUIElement_Container_Flow_Line strip = container.AddChild(new EditorGUIElement_Container_Flow_Line()); strip.AddWeightedChild(1.0f, new EditorGUIElement_Popup_ProcessOperation <Type>( Types.GetFilteredTypes( Filterer_Type.CanBeTreatedAs(property.GetPropertyType()), Filterer_Type.IsConcreteClass() ).NaturalSort(t => t.FullName), t => property.CreateContents(t, true), (out Type t) => property.TryGetContentsType(out t) ) ); strip.AddFixedChild(20.0f, new EditorGUIElement_Button("X", delegate() { property.ClearContents(true); }) ); } else if (property.HasCustomAttributeOfType <MonomorphicFieldAttribute>(true)) { property.EnsureContents( property.GetCustomAttributeOfType <MonomorphicFieldAttribute>(true) .GetTargetType(), false ); } if (property.TryGetContents(out value)) { container.AddChild(new EditorGUIElement_Complex_EditTarget(value)); } return(container); }
partial void OnConstructor() { utilities = new DOMEClass_Generated_GrammarElement_Helper_Utilities(this); iparse_tree_extensions = new DOMEClass_Generated_GrammarElement_Helper_IParseTreeExtensions(this); resolver = new DOMEClass_Generated_GrammarElement_Helper_Resolver(this); syntax_exception = new DOMEClass_Generated_GrammarElement_SyntaxException(this); syntax_exception_thrower = new DOMEClass_Generated_GrammarElement_Helper_SyntaxExceptionThrower(this); get_parser_name = new OperationCache <string>("get_parser_name", delegate() { return(GetGrammarName() + "Parser"); }); get_lexer_name = new OperationCache <string>("get_lexer_name", delegate() { return(GetGrammarName() + "Lexer"); }); get_visitor_name = new OperationCache <string>("get_visitor_name", delegate() { return(GetGrammarName() + "BaseVisitor"); }); get_main_filename = new OperationCache <string>("get_main_filename", delegate() { return(GetGrammarName() + "DOMinator.cs"); }); get_class_generic = new OperationCache <DOMEClass_Generic, string>("get_class_generic", delegate(string name) { return(new DOMEClass_Generic(this, name)); }); get_type_concept = new OperationCache <DOMEVariableTypeConcept, string>("get_type_concept", delegate(string name) { return(Types.GetFilteredTypes( Filterer_Type.CanBeTreatedAs <DOMEVariableTypeConcept>(), Filterer_Type.HasCustomLabeledAttributeOfType <DOMEVariableTypeConceptAttribute>(name, true) ).GetFirst().IfNotNull(t => t.CreateInstance <DOMEVariableTypeConcept>(this), delegate() { if (name.TryTrimPrefix("enum_", out name)) { return new DOMEVariableTypeConcept_Primitive_Enum(this, name); } return new DOMEVariableTypeConcept_Primitive_NewConstruct(this, name); })); }); }
static private void GenerateEditorWindowEXMenuItems() { CodeGenerator.GenerateStaticClass("EditorWindowEXMenuItems", delegate(CSTextDocumentBuilder builder) { foreach (Type type in Types.GetFilteredTypes( Filterer_Type.CanBeTreatedAs <EditorWindowEX>(), Filterer_Type.IsConcreteClass() )) { CSTextDocumentWriter writer = builder.CreateWriterWithVariablePairs( "PATH", ("Window/" + type.Name).StyleAsDoubleQuoteLiteral(), "FUNCTION", ("Open" + type.Name).StyleAsFunctionName(), "TYPE", type.Namespace.AppendToVisible(".") + type.Name ); writer.Write("[MenuItem(?PATH)]"); writer.Write("static public void ?FUNCTION()", delegate() { writer.Write("EditorWindow.GetWindow<?TYPE>().Show();"); }); } }, GeneratedCodeType.EditorOnlyLeaf); }
static private void GenerateSubsystems() { CodeGenerator.GenerateStaticClass("SubsystemMenuItems", delegate(CSTextDocumentBuilder builder) { foreach (Type type in Types.GetFilteredTypes( Filterer_Type.CanBeTreatedAs <Subsystem>(), Filterer_Type.IsConcreteClass() )) { CSTextDocumentWriter writer = builder.CreateWriterWithVariablePairs( "PATH", ("Edit/Project Settings/" + type.Name).StyleAsDoubleQuoteLiteral(), "FUNCTION", ("Focus" + type.Name).StyleAsFunctionName(), "TYPE", type.Namespace.AppendToVisible(".") + type.Name ); writer.Write("[MenuItem(?PATH)]"); writer.Write("static public void ?FUNCTION()", delegate() { writer.Write("?TYPE.GetInstance().FocusAsset();"); }); SubsystemExtensions_Asset.CreateSubsystemAssetIfMissing(type); } }, GeneratedCodeType.EditorOnlyLeaf); }
public override Type GetSystemType(TyonHydraterBase hydrater) { Type[] generic_arguments = GetTyonTypes() .Convert(t => t.GetSystemType(hydrater)) .ToArray(); IEnumerable <Filterer <Type> > filters = new Filterer <Type>[] { Filterer_Type.IsBasicNamed(GetName()), Filterer_Type.IsGenericClass(), Filterer_Type.IsNonNestedClass(), Filterer_Type.CanGenericParametersHold(generic_arguments) }; Type generic_type = Types.GetFilteredTypes( filters.AppendIf( HasNamespace(), Filterer_Type.IsNamespace(GetNamespace()) ) ).GetFirst() .ChainIfNull(t => hydrater.LogMissingType(GetId())); return(generic_type.MakeGenericType(generic_arguments)); }
static private void GenerateAssetClassMenuItems() { CodeGenerator.GenerateStaticClass("AssetClassMenuItems", delegate(CSTextDocumentBuilder builder) { foreach (Type type in Types.GetFilteredTypes( Filterer_Type.HasCustomAttributeOfType <AssetClassAttribute>(true), Filterer_Type.IsConcreteClass(), Filterer_Type.IsNonGenericClass() )) { string category = type.GetCustomLabeledAttributeOfTypeLabel <AssetClassCategoryAttribute>(true); CSTextDocumentWriter writer = builder.CreateWriterWithVariablePairs( "PATH", ("Assets/Create Custom/" + category.AppendToVisible("/") + type.Name.Replace("_", "/")).StyleAsDoubleQuoteLiteral(), "FUNCTION", ("Create" + type.Name).StyleAsFunctionName(), "TYPENAME", type.Namespace.AppendToVisible(".") + type.Name ); writer.Write("[MenuItem(?PATH)]"); writer.Write("static public void ?FUNCTION()", delegate() { writer.Write("Assets.CreateAsset<?TYPENAME>();"); }); } }, GeneratedCodeType.EditorOnlyLeaf); }
protected override Type ReadConstantValue(Buffer buffer) { return(Types.GetFilteredTypes( Filterer_Type.IsNamed(buffer.ReadString()) ).GetFirst()); }
public override IEnumerable <Type> GetOptions(string text) { return(Types.GetFilteredTypes( Filterer_Type.DoesNameContain(text) )); }