当前位置: 首页>>代码示例>>C#>>正文


C# ICmObject.DeleteUnderlyingObject方法代码示例

本文整理汇总了C#中ICmObject.DeleteUnderlyingObject方法的典型用法代码示例。如果您正苦于以下问题:C# ICmObject.DeleteUnderlyingObject方法的具体用法?C# ICmObject.DeleteUnderlyingObject怎么用?C# ICmObject.DeleteUnderlyingObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICmObject的用法示例。


在下文中一共展示了ICmObject.DeleteUnderlyingObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MergeObject


//.........这里部分代码省略.........
						TsStringAccessor myTsa = myCurrentValue as TsStringAccessor;
						myTsa.MergeString(srcCurrentValue as TsStringAccessor, fLoseNoStringData);
						break;
					}

					case (int)FieldType.kcptMultiString: // 14 Fall through.
					case (int)FieldType.kcptMultiBigString: // 18
					{
						if (MergeStringProp((int)flid, nType, objSrc, fLoseNoStringData, myCurrentValue, srcCurrentValue))
							break;
						MultiStringAccessor myMsa = myCurrentValue as MultiStringAccessor;
						myMsa.MergeAlternatives(srcCurrentValue as MultiStringAccessor, fLoseNoStringData);
						break;
					}

					case (int)FieldType.kcptUnicode: // 15 Fall through.
					case (int)FieldType.kcptBigUnicode: // 19
					{
						if (MergeStringProp((int)flid, nType, objSrc, fLoseNoStringData, myCurrentValue, srcCurrentValue))
							break;
						string myUCurrent = myCurrentValue as string;
						string srcUValue = srcCurrentValue as string;
						if ((myUCurrent == null || myUCurrent == String.Empty)
							&& srcUValue != String.Empty)
						{
							Debug.Assert(mySetMethod != null);
							mySetMethod.Invoke(this, new object[] {srcUValue});
						}
						else if (fLoseNoStringData
							&& myUCurrent != null && myUCurrent != String.Empty
							&& srcUValue != null && srcUValue != String.Empty
							&& srcUValue != myUCurrent)
						{
							Debug.Assert(mySetMethod != null);
							mySetMethod.Invoke(this, new object[] {myUCurrent + ' ' + srcUValue});
						}
						break;
					}

					case (int)FieldType.kcptMultiUnicode: // 16 Fall through
					case (int)FieldType.kcptMultiBigUnicode: // 20 This one isn't actually used yet, but I hope it is the same as the small MultiUnicode
					{
						if (MergeStringProp((int)flid, nType, objSrc, fLoseNoStringData, myCurrentValue, srcCurrentValue))
							break;
						MultiUnicodeAccessor myMua = myCurrentValue as MultiUnicodeAccessor;
						myMua.MergeAlternatives(srcCurrentValue as MultiUnicodeAccessor, fLoseNoStringData);
						break;
					}

					/* 23 -> 28 */
					case (int)FieldType.kcptOwningAtom:
					case (int)FieldType.kcptReferenceAtom: // 24
					{
						ICmObject srcObj = srcCurrentValue as ICmObject;
						ICmObject currentObj = myCurrentValue as ICmObject;
						if (myCurrentValue == null)
						{
							Debug.Assert(mySetMethod != null);
							mySetMethod.Invoke(this, new object[] {srcObj});
							break;
						}
						else if (fLoseNoStringData && nType == (int)FieldType.kcptOwningAtom && srcObj != null
							&& currentObj.GetType() == srcObj.GetType())
						{
							// merge the child objects.
							currentObj.MergeObject(srcObj, true);
						}
						break;
					}

					case (int)FieldType.kcptOwningCollection: // 25 Fall through, since the collection class knows how to merge itself properly.
					case (int)FieldType.kcptReferenceCollection: // 26
					{
						PropertyInfo piCol = FdoVector<ICmObject>.HvoArrayPropertyInfo(srcCurrentValue);
						MethodInfo myAddMethod = FdoCollection<ICmObject>.AddIntMethodInfo(myCurrentValue);
						foreach (int hvo in (int[])piCol.GetGetMethod().Invoke(srcCurrentValue, null))
						{
							myAddMethod.Invoke(myCurrentValue, new object[] { hvo });
						}
						break;
					}

					case (int)FieldType.kcptOwningSequence: // 27 Fall through, since the collection class knows how to merge itself properly.
					case (int)FieldType.kcptReferenceSequence: // 28
					{
						PropertyInfo piCol = FdoVector<ICmObject>.HvoArrayPropertyInfo(srcCurrentValue);
						MethodInfo myAppendMethod = FdoSequence<ICmObject>.AppendIntMethodInfo(myCurrentValue);
						foreach (int hvo in (int[])piCol.GetGetMethod().Invoke(srcCurrentValue, null))
						{
							myAppendMethod.Invoke(myCurrentValue, new object[] { hvo });
						}
						break;
					}
				}
			}

			// Now move all incoming references.
			CmObject.ReplaceReferences(m_cache, objSrc, this);
			objSrc.DeleteUnderlyingObject();
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:101,代码来源:CmObject.cs


注:本文中的ICmObject.DeleteUnderlyingObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。