Inheritance: IPluginManager
Ejemplo n.º 1
0
 public void Reload(IPluginHost host, string pluginsDirectory = null)
 {
     if (pluginManager == null)
     {
         pluginManager = new PluginManager.PluginManager(host, pluginsDirectory);
     }
     pluginManager.LoadPlugins();
     //Initialize the plugins
     foreach (var p in pluginManager.Plugins)
     {
         try
         {
             p.Client.Initialize();
         }
         catch (Exception)
         {
             // write better code ;) or throw in the trash (pun intended)
         }
     }
 }
Ejemplo n.º 2
0
 void LoadPlugins()
 {
     pluginManager = new PluginManager.PluginManager(this, Handler.Instance.DirPlugins);
     //Initialize the plugins
     foreach (var p in pluginManager.Plugins)
     {
         try
         {
             p.Client.Initialize();
         }
         catch (Exception)
         {
             // write better code ;) or throw in the trash (pun intended)
         }
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Constructor for Main Window
        ///     - Init Visualisation
        ///     - Text Scrolling
        ///     - Add Event Handlers
        ///     - Apply a Skin 
        ///     - Initialize Tray Icon
        /// </summary>
        /// <param name="appHandle"></param>
        /// <param name="aConfiguration"></param>
        /// <param name="aPluginManager"></param>
        public Standard(App appHandle, Configuration aConfiguration, PluginManager.PluginManager aPluginManager)
        {
            _anAppHandle = appHandle;
            AConfiguration = aConfiguration;
            APluginManager = aPluginManager;
            _aVisualization = new Visualization(2048, VisTimerInMs);

            /*clockVis = new System.Windows.Threading.DispatcherTimer();
            clockVis.Interval = new TimeSpan(0, 0, 0, 0, VisTimerInMs);
            clockVis.Tick += new EventHandler(ClockVisTick);
            */

            _clockScrollingText = new DispatcherTimer { Interval = new TimeSpan(0, 0, 0, 0, ScrollSpeed) };
            _clockScrollingText.Tick += ClockScrollingTextTick;
            _clockScrollingText.IsEnabled = true;

            _scrollDataArtist = new ScrollData();
            _scrollDataAlbum = new ScrollData { ScrollWidthCorrection = -8 };
            _scrollDataTitle = new ScrollData();

            _currentHighlightedSong = -1;

            _changeSeekBarDragged = false;

            InitializeComponent();
            _currentVis = 1;
            _insertFolder = false;

            // Initialise Click-Into BarHandlers
            changeSeekBar.AddHandler(PreviewMouseLeftButtonDownEvent, new RoutedEventHandler(ChangeSeekBarMouseLeftButtonDown), true);
            changeVolumeBar.AddHandler(PreviewMouseLeftButtonDownEvent, new RoutedEventHandler(ChangeVolumeBarMouseLeftButtonDown), true);
            changeBalance.AddHandler(PreviewMouseLeftButtonDownEvent, new RoutedEventHandler(changeBalanceSlide), true);
            sliderEQBand0.AddHandler(PreviewMouseLeftButtonDownEvent, new RoutedEventHandler(sliderEQBand_DragCompleted), true);
            sliderEQBand1.AddHandler(PreviewMouseLeftButtonDownEvent, new RoutedEventHandler(sliderEQBand_DragCompleted), true);
            sliderEQBand2.AddHandler(PreviewMouseLeftButtonDownEvent, new RoutedEventHandler(sliderEQBand_DragCompleted), true);
            sliderEQBand3.AddHandler(PreviewMouseLeftButtonDownEvent, new RoutedEventHandler(sliderEQBand_DragCompleted), true);
            sliderEQBand4.AddHandler(PreviewMouseLeftButtonDownEvent, new RoutedEventHandler(sliderEQBand_DragCompleted), true);
            sliderEQBand5.AddHandler(PreviewMouseLeftButtonDownEvent, new RoutedEventHandler(sliderEQBand_DragCompleted), true);
            sliderEQBand6.AddHandler(PreviewMouseLeftButtonDownEvent, new RoutedEventHandler(sliderEQBand_DragCompleted), true);
            sliderEQBand7.AddHandler(PreviewMouseLeftButtonDownEvent, new RoutedEventHandler(sliderEQBand_DragCompleted), true);
            sliderEQBand8.AddHandler(PreviewMouseLeftButtonDownEvent, new RoutedEventHandler(sliderEQBand_DragCompleted), true);
            sliderEQBand9.AddHandler(PreviewMouseLeftButtonDownEvent, new RoutedEventHandler(sliderEQBand_DragCompleted), true);

            //Trayiconstuff
            _componentForTray = new Container();
            _notifyIcon1 = new NotifyIcon(_componentForTray);

            //Apply skin
            _currentSkin = aConfiguration.UsedSkin;
            ApplySkin(_currentSkin);

            //Gamnoise Plugin
            _dictPluginWindows = new Dictionary<string, Plugin>();
            InitPlugins();
        }