/// ------------------------------------------------------------------------------------ public PersonInformant(ElementRepository <Person> peopleRepository, AutoCompleteValueGatherer autoCompleteValueGatherer) { _peopleRepository = peopleRepository; _peopleRepository.ElementIdChanged += HandlePersonNameChanged; _autoCompleteValueGatherer = autoCompleteValueGatherer; }
/// ------------------------------------------------------------------------------------ public ContributorsEditor(ComponentFile file, string imageKey, AutoCompleteValueGatherer autoCompleteProvider, PersonInformant personInformant) : base(file, null, imageKey) { InitializeComponent(); Name = "Contributors"; _model = new ContributorsListControlViewModel(autoCompleteProvider, SaveContributors); // ReSharper disable once UseObjectOrCollectionInitializer _contributorsControl = new ContributorsListControl(_model); _contributorsControl.Dock = DockStyle.Fill; _contributorsControl.ValidatingContributor += HandleValidatingContributor; InitializeGrid(); Controls.Add(_contributorsControl); file.AfterSave += file_AfterSave; SetComponentFile(file); if (personInformant != null) { personInformant.PersonUiIdChanged += HandlePersonsUiIdChanged; } }
/// ------------------------------------------------------------------------------------ public BasicFieldGridEditor(ComponentFile file, string imageKey, AutoCompleteValueGatherer autoCompleteProvider, FieldGatherer fieldGatherer) : base(file, null, imageKey) { InitializeComponent(); Name = "BasicFieldGridEditor"; InitializeGrid(autoCompleteProvider, fieldGatherer); }
/// ------------------------------------------------------------------------------------ public MediaComponentEditor(ComponentFile file, string tabText, string imageKey, AutoCompleteValueGatherer autoCompleteProvider, FieldGatherer fieldGatherer) : base(file, tabText, imageKey) { InitializeComponent(); InitializeGrid(autoCompleteProvider, fieldGatherer); _toolStrip.Renderer = new NoToolStripBorderRenderer(); _buttonPresets.DropDownItems.Add("HIDE"); }
/// ------------------------------------------------------------------------------------ protected virtual void InitializeGrid(AutoCompleteValueGatherer autoCompleteProvider, FieldGatherer fieldGatherer) { _gridViewModel = new FieldsValuesGridViewModel(_file, autoCompleteProvider, fieldGatherer, key => !"notes contributions".Contains(key)); _grid = new FieldsValuesGrid(_gridViewModel, "MediaComponentEditor._grid"); _grid.Dock = DockStyle.Fill; _tableLayout.Controls.Add(_grid, 0, 1); _grid.BringToFront(); }
/// ------------------------------------------------------------------------------------ public PersonBasicEditor(ComponentFile file, string imageKey, AutoCompleteValueGatherer autoCompleteProvider, FieldGatherer fieldGatherer, ImageFileType imgFileType) : base(file, null, imageKey) { Logger.WriteEvent("PersonBasicEditor constructor. file = {0}", file); InitializeComponent(); Name = "PersonEditor"; _imgFileType = imgFileType; _fatherButtons.AddRange(new[] { _pbPrimaryLangFather, _pbOtherLangFather0, _pbOtherLangFather1, _pbOtherLangFather2, _pbOtherLangFather3 }); _motherButtons.AddRange(new[] { _pbPrimaryLangMother, _pbOtherLangMother0, _pbOtherLangMother1, _pbOtherLangMother2, _pbOtherLangMother3 }); _pbPrimaryLangFather.Tag = _primaryLanguage; _pbPrimaryLangMother.Tag = _primaryLanguage; _pbOtherLangFather0.Tag = _otherLanguage0; _pbOtherLangMother0.Tag = _otherLanguage0; _pbOtherLangFather1.Tag = _otherLanguage1; _pbOtherLangMother1.Tag = _otherLanguage1; _pbOtherLangFather2.Tag = _otherLanguage2; _pbOtherLangMother2.Tag = _otherLanguage2; _pbOtherLangFather3.Tag = _otherLanguage3; _pbOtherLangMother3.Tag = _otherLanguage3; HandleStringsLocalized(); _binder.TranslateBoundValueBeingSaved += HandleBinderTranslateBoundValueBeingSaved; _binder.TranslateBoundValueBeingRetrieved += HandleBinderTranslateBoundValueBeingRetrieved; _binder.SetComponentFile(file); InitializeGrid(autoCompleteProvider, fieldGatherer); SetBindingHelper(_binder); _autoCompleteHelper.SetAutoCompleteProvider(autoCompleteProvider); _id.Enter += delegate { EnsureFirstRowLabelIsVisible(_labelFullName); }; _birthYear.Enter += delegate { EnsureFirstRowLabelIsVisible(_labelBirthYear); }; LoadAndValidatePersonInfo(); _binder.OnDataSaved += _binder_OnDataSaved; }
/// ------------------------------------------------------------------------------------ public ProjectContext(string projectSettingsPath, IContainer parentContainer) { var rootDirectoryPath = Path.GetDirectoryName(projectSettingsPath); BuildSubContainerForThisProject(rootDirectoryPath, parentContainer); Project = _scope.Resolve <Func <string, Project> >()(projectSettingsPath); SetContributorsListToSession(Project.SessionsFolder); var peopleRepoFactory = _scope.Resolve <ElementRepository <Person> .Factory>(); peopleRepoFactory(rootDirectoryPath, Person.kFolderName, _scope.Resolve <PersonFileType>()); var sessionRepoFactory = _scope.Resolve <ElementRepository <Session> .Factory>(); sessionRepoFactory(rootDirectoryPath, Session.kFolderName, _scope.Resolve <SessionFileType>()); // Create background operations _presetGatherer = _scope.Resolve <PresetGatherer>(); _autoCompleteValueGatherer = _scope.Resolve <AutoCompleteValueGatherer>(); _audioVideoDataGatherer = _scope.Resolve <AudioVideoDataGatherer>(); _fieldGatherer = _scope.Resolve <FieldGatherer>(); // Start background operations _presetGatherer.Start(); _autoCompleteValueGatherer.Start(); _audioVideoDataGatherer.Start(); _fieldGatherer.Start(); var view1 = _scope.Resolve <ProjectScreen>(); var view2 = _scope.Resolve <SessionsListScreen>(); var view3 = _scope.Resolve <PersonListScreen>(); var views = new ISayMoreView[] { view1, view2, view3 }; ProjectWindow = _scope.Resolve <ProjectWindow.Factory>()(projectSettingsPath, views); }
/// ------------------------------------------------------------------------------------ public ContributorsEditor(ComponentFile file, string imageKey, AutoCompleteValueGatherer autoCompleteProvider, PersonInformant personInformant) : base(file, null, imageKey) { InitializeComponent(); Name = "Contributors"; _model = new ContributorsListControlViewModel(autoCompleteProvider, SaveContributors); var dataGridView = new DataGridView(); dataGridView.Columns[dataGridView.Columns.Add("date", "date")].Visible = false; _model.ContributorsGridSettings = GridSettings.Create(dataGridView); // ReSharper disable once UseObjectOrCollectionInitializer _contributorsControl = new ContributorsListControl(_model); _contributorsControl.Dock = DockStyle.Fill; _contributorsControl.ValidatingContributor += HandleValidatingContributor; InitializeGrid(); // imageKey == "Contributor" when ContributorsEditor is lazy loaded for the session file type if (imageKey != null) { AddSessionControls(); } else { Controls.Add(_contributorsControl); } file.AfterSave += file_AfterSave; SetComponentFile(file); if (personInformant != null) { personInformant.PersonUiIdChanged += HandlePersonsUiIdChanged; } }
/// ------------------------------------------------------------------------------------ public SessionBasicEditor(ComponentFile file, string imageKey, AutoCompleteValueGatherer autoCompleteProvider, FieldGatherer fieldGatherer, PersonInformant personInformant) : base(file, null, imageKey) { Logger.WriteEvent("PersonBasicEditor constructor. file = {0}", file); InitializeComponent(); Name = "SessionEditor"; _personInformant = personInformant; _autoCompleteProvider = autoCompleteProvider; _autoCompleteProvider.NewDataAvailable += LoadGenreList; _binder.TranslateBoundValueBeingRetrieved += HandleBinderTranslateBoundValueBeingRetrieved; _binder.TranslateBoundValueBeingSaved += HandleBinderTranslateBoundValueBeingSaved; SetBindingHelper(_binder); _autoCompleteHelper.SetAutoCompleteProvider(autoCompleteProvider); _id.Enter += delegate { EnsureFirstRowLabelIsVisible(_labelId); }; _date.Enter += delegate { EnsureFirstRowLabelIsVisible(_labelDate); }; _genre.Enter += delegate { _genreFieldEntered = true; }; _genre.Leave += delegate { _genreFieldEntered = false; }; _genre.KeyPress += HandleGenreKeyPress; InitializeGrid(autoCompleteProvider, fieldGatherer); file.AfterSave += file_AfterSave; if (_personInformant != null) { _personInformant.PersonUiIdChanged += HandlePersonsUiIdChanged; } }
/// ------------------------------------------------------------------------------------ public VideoComponentEditor(ComponentFile file, string imageKey, AutoCompleteValueGatherer autoCompleteProvider, FieldGatherer fieldGatherer) : base(file, null, imageKey, autoCompleteProvider, fieldGatherer) { Name = "Video File Information"; }