Esempio n. 1
0
        private int _exportOCAs(StreamWriter w, bool isFirst, string standard, int id)
        {
            IOCAExport ocaExport = new LegacyOCAExport(_helper, standard);

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

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

            foreach (LibraryStatus status in _lib.Library.Statuses)
            {
                logger.Info("Exporting status graphics for: " + status.Name);

                try
                {
                    if (status.Graphic != null)
                    {
                        string line = id.ToString() + "," + ocaExport.Line(status);
                        id++;

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

                    if (status.Graphics != null)
                    {
                        foreach (LibraryStatusGraphic graphic in status.Graphics)
                        {
                            string line = id.ToString() + "," + ocaExport.Line(status, graphic);
                            id++;

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

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

            return(id);
        }
        private int _exportOCAs(StreamWriter w, bool isFirst, string standard, int id)
        {
            IOCAExport ocaExport = new LegacyOCAExport(_helper, standard);

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

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

            foreach (LibraryStatus status in _lib.Library.Statuses)
            {
                if (status.Graphic != null)
                {
                    string line = id.ToString() + "," + ocaExport.Line(status);
                    id++;

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

                if (status.Graphics != null)
                {
                    foreach (LibraryStatusGraphic graphic in status.Graphics)
                    {
                        string line = id.ToString() + "," + ocaExport.Line(status, graphic);
                        id++;

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

            return(id);
        }
        private int _exportOCAs(StreamWriter w, bool isFirst, string standard, int id)
        {
            IOCAExport ocaExport = new LegacyOCAExport(_helper, standard);

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

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

            foreach (LibraryStatus status in _lib.Library.Statuses)
            {
                logger.Info("Exporting status graphics for: " + status.Name);

                try
                {
                    if (status.Graphic != null)
                    {
                        string line = id.ToString() + "," + ocaExport.Line(status);
                        id++;

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

                    if (status.Graphics != null)
                    {
                        foreach (LibraryStatusGraphic graphic in status.Graphics)
                        {
                            string line = id.ToString() + "," + ocaExport.Line(status, graphic);
                            id++;

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

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

            return id;
        }