Esempio n. 1
0
//		public void Build(
//			dBuild notifyBack_in,
//			Type[] typeofClaSSe_in
//		) {
//			#region Checking...
//			Type[] _interfaces = typeofClaSSe_in.GetInterfaces();
//			bool _found = false;
//			for (int i = 0; i < _interfaces.Length; i++) {
//				if (_interfaces[i] == typeof(iClaSSe_metadata)) {
//					_found = true;
//					break;
//				}
//			}
//			if (!_found)
//				throw new Exception(
//					string.Format(
//						"{0}.{1}.Build(): - invalid type supplied!",
//						this.GetType().Namespace,
//						this.GetType().Name
//					)
//				);
//			#endregion
//			build(
//				notifyBack_in,
//				(iClaSSe_metadata)Activator.CreateInstance(typeofClaSSe_in),
//				true
//			);
//		}
        public void Build(
            dBuild notifyBack_in,
            iClaSSe_metadata metadata_in
            )
        {
            build(
                notifyBack_in,
//				false,
                metadata_in
                );
        }
Esempio n. 2
0
//		public void Build(
//			dBuild notifyBack_in, 
//			Type[] typeofClaSSe_in
//		) {
//			#region Checking...
//			Type[] _interfaces = typeofClaSSe_in.GetInterfaces();
//			bool _found = false;
//			for (int i = 0; i < _interfaces.Length; i++) {
//				if (_interfaces[i] == typeof(iClaSSe_metadata)) {
//					_found = true;
//					break;
//				}
//			}
//			if (!_found)
//				throw new Exception(
//					string.Format(
//						"{0}.{1}.Build(): - invalid type supplied!", 
//						this.GetType().Namespace, 
//						this.GetType().Name
//					)
//				);
//			#endregion
//			build(
//				notifyBack_in, 
//				(iClaSSe_metadata)Activator.CreateInstance(typeofClaSSe_in), 
//				true
//			);
//		}
		public void Build(
			dBuild notifyBack_in, 
			iClaSSe_metadata metadata_in
		) {
			build(
				notifyBack_in, 
//				false, 
				metadata_in
			);
		}
Esempio n. 3
0
        private void build(
            dBuild notifyBack_in,
//			bool loadMetadata_in,
            iClaSSe_metadata metadata_in
            )
        {
            notifyback_ = notifyBack_in;
            //notifyback_("- common items", true);

            if (xmltemplatesfileuri_.IsFile)
            {
                xmltemplatesdir_ = Path.GetDirectoryName(
                    xmltemplatesfileuri_.LocalPath
                    );
            }
            else
            {
                xmltemplatesdir_ = xmltemplatesfileuri_.ToString().Substring(
                    0,
                    xmltemplatesfileuri_.ToString().LastIndexOf("/")
                    );
            }

            #region dbconnectionstrings_[0..n].Connection_createInstance();
            for (int d = 0; d < dbconnectionstrings_.Count; d++)
            {
                dbconnectionstrings_[d].Connection_createInstance();
            }
            #endregion

            //metadata_ = new cDBMetadata(xmlmetadatafile_, xmlmetadataroot_);
            metadata_ = metadata_in;
//            if (loadMetadata_in) {
//// ToDos: now! index must be sinchronized, not very convenient :(
//                for (int m = 0; m < metadatas_.Length; m++) {
//                    metadatas_[m].LoadState_fromFile(
//                        //xmlmetadatafile_,
//                        metafiles_[m].Path,
//                        //xmlmetadataroot_
//                        metafiles_[m].Root
//                    );
//                }
//            }

            templates_ = (xmltemplatesfileuri_.IsFile)
                                ? XS__templates.Load_fromFile(xmltemplatesfileuri_.LocalPath)[0]
                                : XS__templates.Load_fromURI(xmltemplatesfileuri_)[0]
            ;

            bool      _finished;
            ArrayList _finishedTemplates = new ArrayList(templates_.TemplateCollection.Count);
            do
            {
                _finished = true;
                for (template_ = 0; template_ < templates_.TemplateCollection.Count; template_++)
                {
                    #region if (_finishedPreviously = ...) continue;
                    bool _finishedPreviously = false;
                    for (int f = 0; f < _finishedTemplates.Count; f++)
                    {
                        if (
                            templates_.TemplateCollection[template_].Name
                            ==
                            (string)_finishedTemplates[f]
                            )
                        {
                            _finishedPreviously = true;
                            break;
                        }
                    }
                    if (_finishedPreviously)
                    {
                        continue;
                    }
                    #endregion
                    #region if ((_finishedDependencies = ...) == templates_[template_].Dependencies.Count) { _finishedTemplates.Add(templates_[template_].Name); _finished = false; }
                    #region int _finishedDependencies = ...;
                    int _finishedDependencies = 0;
                    for (int d = 0; d < templates_.TemplateCollection[template_].Dependencies.DependencyCollection.Count; d++)
                    {
                        for (int f = 0; f < _finishedTemplates.Count; f++)
                        {
                            if (
                                templates_.TemplateCollection[template_].Dependencies.DependencyCollection[d].Name
                                ==
                                (string)_finishedTemplates[f]
                                )
                            {
                                _finishedDependencies++;
                                break;
                            }
                        }
                    }
                    #endregion
                    if (_finishedDependencies == templates_.TemplateCollection[template_].Dependencies.DependencyCollection.Count)
                    {
                        #region RUNNING: templates_[template_] ...
                        metadata_.IterateThrough_fromRoot(
                            templates_.TemplateCollection[template_].IterationType,
                            new cClaSSe.dIteration_found(notifyme)
                            );
                        #endregion

                        // adding template to finished list of templates
                        _finishedTemplates.Add(templates_.TemplateCollection[template_].Name);
                        _finished = false;

                        notifyback_(
                            string.Format(
                                "#{0}/{1} - {2}",
                                _finishedTemplates.Count,
                                templates_.TemplateCollection.Count,
                                templates_.TemplateCollection[template_].Name
                                ),
                            true
                            );
                    }
                    #endregion
                }
            } while (!_finished);
            #region if (templates_.Count != _finishedTemplates.Count) throw new Exception("unsolved dependencies");
            if (templates_.TemplateCollection.Count != _finishedTemplates.Count)
            {
                string _error = "list of Templates with unsolved dependencies:\n";
                for (int t = 0; t < templates_.TemplateCollection.Count; t++)
                {
                    _finished = false;
                    for (int f = 0; f < _finishedTemplates.Count; f++)
                    {
                        if ((string)_finishedTemplates[f] == templates_.TemplateCollection[template_].Name)
                        {
                            _finished = true;
                            break;
                        }
                    }
                    if (!_finished)
                    {
                        _error += string.Format(
                            "\t{0}\n",
                            templates_.TemplateCollection[template_].Name
                            );
                    }
                }
                throw new Exception(_error);
            }
            #endregion

            #region dbconnectionstrings_[0..n].Connection_clearInstance();
            for (int d = 0; d < dbconnectionstrings_.Count; d++)
            {
                dbconnectionstrings_[d].Connection_clearInstance();
            }
            #endregion
        }
Esempio n. 4
0
		private void build(
			dBuild notifyBack_in, 
//			bool loadMetadata_in, 
			iClaSSe_metadata metadata_in
		) {
			notifyback_ = notifyBack_in;
			//notifyback_("- common items", true);

			if (xmltemplatesfileuri_.IsFile) {
				xmltemplatesdir_ = Path.GetDirectoryName(
					xmltemplatesfileuri_.LocalPath
				);
			} else {
				xmltemplatesdir_ = xmltemplatesfileuri_.ToString().Substring(
					0, 
					xmltemplatesfileuri_.ToString().LastIndexOf("/")
				);
			}

			#region dbconnectionstrings_[0..n].Connection_createInstance();
			for (int d = 0; d < dbconnectionstrings_.Count; d++) {
				dbconnectionstrings_[d].Connection_createInstance();
			}
			#endregion

			//metadata_ = new cDBMetadata(xmlmetadatafile_, xmlmetadataroot_);
			metadata_ = metadata_in;
//            if (loadMetadata_in) {
//// ToDos: now! index must be sinchronized, not very convenient :(
//                for (int m = 0; m < metadatas_.Length; m++) {
//                    metadatas_[m].LoadState_fromFile(
//                        //xmlmetadatafile_, 
//                        metafiles_[m].Path, 
//                        //xmlmetadataroot_
//                        metafiles_[m].Root
//                    );
//                }
//            }

			templates_ = (xmltemplatesfileuri_.IsFile)
				? XS__templates.Load_fromFile(xmltemplatesfileuri_.LocalPath)[0]
				: XS__templates.Load_fromURI(xmltemplatesfileuri_)[0]
			;

			bool _finished;
			ArrayList _finishedTemplates = new ArrayList(templates_.TemplateCollection.Count);
			do {
				_finished = true;
				for (template_ = 0; template_ < templates_.TemplateCollection.Count; template_++) {
					#region if (_finishedPreviously = ...) continue;
					bool _finishedPreviously = false;
					for (int f = 0; f < _finishedTemplates.Count; f++) {
						if (
							templates_.TemplateCollection[template_].Name
							==
							(string)_finishedTemplates[f]
						) {
							_finishedPreviously = true;
							break;
						}
					}
					if (_finishedPreviously) continue;
					#endregion
					#region if ((_finishedDependencies = ...) == templates_[template_].Dependencies.Count) { _finishedTemplates.Add(templates_[template_].Name); _finished = false; }
					#region int _finishedDependencies = ...;
					int _finishedDependencies = 0;
					for (int d = 0; d < templates_.TemplateCollection[template_].Dependencies.DependencyCollection.Count; d++) {
						for (int f = 0; f < _finishedTemplates.Count; f++) {
							if (
								templates_.TemplateCollection[template_].Dependencies.DependencyCollection[d].Name
								==
								(string)_finishedTemplates[f]
							) {
								_finishedDependencies++;
								break;
							}
						}
					}
					#endregion
					if (_finishedDependencies == templates_.TemplateCollection[template_].Dependencies.DependencyCollection.Count) {
						#region RUNNING: templates_[template_] ...
						metadata_.IterateThrough_fromRoot(
							templates_.TemplateCollection[template_].IterationType,
							new cClaSSe.dIteration_found(notifyme)
						);
						#endregion

						// adding template to finished list of templates
						_finishedTemplates.Add(templates_.TemplateCollection[template_].Name);
						_finished = false;

						notifyback_(
							string.Format(
								"#{0}/{1} - {2}", 
								_finishedTemplates.Count, 
								templates_.TemplateCollection.Count, 
								templates_.TemplateCollection[template_].Name
							), 
							true
						);
					}
					#endregion
				}
			} while (!_finished);
			#region if (templates_.Count != _finishedTemplates.Count) throw new Exception("unsolved dependencies");
			if (templates_.TemplateCollection.Count != _finishedTemplates.Count) {
				string _error = "list of Templates with unsolved dependencies:\n";
				for (int t = 0; t < templates_.TemplateCollection.Count; t++) {
					_finished = false;
					for (int f = 0; f < _finishedTemplates.Count; f++) {
						if ((string)_finishedTemplates[f] == templates_.TemplateCollection[template_].Name) {
							_finished = true;
							break;
						}
					}
					if (!_finished) {
						_error += string.Format(
							"\t{0}\n", 
							templates_.TemplateCollection[template_].Name
						);
					}
				}
				throw new Exception(_error);
			}
			#endregion

			#region dbconnectionstrings_[0..n].Connection_clearInstance();
			for (int d = 0; d < dbconnectionstrings_.Count; d++) {
				dbconnectionstrings_[d].Connection_clearInstance();
			}
			#endregion
		}