예제 #1
0
        public void SeparateLastStep(out ArgInfo ai, TargetType pathTargetLeft, TargetType pathTargetRight)
        {
            ai                = new ArgInfo();
            ai._relativity    = PathType.RelativeToDir;
            ai._pathTarget    = pathTargetRight;
            ai._arg           = _locationSteps[_locationSteps.Length - 1];
            ai._locationSteps = new String[1] {
                _locationSteps[_locationSteps.Length - 1]
            };
            ai._arg = ai.GetFullPath();

            _pathTarget = pathTargetLeft;
            Array.Resize <String>(ref _locationSteps, _locationSteps.Length - 1);
            _arg = GetFullPath();
        }
예제 #2
0
        public void Resolve(FileSysEmulator fse)
        {
            FileSysEmulator.FsDrive currDrv = fse.CurrentDrive;
            if (currDrv == null)
            {
                throw new ApplicationException(String.Format("Can't resolve path '{0}': there isn't current drive.", ToString()));
            }

            _resolved = (ArgInfo)this.MemberwiseClone();
            _resolved._locationSteps = new String[0];

            if (_drive.Length == 0)
            {
                _resolved._drive = currDrv.Name;
            }

            if (_relativity == PathType.RelativeToDir || _relativity == PathType.RelativeToDriveDir)
            {
                _resolved._relativity = PathType.RelativeToDriveRoot;
                FileSysEmulator.FsDir currDir = currDrv.CurrentDir;
                if (currDir != null)
                {
                    List <String> lst = currDir.GetLocationSteps(false);
                    lst.AddRange(_locationSteps);
                    _resolved._locationSteps = lst.ToArray();
                }
                else
                {
                    _resolved._locationSteps = _locationSteps;
                }
            }
            else
            {
                _resolved._locationSteps = _locationSteps;
            }


            _resolved._arg = _resolved.GetFullPath();
        }