GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — scriptcs/src/ScriptCs.Core/ScriptPackManager.cs at dev · scriptcs/scriptcs Expand file tree/ Copy pathScriptPackManager.csMore file actions 33 lines (28 loc) · 1.01 KB / Copy pathScriptPackManager.csFile metadata and controls33 lines (28 loc) · 1.01 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 using System; using System.Collections.Generic; using ScriptCs.Contracts; using ScriptCs.Exceptions; namespace ScriptCs { public class ScriptPackManager : IScriptPackManager { private readonly IDictionary<Type, IScriptPackContext> _contexts = new Dictionary<Type, IScriptPackContext>(); public ScriptPackManager(IEnumerable<IScriptPackContext> contexts) { Guard.AgainstNullArgument("contexts", contexts); foreach (var context in contexts) { _contexts[context.GetType()] = context; } } public TContext Get<TContext>() where TContext : IScriptPackContext { var key = typeof(TContext); if (!_contexts.ContainsKey(key)) { throw new ScriptPackException(string.Format("Tried to resolve a script pack '{0}', but such script pack is not available in the current execution context.", key)); } return (TContext)_contexts[key]; } } } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |