예제 #1
0
        /// <summary>
        /// Try to parse view information for a specific version of a diagnostics provider.
        /// </summary>
        /// <param name="viewsPath">Full path to the Views subkey under a single diagnostics provider</param>
        /// <param name="versionName">A subkey beneath the viewsPath</param>
        /// <param name="provider">The provider registration which will be filled in by this.</param>
        /// <returns>true if the view information was parsed successfully</returns>
        bool TryReadVersionedProvider(string viewsPath, string versionName, ref ProviderRegistration provider)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            if (!uint.TryParse(versionName, out provider.version))
            {
                Debug.WriteLine("WARNING: Diagnostics provider '{0}' has a versioned View '{1}' which is not a DWORD", viewsPath, versionName);
                return(false);
            }

            string versionedViewPath = viewsPath + "\\" + versionName;

            if (ErrorHandler.Failed(this.Store.GetString(versionedViewPath, "ViewFactory", out var viewFactory)))
            {
                // ViewFactory is optional (we'll use a generic view), so this isn't an error.
            }
 public RegisteredProvider(ProviderRegistration registration)
     : base(registration.guid, registration.name, registration.package, registration.viewDescriptor)
 {
 }