/// ------------------------------------------------------------------------------------ /// <summary> /// Handles the flids for basic data (bool, string, int, etc.) /// </summary> /// <param name="thisFlid">The object type flid.</param> /// <param name="flidType">The owning flid type.</param> /// <param name="hvoSrc">The hvo of the source object.</param> /// <param name="hvoNew">The hvo of the new object.</param> /// ------------------------------------------------------------------------------------ private void HandleBasicOrStringFlid(int thisFlid, int flidType, int hvoSrc, int hvoNew) { // Basic and String properties are copied switch (flidType) { // Basic Properties follow case (int)CellarPropertyType.Binary: string flidName = m_mdc.GetFieldName(thisFlid); if (flidName == "Rules" || flidName == "StyleRules") { CopyBinaryAsTextProps(thisFlid, hvoSrc, hvoNew); } else { CopyBinaryAsBinary(thisFlid, hvoSrc, hvoNew); } break; case (int)CellarPropertyType.Boolean: // Copy boolean value m_sda.SetBoolean(hvoNew, thisFlid, m_sda.get_BooleanProp(hvoSrc, thisFlid)); break; case (int)CellarPropertyType.Guid: // Copy guid value // These are currently used as the ID for an application, or a version number, or a Scripture Check ID) m_sda.SetGuid(hvoNew, thisFlid, m_sda.get_GuidProp(hvoSrc, thisFlid)); break; case (int)CellarPropertyType.GenDate: // Fall through, since a GenDate is an int. case (int)CellarPropertyType.Integer: // Copy integer value m_sda.SetInt(hvoNew, thisFlid, m_sda.get_IntProp(hvoSrc, thisFlid)); break; case (int)CellarPropertyType.Time: // Copy time value m_sda.SetTime(hvoNew, thisFlid, m_sda.get_TimeProp(hvoSrc, thisFlid)); break; // String Properties follow case (int)CellarPropertyType.String: // Copy string value // Review: Please check these next three! m_sda.SetString(hvoNew, thisFlid, m_sda.get_StringProp(hvoSrc, thisFlid)); break; case (int)CellarPropertyType.Unicode: // Copy Unicode string m_sda.set_UnicodeProp(hvoNew, thisFlid, m_sda.get_UnicodeProp(hvoSrc, thisFlid)); break; case (int)CellarPropertyType.MultiString: // Fall through case (int)CellarPropertyType.MultiUnicode: ITsMultiString sMulti = m_sda.get_MultiStringProp(hvoSrc, thisFlid); for (int i = 0; i < sMulti.StringCount; i++) { int ws; ITsString tss = sMulti.GetStringFromIndex(i, out ws); m_sda.SetMultiStringAlt(hvoNew, thisFlid, ws, tss); } break; default: throw new FDOInvalidFieldTypeException(String.Format("CopyObject: Unsupported field type {0}.", flidType)); } }
/// <summary> /// /// </summary> /// <param name="hvo"></param> /// <param name="tag"></param> /// <returns></returns> public ITsMultiString get_MultiStringProp(int hvo, int tag) { return(m_sda.get_MultiStringProp(hvo, tag)); }
/// <summary> /// Method used to get a whole MultiString. ///</summary> /// <param name='hvo'> </param> /// <param name='tag'> </param> /// <returns></returns> public virtual ITsMultiString get_MultiStringProp(int hvo, int tag) { return(m_baseSda.get_MultiStringProp(hvo, tag)); }