private void Main_Load(object sender, EventArgs e) { // set the list scroll fluidness this.senseListCtrl.Velocity = .80f; // turn off UI updating this.senseListCtrl.BeginUpdate(); // create header divider item StedySoft.SenseSDK.SensePanelDividerItem header = new StedySoft.SenseSDK.SensePanelDividerItem(); //create panel item StedySoft.SenseSDK.SensePanelItem item = new StedySoft.SenseSDK.SensePanelItem(); //---main menu divider---// //header.Text = "Requests"; //this.senseListCtrl.AddItem(header); //add submit taxi request panel IImage iimg = this.getMenuIcon("submit_request"); item.IThumbnail = iimg; item.PrimaryText = "Submit a taxishare request "; item.SecondaryText = "Request a taxi from your destination"; item.Tag = "taxiReqTag"; item.OnClick += new SensePanelItem.ClickEventHandler(OnClickSubmitRequest); this.senseListCtrl.AddItem(item); //add about panel item = new StedySoft.SenseSDK.SensePanelItem(); iimg = this.getMenuIcon("about"); item.IThumbnail = iimg; item.PrimaryText = "About"; item.SecondaryText = "About the application"; item.Tag = "aboutAppTag"; item.OnClick += new SensePanelItem.ClickEventHandler(OnClickAbout); this.senseListCtrl.AddItem(item); //add quit panel item = new StedySoft.SenseSDK.SensePanelItem(); iimg = this.getMenuIcon("quit"); item.IThumbnail = iimg; item.PrimaryText = "Quit"; item.SecondaryText = "Exit the application"; item.Tag = "exitAppTag"; item.OnClick += new SensePanelItem.ClickEventHandler(OnClickQuit); this.senseListCtrl.AddItem(item); //update items so they show on the list this.senseListCtrl.EndUpdate(); }
private void AlbumForm_load(object sender, EventArgs e) { JsonClient = new XbmcConnection(App.Configuration.IpAddress, Convert.ToInt32(App.Configuration.WebPort), App.Configuration.Username, App.Configuration.Password); // set the list scroll fluidness this.senseListCtrl.MinimumMovement = App.Configuration.MinimumMovement; this.senseListCtrl.ThreadSleep = App.Configuration.ThreadSleep; this.senseListCtrl.Velocity = App.Configuration.Velocity; this.senseListCtrl.Springback = App.Configuration.Springback; // turn off UI updating this.senseListCtrl.BeginUpdate(); if (Artist != null) Albums = JsonClient.AudioLibrary.GetAlbumsByArtist((int)Artist); else Albums = JsonClient.AudioLibrary.GetAlbums(new string[] { "artist" }, new SortParams("label", null, null, null)); foreach (Album a in Albums) { StedySoft.SenseSDK.SensePanelItem itm = new StedySoft.SenseSDK.SensePanelItem(a._id.ToString()); itm.ButtonAnimation = true; itm.PrimaryText = a.Label; itm.SecondaryText = a.Artist; itm.Tag = a._id; itm.OnClick += new SensePanelItem.ClickEventHandler(OnClickGeneric); this.senseListCtrl.AddItem(itm); } if (Artist != null) { StedySoft.SenseSDK.SensePanelDividerItem divider = new StedySoft.SenseSDK.SensePanelDividerItem(); this.senseListCtrl.AddItem(divider); StedySoft.SenseSDK.SensePanelItem itm = new StedySoft.SenseSDK.SensePanelItem("PanelItemAll"); itm.ButtonAnimation = true; itm.PrimaryText = "All Songs"; itm.Tag = -1; itm.OnClick += new SensePanelItem.ClickEventHandler(OnClickGeneric); this.senseListCtrl.AddItem(itm); } // we are done so turn on UI updating this.senseListCtrl.EndUpdate(); }