Beispiel #1
0
        public ExportDialog(Mediator mediator)
        {
            m_mediator = mediator;
            m_cache    = (FdoCache)mediator.PropertyTable.GetValue("cache");

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            m_helpTopic = "khtpExportLexicon";

            this.helpProvider = new System.Windows.Forms.HelpProvider();
            this.helpProvider.HelpNamespace = FwApp.App.HelpFile;
            this.helpProvider.SetHelpKeyword(this, FwApp.App.GetHelpString(m_helpTopic, 0));
            this.helpProvider.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic);

            // Determine whether we can support "configured" type export by trying to obtain
            // the XmlVc for an XmlDocView.  Also obtain the database id and class id of the
            // root object.

            object objCurrentControl;

            objCurrentControl = m_mediator.PropertyTable.GetValue("currentContentControlObject", null);
            //XmlDocView docView = objCurrentControl as XmlDocView;
            //if (docView == null)
            //{
            //    XCore.MultiPane xmp = objCurrentControl as XCore.MultiPane;
            //    if (xmp != null)
            //        docView = xmp.FirstVisibleControl as XmlDocView;
            //}
            XmlDocView docView = FindXmlDocView(objCurrentControl as Control);

            if (docView != null)
            {
                m_seqView = docView.Controls[0] as XmlSeqView;
            }
            if (m_seqView != null)
            {
                m_xvc = m_seqView.Vc;
            }

            CmObject cmo = m_mediator.PropertyTable.GetValue("ActiveClerkSelectedObject", null)
                           as CmObject;

            if (cmo != null)
            {
                m_hvoRootObj = cmo.OwnerHVO;
                if (m_hvoRootObj != 0)
                {
                    m_clidRootObj = m_cache.GetClassOfObject(m_hvoRootObj);
                }
            }

            m_chkExportPictures.Checked = false;
            m_chkExportPictures.Visible = false;
            m_chkExportPictures.Enabled = false;
            m_fExportPicturesAndMedia   = false;
        }
Beispiel #2
0
        protected override void SetupDataContext()
        {
            TriggerMessageBoxIfAppropriate();
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

            //m_flid = RecordClerk.GetFlidOfVectorFromName(m_vectorName, Cache, out m_owningObject);
            RecordClerk clerk = Clerk;

            clerk.ActivateUI(false);
            m_fakeFlid = clerk.VirtualFlid;
            // retrieve persisted clerk index and set it.
            int idx = m_mediator.PropertyTable.GetIntProperty(clerk.PersistedIndexProperty, -1, PropertyTable.SettingsGroup.LocalSettings);

            if (idx >= 0 && !clerk.HasEmptyList)
            {
                int idxOld = clerk.CurrentIndex;
                try
                {
                    clerk.JumpToIndex(idx);
                }
                catch
                {
                    clerk.JumpToIndex(idxOld >= 0 ? idxOld : 0);
                }
            }
            clerk.SelectedRecordChanged();
            m_hvoOwner = clerk.OwningObject.Hvo;

            clerk.IsDefaultSort = false;

            // Create the main view

            // Review JohnT: should it be m_configurationParameters or .FirstChild?
            m_mainView = new XmlSeqView(m_hvoOwner, m_fakeFlid, m_configurationParameters);
            m_mainView.Init(m_mediator, m_configurationParameters);             // Required call to xCore.Colleague.
            m_mainView.Dock  = System.Windows.Forms.DockStyle.Fill;
            m_mainView.Cache = Cache;
            m_mainView.SelectionChangedEvent +=
                new FwSelectionChangedEventHandler(OnSelectionChanged);
            m_mainView.ShowRangeSelAfterLostFocus = true;               // This makes selections visible.
            // If the rootsite doesn't have a rootbox, we can't display the record!
            // Calling ShowRecord() from InitBase() sets the state to appear that we have
            // displayed (and scrolled), even though we haven't.  See LT-7588 for the effect.
            m_mainView.MakeRoot();
            SetupStylesheet();
            Controls.Add(m_mainView);
            if (Controls.Count == 2)
            {
                Controls.SetChildIndex(m_mainView, 1);
                m_mainView.BringToFront();
            }
            m_fullyInitialized = true;             // Review JohnT: was this really the crucial last step?
        }