Пример #1
0
 private void CopyMembers(Card old)
 {
     this.keyword = old.keyword;
     this.rawValue = old.rawValue;
     this.comments = old.comments;
 }
Пример #2
0
 public Card(Card old)
 {
     CopyMembers(old);
 }
Пример #3
0
        public void ReadHeader()
        {
            // Make sure header is read only once
            if (!headerRead)
            {
                // Save start position
                headerPosition = Fits.ForwardStream.Position;

                Card card;

                do
                {
                    card = new Card();
                    card.Read(Fits.ForwardStream);

                    if (!cards.ContainsKey(card.Keyword))
                    {
                        // *** TODO: handle comments
                        if (!card.IsComment)
                        {
                            cards.Add(card.Keyword.ToUpper(), card);
                        }
                    }
                    else
                    {
                        // *** TODO: Duplicate keys,
                        throw new Exception();
                    }
                }
                while (!card.IsEnd);

                // Skip block
                Fits.SkipBlock();
                dataPosition = Fits.ForwardStream.Position;

                headerRead = true;
            }
        }