예제 #1
0
            private UIImage GetSourceImage(Linn.Kinsky.Source aSource)
            {
                switch (aSource.Type)
                {
                case Linn.Kinsky.Source.kSourceAux:
                case Linn.Kinsky.Source.kSourceAnalog:
                case Linn.Kinsky.Source.kSourceSpdif:
                case Linn.Kinsky.Source.kSourceToslink:
                    return(KinskyTouch.Properties.ResourceManager.SourceExternal);

                case Linn.Kinsky.Source.kSourceDisc:
                    return(KinskyTouch.Properties.ResourceManager.SourceDisc);

                case Linn.Kinsky.Source.kSourceDs:
                    return(KinskyTouch.Properties.ResourceManager.SourcePlaylist);

                case Linn.Kinsky.Source.kSourceRadio:
                case Linn.Kinsky.Source.kSourceTuner:
                    return(KinskyTouch.Properties.ResourceManager.SourceRadio);

                case Linn.Kinsky.Source.kSourceUpnpAv:
                    return(KinskyTouch.Properties.ResourceManager.SourceUpnpAv);

                case Linn.Kinsky.Source.kSourceReceiver:
                    return(KinskyTouch.Properties.ResourceManager.SourceSongcast);

                default:
                    return(KinskyTouch.Properties.ResourceManager.SourceExternal);
                }
            }
예제 #2
0
 public void InsertItem(int aIndex, Linn.Kinsky.Source aSource)
 {
     iTableView.BeginUpdates();
     iSources.Insert(aIndex, aSource);
     iTableView.InsertRows(new NSIndexPath[] { NSIndexPath.FromRowSection(aIndex, 0) }, UITableViewRowAnimation.Fade);
     iTableView.EndUpdates();
 }
예제 #3
0
            public void ItemChanged(Linn.Kinsky.Source aSource)
            {
                int index = iSources.IndexOf(aSource);

                if (index > -1)
                {
                    iTableView.ReloadRows(new NSIndexPath[] { NSIndexPath.FromRowSection(index, 0) }, UITableViewRowAnimation.Fade);
                }
            }
예제 #4
0
            public void RemoveItem(Linn.Kinsky.Source aSource)
            {
                int index = iSources.IndexOf(aSource);

                if (index > -1)
                {
                    iTableView.BeginUpdates();
                    iSources.Remove(aSource);
                    iTableView.DeleteRows(new NSIndexPath[] { NSIndexPath.FromRowSection(index, 0) }, UITableViewRowAnimation.Fade);
                    iTableView.EndUpdates();
                }
            }
예제 #5
0
            public NSIndexPath IndexPathFor(Linn.Kinsky.Source aSource)
            {
                if (aSource != null)
                {
                    int index = iSources.IndexOf(aSource);
                    if (index > -1)
                    {
                        return(NSIndexPath.FromRowSection(index, 0));
                    }
                }

                return(null);
            }
예제 #6
0
        public void SetSelected(T aItem)
        {
            if (aItem is Linn.Kinsky.Room)
            {
                Linn.Kinsky.Room room = aItem as Linn.Kinsky.Room;
                iButton.Title = room.Name;
            }
            else if (aItem is Linn.Kinsky.Source)
            {
                Linn.Kinsky.Source source = aItem as Linn.Kinsky.Source;
                iButton.Title = String.Format("{0}", source.Name);
            }
            else
            {
                iButton.Title = iDefaultTitle;
                Dismiss();
            }

            iSelectedItem = aItem;
        }
예제 #7
0
            public override UITableViewCell GetCell(UITableView aTableView, NSIndexPath aIndexPath)
            {
                CellDefault cell = aTableView.DequeueReusableCell(kCellIdentifier) as CellDefault;

                if (cell == null)
                {
                    CellDefaultFactory factory = new CellDefaultFactory();
                    NSBundle.MainBundle.LoadNib("CellDefault", factory, null);
                    cell = factory.Cell;
                }

                cell.BackgroundColor = UIColor.Black;
                cell.SelectionStyle  = UITableViewCellSelectionStyle.Gray;
                //cell.TextLabel.TextColor = UIColor.White;

                Linn.Kinsky.Source source = iSources[aIndexPath.Row];
                cell.Title     = source.Name;
                cell.Image     = GetSourceImage(source);
                cell.Accessory = (iSource == source) ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None;

                return(cell);
            }
예제 #8
0
            public void SetSource(Linn.Kinsky.Source aSource)
            {
                Linn.Kinsky.Source oldSource = iSource;
                iSource = aSource;

                if (oldSource != null)
                {
                    int index = iSources.IndexOf(oldSource);
                    if (index > -1)
                    {
                        iTableView.ReloadRows(new NSIndexPath[] { NSIndexPath.FromRowSection(index, 0) }, UITableViewRowAnimation.Fade);
                    }
                }

                if (aSource != null)
                {
                    int index = iSources.IndexOf(aSource);
                    if (index > -1)
                    {
                        iTableView.ReloadRows(new NSIndexPath[] { NSIndexPath.FromRowSection(index, 0) }, UITableViewRowAnimation.Fade);
                    }
                }
            }