コード例 #1
0
        public async Task Initialize()
        {
            this.accessList = new MockStorageItemAccessList();
            this.accessList.Add(
                new MockStorageFile {
                Name = "Some Metadata"
            },
                "Some Metadata"
                );

            this.accessList.Add(
                new MockStorageFile {
                Name = "Some more metadata"
            },
                "Some more metadata"
                );

            this.badFileToken = this.accessList.Add(
                null,
                "Bad"
                );

            this.accessList.Add(
                new MockStorageFile {
                Name = "A test file"
            },
                "A test file"
                );

            this.proxyFileName = "temp.txt";
            StorageFile proxy = await ApplicationData.Current.TemporaryFolder.CreateFileAsync(this.proxyFileName, CreationCollisionOption.OpenIfExists);

            this.accessList.Add(
                proxy.AsWrapper(),
                this.proxyFileName
                );

            this.proxyProvider = new FileProxyProvider(ApplicationData.Current.TemporaryFolder);
            IFileAccessService fileService = new MockFileService();

            this.promptingService = new MockUserPromptingService();
            this.viewModel        = new DashboardViewModel(
                this.accessList,
                new MockMotdProvider(),
                this.proxyProvider,
                new FileExportService(this.accessList, fileService),
                this.promptingService,
                this.promptingService,
                fileService
                );
        }
コード例 #2
0
        private void Application_Startup(object sender, StartupEventArgs args)
        {
            ITelnetClient telnetClient = new TelnetClient();

            model = new Model(telnetClient);
            model.Connect(ConfigurationManager.AppSettings.Get("DEFAULT_IP"), int.Parse(ConfigurationManager.AppSettings.Get("DEFAULT_PORT")));
            model.Start();

            dashboardViewModel = new DashboardViewModel(model);
            mapViewModel       = new MapViewModel(model);

            connectionVM = new ConnectionPanelVM(model);
            errorsVM     = new ErrorsPanelVM(model);
            controellsVM = new ControllersPanelVM(model);
        }
コード例 #3
0
        /// <summary>
        /// The constructor.
        /// </summary>
        /// <param name="viewModel"> The viewmodel associated with the dashboard. </param>
        public DashboardView(IDashboardViewModel viewModel)
        {
            InitializeComponent();

            DataContext = viewModel;
        }
コード例 #4
0
ファイル: DashboardView.xaml.cs プロジェクト: sfuqua/PassKeep
 public async void RequestOpenFileHandler(IDashboardViewModel sender, StoredFileDescriptor eventArgs)
 {
     await AttemptToLoadRecentDatabase(eventArgs);
 }
コード例 #5
0
        /// <summary>
        /// Initializes the specified parent.
        /// </summary>
        /// <param name="parent">The parent.</param>
        /// <param name="page">The page.</param>
        public void Initialize(IDashboardViewModel parent, DashboardPageEdit page)
        {
            _model = page;

            RecreateGadgets();
        }
コード例 #6
0
 public MainViewModel(IDashboardViewModel dashboard,
                      IExercisesViewModel exercises)
 {
     Items.Add(dashboard);
     Items.Add(exercises);
 }
コード例 #7
0
 public DashboardPage()
 {
     InitializeComponent();
     BindingContext          = _viewModel = App.Services.GetRequiredService <IDashboardViewModel>();
     _viewCoordinatesService = App.Services.GetRequiredService <IViewCoordinatesService>();
 }
コード例 #8
0
 public DashboardCenter(IDashboardViewModel viewModel) : base(viewModel)
 {
 }