Exemplo n.º 1
0
        static void Main(string[] args)
        {
            PluginTools plugins = new PluginTools();

            foreach (string item in args)
            {
                Console.WriteLine($"Application arguments: {item}");
            }

            try
            {
                if (plugins.LoadPlugin(args?.Length > 0 ? args[0] : null) == true)
                {
                    Console.WriteLine("Plugin is loaded");

                    Console.WriteLine($"Plugin name: {plugins.Plugin.FullName}");
                }
                else
                {
                    Console.WriteLine("Plugin is NOT found");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            Console.ReadKey();
        }
Exemplo n.º 2
0
 public void GetPluginTools()
 {
     foreach (PluginTool pt in PluginHandler.Plugin.PluginTools)
     {
         PluginTools.Add(pt);
     }
     libTools.ItemsSource = PluginTools;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes all general modules.
        /// Modules that need manual initialization: IAPManager
        /// It's recommended to manually initialize the modules you only need.
        /// </summary>
        public static void Initialize(bool includePluginModules)
        {
            NyanPath.CreateRenkoDirectories();

            Netko.Initialize();
            RenQL.Initialize();
            UnityThread.Initialize();
            Easing.Initialize();

            if (includePluginModules)
            {
                GalleryPicker.Initialize();
                NativeCamera.Initialize();
                PluginTools.Initialize();
            }
        }
        public IEnumerable <T> ConstructEnabledPlugins()
        {
            var plugins = from plugin in Plugins
                          where plugin.IsEnabled
                          select plugin.Construct <T>();

            var pluginList = new List <T>(plugins);

            for (int i = 0; i < pluginList.Count(); i++)
            {
                var plugin = pluginList[i];
                PluginTools.SetPluginSettings(plugin, Settings.PluginSettings);
                pluginList[i] = plugin;
            }

            return(pluginList);
        }
 private void UpdateSettings(T value)
 {
     if (value is T)
     {
         var settings = PluginTools.GetPluginSettings(value);
         foreach (var pair in settings)
         {
             if (Settings.PluginSettings.ContainsKey(pair.Item1))
             {
                 Settings.PluginSettings[pair.Item1] = pair.Item2;
             }
             else
             {
                 Settings.PluginSettings.Add(pair.Item1, pair.Item2);
             }
         }
     }
 }