public VolumeItem(Volume volume, VolumePath parentPath, String name) { Volume = volume; Path = VolumePath.FromString(name, parentPath); InitializeSuffixes(); }
public VolumeItem(Volume volume, VolumePath path) { Volume = volume; Path = path; InitializeSuffixes(); }
public kOSProcessor GetProcessor(Volume volume) { if (processors.ContainsKey(volume)) { return processors[volume]; } throw new Exception("The volume is not attached to any processor"); }
public void AttachTo( TermWindow termWindow, Volume attachVolume, string attachFileName = "" ) { term = termWindow; WindowRect = new Rect(0,0,470,280); // will be resized and moved in onGUI. frozen = false; loadingVolume = attachVolume; loadingFileName = attachFileName; LoadContents(attachVolume, attachFileName); }
public void AttachTo(TermWindow termWindow, Volume attachVolume, GlobalPath path) { term = termWindow; WindowRect = new Rect(0, 0, 470, 280); // will be resized and moved in onGUI. frozen = false; loadingVolume = attachVolume; loadingPath = path; LoadContents(attachVolume, path); }
public void Add(Volume volume) { if (!volumes.ContainsValue(volume)) { volumes.Add(lastId++, volume); if (CurrentDirectory == null) { CurrentDirectory = volumes[0].Root; } } }
public void Add(Volume volume) { if (!volumes.ContainsValue(volume)) { volumes.Add(lastId++, volume); if (currentVolume == null) { currentVolume = volumes[0]; UpdateRequiredPower(); } } }
public int GetVolumeId(Volume volume) { int volumeId = -1; foreach (KeyValuePair<int, Volume> kvp in volumes) { if (kvp.Value == volume) { volumeId = kvp.Key; break; } } return volumeId; }
public bool VolumeIsCurrent(Volume volume) { return volume == CurrentVolume; }
protected bool CopyFile(VolumeFile volumeFile, GlobalPath destinationPath, Volume targetVolume, bool verifyFreeSpace) { return targetVolume.SaveFile(destinationPath, volumeFile.ReadAll(), verifyFreeSpace) != null; }
/// <summary> /// Like GetVolumeBestIdentifier, but without the extra string formatting. /// </summary> /// <param name="volume"></param> /// <returns>The Volume's Identifier without pretty formatting</returns> public string GetVolumeRawIdentifier(Volume volume) { int id = GetVolumeId(volume); return !string.IsNullOrEmpty(volume.Name) ? volume.Name : id.ToString(); }
public void SwitchTo(Volume volume) { CurrentDirectory = volume.Root; }
public void OpenPopupEditor( Volume v, string fName ) { popupEditor.AttachTo(this, v, fName ); popupEditor.Open(); }
public string GetVolumeBestIdentifier(Volume volume) { int id = GetVolumeId(volume); if (!string.IsNullOrEmpty(volume.Name)) return string.Format("#{0}: \"{1}\"", id, volume.Name); return "#" + id; }
public VolumeManager() { volumes = new Dictionary<int, Volume>(); currentVolume = null; }
public void LoadContents( Volume vol, string fName ) { if (isDirty) { Freeze(true); InvokeDirtySaveLoadDialog(); loadingVolume = vol; loadingFileName = fName; } else { loadingVolume = vol; loadingFileName = fName; DelegateLoadContents(this); } }
protected VolumeFile(Volume volume, VolumePath path) : base(volume, path) { InitializeSuffixes(); }
public void RunProgramOn(List<Opcode> program, Volume volume) { kOSProcessor processor = GetProcessor(volume); var runCommand = new RunCommand {Program = program}; processor.ExecuteInterProcCommand(runCommand); }
public void LoadContents(Volume vol, GlobalPath path) { if (isDirty) { Freeze(true); InvokeDirtySaveLoadDialog(); loadingVolume = vol; loadingPath = path; } else { loadingVolume = vol; loadingPath = path; DelegateLoadContents(this); } }
public virtual bool CheckRange(Volume volume) { return true; }
public void Remove(int id) { Volume volume = GetVolume(id); if (volume != null) { volumes.Remove(id); if (currentVolume == volume) { if (volumes.Count > 0) { currentVolume = volumes[0]; UpdateRequiredPower(); } else { currentVolume = null; } } } }
public void OpenPopupEditor(Volume v, GlobalPath path) { popupEditor.AttachTo(this, v, path); popupEditor.Open(); }
public void SwitchTo(Volume volume) { if (volume != null) { currentVolume = volume; UpdateRequiredPower(); } }