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);
        }
Exemple #2
0
 protected TargetFrameworkBackend GetBackend(TargetFramework fx)
 {
     EnsureInitialized();
     lock (frameworkBackends) {
         TargetFrameworkBackend backend;
         if (frameworkBackends.TryGetValue(fx.Id, out backend))
         {
             return(backend);
         }
         backend = fx.CreateBackendForRuntime(this);
         if (backend == null)
         {
             backend = CreateBackend(fx);
             if (backend == null)
             {
                 backend = new NotSupportedFrameworkBackend();
             }
         }
         backend.Initialize(this, fx);
         frameworkBackends[fx.Id] = backend;
         return(backend);
     }
 }
		protected TargetFrameworkBackend GetBackend (TargetFramework fx)
		{
			EnsureInitialized ();
			lock (frameworkBackends) {
				TargetFrameworkBackend backend;
				if (frameworkBackends.TryGetValue (fx.Id, out backend))
					return backend;
				backend = fx.CreateBackendForRuntime (this);
				if (backend == null) {
					backend = CreateBackend (fx);
					if (backend == null)
						backend = new NotSupportedFrameworkBackend ();
				}
				backend.Initialize (this, fx);
				frameworkBackends[fx.Id] = backend;
				return backend;
			}
		}
		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;
		}