Ejemplo n.º 1
0
        /// <summary>
        /// Gets a property from the given output.
        /// </summary>
        internal static string GetProperty(this IVsOutput2 output, string name)
        {
            if (output == null)
            {
                throw new ArgumentNullException("output");
            }
            object pvar;

            ErrorHandler.ThrowOnFailure(output.get_Property(name, out pvar));
            return(pvar as string);
        }
Ejemplo n.º 2
0
        private static string GetFilenameFromOutput(IVsOutput2 output)
        {
            object propVal;
            int    hr;

            try {
                hr = output.get_Property("OUTPUTLOC", out propVal);
            } catch (Exception ex) {
                hr      = Marshal.GetHRForException(ex);
                propVal = null;
            }
            var path = propVal as string;

            if (ErrorHandler.Succeeded(hr) && !string.IsNullOrEmpty(path))
            {
                return(path);
            }

            ErrorHandler.ThrowOnFailure(output.get_DeploySourceURL(out path));
            return(new Uri(path).LocalPath);
        }
Ejemplo n.º 3
0
        private static string GetFilenameFromOutput(IVsOutput2 output) {
            object propVal;
            int hr;
            try {
                hr = output.get_Property("OUTPUTLOC", out propVal);
            } catch (Exception ex) {
                hr = Marshal.GetHRForException(ex);
                propVal = null;
            }
            var path = propVal as string;
            if (ErrorHandler.Succeeded(hr) && !string.IsNullOrEmpty(path)) {
                return path;
            }

            ErrorHandler.ThrowOnFailure(output.get_DeploySourceURL(out path));
            return new Uri(path).LocalPath;
        }