示例#1
0
        public void Dump()
        {
            System.Console.WriteLine(dbrec.Datasets.Count);

            foreach (ImageDataSetRecord dataset in dbrec.Datasets)
            {
                ListRecord list = dataset.Record;

                System.Console.WriteLine("{0}.Count = {1}", list.Name, list.Items.Count);

                if (list is ImageListRecord)
                {
                    ImageItemRecord image = ((ImageListRecord)list).Images [0] as ImageItemRecord;
                    IthmbDb.DisplayItem(image, System.IO.Path.GetDirectoryName(this.Path));

                    foreach (ImageItemRecord iirec in ((ImageListRecord)list).Images)
                    {
                        System.Console.WriteLine("Id = {0}", iirec.Id);
                        foreach (ImageDataObjectRecord file in iirec.Versions)
                        {
                            System.Console.WriteLine("   path={0} size {1} position {2} ID {3}",
                                                     file.Child.Path,
                                                     file.Child.ThumbPosition,
                                                     file.Child.ThumbSize,
                                                     file.Child.CorrelationID);
                        }
                    }
                }
                else if (list is AlbumListRecord)
                {
                    foreach (AlbumBookRecord book in list.Items)
                    {
                        System.Console.WriteLine("Book Title = {0}", book.Title);
                        foreach (AlbumItemRecord entry in book.Items)
                        {
                            System.Console.WriteLine("entry {0}", entry.Id);
                        }
                    }
                }
            }
        }
示例#2
0
        public override void Read(BinaryReader reader)
        {
            base.Read(reader);

            if (this.Name != "mhsd")
            {
                throw new ApplicationException("Unknown header name: " + this.Name);
            }

            byte [] body = reader.ReadBytes(this.HeaderOne - 12);

            Index = BitConverter.ToInt32(body, 0);



            switch (Index)
            {
            case 1:
                this.Record = new ImageListRecord();
                this.Record.Read(reader);
                break;

            case 2:
                this.Record = new AlbumListRecord();
                this.Record.Read(reader);
                //reader.ReadBytes (this.HeaderTwo - this.HeaderOne);
                break;

            case 3:
                this.Record = new FileListRecord();
                this.Record.Read(reader);
                // Skip For Now.
                //reader.ReadBytes (this.HeaderTwo - this.HeaderOne);
                break;

            default:
                throw new ApplicationException("Unknown ImageDataSet record type: " + Index);
            }
        }
		public override void Read (BinaryReader reader) {
			base.Read (reader);
			
			if (this.Name != "mhsd")
				throw new ApplicationException ("Unknown header name: " + this.Name);
			
			byte [] body = reader.ReadBytes (this.HeaderOne - 12);
			
			Index = BitConverter.ToInt32 (body, 0);


			
			switch (Index) {
			case 1:
				this.Record = new ImageListRecord ();
				this.Record.Read (reader);
				break;
			case 2:
				this.Record = new AlbumListRecord ();
				this.Record.Read (reader);
				//reader.ReadBytes (this.HeaderTwo - this.HeaderOne);
				break;
			case 3:
				this.Record = new FileListRecord ();	
				this.Record.Read (reader);
			// Skip For Now.
				//reader.ReadBytes (this.HeaderTwo - this.HeaderOne);
				break;
			default:
				throw new ApplicationException ("Unknown ImageDataSet record type: " + Index);
			}
		}