Ejemplo n.º 1
0
        public bool OnPromoteReversalSubPOS(object cmd)
        {
            Slice slice = m_dataEntryForm.CurrentSlice;

            Debug.Assert(slice != null, "No slice was current");
            if (slice != null)
            {
                FdoCache       cache       = m_dataEntryForm.Cache;
                ICmPossibility sliceObj    = slice.Object as ICmPossibility;
                int            hvoNewOwner = cache.GetOwnerOfObject(sliceObj.OwnerHVO);
                switch (cache.GetClassOfObject(hvoNewOwner))
                {
                default:
                    throw new ArgumentException("Illegal class.");

                case PartOfSpeech.kclsidPartOfSpeech:
                {
                    IPartOfSpeech pos = PartOfSpeech.CreateFromDBObject(cache, hvoNewOwner);
                    pos.SubPossibilitiesOS.Append(sliceObj);
                    break;
                }

                case CmPossibilityList.kclsidCmPossibilityList:
                {
                    ICmPossibilityList posList = CmPossibilityList.CreateFromDBObject(cache, hvoNewOwner);
                    posList.PossibilitiesOS.Append(sliceObj);
                    break;
                }
                }
            }
            return(true);
        }