コード例 #1
0
 private void OnShowMetaDataEditorClicked(object sender, EventArgs e)
 {
     using (var dlg = new MetadataEditorDialog(new Metadata()))
     {
         dlg.ShowDialog();
     }
 }
コード例 #2
0
        public void ShowFullDialog()
        {
            var m = new Metadata();

            using (var dlg = new MetadataEditorDialog(m))
            {
                dlg.ShowDialog();
            }
        }
コード例 #3
0
        public void ShowFullDialogTwiceToCheckRoundTripping()
        {
            var m = new Metadata();

            m.License = CreativeCommonsLicense.FromToken("by");
            m.License.RightsStatement = "some restrictions";

            using (var dlg = new MetadataEditorDialog(m))
            {
                dlg.ShowDialog();
                m = dlg.Metadata;
            }

            using (var dlg = new MetadataEditorDialog(m))
            {
                dlg.ShowDialog();
            }
        }
コード例 #4
0
        private void OnEditMetadataLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            //http://jira.palaso.org/issues/browse/BL-282 hada null in here somewhere
            Guard.AgainstNull(_imageInfo, "_imageInfo");
            Guard.AgainstNull(_imageInfo.Metadata, "_imageInfo.Metadata");

            //it's not clear at the moment where the following belongs... but we want
            //to encourage Creative Commons Licensing, so if there is no license, we'll start
            //the following dialog out with a reasonable default.
            _imageInfo.Metadata.SetupReasonableLicenseDefaultBeforeEditing();

            using (var dlg = new MetadataEditorDialog(_imageInfo.Metadata))
            {
                if (DialogResult.OK == dlg.ShowDialog())
                {
                    Guard.AgainstNull(dlg.Metadata, " dlg.Metadata");
                    _imageInfo.Metadata = dlg.Metadata;
                    SetupMetaDataControls(_imageInfo.Metadata);
                    //Not doing this anymore, too risky. See https://jira.sil.org/browse/BL-1001 _imageInfo.SaveUpdatedMetadataIfItMakesSense();
                    _imageInfo.Metadata.StoreAsExemplar(Metadata.FileCategory.Image);
                }
            }
        }