Пример #1
0
        private DBHeader ExtractHeader(BinaryReader dbReader)
        {
            DBHeader header    = null;
            string   signature = dbReader.ReadString(4);

            if (string.IsNullOrWhiteSpace(signature))
            {
                return(null);
            }

            switch (signature)
            {
            case "WDB5":
                header = new WDB5();
                break;

            case "WDB6":
                header = new WDB6();
                break;

            case "WDC1":
                header = new WDC1();
                break;

            default:
                return(null);
            }

            header?.ReadHeader(ref dbReader, signature);
            return(header);
        }
Пример #2
0
        private DBHeader ExtractHeader(BinaryReader dbReader)
        {
            DBHeader header    = null;
            string   signature = dbReader.ReadString(4);

            if (string.IsNullOrWhiteSpace(signature))
            {
                return(null);
            }

            if (signature[0] != 'W')
            {
                signature = signature.Reverse();
            }

            switch (signature)
            {
            case "WDBC":
                header = new WDBC();
                break;

            case "WDB2":
            case "WCH2":
                header = new WDB2();
                break;

            case "WDB5":
                header = new WDB5();
                break;

            case "WDB6":
                header = new WDB6();
                break;

            case "WCH5":
                header = new WCH5(FileName);
                break;

            case "WCH7":
                header = new WCH7(FileName);
                break;

            case "WCH8":
                header = new WCH8(FileName);
                break;

            case "WDC1":
                header = new WDC1();
                break;

            case "WDC2":
                header = new WDC2();
                break;

            case "WMOB":
            case "WGOB":
            case "WQST":
            case "WIDB":
            case "WNDB":
            case "WITX":
            case "WNPC":
            case "WPTX":
            case "WRDN":
                header = new WDB();
                break;

            case "HTFX":
                header = new HTFX();
                break;
            }

            header?.ReadHeader(ref dbReader, signature);
            return(header);
        }