예제 #1
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="ui"></param>
 /// <param name="stregsystem"></param>
 public StregsystemController(IStregsystemUI ui, IStregsystem stregsystem)
 {
     _ui = ui;
     _s  = stregsystem;
     ui.CommandEntered += ParseCommand;
     PopulateAdminCommands();
 }
예제 #2
0
 public StregsystemController(IStregsystemUI sui, IStregsystem s)
 {
     S   = s;
     SUI = sui;
     SUI.CommandEntered += Controller;
     AddAdminCommands();
 }
 public StregsystemController(IStregsystemUI ui, IStregsystem stregsystem)
 {
     this._ui           = ui;
     this._stregsystem  = stregsystem;
     ui.CommandEntered += HandleInput;
     AddAdminCommands();
 }
예제 #4
0
 public StregsystemCLI(IStregsystem s)
 {
     IS = s;
     IS.FileReadError      += DisplayFileReadError;
     IS.UserBalanceWarning += UserBalanceWarning;
     IS.ReadFiles();
 }
 public StregsystemController(IStregsystemUI ui, IStregsystem stregsystem)
 {
     this.stregsystem = stregsystem;
     Ui = ui;
     adminCommand = new Dictionary<string, Delegate>();
     FillDictionary();
 }
예제 #6
0
 public StregsystemController(IStregsystemUI UI, IStregsystem ss)
 {
     _ui = UI;
     _ui.CommandEntered += CommandParser;
     _ss = ss;
     //_ss.UserBalanceWarning; void UserBalanceNotification(User user, decimal balance)
 }
예제 #7
0
        public StregsystemController(IStregsystem stregsystem, IStregsystemUI ui)
        {
            this.stregsystem = stregsystem;
            this.ui          = ui;
            AddAdminCommands();

            ui.CommandEntered += CheckIfAdmin;
        }
예제 #8
0
 public StregsystemController(IStregsystemUI ui, IStregsystem stregsystem)
 {
     UI = ui;
     UI.OnCommandEntered            += HandleOnCommandEntered;
     Stregsystem                     = stregsystem;
     Stregsystem.UserBalanceWarning += HandleOnUserBalanceNotification;
     CommandParser                   = new StregsystemCommandParser(stregsystemUI: UI, stregsystem: Stregsystem);
 }
        public StregsystemController(IStregsystem stregsystem, IStregsystemUI stregsystemUI) // Interfaces som parametre
        {
            Stregsystem = stregsystem; // Lokale variabler ovenover, sat til parametre
            Ui = stregsystemUI;        //                    ^

            Ui.CommandEntered += ParseCommand; // PareCommand er en metode der blivers midt på CommandEntered EventHandleren fra CLI

            admincommands = new Dictionary<string, Delegate>();
            FillAdminCommands();
        }
예제 #10
0
        public StregsystemController(IStregsystemUI stregsystemCLI, IStregsystem stregsystem)
        {
            _stregsystem   = stregsystem;
            _stregsystemUI = stregsystemCLI;
            _stregsystemUI.CommandEntered += ParseCommand;

            _admincommands.Add(":q", (List <string> args) => stregsystemCLI.Close());
            _admincommands.Add(":quit", (List <string> args) => stregsystemCLI.Close());
            _admincommands.Add(":activate", (List <string> args) => HandleActiveProduct(args));
            _admincommands.Add(":deactivate", (List <string> args) => HandleDeactiveProduct(args));
            _admincommands.Add(":crediton", (List <string> args) => HandleCreditOn(args));
            _admincommands.Add(":creditoff", (List <string> args) => HandleCreditOff(args));
        }
예제 #11
0
        public StregsystemController(IStregsystemUI stregsystemCLI, IStregsystem stregsystem)
        {
            _stregsystem  = stregsystem;
            _stregystemui = stregsystemCLI;
            _stregystemui.CommandEntered += ParseCommand;

            _adminCommands.Add(":q", (List <string> args) => stregsystemCLI.Close());
            _adminCommands.Add(":quit", (List <string> args) => stregsystemCLI.Close());
            _adminCommands.Add(":activate", (List <string> args) => HandleActivateProduct(args));      //method for handling activation
            _adminCommands.Add(":deactivate", (List <string> args) => HandleDeactivateProduct(args));
            _adminCommands.Add(":crediton", (List <string> args) => HandlePurchaseableOnCredit(args)); //method for handling product able to purchased on credit
            _adminCommands.Add(":creditoff", (List <string> args) => HandleNotPurchaseableOnCredit(args));
            _adminCommands.Add(":addcredits", (List <string> args) => HandleAddCreditToUser(args));    //method for handling adding credits
        }
예제 #12
0
        public StregsystemController(IStregsystemUI stregsystemCLI, IStregsystem stregsystem)
        {
            _stregsystem   = stregsystem;
            _stregsystemUI = stregsystemCLI;
            _stregsystemUI.CommandEntered   += ParseCommand;
            _stregsystem.UserBalanceWarning += _stregsystemUI.DisplayUserLowOnMoney;

            _admincommands.Add(":q", (List <string> args) => stregsystemCLI.Close());
            _admincommands.Add(":quit", (List <string> args) => stregsystemCLI.Close());
            _admincommands.Add(":activate", (List <string> args) => HandleActiveProduct(args));
            _admincommands.Add(":deactivate", (List <string> args) => HandleDeactiveProduct(args));
            _admincommands.Add(":crediton", (List <string> args) => HandleCreditOn(args));
            _admincommands.Add(":creditoff", (List <string> args) => HandleCreditOff(args));
            _admincommands.Add(":addcredits", (List <string> args) => HandleAddCreditToUser(args));
        }
예제 #13
0
        public StregsystemCommandParser(IStregsystem stregsystem, IStregsystemUI stregsystemUI)
        {
            Stregsystem = stregsystem;
            UI          = stregsystemUI;

            _adminCommands.Add(":q", (nula, nulb, nulc) => Quit <string>(nula, nulb, nulc));
            _adminCommands.Add(":quit", (nula, nulb, nulc) => Quit <string>(nula, nulb, nulc));
            _adminCommands.Add(":showalltransactions", (nula, nulb, nulc) => ShowAllTransactions <string>(nula, nulb, nulc));
            _adminCommands.Add(":sat", (nula, nulb, nulc) => ShowAllTransactions <string>(nula, nulb, nulc));
            _adminCommands.Add(":deactivate", (activate, id, nulc) => Activate <string>(activate, productID: id, nulc));
            _adminCommands.Add(":activate", (activate, id, nulc) => Activate <string>(activate, productID: id, nulc));
            _adminCommands.Add(":crediton", (crediton, id, nulc) => Crediton <string>(crediton, id, nulc));
            _adminCommands.Add(":creditoff", (crediton, id, nulc) => Crediton <string>(crediton, id, nulc));
            _adminCommands.Add(":insertmoney", (nula, username, amount) => InsertMoney <string>(nula, username, amount));
            _adminCommands.Add(":insert", (nula, username, amount) => InsertMoney <string>(nula, username, amount));
            _adminCommands.Add(":manual", (nula, username, amount) => Manual <string>(nula, username, amount));


            _userCommands.Add("getUser", (username, nulb, nulc) => GetUser <string>(username, nulb, nulc));
            _userCommands.Add("buyProduct", (username, prodID, nulc) => BuyProduct <string>(username, prodID, nulc));
            _userCommands.Add("BuyProductQuantity", (username, prodID, quantity) => BuyProductQuantity <string>(username, prodID, quantity));
        }
예제 #14
0
 public ConsoleMultipleBuy01(IStregsystem stregsystem)
 {
     this._stregsystem = stregsystem;
 }
 public StregsystemCLI(IStregsystem stregsystem)
 {
     _stregsystem = stregsystem;
 }
예제 #16
0
 public StregsystemCLI(IStregsystem ss)
 {
     this.ss = ss;
 }
예제 #17
0
 public StregSystemController(IStregsystemUI ui, IStregsystem core)
 {
     Ui   = ui;
     Core = core;
     Ui.CommandEntered += ParseCommand;
 }
예제 #18
0
        bool Running = false; // Til at styre om programmet skal køre eller ej

        public StregsystemCLI(IStregsystem stregsystem)
        {
            Stregsystem = stregsystem;
            User.OnUserBalanceNotification += PrintLowBalance; // Et event der får en lokal metode (PrintLowBalance) sat på et event
        }
예제 #19
0
 public StregsystemUI(IStregsystem stregsystem)
 {
     Stregsystem = stregsystem;
     stregsystem.UserBalanceWarning += DisplayUserBalanceWarning;
 }
예제 #20
0
 /// <summary>
 /// Default Constructor
 /// </summary>
 /// <param name="stregsystem"></param>
 public StregsystemCLI(IStregsystem stregsystem)
 {
     _stregsystem = stregsystem;
     // Event subscription
     _stregsystem.UserBalanceWarning += DisplayUserBalanceWarning;
 }
예제 #21
0
 public StregsystemCommandParser(IStregsystem ps, IStregSystemUI ui)
 {
     pointsystem        = ps;
     UI                 = ui;
     UI.CommandEntered += Ui_CommandEntered;
 }
예제 #22
0
 //til testbrug
 public StregsystemCLI()
 {
     Stregsystem = new Stregsystem();
 }
예제 #23
0
 public StregsystemController(IStregsystemUI ui, IStregsystem stregsystem)
 {
     _ui                 = ui;
     _stregsystem        = stregsystem;
     _ui.CommandEntered += ParseCommand;
 }
예제 #24
0
 public StregsystemCommandParser(IStregsystemUI ui, IStregsystem stregsystem)
 {
     this.ss = stregsystem;
     this.ui = ui;
     FillAdminCommands();
 }
 public StregsystemCli(IStregsystem stregsystem)
 {
     Stregsystem = stregsystem;
     running     = true;
 }
예제 #26
0
 public StregsystemCLI(IStregsystem stregsystem)
 {
     _stregsystem = stregsystem;
     _info        = "Write your username and the product you want to buy, separated with a space";
 }
예제 #27
0
 public StregsystemCLI(IStregsystem stregsystem)
 {
     _stregsystem = stregsystem;
     isRunning    = true;
     _stregsystem.UserBalanceWarning += DisplayUserBalanceWarning;
 }
예제 #28
0
 public StregsystemCLI(IStregsystem system)
 {
     stregsystem = system;
 }
예제 #29
0
 public ConsoleUserInfo02(User user, IStregsystem stregsystem)
 {
     this.User         = user;
     this._stregsystem = stregsystem;
 }