/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. /// This parameter is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { TestBundleable tb = new TestBundleable(); TestBundleable tbout = null; Bundle b = new Bundle("Testing"); b.storePackedObject("Test Object",tb); tbout = (TestBundleable) b.getPackedObject("Test Object"); if (tb.Equals(tbout)) Debug.WriteLine("Objects are equal"); else Debug.WriteLine("Objects are not equal"); Debug.WriteLine(tbout.TestInt); Debug.WriteLine(tbout.TestString); Bundle c = new Bundle("blah"); c.putInt("abc",98765); c.putString("def","World"); c = c + b; Debug.WriteLine(c.getString("def")); Debug.WriteLine(c.getInt("abc")); tbout = (TestBundleable)c.getPackedObject("Test Object"); if (tb.Equals(tbout)) Debug.WriteLine("Objects are equal"); else Debug.WriteLine("Objects are not equal"); }
/// <summary> /// Unpack this object from the bundle /// </summary> /// <param name="key">the key that it was stored with in the bundle</param> /// <param name="B">The bundle that it is packed in</param> /// <returns> the unpacked object from the bundle</returns> IBundleable IBundleable.unpackOoject(string key, Bundle B) { IBundleable temp = B.getPackedObject(key); return temp; }
/// <summary> /// Pack this object into a bundle /// </summary> /// <param name="key">the key that it will be stored with in the bundle</param> /// <param name="B"> The bundle to pack it in</param> void IBundleable.packObject(string key, Bundle B) { IBundleable temp = this; B.storePackedObject(key, temp); }
/// <summary> /// Unpack this object from the bundle /// </summary> /// <param name="key">the key that it was stored with in the bundle</param> /// <param name="B">The bundle that it is packed in</param> /// <returns> the unpacked object from the bundle</returns> public IBundleable unpackOoject(string key, Bundle B) { IBundleable temp = null; temp = B.getBundleable(key); return temp; }
/// <summary> /// Pack this object into a bundle /// </summary> /// <param name="key">the key that it will be stored with in the bundle</param> /// <param name="B"> The bundle to pack it in</param> public void packObject(string key, Bundle B) { IBundleable temp = this; B.putBundleable(key, temp); }