Esempio n. 1
0
        //------------------------------------------------------------------------------------------
        /// <summary>
        /// Initializer
        /// </summary>
        /// <param name="HostingShell">Host and provider of shell services</param>
        public static void Initialize(IShellProvider HostingShell)
        {
            General.ContractRequires(HostingShell != null);

            ShellHost = HostingShell;

            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            // VERY IMPORTANT!

            // Do not set AppTerminationConfirmation() as the CloseConfirmation action.
            //! ShellHost.CloseConfirmation = AppTerminationConfirmation;
            // Because this Lambda is entangled into serialized content (Still don't know from where)

            var Spheres = WorkSphereManagers;

            ShellHost.CloseConfirmation =
                () =>
            {
                foreach (var Sphere in Spheres)
                {
                    if (!Sphere.Discard())
                    {
                        return(false);
                    }
                }

                return(true);
            };
            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

            AppExec.LogRegistrationPolicy = AppExec.LOGREG_ALL;

            // NOT NEEDED
            // AppExec.LogMessage("ThinkComposer, by Instrumind. Copyright (C) Néstor Sánchez A., for Instrumind Software SpA..", "SYSTEM");
        }
Esempio n. 2
0
 public OrderListViewModel(ISessionRegister sessionRegister,
                           IShellProvider shellProvider,
                           IOrderArchive orderArchive,
                           IOptions <CurrencySettings> currencyOptions) : this()
 {
     _sessionRegister  = sessionRegister;
     _shellProvider    = shellProvider;
     _orderArchive     = orderArchive;
     _currencySettings = currencyOptions.Value;
 }
Esempio n. 3
0
        public SessionViewModel(IShellProvider shellProvider,
                                ISessionRegister sessionRegister,
                                IOptions <BalanceRange> balanceRangeOptions)
        {
            _shellProvider   = shellProvider;
            _sessionRegister = sessionRegister;
            _balanceRange    = balanceRangeOptions.Value;

            Balance = _balanceRange.Start;
        }
Esempio n. 4
0
 public OrderDetailsViewModel(ISessionRegister sessionRegister,
                              IShellProvider shellProvider,
                              IBarcodeProducer barcodeProducer,
                              IOptions <CurrencySettings> currencyOptions,
                              IOrderArchive orderArchive) : this()
 {
     _sessionRegister  = sessionRegister;
     _shellProvider    = shellProvider;
     _barcodeProducer  = barcodeProducer;
     _currencySettings = currencyOptions.Value;
     _orderArchive     = orderArchive;
 }
Esempio n. 5
0
 public OrderCreationViewModel(ISessionRegister sessionRegister,
                               IProductRack productRack,
                               IWindowManager windowManager,
                               IShoppingCart shoppingCart,
                               IShellProvider shellProvider,
                               IBarcodeProducer barcodeProducer,
                               IOptions <CurrencySettings> currencyOptions)
 {
     _sessionRegister  = sessionRegister;
     _productRack      = productRack;
     _windowManager    = windowManager;
     _shoppingCart     = shoppingCart;
     _shellProvider    = shellProvider;
     _barcodeProducer  = barcodeProducer;
     _currencySettings = currencyOptions.Value;
 }
Esempio n. 6
0
 public ShellViewModel(IShellProvider shellProvider)
 {
     _shellProvider = shellProvider;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ShellProvider">The provider of application shell services.</param>
 public WorkspaceManager(IShellProvider ShellProvider)
 {
     General.ContractRequiresNotNull(ShellProvider);
     this.ShellProvider = ShellProvider;
 }
Esempio n. 8
0
 public LoginViewModel(IUserStorage userStorage, ISessionRegister sessionRegister, IShellProvider shellProvider)
 {
     _userStorage     = userStorage;
     _sessionRegister = sessionRegister;
     _shellProvider   = shellProvider;
 }