Exemplo n.º 1
0
        /// <summary>
        /// Load an AnnotationGroupCollection from a binary stream.
        /// </summary>
        /// <param name="br">Specifies the binary reader.</param>
        /// <returns>The list of annotation groups is returned.</returns>
        public static AnnotationGroupCollection LoadList(BinaryReader br)
        {
            AnnotationGroupCollection rg = new AnnotationGroupCollection();
            int nCount = br.ReadInt32();

            for (int i = 0; i < nCount; i++)
            {
                rg.Add(AnnotationGroup.Load(br));
            }

            rg.ImageID         = br.ReadInt32();
            rg.ImageIdx        = br.ReadInt32();
            rg.CreatorID       = br.ReadInt32();
            rg.DatasetID       = br.ReadInt32();
            rg.SourceID        = br.ReadInt32();
            rg.HasDataCriteria = br.ReadBoolean();
            rg.HasDebugData    = br.ReadBoolean();

            return(rg);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Return a copy of the collection.
        /// </summary>
        /// <returns>A copy of the collection is returned.</returns>
        public AnnotationGroupCollection Clone()
        {
            AnnotationGroupCollection col = new AnnotationGroupCollection();

            foreach (AnnotationGroup g in m_rgItems)
            {
                col.Add(g.Clone());
            }

            foreach (KeyValuePair <int, string> kv in m_rgLabels)
            {
                col.m_rgLabels.Add(kv.Key, kv.Value);
            }

            col.ImageID         = m_nImageID;
            col.ImageIdx        = m_nImageIdx;
            col.CreatorID       = m_nCreatorID;
            col.DatasetID       = m_nDatasetID;
            col.SourceID        = m_nSourceID;
            col.HasDataCriteria = m_bHasDataCriteria;
            col.HasDebugData    = m_bHasDebugData;

            return(col);
        }