internal TargetFrameworkBackend CreateBackendForRuntime(TargetRuntime runtime)
        {
            if (FrameworkNode == null)
            {
                return(null);
            }

            lock (FrameworkNode)
            {
                if (FrameworkNode.ChildNodes == null)
                {
                    return(null);
                }
            }

            foreach (TypeExtensionNode node in FrameworkNode.ChildNodes)
            {
                TargetFrameworkBackend backend = (TargetFrameworkBackend)node.CreateInstance(typeof(TargetFrameworkBackend));
                if (backend.SupportsRuntime(runtime))
                {
                    return(backend);
                }
            }
            return(null);
        }
        protected TargetFrameworkBackend GetBackend(TargetFramework fx)
        {
            if (frameworkBackends == null)
            {
                frameworkBackends = new TargetFrameworkBackend [TargetFramework.FrameworkCount];
            }
            else if (fx.Index >= frameworkBackends.Length)
            {
                Array.Resize(ref frameworkBackends, TargetFramework.FrameworkCount);
            }

            TargetFrameworkBackend backend = frameworkBackends [fx.Index];

            if (backend == null)
            {
                backend = fx.CreateBackendForRuntime(this);
                if (backend == null)
                {
                    backend = CreateBackend(fx);
                    if (backend == null)
                    {
                        backend = new NotSupportedFrameworkBackend();
                    }
                }
                backend.Initialize(this, fx);
                frameworkBackends [fx.Index] = backend;
            }
            return(backend);
        }