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