Пример #1
0
        //public string ToJson(Declaration declaration)
        //{
        //    return declaration.ToString();//DeclarationSerializer.Write(declaration);
        //}

        //-------------
        void UpdateField(IFieldTypeRegistry fieldtypeRegistry, string typestring)
        {
            foreach (var k in FFields.Keys)
            {
                if (FFields[k].Typestring == typestring)
                {
                    Type t = null;
                    if (fieldtypeRegistry.StringToType(typestring, out t))
                    {
                        FFields[k].FieldType         = t;
                        FFields[k].ContainerType     = fieldtypeRegistry.ContainerType;
                        FFields[k].ContainerRegistry = fieldtypeRegistry.ContainerRegistry;
                        fieldtypeRegistry.TypeToString(t, out typestring);
                        FFields[k].Typestring = typestring;

                        FFields[k].InvokeChanged();
                    }
                }
            }
        }
Пример #2
0
        void AssemblyAdded(IFieldTypeRegistry fieldtypeRegistry)
        {
            foreach (var k in FFields.Keys)
            {
                if (FFields[k].ContainerType == "Null")
                {
                    Type t = null;
                    if (fieldtypeRegistry.StringToType(FFields[k].Typestring, out t) && t != FFields[k].FieldType)
                    {
                        FFields[k].FieldType         = t;
                        FFields[k].ContainerType     = fieldtypeRegistry.ContainerType;
                        FFields[k].ContainerRegistry = fieldtypeRegistry.ContainerRegistry;
                        var typestring = FFields[k].Typestring;
                        fieldtypeRegistry.TypeToString(t, out typestring); //normalize typestring
                        FFields[k].Typestring = typestring;

                        FFields[k].InvokeChanged();
                    }
                }
            }
        }