Exemple #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();
 }
Exemple #2
0
 public abstract void Execute(ProgramManager pm);
Exemple #3
0
 protected abstract RWSection GetNewSection(ProgramManager pm);
Exemple #4
0
 public override void Execute(ProgramManager pm)
 {
     Console.WriteLine("Unknown command");
 }
Exemple #5
0
 public override void Execute(ProgramManager pm)
 {
     foreach (RWSection section in pm.Current.Childs) {
         Console.WriteLine(section.Header);
     }
 }
Exemple #6
0
 public override void Execute(ProgramManager pm)
 {
     pm.Current = GetNewSection(pm);
 }
Exemple #7
0
 protected override RWSection GetNewSection(ProgramManager pm)
 {
     return pm.Root;
 }
Exemple #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");
 }
Exemple #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));
     }
 }
Exemple #10
0
 public override void Execute(ProgramManager pm)
 {
     Console.WriteLine("Goodbye!");
 }
Exemple #11
0
 public override void Execute(ProgramManager pm)
 {
     // Пустой метод.
 }