// Moonbase.cs created with MonoDevelop // User: chadk at 12:28 PMĀ 12/23/2007 // // To change standard headers go to Edit->Preferences->Coding->Standard Headers // using System; using System.IO; using System.Collections.Generic; namespace Lunar { public class Moonbase { private string mLocation = Configuration.MoonbaseLocation(); private Modules mModules; #region Public Properties public string Location { get { return this.mLocation; } } public bool IsCustomLocation { get { return !(Configuration.DEFAULT_MOONBASE_LOCATION.Equals(this.mLocation)); } } public Modules Modules { get { return this.mModules; } } public List
Sections { get { SortedList sectionDetails = new SortedList(); DirectoryInfo moonbase = new DirectoryInfo(this.mLocation); foreach (DirectoryInfo section in moonbase.GetDirectories("*", SearchOption.TopDirectoryOnly)) { if (!section.Name.StartsWith(".")) // exculde .svn/.git/.whatever files are they are not part of the moonbase proper sectionDetails.Add(section.Name, section.FullName); } List
sections = new List
(); foreach (KeyValuePair section in sectionDetails) { sections.Add(new Section(section.Key, section.Value)); } return sections; } } #endregion public Moonbase() { this.mModules = new Lunar.Modules(this); } } }