public ManagerController(IProductFacade productFacade, IEmployeeFacade employeeFacade, IManagerView view)
 {
     _productFacade  = productFacade;
     _employeeFacade = employeeFacade;
     _view           = view;
     _view.AddController(this);
 }
Example #2
0
        /// <summary>
        /// Attach the Manager model and ManagerView to this presenter.
        /// </summary>
        /// <param name="model">The model</param>
        /// <param name="view">The view to attach</param>
        /// <param name="presenter">The explorer presenter being used</param>
        public void Attach(object model, object view, ExplorerPresenter presenter)
        {
            manager                    = model as Manager;
            managerView                = view as IManagerView;
            explorerPresenter          = presenter;
            intellisense               = new IntellisensePresenter(managerView as ViewBase);
            intellisense.ItemSelected += OnIntellisenseItemSelected;

            scriptModel = manager.Children.FirstOrDefault();

            // See if manager script has a description attribute on it's class.
            if (scriptModel != null)
            {
                DescriptionAttribute descriptionName = ReflectionUtilities.GetAttribute(scriptModel.GetType(), typeof(DescriptionAttribute), false) as DescriptionAttribute;
                if (descriptionName != null)
                {
                    explorerPresenter.ShowDescriptionInRightHandPanel(descriptionName.ToString());
                }
            }

            propertyPresenter.Attach(scriptModel, managerView.GridView, presenter);
            managerView.Editor.Mode = EditorType.ManagerScript;
            managerView.Editor.Text = manager.Code;
            managerView.Editor.ContextItemsNeeded += OnNeedVariableNames;
            managerView.Editor.LeaveEditor        += OnEditorLeave;
            managerView.Editor.AddContextSeparator();
            managerView.Editor.AddContextActionWithAccel("Test compile", OnDoCompile, "Ctrl+T");
            managerView.Editor.AddContextActionWithAccel("Reformat", OnDoReformat, "Ctrl+R");
            managerView.Editor.Location            = manager.Location;
            managerView.TabIndex                   = manager.ActiveTabIndex;
            presenter.CommandHistory.ModelChanged += CommandHistory_ModelChanged;
        }
        public ManagerMainPresenter(Solution solution, IManagerView view)
        {
            if (solution == null || string.IsNullOrEmpty(solution.FullName))
            {
                return;
            }

            _solution     = solution;
            _view         = view;
            _solutionPath = Directory.GetParent(_solution.FullName).FullName;

            if (string.IsNullOrEmpty(_solutionPath))
            {
                return;
            }


            _model = ManagerModel.Instance;
            Initialize();

            Task t = Task.Factory.StartNew(new Action(() =>
            {
                DiscoverConfigurations();
            }));

            ProfileHelper ph = new ProfileHelper();

            _view.SavedConnections = ph.SavedConnections;
        }
Example #4
0
        public ManagerPresenter(IManagerView view, List<CreditRequest> allRequests)
        {
            _view = view;
            _allRequests = allRequests;

            _view.CreditRequestSelected += OnCreditRequestSelected;
            _view.ApproveClicked += OnApproveClicked;
            _view.RejectClicked += OnRejectClicked;
        }
Example #5
0
        /// <summary>
        /// Attach the Manager model and ManagerView to this presenter.
        /// </summary>
        /// <param name="model">The model</param>
        /// <param name="view">The view to attach</param>
        /// <param name="explorerPresenter">The explorer presenter being used</param>
        public void Attach(object model, object view, ExplorerPresenter explorerPresenter)
        {
            this.manager           = model as Manager;
            this.managerView       = view as IManagerView;
            this.explorerPresenter = explorerPresenter;

            this.propertyPresenter.Attach(this.manager.Script, this.managerView.GridView, this.explorerPresenter);

            this.managerView.Editor.Text = this.manager.Code;
            this.managerView.Editor.ContextItemsNeeded += this.OnNeedVariableNames;
            this.managerView.Editor.LeaveEditor        += this.OnEditorLeave;
        }
Example #6
0
        /// <summary>
        /// Attach the Manager model and ManagerView to this presenter.
        /// </summary>
        /// <param name="model">The model</param>
        /// <param name="view">The view to attach</param>
        /// <param name="explorerPresenter">The explorer presenter being used</param>
        public void Attach(object model, object view, ExplorerPresenter explorerPresenter)
        {
            this.manager = model as Manager;
            this.managerView = view as IManagerView;
            this.explorerPresenter = explorerPresenter;

            this.propertyPresenter.Attach(this.manager.Script, this.managerView.GridView, this.explorerPresenter);

            this.managerView.Editor.Text = this.manager.Code;
            this.managerView.Editor.ContextItemsNeeded += this.OnNeedVariableNames;
            this.managerView.Editor.LeaveEditor += this.OnEditorLeave;
        }
        /// <summary>
        /// constructor of the mangerial presenter
        /// </summary>
        /// <param name="view">the interface instance used for the UI</param>
        /// <param name="serviceRegistration">the instance of the registration service backend class</param>
        /// <param name="serviceManagerial">instance of the mangerial service backend class</param>
        /// <param name="staff">staff obect created by a login to the managerial UI</param>
        public ManagerViewPresenter(IManagerView view, RegistrationService serviceRegistration, ManagerialService serviceManagerial, Staff staff)
        {
            //assign the instances of each class from the parameter to the attributes of the presenter
            //allows the presenter to then interface between the backend and the frontend
            _view = view;
            _serviceRegistration = serviceRegistration;
            _serviceManagerial   = serviceManagerial;
            _staff = staff;

            //declare the methods that handle events raised by the interface instance
            _view.SignOut  += SignOut;
            _view.LoadData += LoadData;
        }
Example #8
0
        /// <summary>
        /// Attach the Manager model and ManagerView to this presenter.
        /// </summary>
        /// <param name="model">The model</param>
        /// <param name="view">The view to attach</param>
        /// <param name="presenter">The explorer presenter being used</param>
        public void Attach(object model, object view, ExplorerPresenter presenter)
        {
            manager                    = model as Manager;
            managerView                = view as IManagerView;
            explorerPresenter          = presenter;
            intellisense               = new IntellisensePresenter(managerView as ViewBase);
            intellisense.ItemSelected += OnIntellisenseItemSelected;

            scriptModel = manager.Children.FirstOrDefault();

            // See if manager script has a description attribute on it's class.
            if (scriptModel != null)
            {
                DescriptionAttribute descriptionName = ReflectionUtilities.GetAttribute(scriptModel.GetType(), typeof(DescriptionAttribute), false) as DescriptionAttribute;
                if (descriptionName != null)
                {
                    explorerPresenter.ShowDescriptionInRightHandPanel(descriptionName.ToString());
                }
            }

            if (Configuration.Settings.UseNewPropertyPresenter)
            {
                propertyPresenter = new SimplePropertyPresenter();
            }
            else
            {
                propertyPresenter = new PropertyPresenter();
            }
            try
            {
                propertyPresenter.Attach(scriptModel, managerView.PropertyEditor, presenter);
            }
            catch (Exception err)
            {
                explorerPresenter.MainPresenter.ShowError(err);
            }
            managerView.Editor.Mode = EditorType.ManagerScript;
            managerView.Editor.Text = manager.Code;
#if NETFRAMEWORK
            // In gtk3 builds, the gtksourceview completion infrastructure
            // handles all of the completion functionality internally.
            managerView.Editor.ContextItemsNeeded += OnNeedVariableNames;
#endif
            managerView.Editor.LeaveEditor += OnEditorLeave;
            managerView.Editor.AddContextSeparator();
            managerView.Editor.AddContextActionWithAccel("Test compile", OnDoCompile, "Ctrl+T");
            managerView.Editor.AddContextActionWithAccel("Reformat", OnDoReformat, "Ctrl+R");
            managerView.Editor.Location            = manager.Location;
            managerView.TabIndex                   = manager.ActiveTabIndex;
            presenter.CommandHistory.ModelChanged += CommandHistory_ModelChanged;
        }
Example #9
0
        /// <summary>
        /// Attach the Manager model and ManagerView to this presenter.
        /// </summary>
        /// <param name="model">The model</param>
        /// <param name="view">The view to attach</param>
        /// <param name="explorerPresenter">The explorer presenter being used</param>
        public void Attach(object model, object view, ExplorerPresenter explorerPresenter)
        {
            this.manager           = model as Manager;
            this.managerView       = view as IManagerView;
            this.explorerPresenter = explorerPresenter;

            this.propertyPresenter.Attach(this.manager.Script, this.managerView.GridView, this.explorerPresenter);

            this.managerView.Editor.Text = this.manager.Code;
            this.managerView.Editor.ContextItemsNeeded += this.OnNeedVariableNames;
            this.managerView.Editor.LeaveEditor        += this.OnEditorLeave;
            this.managerView.Editor.AddContextSeparator();
            this.managerView.Editor.AddContextActionWithAccel("Test compile", OnDoCompile, "Ctrl+T");
            this.managerView.Editor.AddContextActionWithAccel("Reformat", OnDoReformat, "Ctrl+R");
            this.explorerPresenter.CommandHistory.ModelChanged += this.CommandHistory_ModelChanged;
        }
Example #10
0
        public ManagerPresenter(IManagerView view, CommandExecutor commandExecutor)
        {
            if (view==null)
            {
                throw new ArgumentNullException("view");
            }

            if (commandExecutor == null)
            {
                throw new ArgumentNullException("commandExecutor");
            }

            this.View = view;

            BindCommands(commandExecutor);
        }
Example #11
0
        private void InitiateCSM()
        {
            if (string.IsNullOrEmpty(_lastSolution) || !_lastSolution.Equals(_applicationObject.Solution.FullName))
            {
                _lastSolution = _applicationObject.Solution.FullName;

                if (_presenter != null)
                {
                    _presenter.Dispose();
                }

                _mainForm  = new ManagerMain();
                _presenter = new ManagerMainPresenter(_applicationObject.Solution, _mainForm);
            }

            _mainForm.Show();
        }
Example #12
0
        /// <summary>
        /// Attach the Manager model and ManagerView to this presenter.
        /// </summary>
        /// <param name="model">The model</param>
        /// <param name="view">The view to attach</param>
        /// <param name="explorerPresenter">The explorer presenter being used</param>
        public void Attach(object model, object view, ExplorerPresenter explorerPresenter)
        {
            this.manager               = model as Manager;
            this.managerView           = view as IManagerView;
            this.explorerPresenter     = explorerPresenter;
            this.intellisense          = new IntellisensePresenter(managerView as ViewBase);
            intellisense.ItemSelected += (sender, e) => managerView.Editor.InsertCompletionOption(e.ItemSelected, e.TriggerWord);

            this.propertyPresenter.Attach(this.manager.Script, this.managerView.GridView, this.explorerPresenter);
            this.managerView.Editor.ScriptMode          = true;
            this.managerView.Editor.Text                = this.manager.Code;
            this.managerView.Editor.ContextItemsNeeded += this.OnNeedVariableNames;
            this.managerView.Editor.LeaveEditor        += this.OnEditorLeave;
            this.managerView.Editor.AddContextSeparator();
            this.managerView.Editor.AddContextActionWithAccel("Test compile", this.OnDoCompile, "Ctrl+T");
            this.managerView.Editor.AddContextActionWithAccel("Reformat", this.OnDoReformat, "Ctrl+R");
            this.managerView.Editor.Location = manager.Location;
            this.managerView.TabIndex        = manager.ActiveTabIndex;
            this.explorerPresenter.CommandHistory.ModelChanged += this.CommandHistory_ModelChanged;
        }
Example #13
0
        /// <summary>
        /// Attach the Manager model and ManagerView to this presenter.
        /// </summary>
        /// <param name="model">The model</param>
        /// <param name="view">The view to attach</param>
        /// <param name="presenter">The explorer presenter being used</param>
        public void Attach(object model, object view, ExplorerPresenter presenter)
        {
            manager                    = model as Manager;
            managerView                = view as IManagerView;
            explorerPresenter          = presenter;
            intellisense               = new IntellisensePresenter(managerView as ViewBase);
            intellisense.ItemSelected += OnIntellisenseItemSelected;

            scriptModel = manager.Children.FirstOrDefault();
            propertyPresenter.Attach(scriptModel, managerView.GridView, presenter);
            managerView.Editor.Mode = EditorType.ManagerScript;
            managerView.Editor.Text = manager.Code;
            managerView.Editor.ContextItemsNeeded += OnNeedVariableNames;
            managerView.Editor.LeaveEditor        += OnEditorLeave;
            managerView.Editor.AddContextSeparator();
            managerView.Editor.AddContextActionWithAccel("Test compile", OnDoCompile, "Ctrl+T");
            managerView.Editor.AddContextActionWithAccel("Reformat", OnDoReformat, "Ctrl+R");
            managerView.Editor.Location            = manager.Location;
            managerView.TabIndex                   = manager.ActiveTabIndex;
            presenter.CommandHistory.ModelChanged += CommandHistory_ModelChanged;
        }
        public ManagerMainPresenter(Solution solution, IManagerView view)
        {
            if (solution == null || string.IsNullOrEmpty(solution.FullName)) { return; }

            _solution = solution;
            _view = view;
            _solutionPath = Directory.GetParent(_solution.FullName).FullName;

            if (string.IsNullOrEmpty(_solutionPath)) { return; }

            _model = ManagerModel.Instance;
            Initialize();

            Task t = Task.Factory.StartNew(new Action(() =>
            {
                DiscoverConfigurations();
            }));

            ProfileHelper ph = new ProfileHelper();
            _view.SavedConnections = ph.SavedConnections;
        }
Example #15
0
 public ManagerPresenter(IManagerView view)
 {
     _view = view;
 }
Example #16
0
 public ManagerViewPresenter(IManagerView managerView, IResourceService service)
 {
     _managerView     = managerView;
     _resourceService = service;
     Initialize();
 }
        private void InitiateCSM()
        {
            if (string.IsNullOrEmpty(_lastSolution) || !_lastSolution.Equals(_applicationObject.Solution.FullName))
            {
                _lastSolution = _applicationObject.Solution.FullName;

                if (_presenter != null) { _presenter.Dispose(); }

                _mainForm = new ManagerMain();
                _presenter = new ManagerMainPresenter(_applicationObject.Solution, _mainForm);
            }

            _mainForm.Show();
        }