public CommitDialog(Repository repository) { Verify.Argument.IsNotNull(repository, nameof(repository)); Repository = repository; InitializeComponent(); Localize(); var inputs = new IUserInputSource[] { Message = new TextBoxInputSource(_txtMessage), Amend = new CheckBoxInputSource(_chkAmend), StagedItems = new ControlInputSource(_lstStaged), }; ErrorNotifier = new UserInputErrorNotifier(NotificationService, inputs); for (int i = 0; i < _lstStaged.Columns.Count; ++i) { var col = _lstStaged.Columns[i]; col.IsVisible = col.Id == (int)ColumnId.Name; } _lstStaged.Columns[0].SizeMode = ColumnSizeMode.Auto; _lstStaged.Style = GitterApplication.DefaultStyle; _lstStaged.SetTree(repository.Status.StagedRoot, TreeListBoxMode.ShowFullTree); _lstStaged.ExpandAll(); _chkAmend.Enabled = !repository.Head.IsEmpty; GitterApplication.FontManager.InputFont.Apply(_txtMessage); if (SpellingService.Enabled) { _speller = new TextBoxSpellChecker(_txtMessage, true); } _txtMessage.Text = repository.Status.LoadCommitMessage(); _txtMessage.Height = _chkAmend.Top - _txtMessage.Top - 2; _controller = new CommitController(repository) { View = this }; }
public CommitDialog(Repository repository) { Verify.Argument.IsNotNull(repository, "repository"); _repository = repository; InitializeComponent(); Localize(); var inputs = new IUserInputSource[] { _messageInput = new TextBoxInputSource(_txtMessage), _amendInput = new CheckBoxInputSource(_chkAmend), _stagedItemsInput = new ControlInputSource(_lstStaged), }; _errorNotifier = new UserInputErrorNotifier(NotificationService, inputs); for(int i = 0; i < _lstStaged.Columns.Count; ++i) { var col = _lstStaged.Columns[i]; col.IsVisible = col.Id == (int)ColumnId.Name; } _lstStaged.Columns[0].SizeMode = ColumnSizeMode.Auto; _lstStaged.Style = GitterApplication.DefaultStyle; _lstStaged.SetTree(repository.Status.StagedRoot, TreeListBoxMode.ShowFullTree); _lstStaged.ExpandAll(); _chkAmend.Enabled = !repository.Head.IsEmpty; GitterApplication.FontManager.InputFont.Apply(_txtMessage); if(SpellingService.Enabled) { _speller = new TextBoxSpellChecker(_txtMessage, true); } _txtMessage.Text = repository.Status.LoadCommitMessage(); _txtMessage.Height = _chkAmend.Top - _txtMessage.Top - 2; _controller = new CommitController(repository) { View = this }; }