private void LoadDomain() { this.Settings = new Application.Configurations.Settings(this.Deployment.ProvideConfigurationContent()); // Setup Languages string[] languageIds = this.Deployment.Languages; if (languageIds.Length == 0) { throw new Exceptions.LanguageFileException(); } this.Languages = new Application.Configurations.Languages(); foreach (string languageId in languageIds) { ((Application.Configurations.Languages) this.Languages).Add( new Application.Configurations.Language( this.Deployment.ProvideLanguageContent(languageId), string.CompareOrdinal(languageId, this.Settings.Configurations.DefaultLanguage) == 0 ) ); } // !--- this.Controls = new Application.ControlManager(this.Deployment.ProvideControlsContent()); this.xService = new Application.Configurations.xService(); // Compile Children Domains this._Children = new Basics.Domain.Info.DomainCollection(); this.CompileChildrenDomains(ref this._Children); }
private void CompileChildrenDomains(ref Basics.Domain.Info.DomainCollection childrenToFill) { DirectoryInfo childrenDI = new DirectoryInfo(this.Deployment.ChildrenRegistration); if (!childrenDI.Exists) { return; } foreach (DirectoryInfo childDI in childrenDI.GetDirectories()) { string[] childAccessTree = new string[this.DomainIdAccessTree.Length + 1]; Array.Copy(this.DomainIdAccessTree, 0, childAccessTree, 0, this.DomainIdAccessTree.Length); childAccessTree[^ 1] = childDI.Name;
private void CompileChildrenDomains(ref Basics.Domain.Info.DomainCollection childrenToFill) { DirectoryInfo childrenDI = new DirectoryInfo(this.Deployment.ChildrenRegistration); if (!childrenDI.Exists) { return; } foreach (DirectoryInfo childDI in childrenDI.GetDirectories()) { string[] childAccessTree = new string[this.DomainIDAccessTree.Length + 1]; Array.Copy(this.DomainIDAccessTree, 0, childAccessTree, 0, this.DomainIDAccessTree.Length); childAccessTree[childAccessTree.Length - 1] = childDI.Name; Domain childDomain = new Domain(childAccessTree); List <Basics.Domain.Info.Language> languages = new List <Basics.Domain.Info.Language>(); foreach (string languageID in childDomain.Languages) { languages.Add(childDomain.Languages[languageID].Info); } Basics.Domain.Info.Domain domainInfo = new Basics.Domain.Info.Domain( childDomain.DeploymentType, childDI.Name, languages.ToArray() ); domainInfo.Children.AddRange(childDomain.Children); childrenToFill.Add(domainInfo); childDomain.Dispose(); } }