Exemplo n.º 1
0
 private void InitInsertMenus()
 {
     InitMenuFields(mnuTableFields, SchemaExtensionManager.GetPropertyMaps <Table>());
     InitMenuFields(mnuColumnFields, SchemaExtensionManager.GetPropertyMaps <Column>());
     InitMenuFields(mnuReferFields, SchemaExtensionManager.GetPropertyMaps <Reference>());
     InitMenuFields(mnuProfileFields, ProfileExtensionManager.GetPropertyMaps());
 }
Exemplo n.º 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.ThreadException += Application_ThreadException;
            Util.ClearTempFiles();

            SchemaExtensionManager.Initialize();
            ProfileExtensionManager.Initialize();
            Application.Run(new frmMain());
        }
Exemplo n.º 3
0
        public static Profile LoadFile(string fileName)
        {
            var profile     = ProfileExtensionManager.Build();
            var profileType = profile.GetType();
            var content     = File.ReadAllText(fileName, Encoding.Default);
            var json        = new JsonSerializer();
            var dyobj       = (IDictionary <string, object>)json.Deserialize <dynamic>(content);

            foreach (var kvp in dyobj)
            {
                var p = profileType.GetProperty(kvp.Key);
                if (p != null)
                {
                    p.SetValue(profile, kvp.Value, null);
                }
            }

            return(profile);
        }