Exemple #1
0
        public bool RequiresInitialization(IVariableDeclarationModel decl)
        {
            if (decl == null)
            {
                return(false);
            }

            VariableType variableType = decl.VariableType;
            Type         dataType     = CSharpTypeSerializer.ResolveType(decl.DataType);

            return((variableType == VariableType.FunctionVariable || variableType == VariableType.GraphVariable) &&
                   (dataType.IsValueType || dataType == typeof(string)));
        }
Exemple #2
0
 public static ITypeMetadata GetMetadata(this Type t, CSharpTypeSerializer serializer,
                                         ITypeMetadataResolver resolver)
 {
     return(t.GenerateTypeHandle(serializer).GetMetadata(resolver));
 }
Exemple #3
0
 public static Type Resolve(this TypeHandle th, CSharpTypeSerializer serializer)
 {
     return(serializer.ResolveType(th));
 }
Exemple #4
0
 public static TypeHandle GenerateTypeHandle(this Type t, CSharpTypeSerializer serializer)
 {
     return(serializer.GenerateTypeHandle(t));
 }
Exemple #5
0
        public bool RequiresInspectorInitialization(IVariableDeclarationModel decl)
        {
            Type dataType = CSharpTypeSerializer.ResolveType(decl.DataType);

            return(RequiresInitialization(decl));
        }
Exemple #6
0
 public GraphContext()
 {
     CSharpTypeSerializer = new CSharpTypeSerializer();
     TypeMetadataResolver = CreateMetadataResolver();
 }