Beispiel #1
0
        private void ChangeSimulatedUser(string userName)
        {
            ClearOutInAnticipationOfSwitchingUsers();

            var dir = Path.Combine(_testDirectory, userName);

            if (!Directory.Exists(dir))
            {
                UnZipToDirectory(dir);
            }

            var shoppingListDir = Path.Combine(dir, "ShoppingList");

            //note: if you don't have a user name, you can just let chorus try to figure one out.
            //Also note that this is not the same name as that used for any given network repository credentials;
            //Rather, it's the name which will show in the history, and besides Notes that this user makes.
            _chorusSystem = new ChorusSystem(shoppingListDir);
            _chorusSystem.DisplaySettings = new ChorusNotesDisplaySettings()
            {
                WritingSystemForNoteLabel   = new TestWritingSystem("Algerian"),
                WritingSystemForNoteContent = new TestWritingSystem("Bradley Hand ITC")
            };

            _chorusSystem.Init(userName);


            _chorusSystem.Repository.SetKnownRepositoryAddresses(new RepositoryAddress[] { _serverRepository });

            _chorusSystem.ProjectFolderConfiguration.IncludePatterns.Add("*.xml");

            _dataEditor      = new DataEditor(_chorusSystem, Path.Combine(shoppingListDir, "shopping.xml"));
            _dataEditor.Dock = DockStyle.Fill;
            _frontPage.Controls.Add(_dataEditor);

            _notesBrowserControl      = _chorusSystem.WinForms.CreateNotesBrowser();
            _notesBrowserControl.Dock = DockStyle.Fill;
            _notesPage.Controls.Add(_notesBrowserControl);

            _historyControl      = _chorusSystem.WinForms.CreateHistoryPage();
            _historyControl.Dock = DockStyle.Fill;
            _historyPage.Controls.Add(_historyControl);
        }
Beispiel #2
0
        private void ChangeSimulatedUser(string userName)
        {
            ClearOutInAnticipationOfSwitchingUsers();

             var dir = Path.Combine(_testDirectory, userName);
             if (!Directory.Exists(dir))
             {
                 UnZipToDirectory(dir);
             }

            var shoppingListDir = Path.Combine(dir, "ShoppingList");

            //note: if you don't have a user name, you can just let chorus try to figure one out.
            //Also note that this is not the same name as that used for any given network repository credentials;
            //Rather, it's the name which will show in the history, and besides Notes that this user makes.
            _chorusSystem = new ChorusSystem(shoppingListDir);
            _chorusSystem.DisplaySettings = new ChorusNotesDisplaySettings()
            {
                WritingSystemForNoteLabel = new TestWritingSystem("Algerian"),
                WritingSystemForNoteContent = new TestWritingSystem("Bradley Hand ITC")
            };

            _chorusSystem.Init(userName);

            _chorusSystem.Repository.SetKnownRepositoryAddresses(new RepositoryAddress[] {_serverRepository});

            _chorusSystem.ProjectFolderConfiguration.IncludePatterns.Add("*.xml");

            _dataEditor = new DataEditor(_chorusSystem, Path.Combine(shoppingListDir, "shopping.xml"));
            _dataEditor.Dock = DockStyle.Fill;
            _frontPage.Controls.Add(_dataEditor);

            /*
             * Eberhard: I commented out the following lines because these components use the
             * Windows Forms WebBrowser. When we try to bring up the GeckoTestDlg this causes
             * a crash on Linux.
            _notesBrowserControl = _chorusSystem.WinForms.CreateNotesBrowser();
            _notesBrowserControl.Dock = DockStyle.Fill;
            _notesPage.Controls.Add(_notesBrowserControl);

            _historyControl = _chorusSystem.WinForms.CreateHistoryPage();
            _historyControl.Dock = DockStyle.Fill;
            _historyPage.Controls.Add(_historyControl);
            */
        }