Ejemplo n.º 1
0
 //hash code trait
 public override int GetHashCode()
 {
     unchecked {
         var hash = 0;
         hash = hash * 31 + OpenString.GetHashCode();
         return(hash);
     }
 }
Ejemplo n.º 2
0
 //pretty print
 public virtual void Print(PrettyPrinter printer)
 {
     printer.Println("Open (");
     using (printer.IndentCookie()) {
         printer.Print("openString = "); OpenString.PrintEx(printer); printer.Println();
     }
     printer.Print(")");
 }
Ejemplo n.º 3
0
 //pretty print
 public override void Print(PrettyPrinter printer)
 {
     printer.Println("Open_Unknown (");
     using (printer.IndentCookie()) {
         printer.Print("openString = "); OpenString.PrintEx(printer); printer.Println();
     }
     printer.Print(")");
 }
Ejemplo n.º 4
0
 /// <summary>Execute the action.</summary>
 /// <param name="actionInput">The full input specified for executing the command.</param>
 public override void Execute(ActionInput actionInput)
 {
     // If the user invoked the context command, try to open or close their target.
     if (OpenString.Equals(actionInput.Noun, StringComparison.CurrentCultureIgnoreCase))
     {
         this.opensClosesBehavior.Open(actionInput.Controller.Thing);
     }
     else if (CloseString.Equals(actionInput.Noun, StringComparison.CurrentCultureIgnoreCase))
     {
         this.opensClosesBehavior.Close(actionInput.Controller.Thing);
     }
 }