protected override void Dispose(bool disposing)
 {
     //			OutputImage.Dispose ();
     //			Pc.Dispose ();
     ItemSaved = null;
     ItemDeleted = null;
     InContainerTouched = null;
     InLocationTouched = null;
     currentItem = null;
     ancestor = null;
     ipc = null;
     ass = null;
     tlc = null;
     tag = null;
     base.Dispose (disposing);
 }
        public void ShowDetails(Item myItem)
        {
            if (myItem == null) {
                myItem = new Item ();
            } else {

            }

            this.currentItem = myItem;

            SetContainerButtonLabel (myItem);
            SetLocationButtonLabel (myItem);

            var count = MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("Count", "Count");
            count = count + ":";
            antall.Text = count + currentItem.antall.ToString ();
            this.antallStepper.Value = currentItem.antall;
            this.antallStepper.ValueChanged += (object sender, EventArgs e) => {
                double ant = this.antallStepper.Value;
                antall.Text = count + ant;
                currentItem.antall = ant;
                AppDelegate.dao.SaveItem(currentItem);
            };
            cashValue.Text = currentItem.cashValue.ToString ();
            cashValue.EditingDidEnd += (object sender, EventArgs e) => {
                try{
                    double newvalue = double.Parse(cashValue.Text);
                    currentItem.cashValue = newvalue;
                    AppDelegate.dao.SaveItem(currentItem);
                    Console.WriteLine("saved cashValue:"+currentItem.cashValue);
                }
                catch(Exception ex){
                    Console.WriteLine("coudlnt parse;"+cashValue.Text+"ex:"+ex.ToString());
                    cashValue.Text = currentItem.cashValue.ToString();
                }
            };

            currency.Text = MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("Currency", "Currency");

            if (myItem != null) {
                Console.WriteLine ("myitem er ikke null");

                this.fieldName.Text = myItem.Name;
                this.fieldDescription.Text = myItem.Description;

                if (myItem.ImageFileName != null) {
                    imp.SetNewImageName (myItem.ImageFileName);
                } else {
                    Console.WriteLine ("imagefilename er null");
                }
                AddTagList ();
            } else {
                Console.WriteLine ("myitem er null");
            }

            showReceipts.SetTitle (NSBundle.MainBundle.LocalizedString ("Show Receipts", "Show Receipts"), UIControlState.Normal);
            showReceipts.TouchUpInside += (object sender, EventArgs e) => {
                ipc = new InsurancePhotoController (myItem);
                ancestor.NavigationController.PushViewController(ipc,true);
            };
        }
        public void ShowDetails(LagerObject myobj)
        {
            //TODO remember to deselect left table after showing details
            MyCurrentObject = myobj;

            Title = MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("Big Items Details", "Big Items Details");
            this.fieldBigName.Placeholder = MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("Name", "Name");
            this.fieldBigDescription.Placeholder = MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("Description", "Description");
            var count = MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("Count", "Count");
            count = count + ":";
            if (myobj != null) {

                this.fieldBigName.Text = myobj.Name;
                this.fieldBigName.Font = UIFont.FromName ("Cochin-BoldItalic", 22f);
                this.fieldBigDescription.Text = myobj.Description;
                this.fieldBigDescription.Font = UIFont.FromName ("AmericanTypewriter", 12f);

                antall.Text = count + MyCurrentObject.antall.ToString ();
            }
            AddTagList ();
            releaseKeyboard ();

            if (MyCurrentObject != null) {
                this.antallStepper.Value = MyCurrentObject.antall;
                this.antallStepper.ValueChanged += (object sender, EventArgs e) => {
                    double ant = this.antallStepper.Value;
                    antall.Text = count + ant;
                    MyCurrentObject.antall = ant;
                    AppDelegate.dao.SaveLagerObject (MyCurrentObject);
                };
                cashValue.Text = MyCurrentObject.cashValue.ToString ();
                cashValue.EditingDidEnd += (object sender, EventArgs e) => {
                    try {
                        double newvalue = double.Parse (cashValue.Text);
                        MyCurrentObject.cashValue = newvalue;
                        AppDelegate.dao.SaveLagerObject (MyCurrentObject);
                        Console.WriteLine("saved cashvalue:"+MyCurrentObject.cashValue);
                    } catch (Exception ex) {
                        Console.WriteLine ("coudlnt parse;" + cashValue.Text + "ex:" + ex.ToString ());
                        cashValue.Text = MyCurrentObject.cashValue.ToString ();
                    }
                };
                if (MyCurrentObject.imageFileName != null) {
                    imp.SetNewImageName (MyCurrentObject.imageFileName);
                }
            }

            currency.Text = MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("Currency", "Currency");

            showReceipts.SetTitle (MonoTouch.Foundation.NSBundle.MainBundle.LocalizedString ("Show Receipts", "Show Receipts"), UIControlState.Normal);
            showReceipts.TouchUpInside += (object sender, EventArgs e) => {
                InsurancePhotoController ipc = new InsurancePhotoController(myobj);
                ancestor.NavigationController.PushViewController(ipc,true);
                //PresentViewController(ipc,true, null);
                //nc.PushViewController(ipc,false);
            };
        }
 protected override void Dispose(bool disposing)
 {
     vip.Dispose ();
     vc = null;
     photo = null;
     base.Dispose (disposing);
 }
 public InsurancePhotoDelegate(InsurancePhotoController vc)
 {
     this.vc = vc;
 }
 public InsurancePhotoDataSource(InsurancePhotoController vc)
 {
     this.vc = vc;
 }