Inheritance: FrameExport, IFrameExport
        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 int _exportFrames(StreamWriter w, bool isFirst, string standard, int id, bool asOriginal)
        {
            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)
            {
                logger.Info("Exporting frames for: " + affiliation.ID);

                try
                {
                    if (affiliation.LegacyFrames != null)
                    {
                        LegacyFrameExport fe = (LegacyFrameExport)frameEx;
                        fe.Affiliation = affiliation;

                        foreach (LegacyLetterCodeType legacyFrame in affiliation.LegacyFrames)
                        {
                            if (legacyFrame.LimitUseTo != "2525Bc2" || asOriginal)
                            {
                                if (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();
                                    }
                                }
                            }
                        }
                    }
                }

                catch (Exception ex)
                {
                    logger.Error(ex.Message);
                }
            }

            return id;
        }