Beispiel #1
0
        public ReportWindow()
        {
            var instance = Active.OfType <ReportWindow>().LastOrDefault();

            if (instance != null)
            {
                this.Left   = instance.Left + STARTUP_LOCATION_OFFSET;
                this.Top    = instance.Top + STARTUP_LOCATION_OFFSET;
                this.Width  = instance.Width;
                this.Height = instance.Height;
            }
            else if (!global::FoxTunes.Properties.Settings.Default.ReportWindowBounds.IsEmpty())
            {
                if (ScreenHelper.WindowBoundsVisible(global::FoxTunes.Properties.Settings.Default.ReportWindowBounds))
                {
                    this.Left = global::FoxTunes.Properties.Settings.Default.ReportWindowBounds.Left;
                    this.Top  = global::FoxTunes.Properties.Settings.Default.ReportWindowBounds.Top;
                }
                this.Width  = global::FoxTunes.Properties.Settings.Default.ReportWindowBounds.Width;
                this.Height = global::FoxTunes.Properties.Settings.Default.ReportWindowBounds.Height;
            }
            else
            {
                this.Width  = 600;
                this.Height = 400;
            }
            if (double.IsNaN(this.Left) || double.IsNaN(this.Top))
            {
                this.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            }
            this.InitializeComponent();
        }
        protected virtual async Task <ToolWindow> Load(ToolWindowConfiguration config)
        {
            try
            {
                if (!ScreenHelper.WindowBoundsVisible(new Rect(config.Left, config.Top, config.Width, config.Height)))
                {
                    //Prevent window from opening off screen.
                    config.Left = 0;
                    config.Top  = 0;
                }
                var window = default(ToolWindow);
                await global::FoxTunes.Windows.Invoke(() =>
                {
                    window = new ToolWindow();
                    window.Configuration = config;
                    window.ShowActivated = false;
                    //Don't set owner as it causes an "always on top" type of behaviour.
                    //We have an option for that.
                    //window.Owner = global::FoxTunes.Windows.ActiveWindow;
                    window.Closed += this.OnClosed;
                }).ConfigureAwait(false);

                this.Windows[config] = window;
                this.OnLoaded(config, window);
                return(window);
            }
            catch (Exception e)
            {
                Logger.Write(this, LogLevel.Warn, "Failed to load config: {0}", e.Message);
                return(null);
            }
        }
Beispiel #3
0
        public MiniWindow()
        {
            var configuration = ComponentRegistry.Instance.GetComponent <IConfiguration>();

            if (configuration != null)
            {
                var element = configuration.GetElement <BooleanConfigurationElement>(
                    WindowsUserInterfaceConfiguration.SECTION,
                    WindowsUserInterfaceConfiguration.EXTEND_GLASS_ELEMENT
                    );
                if (element != null)
                {
                    element.ConnectValue(value => this.IsGlassEnabled = value);
                }
            }
            if (!global::FoxTunes.Properties.Settings.Default.MiniWindowBounds.IsEmpty())
            {
                if (ScreenHelper.WindowBoundsVisible(global::FoxTunes.Properties.Settings.Default.MiniWindowBounds))
                {
                    this.Left = global::FoxTunes.Properties.Settings.Default.MiniWindowBounds.Left;
                    this.Top  = global::FoxTunes.Properties.Settings.Default.MiniWindowBounds.Top;
                }
            }
            this.InitializeComponent();
        }
Beispiel #4
0
 public MiniWindow()
 {
     if (!global::FoxTunes.Properties.Settings.Default.MiniWindowBounds.IsEmpty())
     {
         if (ScreenHelper.WindowBoundsVisible(global::FoxTunes.Properties.Settings.Default.MiniWindowBounds))
         {
             this.Left = global::FoxTunes.Properties.Settings.Default.MiniWindowBounds.Left;
             this.Top  = global::FoxTunes.Properties.Settings.Default.MiniWindowBounds.Top;
         }
     }
     this.InitializeComponent();
 }
Beispiel #5
0
 public EqualizerWindow()
 {
     if (!global::FoxTunes.Properties.Settings.Default.EqualizerWindowBounds.IsEmpty())
     {
         if (ScreenHelper.WindowBoundsVisible(global::FoxTunes.Properties.Settings.Default.EqualizerWindowBounds))
         {
             this.Left = global::FoxTunes.Properties.Settings.Default.EqualizerWindowBounds.Left;
             this.Top  = global::FoxTunes.Properties.Settings.Default.EqualizerWindowBounds.Top;
         }
     }
     if (double.IsNaN(this.Left) || double.IsNaN(this.Top))
     {
         this.WindowStartupLocation = WindowStartupLocation.CenterOwner;
     }
     this.InitializeComponent();
 }
Beispiel #6
0
 private DialogWindow()
 {
     if (!global::FoxTunes.Properties.Settings.Default.SettingsWindowBounds.IsEmpty())
     {
         if (ScreenHelper.WindowBoundsVisible(global::FoxTunes.Properties.Settings.Default.SettingsWindowBounds))
         {
             this.Left = global::FoxTunes.Properties.Settings.Default.SettingsWindowBounds.Left;
             this.Top  = global::FoxTunes.Properties.Settings.Default.SettingsWindowBounds.Top;
         }
         this.Width  = global::FoxTunes.Properties.Settings.Default.SettingsWindowBounds.Width;
         this.Height = global::FoxTunes.Properties.Settings.Default.SettingsWindowBounds.Height;
     }
     else
     {
         this.Width  = 800;
         this.Height = 600;
     }
     if (double.IsNaN(this.Left) || double.IsNaN(this.Top))
     {
         this.WindowStartupLocation = WindowStartupLocation.CenterOwner;
     }
 }
 public PlaylistManagerWindow()
 {
     if (!global::FoxTunes.Properties.Settings.Default.PlaylistManagerWindowBounds.IsEmpty())
     {
         if (ScreenHelper.WindowBoundsVisible(global::FoxTunes.Properties.Settings.Default.PlaylistManagerWindowBounds))
         {
             this.Left = global::FoxTunes.Properties.Settings.Default.PlaylistManagerWindowBounds.Left;
             this.Top  = global::FoxTunes.Properties.Settings.Default.PlaylistManagerWindowBounds.Top;
         }
         this.Width  = global::FoxTunes.Properties.Settings.Default.PlaylistManagerWindowBounds.Width;
         this.Height = global::FoxTunes.Properties.Settings.Default.PlaylistManagerWindowBounds.Height;
     }
     else
     {
         this.Width  = 600;
         this.Height = 400;
     }
     if (double.IsNaN(this.Left) || double.IsNaN(this.Top))
     {
         this.WindowStartupLocation = WindowStartupLocation.CenterOwner;
     }
     this.InitializeComponent();
 }