Beispiel #1
0
        /**
         * Create a new Comment2000, with blank fields
         */
        public Comment2000()
        {
            _header   = new byte[8];
            _children = new Record[4];

            // Setup our header block
            _header[0] = 0x0f; // We are a Container record
            LittleEndian.PutShort(_header, 2, (short)_type);

            // Setup our child records
            CString csa = new CString();
            CString csb = new CString();
            CString csc = new CString();

            csa.Options  = (0x00);
            csb.Options  = (0x10);
            csc.Options  = (0x20);
            _children[0] = csa;
            _children[1] = csb;
            _children[2] = csc;
            _children[3] = new Comment2000Atom();
            FindInterestingChildren();
        }
Beispiel #2
0
        /**
         * Go through our child records, picking out the ones that are
         *  interesting, and saving those for use by the easy helper
         *  methods.
         */
        private void FindInterestingChildren()
        {
            foreach (Record r in _children)
            {
                if (r is CString)
                {
                    CString cs          = (CString)r;
                    int     recInstance = cs.Options >> 4;
                    switch (recInstance)
                    {
                    case 0: authorRecord = cs; break;

                    case 1: commentRecord = cs; break;

                    case 2: authorInitialsRecord = cs; break;
                    }
                }
                else if (r is Comment2000Atom)
                {
                    commentAtom = (Comment2000Atom)r;
                }
            }
        }
Beispiel #3
0
        /**
         * Create a new Comment2000, with blank fields
         */
        public Comment2000()
        {
            _header = new byte[8];
            _children = new Record[4];

            // Setup our header block
            _header[0] = 0x0f; // We are a Container record
            LittleEndian.PutShort(_header, 2, (short)_type);

            // Setup our child records
            CString csa = new CString();
            CString csb = new CString();
            CString csc = new CString();
            csa.Options = (0x00);
            csb.Options = (0x10);
            csc.Options = (0x20);
            _children[0] = csa;
            _children[1] = csb;
            _children[2] = csc;
            _children[3] = new Comment2000Atom();
            FindInterestingChildren();
        }
Beispiel #4
0
        /**
         * Go through our child records, picking out the ones that are
         *  interesting, and saving those for use by the easy helper
         *  methods.
         */
        private void FindInterestingChildren()
        {

            foreach (Record r in _children)
            {
                if (r is CString)
                {
                    CString cs = (CString)r;
                    int recInstance = cs.Options >> 4;
                    switch (recInstance)
                    {
                        case 0: authorRecord = cs; break;
                        case 1: commentRecord = cs; break;
                        case 2: authorInitialsRecord = cs; break;
                    }
                }
                else if (r is Comment2000Atom)
                {
                    commentAtom = (Comment2000Atom)r;
                }
            }

        }