Exemplo n.º 1
0
        /// <summary>Load AblyPlatform.dll, instantiate AblyPlatform.PlatformImpl type.</summary>
        static IoC()
        {
            var name = new AssemblyName("IO.Ably");
            var type = Assembly.Load(name).GetType("IO.Ably.Platform");

            if (type != null)
            {
                var obj = Activator.CreateInstance(type);
                Platform = obj as IPlatform;
            }
            else
            {
                DefaultLogger.Debug("Platform class does not exist. Defaulting Microsoft Websocket library.");
            }
        }
Exemplo n.º 2
0
 /// <summary>Load AblyPlatform.dll, instantiate AblyPlatform.PlatformImpl type.</summary>
 static IoC()
 {
     try
     {
         var name = new AssemblyName("IO.Ably");
         var asm  = Assembly.Load(name);
         var type = Assembly.Load(name).GetType("IO.Ably.Platform");
         if (type != null)
         {
             var obj = Activator.CreateInstance(type);
             Platform = obj as IPlatform;
         }
         else
         {
             DefaultLogger.Debug("Platform class does not exist. Defaulting Microsoft Websocket library.");
         }
     }
     catch (FileNotFoundException e)
     {
         DefaultLogger.Debug($"Assembly cannot be loaded. Defaulting Microsoft Websocket library. ({e.Message})");
     }
 }