コード例 #1
0
ファイル: ScriptExecution.cs プロジェクト: heruix/WinDbgCs
            /// <summary>
            /// Normalizes specified source path with respect to base file path.
            /// </summary>
            /// <param name="path">The source path to normalize. May be absolute or relative.</param>
            /// <param name="baseFilePath">Path of the source file that contains the <paramref name="path" /> (may also be relative), or null if not available.</param>
            /// <returns>
            /// Normalized path, or null if <paramref name="path" /> can't be normalized. The resulting path doesn't need to exist.
            /// </returns>
            public override string NormalizePath(string path, string baseFilePath)
            {
                // Try to see if it is import user type options
                ImportUserTypeOptions options = ImportUserTypeOptions.ParseString(path);

                if (options != null)
                {
                    return(options.Serialize());
                }

                // Normalize path
                string result = originalSourceResolver.NormalizePath(path, baseFilePath);

                return(result);
            }
コード例 #2
0
ファイル: ScriptExecution.cs プロジェクト: heruix/WinDbgCs
            /// <summary>
            /// Resolves specified path with respect to base file path.
            /// </summary>
            /// <param name="path">The path to resolve. May be absolute or relative.</param>
            /// <param name="baseFilePath">Path of the source file that contains the <paramref name="path" /> (may also be relative), or null if not available.</param>
            /// <returns>
            /// Normalized path, or null if the file can't be resolved.
            /// </returns>
            public override string ResolveReference(string path, string baseFilePath)
            {
                // Try to see if it is import user type options
                ImportUserTypeOptions options = ImportUserTypeOptions.ParseString(path);

                if (options != null)
                {
                    return(options.Serialize());
                }

                // Do resolve reference
                string result = originalSourceResolver.ResolveReference(path, baseFilePath);

                if (string.IsNullOrEmpty(result))
                {
                    result = ResolvePath(path, baseFilePath);
                }

                return(result);
            }