Ejemplo n.º 1
0
        public HistoryPage(RevisionInRepositoryModel.Factory revisionsInRepositoryModelFactory,
                           ChangesInRevisionView changesInRevisionView,
                           ChangeReportView changeReportView,
                           HistoryPageOptions options)
        {
            InitializeComponent();

            SuspendLayout();
            this.Padding = new Padding(20, 20, 20, 20);
            var lowerContainer = new SplitContainer();

            lowerContainer.Orientation = Orientation.Vertical;

//             var group = new GroupBox();
//             group.Text = "Changes in Revision";
//             group.Controls.Add(lowerContainer);
//             group.Dock = DockStyle.Fill;

            lowerContainer.Panel1.Controls.Add(changesInRevisionView);
            lowerContainer.Panel2.Controls.Add(changeReportView);

            var revisionListModel         = revisionsInRepositoryModelFactory(options.RevisionListOptions);
            var revisionsInRepositoryView = new RevisionsInRepositoryView(revisionListModel);

            revisionsInRepositoryView.RevisionSelectionChanged += HandleRevisionSelectionChanged;

            var mainContainer = new SplitContainer();

            mainContainer.Orientation = Orientation.Horizontal;

            mainContainer.Panel1.Controls.Add(revisionsInRepositoryView);
            mainContainer.Panel2.Controls.Add(lowerContainer);
            mainContainer.Dock = DockStyle.Fill;

            lowerContainer.Dock            = DockStyle.Fill;
            changesInRevisionView.Dock     = DockStyle.Fill;
            changeReportView.Dock          = DockStyle.Fill;
            revisionsInRepositoryView.Dock = DockStyle.Fill;

            Controls.Add(mainContainer);
            ResumeLayout();
        }
Ejemplo n.º 2
0
        public HistoryPage(RevisionInRepositoryModel.Factory revisionsInRepositoryModelFactory,
			ChangesInRevisionView changesInRevisionView,
			ChangeReportView changeReportView,
			HistoryPageOptions options)
        {
            InitializeComponent();

            SuspendLayout();
            this.Padding = new Padding(20, 20,20,20);
            var lowerContainer = new SplitContainer();
            lowerContainer.Orientation = Orientation.Vertical;

            //             var group = new GroupBox();
            //             group.Text = "Changes in Revision";
            //             group.Controls.Add(lowerContainer);
            //             group.Dock = DockStyle.Fill;

            lowerContainer.Panel1.Controls.Add(changesInRevisionView);
            lowerContainer.Panel2.Controls.Add(changeReportView);

            var revisionListModel = revisionsInRepositoryModelFactory(options.RevisionListOptions);
            var revisionsInRepositoryView = new RevisionsInRepositoryView(revisionListModel);
            revisionsInRepositoryView.RevisionSelectionChanged += HandleRevisionSelectionChanged;

            var mainContainer = new SplitContainer();
            mainContainer.Orientation = Orientation.Horizontal;

            mainContainer.Panel1.Controls.Add(revisionsInRepositoryView);
            mainContainer.Panel2.Controls.Add(lowerContainer);
            mainContainer.Dock = DockStyle.Fill;

            lowerContainer.Dock = DockStyle.Fill;
            changesInRevisionView.Dock = DockStyle.Fill;
            changeReportView.Dock = DockStyle.Fill;
            revisionsInRepositoryView.Dock = DockStyle.Fill;

            Controls.Add(mainContainer);
            ResumeLayout();
        }
Ejemplo n.º 3
0
		/// <summary>
		/// Open the given repo in the 'HistoryPage' control and its sub-system of controls.
		/// </summary>
		private void OpenLocalRepo()
		{
			if (string.IsNullOrWhiteSpace(_repoFolder))
				return;

			SuspendLayout();
			if (_historyPage != null)
			{
				_historyPage.RevisionSelectionChanged -= HistoryPageRevisionSelectionChanged;
				Controls.Remove(_historyPage);
				_historyPage.Dispose();
				_historyPage = null;
			}
			if (_chorusSystem != null)
			{
				_chorusSystem.Dispose();
				_chorusSystem = null;
			}

			var repoType = GetRepoType();
			ChorusSystem newChorusSystem;
			switch (repoType)
			{
				case RepoType.None:
					return;
				case RepoType.NotSupported:
					MessageBox.Show(this, "The selected repository is not supported.", "Unsupported Repository Type",
						MessageBoxButtons.OK, MessageBoxIcon.Warning);
					return;
				case RepoType.LIFT:
					newChorusSystem = Utilities.InitializeChorusSystem(_repoFolder, Environment.UserName, LiftFolder.AddLiftFileInfoToFolderConfiguration);
					break;
				case RepoType.FLEx:
					newChorusSystem = Utilities.InitializeChorusSystem(_repoFolder, Environment.UserName, FlexFolderSystem.ConfigureChorusProjectFolder);
					break;
				default:
					MessageBox.Show(this, "The selected repository is recognized, but not yet supported.", "Unsupported Repository Type",
						MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
					return;
			}
			_chorusSystem = newChorusSystem;

			// Set up some new columns in the main control of the history page.
			// This makes it easy for the user to know the selected revision's branch and simple rev id.
			var historyPageOptions = new HistoryPageOptions();
			var revisionListOptions = historyPageOptions.RevisionListOptions;
			// Not enabled in Chorus. revisionListOptions.ShowRevisionChoiceControls = true;
			var branchColumnDefinition = new HistoryColumnDefinition
			{
				ColumnLabel = "Branch",
				StringSupplier = BranchName
			};
			// This is available as a tool tip of the icon cell, but show it here, anyway.
			var revisionIdColumnDefinition = new HistoryColumnDefinition
			{
				ColumnLabel = "Revision Id",
				StringSupplier = RevisionId
			};
			revisionListOptions.ExtraColumns = new List<HistoryColumnDefinition>
				{
					branchColumnDefinition,
					revisionIdColumnDefinition
				};
			_historyPage = _chorusSystem.WinForms.CreateHistoryPage(historyPageOptions);
			_historyPage.RevisionSelectionChanged += HistoryPageRevisionSelectionChanged;
			Controls.Add(_historyPage);
			_historyPage.Dock = DockStyle.Fill;

			ResumeLayout(true);
			pullFileFromRevisionRangeToolStripMenuItem.Enabled = true;
		}
Ejemplo n.º 4
0
 /// <summary>
 /// Get a UI control which shows all the revisions in the repository, and
 /// lets the user select one to see what changed.
 /// </summary>
 public HistoryPage CreateHistoryPage(HistoryPageOptions options)
 {
     return _container.Resolve<HistoryPage.Factory>()(options);
 }