Exemplo n.º 1
0
        // private ICompanyInformationsService companyInformationsService;

        public GLListView()
        {
            isolateStorageProvider = new IsolatedStorageProvider();

            _gLsService = SmObjectFactory.Container.GetInstance <IGLsService>();
            //    companyInformationsService = SmObjectFactory.Container.GetInstance<ICompanyInformationsService>();
            InitializeComponent();
            Loaded += (s, ea) =>
            {
                _accessUtility = SmObjectFactory.Container.GetInstance <AccessUtility>();

                _viewModel         = DataContext as GLListViewModel;
                _viewModel.Failed += OnFailed;
                _viewModel.Error  += OnError;
                _viewModel.LoadGLs();
                GLDataForm.CommandProvider = new CustomCommandProvider();
                //
                //GLDataForm.AddNewItem();
                GLRadGridView.SelectedItem  = null;
                detailRadTabItem.IsSelected = true;

                //  isolateStorageProvider.LoadFromStorage();
            };
            Unloaded += (s, ea) =>
            {
                _viewModel.Failed -= OnFailed;
                _viewModel.Error  -= OnError;

                //  isolateStorageProvider.SaveToStorage();
            };
        }
        public ExchangeRateListView()
        {
            isolatedStorageProvider = new IsolatedStorageProvider();

            InitializeComponent();
            Loaded += (s, ea) =>
            {
                _viewModel = DataContext as ExchangeRateListViewModel;
                radGridView.SelectedItem = null;

                _viewModel.Deleting += OnDeleting;
                _viewModel.Deleted  += OnDeleted;
                _viewModel.Failed   += OnFailed;
                _viewModel.Error    += OnError;

                isolatedStorageProvider.LoadFromStorage();
            };
            Unloaded += (s, ea) =>
            {
                _viewModel.Deleting -= OnDeleting;
                _viewModel.Deleted  -= OnDeleted;
                _viewModel.Failed   -= OnFailed;
                _viewModel.Error    -= OnError;

                isolatedStorageProvider.SaveToStorage();
            };
        }
        public TLListView()
        {
            isolatedStorageProvider = new IsolatedStorageProvider();

            _tLsService = SmObjectFactory.Container.GetInstance <ITLsService>();

            InitializeComponent();
            Loaded += (s, ea) =>
            {
                _accessUtility = SmObjectFactory.Container.GetInstance <AccessUtility>();

                _viewModel        = DataContext as TLListViewModel;
                _viewModel.Error += OnError;
                _viewModel.LoadTLs();
                //  RaiseCanExecuteChanged();
                //NavStateFalse();
                //var addNewTLCommand = RadDataFormCommands.AddNew as RoutedUICommand;
                TLDataForm.CommandProvider = new CustomCommandProvider();

                //addNewTLCommand.Execute(null, TLDataForm);
                TLRadGridView.SelectedItem  = null;
                detailRadTabItem.IsSelected = true;
                //   DataContext = _viewModel;

                isolatedStorageProvider.LoadFromStorage();
            };
            Unloaded += (s, ea) =>
            {
                _viewModel.Error -= OnError;

                isolatedStorageProvider.SaveToStorage();
            };
        }
		private void OnSave(object sender, System.Windows.RoutedEventArgs e)
		{
			if (this.useIsolatedStorage.IsChecked == true)
			{
				IsolatedStorageProvider isoStorageProvider = new IsolatedStorageProvider();
				isoStorageProvider.SaveToStorage();
			}
			else
			{
				PersistenceManager manager = new PersistenceManager();
				this.stream = manager.Save(this.Content);
				this.EnsureLoadState();
			}
		}
		private void OnLoad(object sender, System.Windows.RoutedEventArgs e)
		{
			if (this.useIsolatedStorage.IsChecked == true)
			{
				IsolatedStorageProvider isoStorageProvider = new IsolatedStorageProvider();
				isoStorageProvider.LoadFromStorage();
			}
			else
			{
				this.stream.Position = 0L;
				PersistenceManager manager = new PersistenceManager();
				manager.Load(this.Content, this.stream);
				this.EnsureLoadState();
			}
		}
Exemplo n.º 6
0
        /// <inheritdoc />
        public void Register(IMutableDependencyResolver resolver, IReadonlyDependencyResolver readonlyDependencyResolver)
        {
            if (resolver is null)
            {
                throw new ArgumentNullException(nameof(resolver));
            }

#if XAMARIN_MOBILE
            var fs = new IsolatedStorageProvider();
#elif WINDOWS_UWP
            var fs = new WinRTFilesystemProvider();
#else
            var fs = new SimpleFilesystemProvider();
#endif
            resolver.Register(() => fs, typeof(IFilesystemProvider), null);

#if WINDOWS_UWP
            var enc = new WinRTEncryptionProvider();
#else
            var enc = new EncryptionProvider();
#endif
            resolver.Register(() => enc, typeof(IEncryptionProvider), null);

            var localCache  = new Lazy <IBlobCache>(() => new InMemoryBlobCache());
            var userAccount = new Lazy <IBlobCache>(() => new InMemoryBlobCache());
            var secure      = new Lazy <ISecureBlobCache>(() => new InMemoryBlobCache());

            resolver.Register(() => localCache.Value, typeof(IBlobCache), "LocalMachine");
            resolver.Register(() => userAccount.Value, typeof(IBlobCache), "UserAccount");
            resolver.Register(() => secure.Value, typeof(ISecureBlobCache), null);

            resolver.Register(() => new AkavacheHttpMixin(), typeof(IAkavacheHttpMixin), null);

#if COCOA
            BlobCache.ApplicationName = NSBundle.MainBundle.BundleIdentifier;
            resolver.Register(() => new MacFilesystemProvider(), typeof(IFilesystemProvider), null);
#endif

#if ANDROID
            var packageManager   = Application.Context.PackageManager;
            var packageName      = Application.Context.PackageName ?? "Unknown Package";
            var applicationLabel = packageManager?.GetApplicationInfo(packageName, 0)?.LoadLabel(packageManager);

            BlobCache.ApplicationName = applicationLabel ?? "Unknown";

            resolver.Register(() => new AndroidFilesystemProvider(), typeof(IFilesystemProvider), null);
#endif
        }
Exemplo n.º 7
0
        public CloseProfitLossAccountListView()
        {
            isolatedStorageProvider = new IsolatedStorageProvider();

            InitializeComponent();
            Loaded += (s, ea) =>
            {
                _accessUtility = SmObjectFactory.Container.GetInstance <AccessUtility>();

                _viewModel = DataContext as CloseProfitLossAccountListViewModel;
                RadGridView1.SelectedItem = null;
                _viewModel.Error         += OnError;
                _viewModel.Information   += OnInformation;

                isolatedStorageProvider.LoadFromStorage();
            };
            Unloaded += (s, ea) =>
            {
                _viewModel.Error       -= OnError;
                _viewModel.Information -= OnInformation;

                isolatedStorageProvider.SaveToStorage();
            };
        }