Пример #1
0
        internal static void Initialize()
        {
            // To-Do: find a more elegant way of iterating through an enum's values and initializing them.
            //foreach (string item in Enum.GetNames(typeof(ResourceStrategyType)))
            //{
            //    IResourceStrategy resourceStrategy =
            //        ResourceStrategyFactory.Create((ResourceStrategyType)Enum.Parse(typeof(ResourceStrategyType), item));

            //    resourceStrategy.Initialize();
            //}

            IResourceStrategy resourceStrategy = ResourceStrategyFactory.Create(ResourceStrategyType.Cache);

            resourceStrategy.Initialize();

            resourceStrategy = ResourceStrategyFactory.Create(ResourceStrategyType.DirectStream);
            resourceStrategy.Initialize();

            resourceStrategy = ResourceStrategyFactory.Create(ResourceStrategyType.LocalFile);
            resourceStrategy.Initialize();
        }
Пример #2
0
 internal ResourceStrategyController(ResourceStrategyType strategyType)
 {
     ResourceStrategy = ResourceStrategyFactory.Create(strategyType);
 }