Inheritance: AmplifierExport, IAmplifierExport
        private int _exportAmplifiers(StreamWriter w, bool isFirst, string standard, int id)
        {
            IAmplifierExport amplifierEx = new LegacyAmplifierExport(_helper, standard);

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

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

            foreach (LibraryAmplifierGroup group in _lib.Library.AmplifierGroups)
            {
                foreach (LibraryAmplifierGroupAmplifier amplifier in group.Amplifiers)
                {
                    if (amplifier.Graphics != null)
                    {
                        foreach (LibraryAmplifierGroupAmplifierGraphic graphic in amplifier.Graphics)
                        {
                            string line = id.ToString() + "," + amplifierEx.Line(group, amplifier, graphic);
                            id++;

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

            return(id);
        }
Beispiel #2
0
        private int _exportAmplifiers(StreamWriter w, bool isFirst, string standard, int id)
        {
            LegacyAmplifierExport legacyAmplifierExport = new LegacyAmplifierExport(_helper, standard);
            IAmplifierExport      amplifierEx           = (IAmplifierExport)legacyAmplifierExport;

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

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

            foreach (LibraryAmplifierGroup group in _lib.Library.AmplifierGroups)
            {
                logger.Info("Exporting amplifiers for: " + group.Name);

                try
                {
                    foreach (LibraryAmplifierGroupAmplifier amplifier in group.Amplifiers)
                    {
                        if (amplifier.Graphics != null)
                        {
                            foreach (LegacyLetterCodeType legacyModifier in group.LegacyModifierCode)
                            {
                                foreach (LibraryAmplifierGroupAmplifierGraphic graphic in amplifier.Graphics)
                                {
                                    string line = id.ToString() + "," + legacyAmplifierExport.Line(legacyModifier.CodingSchemeLetter, group, amplifier, graphic);
                                    id++;

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

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

            return(id);
        }
        private int _exportAmplifiers(StreamWriter w, bool isFirst, string standard, int id)
        {
            LegacyAmplifierExport legacyAmplifierExport = new LegacyAmplifierExport(_helper, standard);
            IAmplifierExport amplifierEx = (IAmplifierExport)legacyAmplifierExport;

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

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

            foreach (LibraryAmplifierGroup group in _lib.Library.AmplifierGroups)
            {
                logger.Info("Exporting amplifiers for: " + group.Name);

                try
                {
                    foreach (LibraryAmplifierGroupAmplifier amplifier in group.Amplifiers)
                    {
                        if (amplifier.Graphics != null)
                        {
                            foreach (LegacyLetterCodeType legacyModifier in group.LegacyModifierCode)
                            {
                                foreach (LibraryAmplifierGroupAmplifierGraphic graphic in amplifier.Graphics)
                                {
                                    string line = id.ToString() + "," + legacyAmplifierExport.Line(legacyModifier.CodingSchemeLetter, group, amplifier, graphic);
                                    id++;

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

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

            return id;
        }