示例#1
0
 private void m_bvList_SelectionChanged(object sender, FwObjectSelectionEventArgs e)
 {
     if (SelectionChanged != null)
     {
         SelectionChanged(this, e);
     }
 }
示例#2
0
 protected override void HandleMatchingSelectionChanged(FwObjectSelectionEventArgs e)
 {
     base.HandleMatchingSelectionChanged(e);
     if (e != null)
     {
         (Clerk as MatchingItemsRecordClerk).SetListIndex(e.Index);                      // keep the list index in sync.
     }
 }
示例#3
0
        /// <summary>
        ///	invoked when our BrowseView selection changes
        /// </summary>
        /// <param name="sender">unused</param>
        /// <param name="e">the event arguments</param>
        virtual public void OnSelectionChanged(object sender, FwObjectSelectionEventArgs e)
        {
            CheckDisposed();

            if (!m_suppressRecordNavigation || !m_suppressShowRecord)
            {
                Clerk.ViewChangedSelectedRecord(e);
                SetInfoBarText();
            }
        }
示例#4
0
 /// <summary>
 /// This comes from a double click on a row in the browse view.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void m_bvMatches_SelectionMade(object sender, FwObjectSelectionEventArgs e)
 {
     m_selEntryID  = e.Hvo;
     btnOK.Enabled = m_selEntryID > 0;
     if (btnOK.Enabled)
     {
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
 }
示例#5
0
        private void m_matchingObjects_SelectionChanged(object sender, FwObjectSelectionEventArgs e)
        {
            if (m_skipCheck)
            {
                return;
            }

            m_selObject = m_cache.ServiceLocator.GetObject(e.Hvo);

            HandleMatchingSelectionChanged(e);
        }
示例#6
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Process mouse double click
 /// </summary>
 /// <param name="e"></param>
 /// ------------------------------------------------------------------------------------
 protected override void OnDoubleClick(EventArgs e)
 {
     if (!ReadOnlySelect)
     {
         base.OnDoubleClick(e);
     }
     else if (SelectedIndex != -1)
     {
         FwObjectSelectionEventArgs e1 =
             new FwObjectSelectionEventArgs(SelectedObject, SelectedIndex);
         m_bv.OnDoubleClick(e1);
     }
 }
示例#7
0
        /// <summary>
        ///	invoked when our XmlDocView selection changes.
        /// </summary>
        /// <param name="sender">unused</param>
        /// <param name="e">the event arguments</param>
        public void OnSelectionChanged(object sender, FwObjectSelectionEventArgs e)
        {
            CheckDisposed();

            // paranoid sanity check.
            Debug.Assert(e.Hvo != 0);
            if (e.Hvo == 0)
            {
                return;
            }
            Clerk.ViewChangedSelectedRecord(e);
            // Change it if it's actually changed.
            SetInfoBarText();
        }
        /// <summary>
        /// This comes from a double click on a row in the browse view.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void m_bvMatches_SelectionMade(object sender, FwObjectSelectionEventArgs e)
        {
            m_selEntryID = e.Hvo;
            RaiseSelectionChanged();
            Form frm = FindForm();

            if (frm is BaseGoDlg && (frm as BaseGoDlg).IsOkEnabled)
            {
                frm.DialogResult = DialogResult.OK;
            }
            else if (frm is InsertEntryDlg)
            {
                frm.DialogResult = DialogResult.Yes;
            }
        }
示例#9
0
 void BrowseViewer_SelectionChanged(object sender, FwObjectSelectionEventArgs e)
 {
     SetRecordStatus();
 }
示例#10
0
 /// <summary>
 /// This comes from a single click on a row in the browse view.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void m_bvMatches_SelectionChanged(object sender, FwObjectSelectionEventArgs e)
 {
     m_selEntryID = e.Hvo;
     (Clerk as MatchingItemsRecordClerk).SetListIndex(e.Index);                  // keep the list index in sync.
     RaiseSelectionChanged();
 }
示例#11
0
 protected virtual void HandleMatchingSelectionChanged(FwObjectSelectionEventArgs e)
 {
     HandleMatchingSelectionChanged();
 }
示例#12
0
		void BrowseViewer_SelectionChanged(object sender, FwObjectSelectionEventArgs e)
		{
			SetRecordStatus();
		}
示例#13
0
		protected virtual void HandleMatchingSelectionChanged(FwObjectSelectionEventArgs e)
		{
			HandleMatchingSelectionChanged();
		}
示例#14
0
 private void m_matchingObjectsBrowser_SelectionMade(object sender, FwObjectSelectionEventArgs e)
 {
     DialogResult = DialogResult.OK;
     Close();
 }
示例#15
0
 public override void OnSelectionChanged(object sender, FwObjectSelectionEventArgs e)
 {
     PreviewCurrentSelection(e.Hvo);
     base.OnSelectionChanged(sender, e);
 }
示例#16
0
        /// <summary>
        /// Handle interaction between to and from POS for a derivational affix MSA.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <remarks>
        /// If the new value is zero, then set the other one's value to zero, as well.
        /// If the other one's value is zero, then set it to the new value.
        /// In all cases, set this one's value to the new value.
        /// </remarks>
        protected void OnReferenceChanged(object sender, FwObjectSelectionEventArgs e)
        {
            Debug.Assert(sender is AtomicReferenceLauncher);
            var source = (AtomicReferenceLauncher)sender;

            Debug.Assert(Control == source);
            Debug.Assert(Object is IMoDerivAffMsa);

            AtomicReferenceLauncher otherControl = null;
            int  idxSender = ContainingDataTree.Slices.IndexOf(this);
            int  otherFlid;
            bool myIsFromPOS = true;

            if (m_flid == MoDerivAffMsaTags.kflidFromPartOfSpeech)
            {
                otherFlid = MoDerivAffMsaTags.kflidToPartOfSpeech;
            }
            else
            {
                otherFlid   = MoDerivAffMsaTags.kflidFromPartOfSpeech;
                myIsFromPOS = false;
            }
            int   otherHvo   = 0;
            Slice otherSlice = null;
            int   idxOther;

            if (idxSender > 0)
            {
                idxOther = idxSender - 1;
                while (otherSlice == null || (otherSlice.Indent == Indent && idxOther > 0 && otherSlice.Object == Object))
                {
                    otherSlice = ContainingDataTree.Slices[idxOther--];
                    if (otherSlice is AtomicReferenceSlice && (otherSlice as AtomicReferenceSlice).Flid == otherFlid)
                    {
                        break;
                    }
                }
                if (otherSlice != null && otherSlice is AtomicReferenceSlice)
                {
                    otherHvo = GetOtherHvo(otherSlice as AtomicReferenceSlice, otherFlid, myIsFromPOS, out otherControl);
                }
                else
                {
                    otherSlice = null;
                }
            }
            if (otherControl == null && idxSender < ContainingDataTree.Slices.Count)
            {
                idxOther = idxSender + 1;
                while (otherSlice == null ||
                       (otherSlice.Indent == Indent && idxOther > 0 && otherSlice.Object == Object))
                {
                    otherSlice = ContainingDataTree.Slices[idxOther++];
                    if (otherSlice is AtomicReferenceSlice && (otherSlice as AtomicReferenceSlice).Flid == otherFlid)
                    {
                        break;
                    }
                }
                if (otherSlice != null && otherSlice is AtomicReferenceSlice)
                {
                    otherHvo = GetOtherHvo(otherSlice as AtomicReferenceSlice, otherFlid, myIsFromPOS, out otherControl);
                }
                else
                {
                    otherSlice = null;
                }
            }

            var msa = Object as IMoDerivAffMsa;

            if (e.Hvo == 0 && otherHvo != 0)
            {
                if (otherControl != null)
                {
                    if (m_flid == MoDerivAffMsaTags.kflidFromPartOfSpeech)
                    {
                        msa.ToPartOfSpeechRA = null;
                    }
                    else
                    {
                        msa.FromPartOfSpeechRA = null;
                    }
                }
            }
            else if (otherHvo == 0 && e.Hvo > 0)
            {
                if (otherControl == null)
                {
                    // The other one is not available (filtered out?),
                    // so set it directly using the msa.
                    if (m_flid == MoDerivAffMsaTags.kflidFromPartOfSpeech)
                    {
                        msa.ToPartOfSpeechRA = m_cache.ServiceLocator.GetInstance <IPartOfSpeechRepository>().GetObject(e.Hvo);
                    }
                    else
                    {
                        msa.FromPartOfSpeechRA = m_cache.ServiceLocator.GetInstance <IPartOfSpeechRepository>().GetObject(e.Hvo);
                    }
                }
                else
                {
                    otherControl.AddItem(m_cache.ServiceLocator.GetObject(e.Hvo));                     // Set the other guy to this value.
                }
            }
        }
示例#17
0
        /// <summary>
        /// Handle interaction between POS and Slot ptoeprties for a inflectional affix MSA.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <remarks>
        /// If the new value is zero, then set the Slot prop to zero.
        /// If the new value is not zero, then make sure the Slot prop is valid.
        ///		If the current slot is not legal for the new POS value, then set it to zero.
        ///		Otherwise leave the slot value alone.
        /// </remarks>
        protected void OnReferenceChanged(object sender, FwObjectSelectionEventArgs e)
        {
            Debug.Assert(sender is AtomicReferenceLauncher);
            var source = (AtomicReferenceLauncher)sender;

            Debug.Assert(Control == source);
            Debug.Assert(Object is IMoInflAffMsa);

            int idxSender = ContainingDataTree.Slices.IndexOf(this);

            int   otherFlid  = MoInflAffMsaTags.kflidSlots;
            Slice otherSlice = null;
            int   idxOther;

            // Try to get the Slots slice.
            // Check for slices before this one.
            if (idxSender > 0)
            {
                idxOther = idxSender - 1;
                while (idxOther >= 0 &&
                       (otherSlice == null ||
                        (otherSlice.Indent == Indent && idxOther > 0 && otherSlice.Object == Object)))
                {
                    otherSlice = ContainingDataTree.Slices[idxOther--];
                    if (otherSlice is ReferenceVectorSlice && (otherSlice as ReferenceVectorSlice).Flid == otherFlid)
                    {
                        break;
                    }
                    otherSlice = null;
                }
            }

            // Check for following slices, if we didn't get one earlier.
            if (otherSlice == null && idxSender < ContainingDataTree.Slices.Count)
            {
                idxOther = idxSender + 1;
                while (idxOther < ContainingDataTree.Slices.Count &&
                       (otherSlice == null ||
                        (otherSlice.Indent == Indent && idxOther > 0 && otherSlice.Object == Object)))
                {
                    otherSlice = ContainingDataTree.Slices[idxOther++];
                    if (otherSlice is ReferenceVectorSlice && (otherSlice as ReferenceVectorSlice).Flid == otherFlid)
                    {
                        break;
                    }
                    otherSlice = null;
                }
            }

            VectorReferenceLauncher otherControl = null;

            if (otherSlice != null)
            {
                Debug.Assert(otherSlice.Flid == otherFlid);
                Debug.Assert(otherSlice.Object == Object);
                otherControl = otherSlice.Control as VectorReferenceLauncher;
                Debug.Assert(otherControl != null);
            }

            var msa = Object as IMoInflAffMsa;
            IMoInflAffixSlot slot = null;

            if (msa.SlotsRC.Count > 0)
            {
                slot = msa.SlotsRC.First();
            }
            if (e.Hvo == 0 || slot != null)
            {
                var  pos       = msa.PartOfSpeechRA;
                var  slots     = pos != null ? pos.AllAffixSlots : Enumerable.Empty <IMoInflAffixSlot>();
                bool clearSlot = e.Hvo == 0 || !slots.Contains(slot);
                if (clearSlot)
                {
                    if (otherControl == null)
                    {
                        msa.SlotsRC.Clear();                         // The slot slice is not showing, so directly set the object's Slot property.
                    }
                    else
                    {
                        otherControl.AddItem(null);                         // Reset it using the other slice, so it gets refreshed.
                    }
                }
            }
        }
示例#18
0
 /// <summary>
 /// This comes from a double click on a row in the browse view.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void m_bvMatches_SelectionMade(object sender, FwObjectSelectionEventArgs e)
 {
     m_selObject = m_cache.ServiceLocator.GetObject(e.Hvo);
     FireSelectionMade();
 }
示例#19
0
		protected void OnValueChanged(object sender, FwObjectSelectionEventArgs args)
		{
			if (ValueChanged != null)
				ValueChanged(sender, args);
		}
示例#20
0
		/// <summary>
		/// The selected item may have changed in the "Change To" comboBox under
		/// the List Choice tab therefore
		/// enable or disable the Apply and Preview buttons based on the selection.
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e">in some situations an item selected in the combo box has no hvo so the index of the item in the list is used.</param>
		void besc_ValueChanged(object sender, FwObjectSelectionEventArgs e)
		{

			if (e.Hvo != 0 || e.Index >= 0)
			{
				m_ApplyButton.Enabled = true;
				m_previewButton.Enabled = true;
				return;
			}
			else
			{
				m_ApplyButton.Enabled = false;
				m_previewButton.Enabled = false;
				return;
			}
		}
示例#21
0
		/// <summary>
		/// This comes from a double click on a row in the browse view.
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		void m_bvMatches_SelectionMade(object sender, FwObjectSelectionEventArgs e)
		{
			m_selEntryID = e.Hvo;
			btnOK.Enabled = m_selEntryID > 0;
			if (btnOK.Enabled)
			{
				this.DialogResult = DialogResult.OK;
				this.Close();
			}
		}
示例#22
0
		protected override void HandleMatchingSelectionChanged(FwObjectSelectionEventArgs e)
		{
			base.HandleMatchingSelectionChanged(e);
			if (e != null)
				(Clerk as MatchingItemsRecordClerk).SetListIndex(e.Index);	// keep the list index in sync.
		}
		void m_bvList_SelectionChanged(object sender, FwObjectSelectionEventArgs e)
		{
			PopulateValuesCombo();
			PositionValuesCombo();
		}
示例#24
0
 void m_bvList_SelectionChanged(object sender, FwObjectSelectionEventArgs e)
 {
     PopulateValuesCombo();
     PositionValuesCombo();
 }
示例#25
0
		public override void OnSelectionChanged(object sender, FwObjectSelectionEventArgs e)
		{
			PreviewCurrentSelection(e.Hvo);
			base.OnSelectionChanged(sender, e);
		}