예제 #1
0
 protected virtual void Unload(ToolWindowConfiguration config, ToolWindow window)
 {
     UIDisposer.Dispose(window);
     this.Windows.TryGetValue(config, out window);
     if (!this.Windows.Remove(config))
     {
         return;
     }
     this.OnUnloaded(config, window);
 }
예제 #2
0
 private static void OnMainWindowClosed(object sender, EventArgs e)
 {
     if (IsMainWindowCreated)
     {
         UIDisposer.Dispose(MainWindow);
     }
     _MainWindow = new Lazy <Window>(() => new MainWindow());
     if (MainWindowClosed != null)
     {
         MainWindowClosed(typeof(MainWindow), EventArgs.Empty);
     }
     CheckShutdown();
 }
예제 #3
0
 private static void OnPlaylistManagerWindowClosed(object sender, EventArgs e)
 {
     if (IsPlaylistManagerWindowCreated)
     {
         UIDisposer.Dispose(PlaylistManagerWindow);
     }
     _PlaylistManagerWindow = new Lazy <Window>(() => new PlaylistManagerWindow()
     {
         Owner = ActiveWindow
     });
     if (PlaylistManagerWindowClosed == null)
     {
         return;
     }
     PlaylistManagerWindowClosed(typeof(PlaylistManagerWindow), EventArgs.Empty);
 }
예제 #4
0
 private static void OnTempoWindowClosed(object sender, EventArgs e)
 {
     if (IsTempoWindowCreated)
     {
         UIDisposer.Dispose(TempoWindow);
     }
     _TempoWindow = new Lazy <Window>(() => new TempoWindow()
     {
         Owner = ActiveWindow
     });
     if (TempoWindowClosed == null)
     {
         return;
     }
     TempoWindowClosed(typeof(TempoWindow), EventArgs.Empty);
 }
예제 #5
0
 private static void OnEqualizerWindowClosed(object sender, EventArgs e)
 {
     if (IsEqualizerWindowCreated)
     {
         UIDisposer.Dispose(EqualizerWindow);
     }
     _EqualizerWindow = new Lazy <Window>(() => new EqualizerWindow()
     {
         Owner = ActiveWindow
     });
     if (EqualizerWindowClosed == null)
     {
         return;
     }
     EqualizerWindowClosed(typeof(EqualizerWindow), EventArgs.Empty);
 }
예제 #6
0
 private static void OnToolWindowManagerWindowClosed(object sender, EventArgs e)
 {
     if (IsToolWindowManagerWindowCreated)
     {
         UIDisposer.Dispose(ToolWindowManagerWindow);
     }
     _ToolWindowManagerWindow = new Lazy <Window>(() => new ToolWindowManagerWindow()
     {
         Owner = global::FoxTunes.Windows.ActiveWindow
     });
     if (ToolWindowManagerWindowClosed == null)
     {
         return;
     }
     ToolWindowManagerWindowClosed(typeof(ToolWindowManagerWindow), EventArgs.Empty);
 }
예제 #7
0
 protected virtual Task LoadLayout()
 {
     if (this.Provider != null)
     {
         this.Provider.Updated -= this.OnProviderUpdated;
     }
     this.Provider = LayoutManager.Instance.Provider;
     if (this.Provider != null)
     {
         this.Provider.Updated += this.OnProviderUpdated;
     }
     return(Windows.Invoke(() =>
     {
         if (this.Content is FrameworkElement element)
         {
             UIDisposer.Dispose(element);
         }
         this.Content = LayoutManager.Instance.Load(UILayoutTemplate.Main);
     }));
 }
예제 #8
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (this.ContentControl.Content is FrameworkElement element)
            {
                UIDisposer.Dispose(element);
            }
            var configuration = value as UIComponentConfiguration;

            if (configuration == null || string.IsNullOrEmpty(configuration.Component))
            {
                return(this.CreateSelector());
            }
            var component = default(UIComponentBase);
            var control   = Factory.CreateControl(configuration, out component);

            if (control == null)
            {
                //If a plugin was uninstalled the control will be null.
                return(this.CreateSelector());
            }
            this.Content = component;
            return(control);
        }