Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of <see cref="VirtualizationEngine"/>.
        /// </summary>
        /// <param name="configurationProvider">
        /// The <see cref="IConfigurationProvider"/> to use for loading the required resources.
        /// </param>
        /// <returns></returns>
        public static VirtualizationEngine InitializeEngine(IConfigurationProvider configurationProvider)
        {
            var syncBus = new SynchronizationBus(configurationProvider);
            var engine  = new VirtualizationEngine(syncBus);

            if (!configurationProvider.ConnectionStrings.ContainsKey(ConfigurationDataType.FileSystemRoot))
            {
                throw new ConfigurationDataException(ConfigurationDataType.FileSystemRoot);
            }
            var fsProvider = new FileSystemProvider(configurationProvider.ConnectionStrings[ConfigurationDataType.FileSystemRoot],
                                                    configurationProvider.GetFileSystemEngineRules());
            var regProvider = new RegistryProvider(syncBus);

            engine._hookManager.RegisterHookProvider(new FileSystemHookProvider(fsProvider));
            engine._hookManager.RegisterHookProvider(new RegistryHookProvider(regProvider));
            return(engine);
        }
 /// <summary>
 /// Private constructor, instantiates the class variables.
 /// </summary>
 /// <param name="synchronizationBus"></param>
 private VirtualizationEngine(SynchronizationBus synchronizationBus)
 {
   _hookManager = new HookManager();
   _syncBus = synchronizationBus;
 }
 /// <summary>
 /// Initializes a new instance of <see cref="VirtualizationEngine"/>.
 /// </summary>
 /// <param name="configurationProvider">
 /// The <see cref="IConfigurationProvider"/> to use for loading the required resources.
 /// </param>
 /// <returns></returns>
 public static VirtualizationEngine InitializeEngine(IConfigurationProvider configurationProvider)
 {
   var syncBus = new SynchronizationBus(configurationProvider);
   var engine = new VirtualizationEngine(syncBus);
   if (!configurationProvider.ConnectionStrings.ContainsKey(ConfigurationDataType.FileSystemRoot))
     throw new ConfigurationDataException(ConfigurationDataType.FileSystemRoot);
   var fsProvider = new FileSystemProvider(configurationProvider.ConnectionStrings[ConfigurationDataType.FileSystemRoot],
                                           configurationProvider.GetFileSystemEngineRules());
   var regProvider = new RegistryProvider(syncBus);
   engine._hookManager.RegisterHookProvider(new FileSystemHookProvider(fsProvider));
   engine._hookManager.RegisterHookProvider(new RegistryHookProvider(regProvider));
   return engine;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Private constructor, instantiates the class variables.
 /// </summary>
 /// <param name="synchronizationBus"></param>
 private VirtualizationEngine(SynchronizationBus synchronizationBus)
 {
     _hookManager = new HookManager();
     _syncBus     = synchronizationBus;
 }