예제 #1
0
        public void Update(Package package)
        {
            for (int i = 0; i < list.ChildCount; i++)
            {
                PackageRow view = (PackageRow)list.GetChildAt(i);

                if (view.Id == package.Id)
                {
                    view.Update(package);
                }
            }
        }
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            PackageRow row     = (PackageRow)convertView;
            Package    package = packages[position];

            if (row == null)
            {
                row = new PackageRow(context);
            }

            // Always Detach handler first to avoid multiple handlers on reuse
            row.Button.Click -= Activity.OnAdapterActionButtonClick;
            row.Button.Click += Activity.OnAdapterActionButtonClick;

            row.Update(package);

            return(row);
        }
예제 #3
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            PackageRow row     = (PackageRow)convertView;
            Package    package = packages[position];

            if (row == null)
            {
                row = new PackageRow(context);

                if (Context is AdvancedPackageManagerActivity)
                {
                    row.Button.Click += (context as AdvancedPackageManagerActivity).OnAdapterActionButtonClick;
                }
                else if (Context is OfflineRoutingActivity)
                {
                    row.Button.Click += (context as OfflineRoutingActivity).OnAdapterActionButtonClick;
                }
            }

            row.Update(package);

            return(row);
        }