コード例 #1
0
ファイル: Window1.xaml.cs プロジェクト: Dimidx/htpcutils
        private void Load()
        {
            XBMC.SetIp(Settings.Default.Ip);
            XBMC.SetConnectionTimeout(Settings.Default.ConnectionTimeout);
            XBMC.SetCredentials(Settings.Default.UserName, Settings.Default.Password);
            XBMC.NowPlaying.FistTime = true;
            XBMC.Status.Refresh();


            //Chargement des artistes
            string[] _art = XBMC.Database.GetArtists();
            ObservableCollection <MusicArtist> _artistes = new ObservableCollection <MusicArtist>();

            if (_art != null)
            {
                foreach (string item in _art)
                {
                    MusicArtist art = new MusicArtist();
                    art.Artist = item;
                    _artistes.Add(art);
                }
            }
            lstArtistes.ItemsSource = _artistes;
            Console.WriteLine(lstPlaylist.Items.Count.ToString());
        }
コード例 #2
0
        private void XbmcConnect()
        {
            oStatusUpdate.Stop();
            if (oConfiguration.values.ipAddress != "")
            {
                oXbmc.SetIp(oConfiguration.values.ipAddress);
                oXbmc.SetConnectionTimeout(Convert.ToInt32(oConfiguration.values.connectionTimeout) * 1000);
                oXbmc.SetCredentials(oConfiguration.values.username, oConfiguration.values.password);
                this.isConnected = (oXbmc.Status.WebServerEnabled()) ? true : false;

                if (IsConnected())
                {
                    if (!oStatusUpdate.IsRunning())
                    {
                        oStatusUpdate.Start();
                    }
                    SetStartupvalues();
                    oStatusUpdate = new StatusUpdate(this);
                }
                else
                {
                    oStatusUpdate.Stop();
                    oHelper.Messagebox("Could not connect to XBMC with the current configuration.");
                    nbRight.CurrentPage = 3;
                }
            }
            else
            {
                oStatusUpdate.Stop();
                oHelper.Messagebox("Configure XBMControl to connect with XBMC.");
                nbRight.CurrentPage = 3;
            }
        }
コード例 #3
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        oXbmc = new XBMC_Communicator();
        oXbmc.SetIp("10.0.0.5");
        oXbmc.SetConnectionTimeout(4000);
        oXbmc.SetCredentials("", "");
        oXbmc.Status.StartHeartBeat();

        Build();

        this.AllowStaticAccess();

        //Create objects used
        oPlaylist     = new Playlist(this);
        oControls     = new Controls(this);
        oMenuItems    = new MenuItems(this);
        oContextMenu  = new ContextMenu(this);
        oShareBrowser = new ShareBrowser(this);
        oTrayicon     = new SysTrayIcon(this);
        oStatusUpdate = new StatusUpdate(this);
        oMediaInfo    = new MediaInfo(this);
        oNowPlaying   = new NowPlaying(this);
        oGuiConfig    = new GuiConfig(this);

        nbDataContainer.CurrentPage = 0;
    }
コード例 #4
0
 private void XbmcConnect()
 {
     oXbmc = new XBMC_Communicator();
     oXbmc.SetIp("10.0.0.5");
     oXbmc.SetConnectionTimeout(4000);
     oXbmc.SetCredentials("", "");
     oXbmc.Status.StartHeartBeat();
 }
コード例 #5
0
ファイル: Window2.xaml.cs プロジェクト: Dimidx/htpcutils
        public Window2()
        {
            XBMC.SetIp("127.0.0.1:80");
            XBMC.SetConnectionTimeout(Settings.Default.ConnectionTimeout);
            XBMC.SetCredentials(Settings.Default.UserName, Settings.Default.Password);
            this.DataContext = XBMC;



            InitializeComponent();
        }
コード例 #6
0
 public MainForm()
 {
     Language = new XBMCLanguage();
     XBMC     = new XBMC_Communicator();
     XBMC.SetIp(Settings.Default.Ip);
     XBMC.SetConnectionTimeout(Settings.Default.ConnectionTimeout);
     XBMC.SetCredentials(Settings.Default.Username, Settings.Default.Password);
     InitializeComponent();
     ApplySettings();
     SetLanguageStrings();
     Initialize();
 }
コード例 #7
0
        internal void ApplySettings()
        {
            XBMC.SetConnectionTimeout(Settings.Default.ConnectionTimeout);
            XBMC.SetCredentials(Settings.Default.Username, Settings.Default.Password);
            XBMC.SetIp(Settings.Default.Ip);

            Language.SetLanguage(Settings.Default.Language);
            notifyIcon1.Visible = Settings.Default.ShowInSystemTray;

            this.Visible     = Settings.Default.ShowInTaskbar;
            this.WindowState = (Settings.Default.StartMinimized) ? FormWindowState.Minimized : FormWindowState.Normal;
            this.SetLanguageStrings();
        }