예제 #1
0
		private Entity CreateMetadataFile(DataSourceEntity entity) 
		{
			MetadataFile file = new MetadataFile(this.Project);
			Entity orEntity = new Entity();
			file.MetadataEntities.Add(orEntity);
			file.Save(GetEntityFileName(entity));
			this.Project.MetadataFiles.Add(file);
			return orEntity;
		}
		private Entity CreateMetadataEntity(TableSchema table) {
			//string fileName = GetEntityFileName(table);
			MetadataFile file = new MetadataFile(_dataSource.Project);
			Entity entity = new Entity();
			file.MetadataEntities.Add(entity);
			file.Save(GetEntityFileName(table));
			_dataSource.Project.MetadataFiles.Add(file);
			return entity;
		}
예제 #3
0
		private void AddNewMetadataFile_Click(object sender, EventArgs e) {
			SaveFileDialog dlg = new SaveFileDialog();
			dlg.InitialDirectory = _project.GetFullMetadataPath();
			dlg.Filter = "XML Files (.XML)|*.xml|All Files (*.*)|*.*";
			if (dlg.ShowDialog(this) == DialogResult.OK)
			{
				MetadataFile file = new MetadataFile(_project);
				XmlDocument doc = new XmlDocument();
				doc.LoadXml("<Metadata></Metadata>");
				file.LoadXml(doc);
				file.Save(dlg.FileName);
				_project.MetadataFiles.Add(file);
				RefreshUI();
				OpenObjectEditor(file);
			}
		}