Пример #1
0
		public static int MetaFile_find(
			MetaFile[] metaFiles_in,
			string root_in
		) {
			for (int i = 0; i < metaFiles_in.Length; i++) {
				if (metaFiles_in[i].Root == root_in) {
					return i;
				}
			}

			throw new Exception(string.Format(
				"can't find: {0}",
				root_in
			));
		}
Пример #2
0
//		public void Save() {
//			if (this.hasChanges) {
//
//				metadata_.SaveState_toFile(
//					filename_
//				);
//
//				haschanges_ = false;
//			}
//		}
		#endregion
		#region public void Build(cGenerator.dBuild notifyBase_in);
		public void Build(cGenerator.dBuild notifyBase_in) {
			string _outputDir = Path.GetDirectoryName(filename_);
			if (notifyBase_in != null) notifyBase_in("generating...", true);

			MetaFile[] _metafiles = new MetaFile[1];
			_metafiles[0] = new MetaFile(
				filename_,
				XS__diagram.DIAGRAM
			);
			new cGenerator(
				#if !NET_1_1
				System.Configuration.ConfigurationManager.AppSettings
				#else
				System.Configuration.ConfigurationSettings.AppSettings
				#endif
					["Templates"],
				_outputDir, 
				_metafiles
			).Build(
				notifyBase_in, 
				diagram_
			);
			if (notifyBase_in != null) notifyBase_in("...finished", true);
		}
Пример #3
0
		//#endregion
//		#region public void Build(cGenerator.dBuild notifyBase_in);
		public void Build(
			cGenerator.dBuild notifyBase_in,
			params string[] templateTypes_in
		) {
			#region string _outputDir = ...;
			string _outputDir = ParentDirectoryname;
			#endregion
			if (notifyBase_in != null) notifyBase_in("generating...", true);

// ToDos: now! need to save MetadataDB to xml file

			MetaFile[] _metafiles = new MetaFile[metadata_.MetadataFiles.MetadataFiles.Count];
			for (int i = 0; i < metadata_.MetadataFiles.MetadataFiles.Count; i++) {
				_metafiles[i] = new MetaFile(
					Path.Combine(
						Directoryname, 
						metadata_.MetadataFiles.MetadataFiles[i].XMLFilename
					),
					metadata_.MetadataFiles.MetadataFiles[i].XMLFileType
				);
			}

			new cGenerator(
				#if !NET_1_1
				System.Configuration.ConfigurationManager.AppSettings
				#else
				System.Configuration.ConfigurationSettings.AppSettings
				#endif
					["Templates"],
				metadata_dbconnectionstrings(), 
				_outputDir, 
				_metafiles
			).Build(
				notifyBase_in, 
				metadata_,
				templateTypes_in
			);
			if (notifyBase_in != null) notifyBase_in("...finished", true);
		}
Пример #4
0
//		#region public void Save(...);
//		public void Save() {
//			if (this.hasChanges) {
//
//				rootmetadata_.ExtendedMetadata.SaveState_toFile(
//					filenameextendedmetadata_
//				);
//				for (int i = 0; i < rootmetadata_.SchemaCollection.Count; i++) {
//					rootmetadata_.SchemaCollection[i].SaveState_toFile(
//						Path.Combine(
//							Path.GetDirectoryName(filenameextendedmetadata_),
//							rootmetadata_.ExtendedMetadata.MetadataIndex[i].XMLFilename
//						)
//					);
//				}
//
//				haschanges_ = false;
//			}
//		}
//		#endregion
//		#region public void Build(cGenerator.dBuild notifyBase_in);
		public void Build(cGenerator.dBuild notifyBase_in) {
			#region string _outputDir = ...;
			string _outputDir = System.IO.Directory.GetParent(
				Path.GetDirectoryName(filenameextendedmetadata_)
			).FullName;
			#endregion
			if (notifyBase_in != null) notifyBase_in("generating...", true);

			MetaFile[] _metafiles = new MetaFile[1 + rootmetadata_.MetadataFiles.MetadataFiles.Count];
			_metafiles[0] = new MetaFile(
				filenameextendedmetadata_,
				ExtendedMetadata.METADATA
			);
			for (int i = 0; i < rootmetadata_.MetadataFiles.MetadataFiles.Count; i++) {
				_metafiles[1 + i] = new MetaFile(
					Path.Combine(
						Path.GetDirectoryName(filenameextendedmetadata_), 
						rootmetadata_.MetadataFiles.MetadataFiles[i].XMLFilename
					),
					XS_Schema.SCHEMA
				);
			}
			new cGenerator(
				#if !NET_1_1
				System.Configuration.ConfigurationManager.AppSettings
				#else
				System.Configuration.ConfigurationSettings.AppSettings
				#endif
					["Templates"],
				_outputDir,
				_metafiles
			).Build(
				notifyBase_in, 
				rootmetadata_
			);
			if (notifyBase_in != null) notifyBase_in("...finished", true);
		}