public void showProperties()
        {
            CheckDisposed();
            var pic = (ICmPicture)Object;
            var app = (IApp)m_mediator.PropertyTable.GetValue("App");

            using (var dlg = new PicturePropertiesDialog(m_cache, pic, m_mediator.HelpTopicProvider, app, true))
            {
                if (dlg.Initialize())
                {
                    var stylesheet = FontHeightAdjuster.StyleSheetFromMediator(m_mediator);
                    dlg.UseMultiStringCaption(m_cache, WritingSystemServices.kwsVernAnals, stylesheet);
                    dlg.SetMultilingualCaptionValues(pic.Caption);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        UndoableUnitOfWorkHelper.Do(DetailControlsStrings.ksUndoUpdatePicture, DetailControlsStrings.ksRedoUpdatePicture, m_obj, () =>
                        {
                            string strLocalPictures = CmFolderTags.DefaultPictureFolder;
                            dlg.GetMultilingualCaptionValues(pic.Caption);
                            pic.UpdatePicture(dlg.CurrentFile, null, strLocalPictures, 0);
                        });
                        InstallPicture(m_picBox);
                        m_lastSize = new Size(0, 0);                         // forces OnSizeChanged to do something (we need to adjust to new aspect ratio).
                        OnSizeChanged(new EventArgs());
                    }
                }
            }
        }
Example #2
0
        public void showProperties()
        {
            CheckDisposed();
            CmPicture pic = (CmPicture)this.Object;

            using (PicturePropertiesDialog dlg = new PicturePropertiesDialog(m_cache, pic,
                                                                             FwApp.App, true))
            {
                if (dlg.Initialize())
                {
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        string strLocalPictures = SIL.FieldWorks.Common.RootSites.EditingHelper.DefaultPictureFolder;
                        pic.UpdatePicture(dlg.CurrentFile, dlg.Caption, strLocalPictures, pic.Cache.DefaultAnalWs);
                        InstallPicture(m_picBox);
                        m_lastSize = new Size(0, 0);                         // forces OnSizeChanged to do something (we need to adjust to new aspect ratio).
                        OnSizeChanged(new EventArgs());
                    }
                }
            }
        }