protected string BuildFrameItemName(LibraryContext context, LibraryDimension dimension, LibraryStandardIdentity identity, LibraryStatus status, bool asAnyCivilian)
        {
            // Constructs a string containing the name of a frame, where each label value
            // is seperated by a DomainSeparator (usually a colon).  Builds this for each group
            // of related contexts, standard identities, and symbolsets.

            string result = "";   //"Frame" + _configHelper.DomainSeparator;   //Removed because thought to be redundant

            if (context != null)
            {
                if (context.Label != "Reality")
                    result = result + context.Label.Replace(',', '-') + _configHelper.DomainSeparator;
            }

            result = result + identity.Label.Replace(',', '-');

            if(dimension != null)
                result = result + _configHelper.DomainSeparator + dimension.Label.Replace(',', '-');

            if (status != null)
            {
                if (status.StatusCode == 1)
                    result = result + _configHelper.DomainSeparator + ((status.LabelAlias == "") ? status.Label : status.LabelAlias);
            }

            if (asAnyCivilian)
            {
                result = result + _configHelper.DomainSeparator + "Civilian";
            }

            return result;
        }
        string IFrameExport.Line(Librarian librarian, LibraryContext context, LibraryStandardIdentity identity, LibraryDimension dimension, LibraryStatus status, bool asCivilian, bool asPlannedCivilian)
        {
            string result = "";

            if (_legacyFrame != null)
            {
                result = BuildFrameItemName(context, dimension, identity, status, false);

                result = result + "," + BuildSIDCKey(_legacyStatusCode(_standard, status), _legacyFrame);

                if(_legacyFrame.LimitUseTo == "2525C" || _legacyFrame.LimitUseTo == "")
                    // For 2525C frames or 2525Bc2 frames that are the same we 2525C we use the 2525D icons
                    // (2525C and some 2525Bc2 frames are identical to 2525D)
                    result = result + "," + BuildFrameCode(context, identity, dimension, status, false);
                else
                    // For 2525Bc2 unique frames we use the unique icons that are keyed accordingly.
                    result = result + "," + BuildFrameCode(_legacyStatusCode(_standard, status), _legacyFrame);

                result = result + ","; // + "Modifier1";
                result = result + ","; // + "Modifier2";
                result = result + ","; // + "ExtraIcon";
                result = result + ","; // + "FullFrame";
                result = result + "," + "Point"; // + "GeometryType";
                result = result + "," + _legacyFrame.LimitUseTo; // + "Standard";
                result = result + ","; // + "Status";
                result = result + "," + _legacyFrame.Description; // + "Notes";
            }

            return result;
        }
        protected string BuildQuotedHQTFFDCode(LibraryStandardIdentityGroup identityGroup, LibraryDimension dimension, LibraryHQTFDummy hqTFFD)
        {
            // Creates the quoted unique idntifier code for a given HQTFFD.

            string code = '"' + this.BuildHQTFFDCode(identityGroup, dimension, hqTFFD) + '"';

            return code;
        }
        string IFrameExport.Line(Librarian librarian, LibraryContext context, LibraryStandardIdentity identity, LibraryDimension dimension, LibraryStatus status, bool asCivilian, bool asPlannedCivilian)
        {
            string result = "";

            result = BuildFrameItemName(null, null, identity, null, false) + "," + BuildFrameCode(null, identity, null, null, false);

            return result;
        }
        protected string BuildQuotedFrameCode(LibraryContext context, LibraryStandardIdentity identity, LibraryDimension dimension, LibraryStatus status, bool asAnyCivilian)
        {
            // Creates the unique idntifier code for a given frame, surrounded by quotes.

            string code = '"' + this.BuildFrameCode(context, identity, dimension, status, asAnyCivilian) + '"';

            return code;
        }
        protected string BuildQuotedOCACode(LibraryStandardIdentityGroup identity, LibraryDimension dimension, LibraryStatus status)
        {
            // Creates the quoted unique idntifier code for a given OCA.

            string code = '"' + this.BuildOCACode(identity, dimension, status) + '"';

            return code;
        }
        public string NameIt(LibraryStandardIdentityGroup identity, LibraryDimension dimension, LibraryStatus status)
        {
            string name = "";

            if(status != null)
                name = BuildOCAItemName(identity, dimension, status);

            return name;
        }
        public string NameIt(LibraryContext context, LibraryDimension dimension, LibraryStandardIdentity identity, LibraryStatus status, bool asAnyCivilian)
        {
            string name = "";

            if (identity != null)
                name = BuildFrameItemName(context, dimension, identity, status, asAnyCivilian);

            return name;
        }
        public string NameIt(LibraryStandardIdentityGroup identityGroup, LibraryDimension dimension, LibraryHQTFDummy hqTFFD)
        {
            string name = "";

            if(dimension != null && hqTFFD != null)
                name = BuildHQTFFDItemName(identityGroup, dimension, hqTFFD);

            return name;
        }
        protected string BuildHQTFFDItemTags(LibraryStandardIdentityGroup identityGroup,
                                             LibraryDimension dimension, 
                                             LibraryHQTFDummy hqTFFD, 
                                             string graphicPath, 
                                             bool omitSource,
                                             bool omitLegacy)
        {
            // Constructs a string of semicolon delimited tags that users can utilize to search
            // for or find a given symbol.

            // The information concatenated together for this comes from a given HQTFFD, Dimension, and Standard Identity.
            // Information includes the Label attributes, location of the original graphic file, the code, etc.

            string result = "HQTFFD;";
            result = result + hqTFFD.Label.Replace(',', '-') + ";";
            result = result + dimension.Label.Replace(',', '-') + ";";
            result = result + identityGroup.Label.Replace(',', '-') + ";";
            
            // Loop through standard identities in the group and add them

            foreach (string sIID in identityGroup.StandardIdentityIDs.Split(' '))
            {
                LibraryStandardIdentity si = _configHelper.Librarian.StandardIdentity(sIID);
                if (si != null)
                {
                    if (si.Label != identityGroup.Label)
                        result = result + si.Label.Replace(',', '-') + ";";
                }
            }

            // Loop through each symbol set in the dimension and add any labels from those

            if (dimension.SymbolSets != null)
            {
                foreach (LibraryDimensionSymbolSetRef ssRef in dimension.SymbolSets)
                {
                    if (ssRef.Label != dimension.Label)
                        result = result + ssRef.Label.Replace(',', '-') + ";";
                }
            }

            result = result + "HQTFFD;";

            if(!omitLegacy)
                result = result + _configHelper.SIDCIsNA + ";";

            if (!omitSource)
                result = result + graphicPath.Substring(1) + ";";

            result = result + "Point;";
            result = result + BuildHQTFFDItemName(identityGroup, dimension, hqTFFD) + ";";
            result = result + BuildHQTFFDCode(identityGroup, dimension, hqTFFD);

            return result;
        }
        string IFrameExport.Line(Librarian librarian, LibraryContext context, LibraryStandardIdentity identity, LibraryDimension dimension, LibraryStatus status, bool asCivilian, bool asPlannedCivilian)
        {
            _notes = "";

            string result = "";
            string graphic = "";

            string graphicPath = _configHelper.GetPath(context.ID, FindEnum.FindFrames);

            LibraryAffiliation affiliation = librarian.Affiliation(context.ID, dimension.ID, identity.ID);

            if (affiliation != null)
            {
                if (affiliation.Shape != ShapeType.NA && (status.StatusCode == 0 || affiliation.PlannedGraphic != ""))
                {
                    if (status.StatusCode == 0)
                        if (asCivilian && affiliation.CivilianGraphic != "")
                            graphic = affiliation.CivilianGraphic;
                        else
                            graphic = affiliation.Graphic;
                    else
                        if (asPlannedCivilian && affiliation.PlannedCivilianGraphic != "")
                            graphic = affiliation.PlannedCivilianGraphic;
                        else
                            graphic = affiliation.PlannedGraphic;

                    if (graphic == null)
                        _notes = _notes + "graphic is missing - frame is NA - frame is never to be drawn;";

                    string itemRootedPath = _configHelper.BuildRootedPath(graphicPath, graphic);
                    string itemOriginalPath = _configHelper.BuildOriginalPath(graphicPath, graphic);

                    if (!File.Exists(itemOriginalPath))
                        _notes = _notes + "image file does not exist;";

                    string itemName = BuildFrameItemName(context, dimension, identity, status, asCivilian || asPlannedCivilian);
                    string itemCategory = "Frame";
                    string itemTags = BuildFrameItemTags(context, identity, dimension, status, graphicPath + "\\" + graphic, _omitSource, _omitLegacy, asCivilian || asPlannedCivilian);
                    string itemID = BuildFrameCode(context, identity, dimension, status, asCivilian || asPlannedCivilian);

                    result = itemRootedPath + "," +
                             Convert.ToString(_configHelper.PointSize) + "," +
                             itemName + "," +
                             itemCategory + "," +
                             itemTags + "," +
                             itemID + "," +
                             "Point" + "," +
                             _notes;
                }
            }

            return result;
        }
        protected string BuildOCACode(LibraryStandardIdentityGroup identity, LibraryDimension dimension, LibraryStatus status)
        {
            // Creates the unique idntifier code for a given OCA.
            
            string code = "";

            if (identity != null && dimension != null)
            {
                code = "0" + Convert.ToString(identity.StandardIdentityGroupCode) +
                             Convert.ToString(dimension.DimensionCode.DigitOne) + Convert.ToString(dimension.DimensionCode.DigitTwo) +
                             Convert.ToString(status.StatusCode) + "2";
            }
            else
                code = Convert.ToString(status.StatusCode);

            return code;
        }
        protected string BuildOCAItemName(LibraryStandardIdentityGroup identity, LibraryDimension dimension, LibraryStatus status)
        {
            // Constructs a string containing the name of an OCA, where each label value
            // is seperated by a DomainSeparator (usually a colon).

            string result = "";

            if (identity != null && dimension != null)
            {
                result = result + ((status.LabelAlias != "") ? status.LabelAlias.Replace(',', '-') : status.Label.Replace(',', '-')) + _configHelper.DomainSeparator;
                result = result + dimension.Label.Replace(',', '-') + _configHelper.DomainSeparator;
                result = result + identity.Label.Replace(',', '-');
            }
            else
                result = (status.LabelAlias != "") ? status.LabelAlias.Replace(',', '-') : status.Label.Replace(',', '-');

            return result;
        }
        protected string BuildHQTFFDItemName(LibraryStandardIdentityGroup identityGroup, LibraryDimension dimension, LibraryHQTFDummy hqTFFD)
        {
            // Constructs a string containing the name of a HQTFFD, where each label value
            // is seperated by a DomainSeparator (usually a colon).  Builds this for each group
            // of related identity, dimension, and HQTFFD.

            string result = "";  //"HQTFFD" + _configHelper.DomainSeparator;  // Removed because thought to be redundant

            string hqTFFDLabel = (hqTFFD.LabelAlias == "") ? hqTFFD.Label : hqTFFD.LabelAlias;
            result = result + hqTFFDLabel.Replace(',', '-');

            if (identityGroup != null && dimension != null)
            {
                result = result + _configHelper.DomainSeparator;
                result = result + dimension.Label.Replace(',', '-') + _configHelper.DomainSeparator;
                result = result + identityGroup.Label.Replace(',', '-');
            }
            
            return result;
        }
        protected string BuildHQTFFDCode(LibraryStandardIdentityGroup identityGroup, LibraryDimension dimension, LibraryHQTFDummy hqTFFD)
        {
            // Creates the unique idntifier code for a given HQTFFD.

            string code = "";

            if (identityGroup != null)
            {
                code = Convert.ToString(identityGroup.StandardIdentityGroupCode);
            }
            
            if(dimension != null)
            {
                code = code + Convert.ToString(dimension.DimensionCode.DigitOne) + Convert.ToString(dimension.DimensionCode.DigitTwo);
            }      
                    
            code = code + Convert.ToString(hqTFFD.HQTFDummyCode);

            return code;
        }
        protected string BuildFrameCode(LibraryContext context, LibraryStandardIdentity identity, LibraryDimension dimension, LibraryStatus status, bool asAnyCivilian)
        {
            // Creates the unique idntifier code for a given frame.

            string code = "";

            if (context != null && dimension != null && status != null)
            {
                code = Convert.ToString(context.ContextCode) + "_" +
                       Convert.ToString(identity.StandardIdentityCode) +
                       Convert.ToString(dimension.DimensionCode.DigitOne) + Convert.ToString(dimension.DimensionCode.DigitTwo) + "_" +
                       Convert.ToString((status.StatusCode == 1) ? 1 : 0);

                if (asAnyCivilian)
                    code = code + "c";
            }
            else
                code = Convert.ToString(identity.StandardIdentityCode);

            return code;
        }
        protected string BuildOCAItemTags(LibraryStandardIdentityGroup identity, 
                                          LibraryDimension dimension,
                                          LibraryStatus status,
                                          string graphicPath,
                                          bool omitSource,
                                          bool omitLegacy)
        {
            // Constructs a string of semicolon delimited tags that users can utilize to search
            // for or find a given OCA.

            // The information concatenated together for this comes from a given StandardIdentity, Dimension, and Status.
            // Information includes the Label attributes, location of the original graphic file, the code, etc.

            string result = "Operational Condition;";

            if (identity != null && dimension != null)
            {
                result = result + ((status.LabelAlias != "") ? status.LabelAlias.Replace(',', '-') : status.Label.Replace(',', '-')) + ";";
                result = result + dimension.Label.Replace(',', '-') + ";";
                result = result + identity.Label.Replace(',', '-') + ";";
            }
            else
                result = result + ((status.LabelAlias != "") ? status.LabelAlias.Replace(',', '-') : status.Label.Replace(',', '-')) + ";";

            result = result + "OCA;";

            if(!omitLegacy)
                result = result + _configHelper.SIDCIsNA + ";";

            if (!omitSource)
                result = result + graphicPath.Substring(1) + ";";

            result = result + "Point" + ";";
            result = result + BuildOCAItemName(identity, dimension, status) + ";";
            result = result + BuildOCACode(identity, dimension, status);

            return result;
        }
        string IFrameExport.Line(Librarian librarian, LibraryContext context, LibraryStandardIdentity identity, LibraryDimension dimension, LibraryStatus status, bool asCivilian, bool asPlannedCivilian)
        {
            string result = "";

            if (_legacyFrame != null)
            {
                result = BuildFrameItemName(context, dimension, identity, status, false);

                result = result + "," + BuildSIDCKey(_legacyStatusCode(_standard, status), _legacyFrame);

                result = result + "," + BuildFrameCode(context, identity, dimension, status, false);

                result = result + ","; // + "Modifier1";
                result = result + ","; // + "Modifier2";
                result = result + ","; // + "ExtraIcon";
                result = result + ","; // + "FullFrame";
                result = result + "," + "Point"; // + "GeometryType";
                result = result + ","; // + "Status";
                result = result + "," + _legacyFrame.Description; // + "Notes";
            }

            return result;
        }
        string IFrameExport.Line(Librarian librarian, LibraryContext context, LibraryStandardIdentity identity, LibraryDimension dimension, LibraryStatus status, bool asCivilian, bool asPlannedCivilian)
        {
            string result = "";
            string graphic = "";

            _notes = "";

            string graphicPath = _configHelper.GetPath("JMSML_2525BC2", FindEnum.Find2525BC2);

            graphic = _legacyFrame.Graphic;

            string id = BuildFrameCode(_legacyStatusCode(_standard, status), _legacyFrame);

            string geometryType = "Point";

            string itemRootedPath = _configHelper.BuildRootedPath(graphicPath, graphic);
            string itemOriginalPath = _configHelper.BuildOriginalPath(graphicPath, graphic);
            string tags = BuildFrameItemTags(context, identity, dimension, status, graphicPath, true, true, false);

            // Replace the 2525D ID with the 2525B Change 2 ID
            string dCode = BuildFrameCode(context, identity, dimension, status, false);
            tags = tags.Replace(dCode, id);

            if (!File.Exists(itemOriginalPath))
                _notes = _notes + "image file does not exist;";

            result = result + itemRootedPath;
            result = result + "," + Convert.ToString(_configHelper.PointSize);
            result = result + "," + id;
            result = result + "," + "Frame";
            result = result + "," + tags;
            result = result + "," + id;
            result = result + "," + geometryType;
            result = result + "," + _notes;

            return result;
        }
        protected string BuildSIDCKey(LibraryStandardIdentityGroup identity, LibraryDimension dimension, LibraryStatus status)
        {
            string key = "";

            if (status.LegacyStatusCode != null)
            {
                if (identity != null && dimension != null)
                {
                    key = key + identity.LegacyStandardIdentityCode[0].Value;
                    key = key + dimension.LegacyDimensionCode[0].Value;
                }

                key = key + status.LegacyStatusCode[0].Value;

                if (dimension != null)
                {
                    LegacyLetterCodeType code = dimension.LegacyDimensionCode[0];
                    key = key + (code.FirstFunctionLetter == "" ? "-" : code.FirstFunctionLetter);
                }
            }

            return key;
        }
        protected string BuildFrameItemTags(LibraryContext context, 
                                            LibraryStandardIdentity identity, 
                                            LibraryDimension dimension, 
                                            LibraryStatus status, 
                                            string graphicPath, 
                                            bool omitSource, 
                                            bool omitLegacy,
                                            bool asAnyCivilian)
        {
            // Constructs a string of semicolon delimited tags that users can utilize to search
            // for or find a given symbol.

            // The information concatenated together for this comes from a given SymbolSet, Context, and Standard Identity.
            // Information includes the Label attributes, location of the original graphic file, the code, etc.

            string result = "Frame;";
            result = result + context.Label.Replace(',', '-') + ";";
            result = result + identity.Label.Replace(',', '-') + ";";
            result = result + dimension.Label.Replace(',', '-') + ";";

            if(status.StatusCode == 1)
                result = result + ((status.LabelAlias == "") ? status.Label.Replace(',', '-') : status.LabelAlias.Replace(',', '-')) + ";";

            if (asAnyCivilian)
                result = result + "Civilian;";

            // Loop through each symbol set in the dimension and add any labels from those

            if (dimension.SymbolSets != null)
            {
                foreach (LibraryDimensionSymbolSetRef ssRef in dimension.SymbolSets)
                {
                    if (ssRef.Label != dimension.Label)
                        result = result + ssRef.Label.Replace(',', '-') + ";";
                }
            }

            result = result + "FRAME;";

            if(!omitLegacy)
                result = result + _configHelper.SIDCIsNA + ";";

            if(!omitSource)
                result = result + graphicPath.Substring(1) + ";";

            if(_configHelper.Librarian.Affiliation(context.ID, dimension.ID, identity.ID).Graphic != null)
                result = result + "Point;";
            else
                result = result + "NotValid;";

            result = result + BuildFrameItemName(context, dimension, identity, status, asAnyCivilian) + ";";
            result = result + BuildFrameCode(context, identity, dimension, status, asAnyCivilian);

            return result;
        }
        private void _UpdateFromCurrent()
        {
            // Search for the appropriate JMSML Library elements, given the current (2525D)
            // SIDC for this Symbol.

            string first10 = _sidc.PartAString;
            string second10 = _sidc.PartBString;

            _librarian.ResetStatusCode();

            _version = _librarian.Version(Convert.ToUInt16(first10.Substring(0, 1)),
                                          Convert.ToUInt16(first10.Substring(1, 1)));

            _context = _librarian.Context(Convert.ToUInt16(first10.Substring(2, 1)));
            _standardIdentity = _librarian.StandardIdentity(Convert.ToUInt16(first10.Substring(3, 1)));
            _sig = _librarian.StandardIdentityGroup(_standardIdentity);
            _symbolSet = _librarian.SymbolSet(Convert.ToUInt16(first10.Substring(4, 1)), Convert.ToUInt16(first10.Substring(5, 1)));

            if (_symbolSet != null)
            {
                _dimension = _librarian.DimensionBySymbolSet(_symbolSet.ID);
            }

            if (_context != null && _dimension != null && _standardIdentity != null)
            {
                _affiliation = _librarian.Affiliation(_context.ID, _dimension.ID, _standardIdentity.ID);
            }

            _status = _librarian.Status(Convert.ToUInt16(first10.Substring(6, 1)));
            _hqTFDummy = _librarian.HQTFDummy(Convert.ToUInt16(first10.Substring(7, 1)));
            _amplifierGroup = _librarian.AmplifierGroup(Convert.ToUInt16(first10.Substring(8, 1)));

            if (_amplifierGroup != null)
            {
                _amplifier = _librarian.Amplifier(_amplifierGroup, Convert.ToUInt16(first10.Substring(9, 1)));
            }

            if (_symbolSet != null)
            {
                _entity = _librarian.Entity(_symbolSet, Convert.ToUInt16(second10.Substring(0, 1)), Convert.ToUInt16(second10.Substring(1, 1)));

                if (_entity != null)
                {
                    _entityType = _librarian.EntityType(_entity, Convert.ToUInt16(second10.Substring(2, 1)), Convert.ToUInt16(second10.Substring(3, 1)));
                }

                if (_entityType != null)
                {
                    _entitySubType = _librarian.EntitySubType(_entityType, Convert.ToUInt16(second10.Substring(4, 1)), Convert.ToUInt16(second10.Substring(5, 1)));

                    if (_entitySubType == null)
                    {
                        _entitySubType = _librarian.EntitySubType(_symbolSet, Convert.ToUInt16(second10.Substring(4, 1)), Convert.ToUInt16(second10.Substring(5, 1)));
                    }
                }

                _modifierOne = _librarian.ModifierOne(_symbolSet, Convert.ToUInt16(second10.Substring(6, 1)), Convert.ToUInt16(second10.Substring(7, 1)));
                _modifierTwo = _librarian.ModifierTwo(_symbolSet, Convert.ToUInt16(second10.Substring(8, 1)), Convert.ToUInt16(second10.Substring(9, 1)));

                _legacySymbol = _librarian.LegacySymbol(_symbolSet, _entity, _entityType, _entitySubType, _modifierOne, _modifierTwo);
            }

            _librarian.LogConversionResult(_sidc.PartAString + ", " + _sidc.PartBString);

            _ValidateStatus();
        }
        private void _SetInvalidSymbolProps()
        {
            // If a symbol can't be recognized, this method sets up
            // the current symbol to represent the special Invalid symbol.

            _version = _librarian.Version(1, 0);
            _context = _librarian.Context(0);
            _dimension = _librarian.Dimension("INTERNAL");
            _standardIdentity = _librarian.StandardIdentity(1);
            _symbolSet = _librarian.SymbolSet(9, 8);
            _status = _librarian.Status(0);
            _hqTFDummy = _librarian.HQTFDummy(0);
            _amplifierGroup = _librarian.AmplifierGroup(0);
            _amplifier = _librarian.Amplifier(_amplifierGroup, 0);
            _affiliation = _librarian.Affiliation("REALITY", "INTERNAL", "SI_UNKNOWN");
            _entity = _librarian.Entity(_symbolSet, "INVALID");
            _entityType = null;
            _entitySubType = null;
            _modifierOne = null;
            _modifierTwo = null;
        }
        protected string BuildSIDCKey(LibraryStandardIdentityGroup identityGroup, LibraryDimension dimension, LibraryHQTFDummy hqTFFD)
        {
            string key = "";

            key = "S";
            key = key + identityGroup.LegacyStandardIdentityCode[0].Value;
            key = key + dimension.LegacyDimensionCode[0].Value;
            key = key + "-";
            key = key + (dimension.LegacyDimensionCode[0].FirstFunctionLetter == "" ? "-" : dimension.LegacyDimensionCode[0].FirstFunctionLetter);
            key = key + hqTFFD.LegacyHQTFDummyCode[0].Value;

            return key;
        }
        internal SymbolSetLegacySymbol LegacySymbol(string legacySIDC, ref LibraryDimension dimensionOut, ref SymbolSet ssOut)
        {
            SymbolSetLegacySymbol retObj = null;

            dimensionOut = null;
            ssOut = null;

            string codingSchemeLetter = legacySIDC.Substring(0, 1);
            string code = legacySIDC.Substring(2, 1);
            string firstLetterInFunction = legacySIDC.Substring(4, 1);

            foreach (LibraryDimension lObj in _library.Dimensions)
            {
                if (lObj.LegacyDimensionCode != null)
                {
                    foreach (LegacyLetterCodeType lObj2 in lObj.LegacyDimensionCode)
                    {
                        if ((lObj2.Value == code && lObj2.FirstFunctionLetter == "" && lObj2.CodingSchemeLetter == "") ||
                            (lObj2.Value == code && lObj2.FirstFunctionLetter == firstLetterInFunction && lObj2.CodingSchemeLetter == "") ||
                            (lObj2.Value == code && lObj2.FirstFunctionLetter == "" && lObj2.CodingSchemeLetter == codingSchemeLetter) ||
                            (lObj2.Value == code && lObj2.FirstFunctionLetter == firstLetterInFunction && lObj2.CodingSchemeLetter == codingSchemeLetter))
                        {
                            if (lObj.SymbolSets != null)
                            {
                                foreach (LibraryDimensionSymbolSetRef ssRef in lObj.SymbolSets)
                                {
                                    SymbolSet ss = this.SymbolSet(ssRef.ID);

                                    if (ss != null)
                                    {
                                        retObj = this.LegacySymbol(ss, legacySIDC);

                                        if (retObj != null)
                                        {
                                            dimensionOut = lObj;
                                            ssOut = ss;

                                            return retObj;
                                        }
                                    }
                                }
                            }
                        }
                    }

                }
            }

            if (retObj == null)
            {
                _statusFlag -= 4;  // Can't find a Dimension
                _statusFlag -= 16; // Can't find a SymbolSet
                _statusFlag -= 65536; // Can't find a LegacySymbol
            }

            return retObj;
        }