コード例 #1
0
ファイル: ExportDialog.cs プロジェクト: sillsdev/WorldPad
		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;
		}
コード例 #2
0
ファイル: XmlDocView.cs プロジェクト: sillsdev/FieldWorks
		protected override void SetupDataContext()
		{
			TriggerMessageBoxIfAppropriate();
			using (new WaitCursor(this))
			{
				//m_flid = RecordClerk.GetFlidOfVectorFromName(m_vectorName, Cache, out m_owningObject);
				RecordClerk clerk = Clerk;
				clerk.ActivateUI(false);
				// Enhance JohnT: could use logic similar to RecordView.InitBase to load persisted list contents (filtered and sorted).
				if (clerk.RequestedLoadWhileSuppressed)
					clerk.UpdateList(false);
				m_fakeFlid = clerk.VirtualFlid;
				if (clerk.OwningObject != null)
				{
					m_hvoOwner = clerk.OwningObject.Hvo;
				}

				if (!clerk.SetCurrentFromRelatedClerk())
				{
					// 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(false);
				}

				clerk.IsDefaultSort = false;

				// Create the main view

				// Review JohnT: should it be m_configurationParameters or .FirstChild?
				IApp app = (IApp)m_mediator.PropertyTable.GetValue("App");
				m_mainView = new XmlSeqView(Cache, m_hvoOwner, m_fakeFlid, m_configurationParameters, Clerk.VirtualListPublisher, app,
					Publication);
				m_mainView.Init(m_mediator, m_configurationParameters); // Required call to xCore.Colleague.
				m_mainView.Dock = DockStyle.Fill;
				m_mainView.Cache = Cache;
				m_mainView.SelectionChangedEvent +=
					new FwSelectionChangedEventHandler(OnSelectionChanged);
				m_mainView.MouseClick += m_mainView_MouseClick;
				m_mainView.MouseMove += m_mainView_MouseMove;
				m_mainView.MouseLeave += m_mainView_MouseLeave;
				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?
			}
		}
コード例 #3
0
ファイル: XmlDocView.cs プロジェクト: sillsdev/WorldPad
		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?

		}
コード例 #4
0
ファイル: ExportDialog.cs プロジェクト: bbriggs/FieldWorks
        private void InitFromMainControl(object objCurrentControl)
        {
            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;
                m_sda = m_seqView.RootBox.DataAccess;
            }
            var cmo = m_mediator.PropertyTable.GetValue("ActiveClerkSelectedObject", null) as ICmObject;
            if (cmo != null)
            {
                int clidRoot;
                var newHvoRoot = SetRoot(cmo, out clidRoot);
                if (newHvoRoot > 0)
                {
                    m_hvoRootObj = newHvoRoot;
                    m_clidRootObj = clidRoot;
                }
            }

            XmlBrowseView browseView = FindXmlBrowseView(objCurrentControl as Control);
            if (browseView != null)
                m_sda = browseView.RootBox.DataAccess;
        }