View showing related words. The provided data access should contain the needed data. object hvoEntry has a sequence (ktagDomains) of domains. each domain has a string ktagName and a sequence (ktagWords) of words. each word has a ktagName.
Inheritance: SIL.FieldWorks.Common.RootSites.SimpleRootSite
Example #1
0
        public RelatedWords(LcmCache cache, IVwSelection sel, int hvoEntry, int[] domains, int[] lexrels,
                            IVwCacheDa cdaTemp, IVwStylesheet styleSheet, Mediator mediator, bool hideInsertButton)
        {
            m_cache      = cache;
            m_sel        = sel;
            m_hvoEntry   = hvoEntry;
            m_styleSheet = styleSheet;
            m_mediator   = mediator;
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            AccessibleName      = GetType().Name;
            m_btnInsert.Visible = !hideInsertButton;

            m_cdaTemp = cdaTemp;
            ISilDataAccess sda = m_cdaTemp as ISilDataAccess;

            sda.WritingSystemFactory = cache.WritingSystemFactory;

            SetupForEntry(domains, lexrels);

            var entry = cache.ServiceLocator.GetInstance <ILexEntryRepository>().GetObject(m_hvoEntry);

            m_view = new RelatedWordsView(m_cache, m_hvoEntry, entry.HeadWord,
                                          m_cdaTemp as ISilDataAccess,
                                          cache.ServiceLocator.WritingSystemManager.UserWs);
            m_view.Width     = this.Width - 20;
            m_view.Height    = m_btnClose.Top - 20;
            m_view.Top       = 10;
            m_view.Left      = 10;
            m_view.Anchor    = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            m_view.BackColor = Color.FromKnownColor(KnownColor.Window);
            m_view.EditingHelper.DefaultCursor = Cursors.Arrow;

            m_view.SelChanged += new EventHandler(m_view_SelChanged);
            this.Controls.Add(m_view);
        }
Example #2
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            System.Diagnostics.Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
                if (m_view != null && !Controls.Contains(m_view))
                {
                    m_view.Dispose();
                }
                if (m_detailView != null && !Controls.Contains(m_detailView))
                {
                    m_detailView.Dispose();
                }
            }
            m_sel        = null;
            m_cache      = null;
            m_view       = null;
            m_detailView = null;
            if (m_cdaTemp != null)
            {
                m_cdaTemp.ClearAllData();
                Marshal.ReleaseComObject(m_cdaTemp);
                m_cdaTemp = null;
            }

            base.Dispose(disposing);
        }
Example #3
0
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			System.Diagnostics.Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
			// Must not be run more than once.
			if (IsDisposed)
				return;

			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
				if (m_view != null && !Controls.Contains(m_view))
					m_view.Dispose();
				if (m_detailView != null && !Controls.Contains(m_detailView))
					m_detailView.Dispose();
			}
			m_sel = null;
			m_cache = null;
			m_view = null;
			m_detailView = null;
			if (m_cdaTemp != null)
			{
				m_cdaTemp.ClearAllData();
				Marshal.ReleaseComObject(m_cdaTemp);
				m_cdaTemp = null;
			}

			base.Dispose( disposing );
		}
Example #4
0
		public RelatedWords(FdoCache cache, IVwSelection sel, int hvoEntry, int[] domains, int[] lexrels,
			IVwCacheDa cdaTemp, IVwStylesheet styleSheet, Mediator mediator, bool hideInsertButton)
		{
			m_cache = cache;
			m_sel = sel;
			m_hvoEntry = hvoEntry;
			m_styleSheet = styleSheet;
			m_mediator = mediator;
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
			AccessibleName = GetType().Name;
			m_btnInsert.Visible = !hideInsertButton;

			m_cdaTemp = cdaTemp;
			ISilDataAccess sda = m_cdaTemp as ISilDataAccess;
			sda.WritingSystemFactory = cache.WritingSystemFactory;

			SetupForEntry(domains, lexrels);

			var entry = cache.ServiceLocator.GetInstance<ILexEntryRepository>().GetObject(m_hvoEntry);
			m_view = new RelatedWordsView(m_cache, m_hvoEntry, entry.HeadWord,
				m_cdaTemp as ISilDataAccess,
				cache.ServiceLocator.WritingSystemManager.UserWs);
			m_view.Width = this.Width - 20;
			m_view.Height = m_btnClose.Top - 20;
			m_view.Top = 10;
			m_view.Left = 10;
			m_view.Anchor = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
			m_view.BackColor = Color.FromKnownColor(KnownColor.Window);
			m_view.EditingHelper.DefaultCursor = Cursors.Arrow;

			m_view.SelChanged += new EventHandler(m_view_SelChanged);
			this.Controls.Add(m_view);
		}