public void DoAutoImportWork() { //m_clsFieldDescription = null; // remove the custom version of this class //m_clsFieldDescription = ClsFieldDescription; // create a simple version for the auto import field m_LexImportField = null; }
public void AddLexImportField(Sfm2Xml.ILexImportField field) { m_LexImportField = field as Sfm2Xml.LexImportField; if (field != null) m_clsFieldDescription.Type = field.DataType; else m_clsFieldDescription.Type = "string"; //if (m_LexImportField != null) // m_clsFieldDescription = LexImportField.ClsFieldDescriptionWith(ClsFieldDescription); //m_clsFieldDescription = xyz; // m_clsFieldDescription = null; // force recreation with new data // m_clsFieldDescription = ClsFieldDescription; // need to use lex field data type }
public ContentMapping(string marker, string desc, string className, string fwDest, string ws, string langDescriptor, int count, int order, Sfm2Xml.ClsFieldDescription fdesc, bool isCustom) { m_marker = marker; m_description = desc; m_FWDestination = fwDest; m_writingSystem = ws; m_langDescriptor = langDescriptor; m_count = count; m_srcOrder = order; //m_excluded = false; m_destinationClass = className; m_clsFieldDescription = fdesc; // saved for now, used at end for producing map file m_LexImportField = null; if (m_clsFieldDescription == null) { if (!isCustom) m_clsFieldDescription = ClsFieldDescription; else { int shouldNotBeHere = 0; shouldNotBeHere++; m_clsFieldDescription = new Sfm2Xml.ClsCustomFieldDescription("", "", /*System.Guid.NewGuid(),*/ 0, false, 0, m_marker, " ", "string", this.m_langDescriptor, this.IsAbbrvField, this.m_FWDestination); } } m_isBeginMarker = false; }
private void FillLexicalRefTypesCombo(Sfm2Xml.LexImportField field) { if (m_LastSelectedField == field) return; // don't change m_LastSelectedField = field; // fill the combo box with current values in the DB cbFunction.Items.Clear(); m_htNameToAbbr.Clear(); if (field.IsRef) { lblFunction.Text = LexTextControls.ksLexicalRelationType; int pos = -1; //string abbr, name, reverseAbbr, reverseName; rbAbbrAbbr.Checked = true; rbAbbrName.Checked = false; if (field.ID == "cref" || field.ID == "scref") { // Fill the comboBox with the names (and where appropriate, reverse names) of the // LexRefType objects which map to entries. foreach (ILexRefType lrt in m_cache.LanguageProject.LexDbOA.ReferencesOA.PossibilitiesOS) { switch (lrt.MappingType) { case (int)MappingTypes.kmtEntryCollection: case (int)MappingTypes.kmtEntryPair: case (int)MappingTypes.kmtEntrySequence: case (int)MappingTypes.kmtEntryOrSenseCollection: case (int)MappingTypes.kmtEntryOrSensePair: case (int)MappingTypes.kmtEntryOrSenseSequence: //abbr = lrt.Abbreviation.AnalysisDefaultWritingSystem.Text; //name = lrt.Name.AnalysisDefaultWritingSystem.Text; //AddAbbrAndNameInfo(abbr, name, "en", null, null, null); AddAbbrAndNameInfo(lrt.Abbreviation, lrt.Name, null, null); break; case (int)MappingTypes.kmtEntryAsymmetricPair: case (int)MappingTypes.kmtEntryTree: case (int)MappingTypes.kmtEntryOrSenseAsymmetricPair: case (int)MappingTypes.kmtEntryOrSenseTree: //abbr = lrt.Abbreviation.AnalysisDefaultWritingSystem.Text; //name = lrt.Name.AnalysisDefaultWritingSystem.Text; //reverseAbbr = lrt.ReverseAbbreviation.AnalysisDefaultWritingSystem.Text; //reverseName = lrt.ReverseName.AnalysisDefaultWritingSystem.Text; //AddAbbrAndNameInfo(abbr, name, "en", reverseAbbr, reverseName, "en"); AddAbbrAndNameInfo(lrt.Abbreviation, lrt.Name, lrt.ReverseAbbreviation, lrt.ReverseName); break; } } } else if (field.ID == "lxrel") { // Fill the comboBox with the names (and where appropriate, reverse names) of the // LexRefType objects which map to senses. foreach (ILexRefType lrt in m_cache.LanguageProject.LexDbOA.ReferencesOA.PossibilitiesOS) { switch (lrt.MappingType) { case (int)MappingTypes.kmtSenseCollection: case (int)MappingTypes.kmtSensePair: case (int)MappingTypes.kmtSenseSequence: case (int)MappingTypes.kmtEntryOrSenseCollection: case (int)MappingTypes.kmtEntryOrSensePair: case (int)MappingTypes.kmtEntryOrSenseSequence: //abbr = lrt.Abbreviation.AnalysisDefaultWritingSystem.Text; //name = lrt.Name.AnalysisDefaultWritingSystem.Text; //AddAbbrAndNameInfo(abbr, name, "en", null, null, null); AddAbbrAndNameInfo(lrt.Abbreviation, lrt.Name, null, null); break; case (int)MappingTypes.kmtSenseAsymmetricPair: case (int)MappingTypes.kmtSenseTree: case (int)MappingTypes.kmtEntryOrSenseAsymmetricPair: case (int)MappingTypes.kmtEntryOrSenseTree: //abbr = lrt.Abbreviation.AnalysisDefaultWritingSystem.Text; //name = lrt.Name.AnalysisDefaultWritingSystem.Text; //reverseAbbr = lrt.ReverseAbbreviation.AnalysisDefaultWritingSystem.Text; //reverseName = lrt.ReverseName.AnalysisDefaultWritingSystem.Text; //AddAbbrAndNameInfo(abbr, name, "en", reverseAbbr, reverseName, "en"); AddAbbrAndNameInfo(lrt.Abbreviation, lrt.Name, lrt.ReverseAbbreviation, lrt.ReverseName); break; } } } else if (field.ID == "var") { lblFunction.Text = LexTextControls.ksVariantType; // fill the comboBox with the names of the Variant objects foreach (var let in m_cache.LangProject.LexDbOA.VariantEntryTypesOA.ReallyReallyAllPossibilities) { AddAbbrAndNameInfo(let.Abbreviation, let.Name, null, null); //int wsActual; //ITsString tssAnal = let.Name. GetAlternativeOrBestTss(m_cache.DefaultAnalWs, out wsActual); //name = tssAnal.Text; //string ws = m_cache.LanguageWritingSystemFactoryAccessor.GetStrFromWs(wsActual); //AddAbbrAndNameInfo(null, name, ws, null, null, null); } } else if (field.ID == "sub") { lblFunction.Text = LexTextControls.ksComplexFormType; // fill the comboBox with the names of the Variant objects foreach (var let in m_cache.LangProject.LexDbOA.ComplexEntryTypesOA.ReallyReallyAllPossibilities) { AddAbbrAndNameInfo(let.Abbreviation, let.Name, null, null); //int wsActual; //ITsString tssAnal = let.Name.GetAlternativeOrBestTss(m_cache.DefaultAnalWs, out wsActual); //name = tssAnal.Text; //string ws = m_cache.LanguageWritingSystemFactoryAccessor.GetStrFromWs(wsActual); //AddAbbrAndNameInfo(null, name, ws, null, null, null); } } // now select the one with the correct abbreviation pos = -1; if (m_refFuncString.Length > 0) pos = cbFunction.FindString(m_refFuncString); if (pos >= 0) { cbFunction.SelectedIndex = pos; cbFunction.Text = cbFunction.SelectedItem as string; } } // The radio buttons for abbr and Name are set when initialized - so don't reset them }