Пример #1
0
 protected SchemaDefinition GetSchemaDefinition()
 {
     if (NameMap != null)
     {
         MappedSchemaDefinition mappedDefinition = new MappedSchemaDefinition(Schema, NameMap);
         return(mappedDefinition.MapSchemaClassAndPropertyNames());
     }
     else
     {
         return(Schema);
     }
 }
Пример #2
0
        public void LoadSchemaOnClick(object sender, EventArgs e)
        {
            Form.OpenFileDialog.InitialDirectory = this.WorkspaceFolder;
            Form.OpenFileDialog.Filter           = MappedSchemaFileFilter;
            Form.OpenFileDialog.DefaultExt       = MappedSchemaExtension;
            DialogResult result = Form.OpenFileDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                TryOrShowMessage(() =>
                {
                    FileInfo schemaFile           = new FileInfo(Form.OpenFileDialog.FileName);
                    MappedSchemaDefinition schema = MappedSchemaDefinition.Load(schemaFile);
                    MappedSchemaDefinition        = schema;
                    PopulateTableNameMapList();
                    Form.TabControlMain.SelectedTab = Form.TabPageSchemaInfo;

                    SetSchemaStatus("Loaded schema: {0}"._Format(schemaFile.FullName));
                });
            }
        }