Esempio n. 1
0
 private static void Main(string[] args)
 {
     if (args.Length == 1) {
         ProgramManager pm = new ProgramManager(args[0]);
         Console.WriteLine("Model loaded successfully");
         pm.Execute();
     }
     else {
         Console.WriteLine("Error in parameters");
     }
     Console.WriteLine("Press any key to contiue...");
     Console.ReadKey();
 }
Esempio n. 2
0
 public abstract void Execute(ProgramManager pm);
Esempio n. 3
0
 protected abstract RWSection GetNewSection(ProgramManager pm);
Esempio n. 4
0
 public override void Execute(ProgramManager pm)
 {
     Console.WriteLine("Unknown command");
 }
Esempio n. 5
0
 public override void Execute(ProgramManager pm)
 {
     foreach (RWSection section in pm.Current.Childs) {
         Console.WriteLine(section.Header);
     }
 }
Esempio n. 6
0
 public override void Execute(ProgramManager pm)
 {
     pm.Current = GetNewSection(pm);
 }
Esempio n. 7
0
 protected override RWSection GetNewSection(ProgramManager pm)
 {
     return pm.Root;
 }
Esempio n. 8
0
 protected override RWSection GetNewSection(ProgramManager pm)
 {
     if (pm.Current != pm.Root) {
         return pm.Current.Parent;
     }
     else
         throw new Exception("You are already in the root section");
 }
Esempio n. 9
0
 protected override RWSection GetNewSection(ProgramManager pm)
 {
     RWSection[] childSections = (from c in pm.Current.Childs
                                  where (int)c.Header.Id == this.NewSectionType
                                  select c).ToArray() as RWSection[];
     if (this.NewSectionNumber < childSections.Length) {
         return childSections[NewSectionNumber];
     }
     else {
         throw new Exception(String.Format("There is no child section {O}[{1}]", this.NewSectionType, this.NewSectionNumber));
     }
 }
Esempio n. 10
0
 public override void Execute(ProgramManager pm)
 {
     Console.WriteLine("Goodbye!");
 }
Esempio n. 11
0
 public override void Execute(ProgramManager pm)
 {
     // Пустой метод.
 }