/// <summary> Gets the base class id for a given class. </summary> /// <param name='luClid'>Class identification number. In the database, this corresponds to "Id" /// column in the Class$ table. </param> /// <returns>Points to the output base class identification number. In the database, /// this corresponds to the "Base" column in the Class$ table.</returns> public virtual int GetBaseClsId(int luClid) { return(m_metaDataCache.GetBaseClsId(luClid)); }
private void SetSubControl() { m_groupOptions.Controls.Clear(); if (m_rsfm.m_flid == 0) { m_groupOptions.Text = LexTextControls.ksDiscardedField; m_groupOptions.Controls.Add(m_discardOpt); m_discardOpt.Location = m_locSubCtrl; return; } CellarPropertyType cpt = (CellarPropertyType)m_mdc.GetFieldType(m_rsfm.m_flid); int clidDst = -1; switch (cpt) { case CellarPropertyType.ReferenceAtomic: case CellarPropertyType.ReferenceCollection: case CellarPropertyType.ReferenceSequence: clidDst = m_mdc.GetDstClsId(m_rsfm.m_flid); switch (clidDst) { case RnGenericRecTags.kClassId: m_groupOptions.Text = LexTextControls.ksRnLinkFieldOptions; m_groupOptions.Controls.Add(m_linkOpt); m_linkOpt.Location = m_locSubCtrl; break; case CrossReferenceTags.kClassId: case ReminderTags.kClassId: throw new NotImplementedException(LexTextControls.ksUnimplementedField); default: int clidBase = clidDst; while (clidBase != 0 && clidBase != CmPossibilityTags.kClassId) { clidBase = m_mdc.GetBaseClsId(clidBase); } if (clidBase == CmPossibilityTags.kClassId) { m_groupOptions.Text = LexTextControls.ksListRefImportOptions; m_groupOptions.Controls.Add(m_listOpt); m_listOpt.Location = m_locSubCtrl; m_listOpt.Initialize(m_cache, m_helpTopicProvider, m_app, m_stylesheet, m_rsfm, cpt); break; } throw new ArgumentException(LexTextControls.ksInvalidField); } break; case CellarPropertyType.OwningAtomic: case CellarPropertyType.OwningCollection: case CellarPropertyType.OwningSequence: clidDst = m_mdc.GetDstClsId(m_rsfm.m_flid); switch (clidDst) { case StTextTags.kClassId: Debug.Assert(cpt == CellarPropertyType.OwningAtomic); m_groupOptions.Text = LexTextControls.ksTextImportOptions; m_groupOptions.Controls.Add(m_textOpt); m_textOpt.Location = m_locSubCtrl; m_textOpt.Initialize(m_cache, m_helpTopicProvider, m_app, m_stylesheet, m_rsfm); break; case RnRoledParticTags.kClassId: m_groupOptions.Text = LexTextControls.ksListRefImportOptions; m_groupOptions.Controls.Add(m_listOpt); m_listOpt.Location = m_locSubCtrl; m_listOpt.Initialize(m_cache, m_helpTopicProvider, m_app, m_stylesheet, m_rsfm, cpt); break; case RnGenericRecTags.kClassId: throw new NotImplementedException(LexTextControls.ksUnimplementedField); default: throw new ArgumentException(LexTextControls.ksInvalidField); } break; case CellarPropertyType.MultiString: case CellarPropertyType.MultiUnicode: m_groupOptions.Text = LexTextControls.ksMultiStringImportOptions; m_groupOptions.Controls.Add(m_stringOpt); m_stringOpt.Location = m_locSubCtrl; m_stringOpt.Initialize(m_cache, m_helpTopicProvider, m_app, m_stylesheet, m_rsfm); break; case CellarPropertyType.String: m_groupOptions.Text = LexTextControls.ksStringImportOptions; m_groupOptions.Controls.Add(m_stringOpt); m_stringOpt.Location = m_locSubCtrl; m_stringOpt.Initialize(m_cache, m_helpTopicProvider, m_app, m_stylesheet, m_rsfm); break; case CellarPropertyType.GenDate: m_groupOptions.Text = LexTextControls.ksGenDateImportOptions; m_groupOptions.Controls.Add(m_dateOpt); m_dateOpt.Location = m_locSubCtrl; m_dateOpt.Initialize(m_cache, m_helpTopicProvider, m_rsfm, true); break; case CellarPropertyType.Time: m_groupOptions.Text = LexTextControls.ksDateTimeImportOptions; m_groupOptions.Controls.Add(m_dateOpt); m_dateOpt.Location = m_locSubCtrl; m_dateOpt.Initialize(m_cache, m_helpTopicProvider, m_rsfm, false); break; case CellarPropertyType.Unicode: case CellarPropertyType.Binary: case CellarPropertyType.Image: case CellarPropertyType.Boolean: case CellarPropertyType.Float: case CellarPropertyType.Guid: case CellarPropertyType.Integer: case CellarPropertyType.Numeric: throw new ArgumentException(LexTextControls.ksInvalidField); } }