private int _exportFrames(StreamWriter w, bool isFirst, string standard, int id)
        {
            IFrameExport frameEx = new LegacyFrameExport(_helper, standard);

            if (isFirst)
            {
                string headers = frameEx.Headers;
                headers = "id," + headers;

                w.WriteLine(headers);
                w.Flush();
            }

            foreach (LibraryAffiliation affiliation in _lib.Library.Affiliations)
            {
                if (affiliation.LegacyFrames != null)
                {
                    LegacyFrameExport fe = (LegacyFrameExport)frameEx;
                    fe.Affiliation = affiliation;

                    foreach (LegacyLetterCodeType legacyFrame in affiliation.LegacyFrames)
                    {
                        if (legacyFrame.Name == standard && legacyFrame.Function == "")
                        {
                            fe.LegacyFrame = legacyFrame;

                            LibraryContext          context   = _lib.Context(affiliation.ContextID);
                            LibraryStandardIdentity identity  = _lib.StandardIdentity(affiliation.StandardIdentityID);
                            LibraryDimension        dimension = _lib.Dimension(affiliation.DimensionID);

                            string line = id.ToString() + "," + frameEx.Line(_lib, context, identity, dimension, _lib.Status(0), false, false);
                            id++;

                            w.WriteLine(line);
                            w.Flush();

                            if (legacyFrame.IsPlanned)
                            {
                                LibraryStatus status = _lib.Status(1);
                                status.LabelAlias = "Planned";
                                line = id.ToString() + "," + frameEx.Line(_lib, context, identity, dimension, status, false, false);
                                status.LabelAlias = "";
                                id++;

                                w.WriteLine(line);
                                w.Flush();
                            }
                        }
                    }
                }
            }

            return(id);
        }
        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();
        }