Example #1
0
        public ViewModel(IExrinContainer exrinContainer, IVisualState visualState, [CallerFilePath] string caller = nameof(ViewModel))
        {
            if (exrinContainer == null)
            {
                throw new ArgumentNullException(nameof(IExrinContainer));
            }

            _applicationInsights  = exrinContainer.ApplicationInsights;
            _displayService       = exrinContainer.DisplayService;
            _navigationService    = exrinContainer.NavigationService;
            _errorHandlingService = exrinContainer.ErrorHandlingService;

            VisualState = visualState;

            if (VisualState != null)
            {
                Task.Run(() => visualState.Init())
                .ContinueWith((task) =>
                {
                    if (task.Exception != null)
                    {
                        _applicationInsights.TrackException(task.Exception);
                    }
                });
            }

            Execution = new Execution()
            {
                HandleTimeout          = TimeoutHandle,
                NotifyOfActivity       = NotifyActivity,
                NotifyActivityFinished = NotifyActivityFinished,
                HandleResult           = HandleResult
            };
        }
Example #2
0
        public ViewModel(IExrinContainer exrinContainer, IVisualState visualState, [CallerFilePath] string caller = nameof(ViewModel))
        {

            if (exrinContainer == null)
                throw new ArgumentNullException(nameof(IExrinContainer));

            _applicationInsights = exrinContainer.ApplicationInsights;
            _displayService = exrinContainer.DisplayService;
            _navigationService = exrinContainer.NavigationService;
            _errorHandlingService = exrinContainer.ErrorHandlingService;

            VisualState = visualState;

            if (VisualState != null)
                Task.Run(() => visualState.Init())
                    .ContinueWith((task) =>
                    {
                        if (task.Exception != null)
                            _applicationInsights.TrackException(task.Exception);
                    });

            Execution = new Execution()
            {
                HandleTimeout = TimeoutHandle,
                NotifyOfActivity = NotifyActivity,
                NotifyActivityFinished = NotifyActivityFinished,
                HandleResult = HandleResult
            };

        }
Example #3
0
        public AuthModel(IExrinContainer exrinContainer, IAuthenticationService service)
            : base(exrinContainer, new AuthModelState())
        {
            _service = service;

            // TEMP: Just to demonstrate the login function if AuthenticationExpired is called
            //ThreadHelper.RunOnUIThread(() =>
            //{
            //    Device.StartTimer(TimeSpan.FromSeconds(10), () => { AuthenticationExpired(); return false; });
            //});
        }
Example #4
0
File: Model.cs Project: exrin/Exrin
        public Model(IExrinContainer exrinContainer, IModelState modelState)
        {
            if (exrinContainer == null)
                throw new ArgumentNullException(nameof(IExrinContainer));

            _displayService = exrinContainer.DisplayService;
            _errorHandlingService = exrinContainer.ErrorHandlingService;
            _applicationInsights = exrinContainer.ApplicationInsights;

            ModelState = modelState;
            Execution = new ModelExecution()
            {
                HandleTimeout = TimeoutHandle,
                HandleUnhandledException = HandleError
            };
        }
Example #5
0
        public ViewModel(IExrinContainer exrinContainer, IVisualState visualState, [CallerFilePath] string caller = "ViewModel")
        {
            if (exrinContainer == null)
            {
                throw new ArgumentNullException(nameof(IExrinContainer));
            }

            ApplicationInsights  = exrinContainer.ApplicationInsights;
            DisplayService       = exrinContainer.DisplayService;
            NavigationService    = exrinContainer.NavigationService;
            ErrorHandlingService = exrinContainer.ErrorHandlingService;
            _containerSet        = true;

            VisualState = visualState;

            SetExecution();
        }
Example #6
0
        public Model(IExrinContainer exrinContainer, IModelState modelState)
        {
            if (exrinContainer == null)
            {
                throw new ArgumentNullException(nameof(IExrinContainer));
            }

            _displayService       = exrinContainer.DisplayService;
            _errorHandlingService = exrinContainer.ErrorHandlingService;
            _applicationInsights  = exrinContainer.ApplicationInsights;

            ModelState = modelState;
            Execution  = new ModelExecution()
            {
                HandleTimeout            = TimeoutHandle,
                HandleUnhandledException = HandleError
            };
        }
Example #7
0
        void IComposition.SetContainer(IExrinContainer exrinContainer)
        {
            if (_containerSet)
            {
                return;
            }

            if (exrinContainer == null)
            {
                throw new ArgumentNullException(nameof(IExrinContainer));
            }

            ApplicationInsights  = exrinContainer.ApplicationInsights;
            DisplayService       = exrinContainer.DisplayService;
            ErrorHandlingService = exrinContainer.ErrorHandlingService;

            _containerSet = true;
        }
 public ServiceCentreViewModel(IAuthModel model, IServiceModel serviceModel, IExrinContainer exrinContainer) :
     base(model, exrinContainer, new ServiceCentreVisualState(serviceModel))
 {
 }
 public ServiceViewModel(IAuthModel authModel, IServiceModel model, IExrinContainer exrinContainer) :
     base(authModel, exrinContainer, new ServiceVisualState(model))
 {
     Model = model;
 }
Example #10
0
 public AboutViewModel(IExrinContainer exrinContainer, IMainModel model) : base(exrinContainer, new AboutVisualState(model))
 {
 }
 public FourthViewModel(IExrinContainer exrinContainer) : base(exrinContainer, null)
 {
 }
 public ControlViewModel(IAuthModel authModel, IControlModel model, IExrinContainer exrinContainer) :
     base(authModel, exrinContainer, new ControlVisualState(model))
 {
     Model = model;
 }
Example #13
0
 public BaseViewModel(IExrinContainer exrinContainer,
                      IVisualState visualState, string caller = nameof(BaseViewModel))
     : base(exrinContainer, visualState, caller)
 {
 }
Example #14
0
 public LoginViewModel(IAuthModel model, IExrinContainer exrinContainer) :
     base(exrinContainer, new LoginVisualState(model))
 {
     _model = model;
 }
Example #15
0
 public AboutViewModel(IAboutModel i_Model, IExrinContainer i_ExrinContainer)
     : base(i_ExrinContainer, new AboutVisualState(i_Model))
 {
     r_Model = i_Model;
 }
Example #16
0
 public MainViewModel(IMainModel i_Model, IExrinContainer i_ExrinContainer)
     : base(i_ExrinContainer, new MainVisualState(i_Model))
 {
     r_Model = i_Model;
 }
Example #17
0
 public FisrtModel(IExrinContainer exrinContainer) : base(exrinContainer, new FirstModelState())
 {
 }
Example #18
0
 public MainModel(IExrinContainer i_ExrinContainer, IPersonsRepository i_PersonsRepository, ILogger <MainModel> i_Logger)
     : base(i_ExrinContainer, new MainModelState())
 {
     r_PersonsRepository = i_PersonsRepository;
     r_Logger            = i_Logger;
 }
Example #19
0
 public PinViewModel(IAuthModel model, IExrinContainer exrinContainer) :
     base(model, exrinContainer, new PinVisualState(model))
 {
 }
Example #20
0
 public MainModel(IExrinContainer exrinContainer)
     : base(exrinContainer, new MainModelState())
 {
 }
Example #21
0
 public MainViewModel(IMainModel model, IExrinContainer exrinContainer)
     : base(exrinContainer, new MainVisualState(model))
 {
 }
 public BookingViewModel(IAuthModel model, IServiceModel serviceModel, IExrinContainer exrinContainer) :
     base(model, exrinContainer, new BookingVisualState(serviceModel))
 {
 }
Example #23
0
 public ThirdViewModel(IExrinContainer exrinContainer) : base(exrinContainer, null)
 {
 }
Example #24
0
 public BaseModel(IExrinContainer exrinContainer, IModelState modelState)
     : base(exrinContainer, modelState)
 {
 }
 public ClimateViewModel(IAuthModel authModel, IClimateModel model, IExrinContainer exrinContainer) :
     base(authModel, exrinContainer, new ClimateVisualState(model))
 {
     _model     = model;
     _container = exrinContainer;
 }
Example #26
0
 public LoginModel(IExrinContainer i_ExrinContainer)
     : base(i_ExrinContainer, new LoginModelState())
 {
 }
 public MainViewModel(IAuthModel authModel, IExrinContainer exrinContainer) :
     base(authModel, exrinContainer, null)
 {
 }
Example #28
0
 public AboutModel(IExrinContainer i_ExrinContainer, IPhoneDialer i_PhoneDialer, ILogger <AboutModel> i_Logger)
     : base(i_ExrinContainer, new AboutModelState())
 {
     r_PhoneDialer = i_PhoneDialer;
     r_Logger      = i_Logger;
 }
 public ServiceModel(IExrinContainer exrinContainer, IServiceService serviceService, IAuthModel authModel)
     : base(exrinContainer, new ServiceModelState())
 {
     _serviceService = serviceService;
 }
 public FirstViewModel(IExrinContainer exrinContainer, IFisrtModel model) : base(exrinContainer, new FirstVisualState(model))
 {
 }
 public SecondViewModel(IExrinContainer exrinContainer) : base(exrinContainer, null)
 {
 }
Example #32
0
 public AuthModel(IExrinContainer exrinContainer)
     : base(exrinContainer, new AuthModelState())
 {
 }