Exemplo n.º 1
0
        /// <summary>
        /// Sets the currently active external texture source by name.
        /// </summary>
        /// <param name="texturePluginType">
        /// The string name of the plugin to activate.
        /// </param>
        public void SetCurrentPlugin(string texturePluginType)
        {
            IDictionaryEnumerator i = (IDictionaryEnumerator)TextureSystems.GetEnumerator();

            while (i.MoveNext())
            {
                if ((i.Key as string) == texturePluginType)
                {
                    CurrExternalTextureSource = (ExternalTextureSource)i.Value;
                    CurrExternalTextureSource.Initialize();
                    return;
                }
            }
            CurrExternalTextureSource = null;
            log.ErrorFormat("ExternalTextureSourceManager.SetCurrentPlugin({0}) did not find plugin",
                            texturePluginType);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Called from plugin to register itself
        /// </summary>
        /// <param name="texturePluginType">The string name of the plugin</param>
        /// <param name="textureSystem">The actual texture system</param>
        public void SetExternalTextureSource(string texturePluginType, ExternalTextureSource textureSystem)
        {
            log.InfoFormat("Registering Texture Controller: Type = {0}, Name = {1}",
                           texturePluginType, textureSystem.PluginName);

            IDictionaryEnumerator i = (IDictionaryEnumerator)TextureSystems.GetEnumerator();

            while (i.MoveNext())
            {
                if ((i.Key as string) == texturePluginType)
                {
                    ExternalTextureSource ets = (i.Value as ExternalTextureSource);
                    log.InfoFormat("Shutting Down Texture Controller: {0} to be replaced by: {1}",
                                   ets.PluginName, textureSystem.PluginName);
                    ets.Shutdown();
                    break;
                }
            }
            // Add it to the map, or replace the existing entry
            TextureSystems[texturePluginType] = textureSystem;
        }
 internal ExternalTextureSourceManager()
 {
     CurrExternalTextureSource = null;
 }
 /// <summary>
 /// Sets the currently active external texture source by name.
 /// </summary>
 /// <param name="texturePluginType">
 /// The string name of the plugin to activate.
 /// </param>
 public void SetCurrentPlugin(string texturePluginType)
 {
     IDictionaryEnumerator i = (IDictionaryEnumerator) TextureSystems.GetEnumerator();
     while(i.MoveNext())
     {
         if((i.Key as string) == texturePluginType)
         {
             CurrExternalTextureSource = (ExternalTextureSource)i.Value;
             CurrExternalTextureSource.Initialize();
             return;
         }
     }
     CurrExternalTextureSource = null;
     log.ErrorFormat("ExternalTextureSourceManager.SetCurrentPlugin({0}) did not find plugin",
                     texturePluginType);
 }
        /// <summary>
        /// Called from plugin to register itself
        /// </summary>
        /// <param name="texturePluginType">The string name of the plugin</param>
        /// <param name="textureSystem">The actual texture system</param>
        public void SetExternalTextureSource(string texturePluginType, ExternalTextureSource textureSystem)
        {
            log.InfoFormat("Registering Texture Controller: Type = {0}, Name = {1}",
                           texturePluginType, textureSystem.PluginName);

            IDictionaryEnumerator i = (IDictionaryEnumerator)TextureSystems.GetEnumerator();
            while(i.MoveNext())
            {
                if((i.Key as string) == texturePluginType)
                {
                    ExternalTextureSource ets = (i.Value as ExternalTextureSource);
                    log.InfoFormat("Shutting Down Texture Controller: {0} to be replaced by: {1}",
                                   ets.PluginName, textureSystem.PluginName);
                    ets.Shutdown();
                    break;
                }
            }
            // Add it to the map, or replace the existing entry
            TextureSystems[texturePluginType] = textureSystem;
        }