コード例 #1
0
ファイル: Program.cs プロジェクト: git-heavy/GTAViewer
 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
ファイル: Command.cs プロジェクト: git-heavy/GTAViewer
 public abstract void Execute(ProgramManager pm);
コード例 #3
0
ファイル: Command.cs プロジェクト: git-heavy/GTAViewer
 protected abstract RWSection GetNewSection(ProgramManager pm);
コード例 #4
0
ファイル: Command.cs プロジェクト: git-heavy/GTAViewer
 public override void Execute(ProgramManager pm)
 {
     Console.WriteLine("Unknown command");
 }
コード例 #5
0
ファイル: Command.cs プロジェクト: git-heavy/GTAViewer
 public override void Execute(ProgramManager pm)
 {
     foreach (RWSection section in pm.Current.Childs) {
         Console.WriteLine(section.Header);
     }
 }
コード例 #6
0
ファイル: Command.cs プロジェクト: git-heavy/GTAViewer
 public override void Execute(ProgramManager pm)
 {
     pm.Current = GetNewSection(pm);
 }
コード例 #7
0
ファイル: Command.cs プロジェクト: git-heavy/GTAViewer
 protected override RWSection GetNewSection(ProgramManager pm)
 {
     return pm.Root;
 }
コード例 #8
0
ファイル: Command.cs プロジェクト: git-heavy/GTAViewer
 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
ファイル: Command.cs プロジェクト: git-heavy/GTAViewer
 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
ファイル: Command.cs プロジェクト: git-heavy/GTAViewer
 public override void Execute(ProgramManager pm)
 {
     Console.WriteLine("Goodbye!");
 }
コード例 #11
0
ファイル: Command.cs プロジェクト: git-heavy/GTAViewer
 public override void Execute(ProgramManager pm)
 {
     // Пустой метод.
 }