コード例 #1
0
ファイル: Disk.cs プロジェクト: p141592/root-2015-tasks
 public Disk(DiskIndex index, DiskType type, string name)
     : this()
 {
     this.Index = index;
     this.Type  = type;
     this.Name  = name;
 }
コード例 #2
0
ファイル: Disk.cs プロジェクト: p141592/root-2015-tasks
        internal Disk(DiskInformation info)
        {
            this.Type        = info.type;
            this.State       = info.state;
            this.ContentType = info.content_type;
            this.Index       = DiskIndex.Parse(info.index);
            this.Available   = info.available;
            this.Name        = info.name;

            if (info.files != null)
            {
                this.FileTree = new FileTree(this, info);
            }

            if (info.content != null)
            {
                this.Content = new DiskContent(this, info);
            }
        }
コード例 #3
0
ファイル: Database.cs プロジェクト: p141592/root-2015-tasks
        public void AddDisk(DiskType type, DiskContentType contentType, char letter, string name, string path)
        {
            var number = (byte)(GetMax(from pair in this.disks
                                       let idx = pair.Value.Index
                                                 where idx.Letter == letter
                                                 select idx.Number,
                                       0) + 1);

            var index = new DiskIndex(letter, number);
            var disk  = new Disk(index, type, name)
            {
                ContentType = contentType
            };

            if (path != null)
            {
                disk.AddFileTree(new DirectoryInfo(path));
                disk.State = DiskState.FINALIZED;
            }

            this.disks.Add(index.ToString(), disk);

            return;
        }
コード例 #4
0
ファイル: Database.cs プロジェクト: p141592/root-2015-tasks
 public IDisk this [DiskIndex index] {
     get { return(this [index.ToString()]); }
 }