Esempio n. 1
0
        public SPListItem(SPListView parent, String uri, String title)
        {
            this.Block          = (Block)parent.Block.Clone();
            this.SelectedBlock  = (Block)parent.SelectedBlock.Clone();
            this.DividerBlock   = (Block)parent.stylesheet.Blocks["hr"].Clone();
            this.ParentListView = parent;

            this.parent   = parent;
            this.Uri      = new Uri(uri);
            this.Children = new List <SPListItem>();

            this.Text     = title;
            this.SubBlock = parent.stylesheet.Blocks["::sub"];
        }
Esempio n. 2
0
 public SPListItem(SPListView parent, String uri)
 {
     this.parent         = parent;
     this.ParentListView = parent;
     this.Block          = (Block)parent.stylesheet.Blocks["listitem"].Clone();
     this.SelectedBlock  = (Block)parent.SelectedBlock.Clone();
     this.Uri            = new Uri(uri);
     this.Children       = new List <SPListItem>();
     this.AppInstance    = this.Parent.Host.LoadApp(uri.ToString());
     AppInstance.Loaded += instance_Loaded;
     this.DividerBlock   = (Block)parent.stylesheet.Blocks["hr"].Clone();
     this.SubBlock       = parent.stylesheet.Blocks["::sub"];
     this.Text           = "Loading..";
 }
Esempio n. 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            SpiderHost = new Spider.SpiderHost();
            SpiderHost.RegistredAppTypes.Add("main", typeof(Spider.Apps.main));
            tmrReload = new System.Windows.Forms.Timer();

            this.Controls.Add(SpiderHost);
            SpiderHost.Dock = DockStyle.Fill;
            SPListView listView = new SPListView(this.Stylesheet);
            this.Controls.Add(listView);
            listView.AddItem("Test", new Uri("leros:internal:test"));
            listView.Dock = DockStyle.Left;
            listView.Width = 270;
            SpiderHost.Navigate("spider:main:t");
        }
Esempio n. 4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            SpiderHost = new Spider.SpiderHost(new DummyService());
            SpiderHost.Notify += SpiderHost_Notify;
            SpiderHost.RegistredAppTypes.Add("group", typeof(Apps.group));
            SpiderHost.RegistredAppTypes.Add("internal", typeof(Apps.@internal));
            SpiderHost.RegistredAppTypes.Add("playqueue", typeof(Apps.playqueue));
            SpiderHost.RegistredAppTypes.Add("app", typeof(Apps.app));
            SpiderHost.RegistredAppTypes.Add("artist", typeof(Apps.artist));
            SpiderHost.RegistredAppTypes.Add("album", typeof(Apps.album));
            SpiderHost.RegistredAppTypes.Add("search", typeof(Apps.search));
            SpiderHost.RegistredAppTypes.Add("user", typeof(Apps.user));
            tmrReload = new System.Windows.Forms.Timer();
            listView = new SPListView(this.Stylesheet, SpiderHost);
            this.Controls.Add(SpiderHost);
            SpiderHost.Dock = DockStyle.Fill;
            this.Controls.Add(listView);

            listView.ItemInserted += listView_ItemInserted;
            listView.AddItem(new Uri("spotify:internal:home"), true);
            listView.AddItem("-", new Uri("spotify:internal:placeholder"), true);
            listView.ItemSelected += listView_ItemSelected;
            // this.SpiderHost.MusicService.ObjectsDelivered += MusicService_ObjectsDelivered;
            listView.ItemReordered += listView_ItemReordered;
            listView.Dock = DockStyle.Left;
            listView.Width = 270;
            this.SpiderHost.MusicService.RequestUserObjects();
            this.SpiderHost.MusicService.PlaybackStarted += MusicService_PlaybackStarted;
            var panel = new AppHeader((PixelStyle)this.Stylesheet);
            panel.BackgroundImage = Properties.Resources.header;

            var panel2 = new AppHeader((PixelStyle)this.Stylesheet);
            panel2.BackgroundImage = Properties.Resources.footer;
            panel2.Dock = DockStyle.Bottom;
            panel.Dock = DockStyle.Top;
            panel2.Height = panel2.BackgroundImage.Height;
            panel2.MouseDown += panel2_MouseDown;
            panel.Height = panel.BackgroundImage.Height;
            infoBar = new infobar(this.Stylesheet);
            infoBar.Hide();
            this.Controls.Add(infoBar);
            infoBar.Dock = DockStyle.Top;
            this.Controls.Add(panel);
            panel.MouseMove += panel_MouseMove;

            this.Controls.Add(panel2);
            searchBox = new SearchBox();
            panel.Controls.Add(searchBox);
            searchBox.Left = 80;
            searchBox.Top = 26;
            searchBox.SearchClicked += searchBox_SearchClicked;

            // add some playlists
        }
Esempio n. 5
0
 void listView_ItemSelected(object Sender, SPListView.SelectedItemEventArgs e)
 {
     if (e.Item.Uri.ToString().StartsWith("spotify:internal:add_playlist"))
     {
         e.Cancel = true;
         NewPlaylist np = new NewPlaylist();
         if (np.ShowDialog() == DialogResult.OK)
         {
             String identifier = this.SpiderHost.MusicService.NewPlaylist(np.PlaylistName);
             this.listView.AddItem(new Uri("" + identifier), false);
             this.listView.Refresh();
         }
         return;
     }
     if (!SpiderHost.Navigate(e.Item.Uri.ToString()))
     {
         infoBar.ShowMessage("Link could not be found", NotificationType.Warning);
     }
 }
Esempio n. 6
0
 void listView_ItemReordered(object sender, SPListView.ItemReorderEventArgs e)
 {
 }
Esempio n. 7
0
 void listView_ItemInserted(object sender, SPListView.ItemInsertEventArgs e)
 {
     this.SpiderHost.MusicService.insertUserObject(e.Uri.ToString(), e.Position);
 }
Esempio n. 8
0
 public SPSidebar(SpiderHost host, Skinning.Style style)
 {
     InitializeComponent();
     this.ListView = new SPListView(style, host);
 }
Esempio n. 9
0
 public SPListItem(SPListView parent)
 {
     this.parent   = parent;
     this.Children = new List <SPListItem>();
 }
Esempio n. 10
0
        public SPListItem(SPListView parent)
        {

            this.parent = parent;
            this.Children = new List<SPListItem>();
        }
Esempio n. 11
0
        public SPListItem(SPListView parent, String uri, String title)
        {
            this.Block = (Block)parent.Block.Clone();
            this.SelectedBlock = (Block)parent.SelectedBlock.Clone();
            this.DividerBlock = (Block)parent.stylesheet.Blocks["hr"].Clone();
            this.ParentListView = parent;

            this.parent = parent;
            this.Uri = new Uri(uri);
            this.Children = new List<SPListItem>();
            
            this.Text = title;
            this.SubBlock = parent.stylesheet.Blocks["::sub"];
        }
Esempio n. 12
0
 public SPListItem(SPListView parent, String uri)
 {
     this.parent = parent;
     this.ParentListView = parent;
     this.Block = (Block)parent.stylesheet.Blocks["listitem"].Clone();
     this.SelectedBlock = (Block)parent.SelectedBlock.Clone();
     this.Uri = new Uri(uri);
     this.Children = new List<SPListItem>();
     this.AppInstance = this.Parent.Host.LoadApp(uri.ToString());
     AppInstance.Loaded += instance_Loaded;
     this.DividerBlock = (Block)parent.stylesheet.Blocks["hr"].Clone();
     this.SubBlock = parent.stylesheet.Blocks["::sub"];
     this.Text = "Loading..";
 }