Example #1
0
        public static IChartFile GetChartFile(Stream s)
        {
            IChartFile icf = null;

            //Try to discover filetype
            try
            {
                XmlTextReader xr = new XmlTextReader(s);
                while (xr.Read())
                {
                    if (xr.NodeType == XmlNodeType.Element)
                    {
                        break;
                    }
                }

                if (xr.Name == "ChartData")
                {
                    s.Position = 0;
                    icf        = new FtXnc();
                }
                else if (xr.Name == "NextGenMultipleChart")
                {
                    s.Position = 0;
                    icf        = new FtXnmc();
                }
            }
            catch (Exception ex)
            {
                // TODO: Better Message
            }
            return(icf);
        }
Example #2
0
        public static IChartFile GetChartFile(string filename)
        {
            IChartFile icf = null;

            switch (Path.GetExtension(filename))
            {
            case ".xnc":
                icf = new FtXnc();
                break;

            case ".xnmc":
                icf = new FtXnmc();
                break;
            }
            return(null);
        }
Example #3
0
        public IChartFile GetChartFile(int filterindex)
        {
            filterindex -= 1;
            filetypes ft = filetypes.none;

            if (fts.Length > filterindex)
            {
                ft = fts[filterindex];
            }

            IChartFile icf = null;

            switch (ft)
            {
            case filetypes.xnmc:
                icf = new FtXnmc();
                break;

            case filetypes.xnc:
                icf = new FtXnc();
                break;

            case filetypes.bnmc:
                icf = new FtBnmc();
                break;

            case filetypes.html:
                icf = new FtHtml();
                break;

            case filetypes.tab:
                icf = new FtText("\t");
                break;

            case filetypes.csvsemi:
                icf = new FtText(";");
                break;

            case filetypes.cvscomma:
                icf = new FtText(",");
                break;

            case filetypes.jpeg:
                icf = new FtImage(cc, System.Drawing.Imaging.ImageFormat.Jpeg);
                break;

            case filetypes.bmp:
                icf = new FtImage(cc, System.Drawing.Imaging.ImageFormat.Bmp);
                break;

            case filetypes.gif:
                icf = new FtImage(cc, System.Drawing.Imaging.ImageFormat.Gif);
                break;

            case filetypes.png:
                icf = new FtImage(cc, System.Drawing.Imaging.ImageFormat.Png);
                break;

            case filetypes.tiff:
                icf = new FtImage(cc, System.Drawing.Imaging.ImageFormat.Tiff);
                break;
            }
            return(icf);
        }