예제 #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Insert a picture at the current selection of the active rootsite.
        /// </summary>
        /// <param name="initialPicture">The existing CmPicture being modified, if any</param>
        /// <param name="srcFilename">The path to the original filename (an internal copy will
        /// be made in this method)</param>
        /// <param name="captionTss">The caption</param>
        /// <param name="sFolder">The name of the CmFolder where picture should be stored</param>
        /// ------------------------------------------------------------------------------------
        public void UpdatePicture(CmPicture initialPicture, string srcFilename,
                                  ITsString captionTss, string sFolder)
        {
            CheckDisposed();

            initialPicture.UpdatePicture(srcFilename, captionTss, sFolder);
        }
예제 #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());
                    }
                }
            }
        }