Inheritance: Structure
Example #1
0
        public VolumeItem(Volume volume, VolumePath parentPath, String name)
        {
            Volume = volume;
            Path = VolumePath.FromString(name, parentPath);

            InitializeSuffixes();
        }
Example #2
0
        public VolumeItem(Volume volume, VolumePath path)
        {
            Volume = volume;
            Path = path;

            InitializeSuffixes();
        }
Example #3
0
 public kOSProcessor GetProcessor(Volume volume)
 {
     if (processors.ContainsKey(volume))
     {
         return processors[volume];
     }
     throw new Exception("The volume is not attached to any processor");
 }
Example #4
0
 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);
 }
Example #5
0
 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);
 }
Example #6
0
        public void Add(Volume volume)
        {
            if (!volumes.ContainsValue(volume))
            {
                volumes.Add(lastId++, volume);

                if (CurrentDirectory == null)
                {
                    CurrentDirectory = volumes[0].Root;
                }
            }
        }
Example #7
0
        public void Add(Volume volume)
        {
            if (!volumes.ContainsValue(volume))
            {
                volumes.Add(lastId++, volume);

                if (currentVolume == null)
                {
                    currentVolume = volumes[0];
                    UpdateRequiredPower();
                }
            }
        }
Example #8
0
        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;
        }
Example #9
0
 public bool VolumeIsCurrent(Volume volume)
 {
     return volume == CurrentVolume;
 }
Example #10
0
 protected bool CopyFile(VolumeFile volumeFile, GlobalPath destinationPath, Volume targetVolume,
     bool verifyFreeSpace)
 {
     return targetVolume.SaveFile(destinationPath, volumeFile.ReadAll(), verifyFreeSpace) != null;
 }
Example #11
0
 /// <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();
 }
Example #12
0
 public void SwitchTo(Volume volume)
 {
     CurrentDirectory = volume.Root;
 }
Example #13
0
 public void OpenPopupEditor( Volume v, string fName )
 {
     popupEditor.AttachTo(this, v, fName );
     popupEditor.Open();
 }
Example #14
0
 public string GetVolumeBestIdentifier(Volume volume)
 {
     int id = GetVolumeId(volume);
     if (!string.IsNullOrEmpty(volume.Name)) return string.Format("#{0}: \"{1}\"", id, volume.Name);
     return "#" + id;
 }
Example #15
0
 public VolumeManager()
 {
     volumes = new Dictionary<int, Volume>();
     currentVolume = null;
 }
Example #16
0
 public void LoadContents( Volume vol, string fName )
 {
     if (isDirty)
     {
         Freeze(true);
         InvokeDirtySaveLoadDialog();
         loadingVolume = vol;
         loadingFileName = fName;
     }
     else
     {
         loadingVolume = vol;
         loadingFileName = fName;
         DelegateLoadContents(this);
     }
 }
Example #17
0
 protected VolumeFile(Volume volume, VolumePath path)
     : base(volume, path)
 {
     InitializeSuffixes();
 }
Example #18
0
 public void RunProgramOn(List<Opcode> program, Volume volume)
 {
     kOSProcessor processor = GetProcessor(volume);
     var runCommand = new RunCommand {Program = program};
     processor.ExecuteInterProcCommand(runCommand);
 }
Example #19
0
 public void LoadContents(Volume vol, GlobalPath path)
 {
     if (isDirty)
     {
         Freeze(true);
         InvokeDirtySaveLoadDialog();
         loadingVolume = vol;
         loadingPath = path;
     }
     else
     {
         loadingVolume = vol;
         loadingPath = path;
         DelegateLoadContents(this);
     }
 }
Example #20
0
 public virtual bool CheckRange(Volume volume)
 {
     return true;
 }
Example #21
0
        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;
                    }
                }
            }
        }
Example #22
0
 public void OpenPopupEditor(Volume v, GlobalPath path)
 {
     popupEditor.AttachTo(this, v, path);
     popupEditor.Open();
 }
Example #23
0
 public void SwitchTo(Volume volume)
 {
     if (volume != null)
     {
         currentVolume = volume;
         UpdateRequiredPower();
     }
 }