LabeledMultiStringView displays one or more writing system alternatives of a string property. It simply edits that property.
Inheritance: SIL.FieldWorks.Common.RootSites.RootSiteControl
コード例 #1
0
		public MultiStringSlice(ICmObject obj, int flid, int ws, int wsOptional, bool forceIncludeEnglish, bool editable, bool spellCheck)
		{
			var view = new LabeledMultiStringView(obj.Hvo, flid, ws, wsOptional, forceIncludeEnglish, editable, spellCheck);
			Control = view;
#if _DEBUG
			Control.CheckForIllegalCrossThreadCalls = true;
#endif
			InternalInitialize();
			Reuse(obj, flid);
			view.InnerView.Display += view_Display;
			view.InnerView.RightMouseClickedEvent += HandleRightMouseClickedEvent;
			view.InnerView.LostFocus += view_LostFocus;
		}
コード例 #2
0
        public void InnerViewRefreshesWhenRefreshIsPending()
        {
            ILexEntry entry = null;
            int       flid  = 5035001;      // MoForm flid

            NonUndoableUnitOfWorkHelper.Do(Cache.ActionHandlerAccessor, () =>
            {
                entry = Cache.ServiceLocator.GetInstance <ILexEntryFactory>().Create();
                IMoStemAllomorph morph = Cache.ServiceLocator.GetInstance <IMoStemAllomorphFactory>().Create();
                entry.LexemeFormOA     = morph;
            });

            Form dummyForm = new Form();
            LabeledMultiStringView view = new LabeledMultiStringView(entry.LexemeFormOA.Hvo, flid, WritingSystemServices.kwsVern, false, true);

            dummyForm.Controls.Add(view);
            InnerLabeledMultiStringView innerView = view.InnerView;

            view.FinishInit();
            innerView.Cache = Cache;

            // Access the Handle of the innerView to construct the RootBox.
            var handle = innerView.Handle;

            Assert.IsFalse(innerView.Visible);
            Assert.IsFalse(innerView.RefreshPending);
            view.WritingSystemsToDisplay =
                WritingSystemServices.GetWritingSystemList(Cache, WritingSystemServices.kwsVern, false);
            view.RefreshDisplay();
            // The flag gets set because the view is not yet visible, so the display cannot refresh.
            Assert.IsTrue(innerView.RefreshPending);
            // Trigger the display to refresh by making the form visible.
            dummyForm.Visible = true;
            Assert.IsFalse(innerView.RefreshPending);
            view.Dispose();
            NonUndoableUnitOfWorkHelper.Do(Cache.ActionHandlerAccessor, () => entry.Delete());
        }
コード例 #3
0
		protected override void Dispose(bool disposing)
		{
			base.Dispose(disposing);

			if (disposing)
			{
				// Dispose managed resources here.
			}

			// Dispose unmanaged resources here, whether disposing is true or false.
			m_view = null;
		}
コード例 #4
0
		public LabeledMultiStringViewVc(int flid, ILgWritingSystem[] rgws, int wsUser, bool editable,
			LabeledMultiStringView view)
			: base(flid, rgws, wsUser, editable, view.WritingSystemFactory.GetWsFromStr("en"))
		{
			m_view = view;
			Debug.Assert(m_view != null);
		}