Exemple #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();
 }
 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();
 }
Exemple #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();
 }
 public StregsystemController(IStregsystemUI UI, IStregsystem ss)
 {
     _ui = UI;
     _ui.CommandEntered += CommandParser;
     _ss = ss;
     //_ss.UserBalanceWarning; void UserBalanceNotification(User user, decimal balance)
 }
Exemple #7
0
        public StregsystemController(IStregsystem stregsystem, IStregsystemUI ui)
        {
            this.stregsystem = stregsystem;
            this.ui          = ui;
            AddAdminCommands();

            ui.CommandEntered += CheckIfAdmin;
        }
 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();
        }
        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));
        }
Exemple #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
        }
Exemple #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));
        }
        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));
        }
Exemple #14
0
 public ConsoleMultipleBuy01(IStregsystem stregsystem)
 {
     this._stregsystem = stregsystem;
 }
 public StregsystemCLI(IStregsystem stregsystem)
 {
     _stregsystem = stregsystem;
 }
Exemple #16
0
 public StregsystemCLI(IStregsystem ss)
 {
     this.ss = ss;
 }
Exemple #17
0
 public StregSystemController(IStregsystemUI ui, IStregsystem core)
 {
     Ui   = ui;
     Core = core;
     Ui.CommandEntered += ParseCommand;
 }
        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
        }
Exemple #19
0
 public StregsystemUI(IStregsystem stregsystem)
 {
     Stregsystem = stregsystem;
     stregsystem.UserBalanceWarning += DisplayUserBalanceWarning;
 }
Exemple #20
0
 /// <summary>
 /// Default Constructor
 /// </summary>
 /// <param name="stregsystem"></param>
 public StregsystemCLI(IStregsystem stregsystem)
 {
     _stregsystem = stregsystem;
     // Event subscription
     _stregsystem.UserBalanceWarning += DisplayUserBalanceWarning;
 }
Exemple #21
0
 public StregsystemCommandParser(IStregsystem ps, IStregSystemUI ui)
 {
     pointsystem        = ps;
     UI                 = ui;
     UI.CommandEntered += Ui_CommandEntered;
 }
Exemple #22
0
 //til testbrug
 public StregsystemCLI()
 {
     Stregsystem = new Stregsystem();
 }
Exemple #23
0
 public StregsystemController(IStregsystemUI ui, IStregsystem stregsystem)
 {
     _ui                 = ui;
     _stregsystem        = stregsystem;
     _ui.CommandEntered += ParseCommand;
 }
 public StregsystemCommandParser(IStregsystemUI ui, IStregsystem stregsystem)
 {
     this.ss = stregsystem;
     this.ui = ui;
     FillAdminCommands();
 }
 public StregsystemCli(IStregsystem stregsystem)
 {
     Stregsystem = stregsystem;
     running     = true;
 }
Exemple #26
0
 public StregsystemCLI(IStregsystem stregsystem)
 {
     _stregsystem = stregsystem;
     _info        = "Write your username and the product you want to buy, separated with a space";
 }
Exemple #27
0
 public StregsystemCLI(IStregsystem stregsystem)
 {
     _stregsystem = stregsystem;
     isRunning    = true;
     _stregsystem.UserBalanceWarning += DisplayUserBalanceWarning;
 }
Exemple #28
0
 public StregsystemCLI(IStregsystem system)
 {
     stregsystem = system;
 }
Exemple #29
0
 public ConsoleUserInfo02(User user, IStregsystem stregsystem)
 {
     this.User         = user;
     this._stregsystem = stregsystem;
 }