Exemplo n.º 1
0
 private Volume GetVolumeWithRangeCheck(Volume volume)
 {
     if (volume.CheckRange(shared.Vessel))
     {
         return(volume);
     }
     throw new Exception("Volume is out of range");
 }
Exemplo n.º 2
0
 private Volume GetVolumeWithRangeCheck(Volume volume)
 {
     if (volume.CheckRange(shared.Vessel))
     {
         return(volume);
     }
     throw new Safe.Exceptions.KOSVolumeOutOfRangeException();
 }
Exemplo n.º 3
0
        private kList GetVolumeList(SharedObjects shared)
        {
            kList list = new kList();

            list.Title = "Volumes";
            list.AddColumn("ID", 6, ColumnAlignment.Left);
            list.AddColumn("Name", 24, ColumnAlignment.Left);
            list.AddColumn("Size", 7, ColumnAlignment.Right);

            if (shared.VolumeMgr != null)
            {
                foreach (KeyValuePair <int, Volume> kvp in shared.VolumeMgr.Volumes)
                {
                    Volume volume = kvp.Value;
                    string id     = kvp.Key.ToString() + (shared.VolumeMgr.VolumeIsCurrent(volume) ? "*" : "");
                    string size   = volume.CheckRange(shared.Vessel) ? (volume.Capacity > -1 ? volume.Capacity.ToString() : "Inf") : "Disc";
                    list.AddItem(id, volume.Name, size);
                }
            }

            return(list);
        }