コード例 #1
0
            public bool CanGetAbsolutePathFrom(IAbsoluteDirectoryPath path, out string failureMessage)
            {
                Debug.Assert(path != null);                 // Enforced by contract
                string pathAbsoluteUnused;

                return(AbsoluteRelativePathHelpers.TryGetAbsolutePathFrom(path, this, out pathAbsoluteUnused, out failureMessage));
            }
コード例 #2
0
            public bool CanGetAbsolutePathFrom(IAbsoluteDirectoryPath path, out string failureMessage)
            {
                Argument.IsNotNull(nameof(path), path);

                string absolutePath;

                return(AbsoluteRelativePathHelpers.TryGetAbsolutePathFrom(path, this, out absolutePath, out failureMessage));
            }
コード例 #3
0
            //
            //  Absolute/Relative pathString conversion
            //
            IAbsoluteDirectoryPath IRelativeDirectoryPath.GetAbsolutePathFrom(IAbsoluteDirectoryPath path)
            {
                Debug.Assert(path != null);                 // Enforced by contracts!
                string pathAbsolute, failureReason;

                if (!AbsoluteRelativePathHelpers.TryGetAbsolutePathFrom(path, this, out pathAbsolute, out failureReason))
                {
                    throw new ArgumentException(failureReason);
                }
                Debug.Assert(pathAbsolute != null);
                Debug.Assert(pathAbsolute.Length > 0);
                return(pathAbsolute.ToAbsoluteDirectoryPath());
            }
コード例 #4
0
            IAbsoluteFilePath IRelativeFilePath.GetAbsolutePathFrom(IAbsoluteDirectoryPath path)
            {
                Argument.IsNotNull(nameof(path), path);

                string absolutePath, failureMessage;

                if (!AbsoluteRelativePathHelpers.TryGetAbsolutePathFrom(path, this, out absolutePath, out failureMessage))
                {
                    throw new ArgumentException(failureMessage);
                }

                //Debug.Assert(pathAbsolute != null);
                //Debug.Assert(pathAbsolute.Length > 0);

                return((absolutePath + MiscHelpers.DirectorySeparatorChar + FileName).ToAbsoluteFilePath());
            }