CheckRange() публичный Метод

public CheckRange ( ) : bool
Результат bool
Пример #1
0
        public override void Evaluate()
        {
            // For now only log to the archive.
            String volumeName   = "Archive";
            Volume targetVolume = GetVolume(volumeName);

            // If the archive is out of ranch, the signal is lost in space.
            if (!targetVolume.CheckRange())
            {
                State = ExecutionState.DONE;
                return;
            }

            String     targetFile = RegexMatch.Groups[1].Value.Trim();
            Expression e          = new Expression(RegexMatch.Groups[2].Value, ParentContext);

            if (e.IsNull())
            {
                State = ExecutionState.DONE;
            }
            else
            {
                targetVolume.AppendToName(targetFile, e.ToString());
                State = ExecutionState.DONE;
            }
        }
Пример #2
0
        public override void Evaluate()
        {
            // Todo: let the user specify a volume "LOG something TO file ON volume"
            Volume targetVolume = SelectedVolume;

            // If the archive is out of reach, the signal is lost in space.
            if (!targetVolume.CheckRange())
            {
                State = ExecutionState.DONE;
                return;
            }

            String     targetFile = RegexMatch.Groups[2].Value.Trim();
            Expression e          = new Expression(RegexMatch.Groups[1].Value, ParentContext);

            if (e.IsNull())
            {
                State = ExecutionState.DONE;
            }
            else
            {
                targetVolume.AppendToFile(targetFile, e.ToString());
                State = ExecutionState.DONE;
            }
        }
Пример #3
0
 private Volume GetVolumeWithRangeCheck(Volume volume)
 {
     if (volume.CheckRange(_shared.Vessel))
     {
         return(volume);
     }
     else
     {
         throw new Exception("Volume is out of range");
     }
 }
Пример #4
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);
        }
Пример #5
0
 public override void VerifyMount()
 {
     selectedVolume.CheckRange();
 }