Exemplo n.º 1
0
 private void debugConsoleToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (iFormUserLog.IsDisposed)
     {
         iFormUserLog = new FormUserLog(iHelper.Icon);
     }
     iFormUserLog.Show();
 }
Exemplo n.º 2
0
 private void MenuItemDebugClick(object sender, EventArgs e)
 {
     if (iFormUserLog == null || iFormUserLog.IsDisposed)
     {
         iFormUserLog = new FormUserLog(Icon);
     }
     iFormUserLog.Show();
 }
Exemplo n.º 3
0
 private void consoleToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (iFormUserLog.IsDisposed)
     {
         iFormUserLog = new FormUserLog(Icon);
     }
     iFormUserLog.SetBackColour(iViewSupport.BackColour);
     iFormUserLog.SetForeColour(iViewSupport.ForeColour);
     iFormUserLog.SetFont(iViewSupport.FontSmall);
     iFormUserLog.Show();
 }
Exemplo n.º 4
0
        public FormLinnSetup(HelperLinnSetup aHelper, Diagnostics aDiagnostics, AppletManager aManager)
        {
            iManager     = aManager;
            iHelper      = aHelper;
            iDiagnostics = aDiagnostics;

            iFormUserLog = new FormUserLog(iHelper.Icon);
            iFormUserLog.SetBackColour(Color.Black);
            iFormUserLog.SetForeColour(Color.White);

            InitializeComponent();

            this.WindowState = FormWindowState.Maximized;
            this.Text        = iHelper.Product;
            this.Icon        = iHelper.Icon;

            releaseNotesToolStripMenuItem.Image     = Linn.Toolkit.WinForms.Properties.Resources.Rss;
            betaReleaseNotesToolStripMenuItem.Image = Linn.Toolkit.WinForms.Properties.Resources.Rss;

            // select view
            if (aHelper.ApplicationOptions.ViewDetails)
            {
                tableLayoutPanel1.Visible           = false;
                listView1.Visible                   = true;
                deviceDetailsToolStripMenuItem.Text = "Icons";
            }

            // set up column sorting
            listView1.ListViewItemSorter = new ComparerListView(0); // default to sort by room

            //create tabs for applets
            for (int i = 0; i < iManager.AppletNames.Count; i++)
            {
                TabPage page = new TabPage(iManager.AppletNames[i]);
                page.Tag = i;
                tabControl1.TabPages.Add(page);
            }

            statusStrip1.Padding = new Padding(3, 0, 3, 0);
            Closed += EventFormClosedHandler;
        }
Exemplo n.º 5
0
        public FormKinskyDesktop(HelperKinsky aHelperKinsky)
        {
            iCurrentView = 0;

            iHelper = aHelperKinsky;

            KinskyDesktop.Properties.Resources.SetBasePath(iHelper.ExePath.FullName);

            InitializeComponent();

            if (Environment.OSVersion.Platform == PlatformID.Unix)
            {
                SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
            }

            Icon = Icon.FromHandle(Linn.Kinsky.Properties.Resources.KinskyLogo.GetHicon());

            SplitContainer.Panel1MinSize    = 200;
            SplitContainer.Panel2MinSize    = 200;
            SplitContainer.SplitterDistance = (int)(Width * 0.5f);

            Text = iHelper.Product;

            notifyIcon.Text = iHelper.Product;
            try
            {
                notifyIcon.Icon = Icon;
            }
            catch (NotImplementedException) { } // thrown on MacOSX

            kHeaderLeft   = KinskyDesktop.Properties.Resources.Wing1;
            kHeaderRight  = KinskyDesktop.Properties.Resources.Wing2;
            kHeaderFiller = KinskyDesktop.Properties.Resources.FillerTop;

            kFooterLeft   = KinskyDesktop.Properties.Resources.Wing3;
            kFooterRight  = KinskyDesktop.Properties.Resources.Wing4;
            kFooterFiller = KinskyDesktop.Properties.Resources.FillerBottom;

            kRightEdgeFiller = KinskyDesktop.Properties.Resources.RightEdgeFiller;
            kLeftEdgeFiller  = KinskyDesktop.Properties.Resources.LeftEdgeFiller;

            kMiniLeft   = KinskyDesktop.Properties.Resources.MiniWing1;
            kMiniRight  = KinskyDesktop.Properties.Resources.MiniWing2;
            kMiniFiller = KinskyDesktop.Properties.Resources.MiniFiller;

            iBrushHeaderFiller = new TextureBrush(kHeaderFiller);
            iBrushLeftFiller   = new TextureBrush(kLeftEdgeFiller);
            iBrushLeftFiller.TranslateTransform(0, kHeaderLeft.Height);
            iBrushRightFiller  = new TextureBrush(kRightEdgeFiller);
            iBrushFooterFiller = new TextureBrush(kFooterFiller);
            iBrushMiniFiller   = new TextureBrush(kMiniFiller);

            iHttpClient = new HttpClient();
            iHttpServer = new HttpServer(HttpServer.kPortKinskyDesktop);

            iUiOptions = new UiOptions(iHelper);

            iOptionPageGeneral = new OptionPageGeneral();
            iHelper.AddOptionPage(iOptionPageGeneral);

            iOptionPageColours = new OptionPageColours();
            iHelper.AddOptionPage(iOptionPageColours);

            iOptionPageFonts = new OptionPageFonts();
            iHelper.AddOptionPage(iOptionPageFonts);

            iArtworkCache = new ArtworkCache(ArtworkCache.ECacheSize.eMedium);

            iViewSupport = new ViewSupport(iOptionPageColours, iOptionPageFonts);

            iLibrary         = new MediaProviderLibrary(iHelper);
            iLocalPlaylists  = new LocalPlaylists(iHelper, true);
            iSharedPlaylists = new SharedPlaylists(iHelper);

            MediaProviderSupport mediaProviderSupport = new MediaProviderSupport(iHttpServer);

            iOptionPageGeneral.EventTransparencyChanged      += TransparencyOrBorderChanged;
            iOptionPageGeneral.EventWindowBorderChanged      += TransparencyOrBorderChanged;
            iOptionPageGeneral.EventHideMouseCursorChanged   += HideMouseCursorChanged;
            iOptionPageGeneral.EventUseRotaryControlsChanged += UseRotaryControlsChanged;
            iOptionPageGeneral.EventShowToolTipsChanged      += ShowToolTipsChanged;
            iViewSupport.EventSupportChanged += EventSupportChanged;

            iFormUserLog = new FormUserLog(Icon);

            iViewStatus                 = new FormStatus(this, iArtworkCache, iViewSupport);
            iViewStatus.UseTheme        = false;
            iViewStatus.Icon            = Icon;
            iViewStatus.Visible         = false;
            iViewStatus.TopLevel        = false;
            iViewStatus.FormBorderStyle = FormBorderStyle.None;
            iViewStatus.MouseMove      += FormKinskyDesktop_MouseMove;
            Controls.Add(iViewStatus);

            PluginManager pluginManager = new PluginManager(iHelper, iHttpClient, mediaProviderSupport);

            iLocator = new ContentDirectoryLocator(pluginManager, new AppRestartHandler());
            iLocator.Add(MediaProviderLibrary.kLibraryId, iLibrary);
            OptionBool optionLocalPlaylists  = iLocator.Add(LocalPlaylists.kRootId, iLocalPlaylists);
            OptionBool optionSharedPlaylists = iLocator.Add(SharedPlaylists.kRootId, iSharedPlaylists);

            iSaveSupport     = new SaveSupport(iHelper, iSharedPlaylists, optionSharedPlaylists, iLocalPlaylists, optionLocalPlaylists);
            iViewSaveSupport = new ViewSaveSupport(RequestLocalPlaylistFilename, iSaveSupport);

            iPlaySupport = new PlaySupport();

            // create the DropConverter for the browse views
            DropConverter browseDropConverter = new DropConverter();

            browseDropConverter.Add(new DropConverterInternal());
            browseDropConverter.Add(new DropConverterUri());
            browseDropConverter.Add(new DropConverterFileDrop(iHttpServer, false));
            browseDropConverter.Add(new DropConverterText());

            MediatorLocation location = new MediatorLocation();

            MediatorTab tab = new MediatorTab(this, location);

            IBrowser b = new Browser(new Location(iLocator));

            tab.Add(new ViewWidgetTabPage(this, 0), new ViewWidgetBrowser(this, b, iArtworkCache, iViewSupport, iPlaySupport, browseDropConverter, iUiOptions), b);
            b = new Browser(new Location(iLocator));
            tab.Add(new ViewWidgetTabPage(this, 1), new ViewWidgetBrowser(this, b, iArtworkCache, iViewSupport, iPlaySupport, browseDropConverter, iUiOptions), b);
            b = new Browser(new Location(iLocator));
            tab.Add(new ViewWidgetTabPage(this, 2), new ViewWidgetBrowser(this, b, iArtworkCache, iViewSupport, iPlaySupport, browseDropConverter, iUiOptions), b);
            b = new Browser(new Location(iLocator));
            tab.Add(new ViewWidgetTabPage(this, 3), new ViewWidgetBrowser(this, b, iArtworkCache, iViewSupport, iPlaySupport, browseDropConverter, iUiOptions), b);

            location.Add(tab);

            ViewWidgetBreadcrumb breadcrumb = new ViewWidgetBreadcrumb(this, iViewSupport, location, new ViewWidgetButtonUp(this));

            location.Add(breadcrumb);

            // create the DropConverter for the other views
            DropConverter viewDropConverter = new DropConverter();

            viewDropConverter.Add(new DropConverterInternal());
            viewDropConverter.Add(new DropConverterUri());
            viewDropConverter.Add(new DropConverterFileDrop(iHttpServer, true));
            viewDropConverter.Add(new DropConverterText());

            iSourceList = new ReceiverSourceList(iHelper);

            iView  = new View(this, iArtworkCache, iViewSupport, iPlaySupport, iViewSaveSupport, viewDropConverter, iSourceList, iHelper.Senders);
            iModel = new Model(iView, iPlaySupport);

            iMediator = new Mediator(iHelper, iModel);

            iHelper.SetStackExtender(this);
            iHelper.Stack.SetStatusHandler(new StackStatusHandlerWinForms(iHelper.Title, notifyIcon));
        }