コード例 #1
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.MainLayout);

			// Create the picker instance
			saver = Saver.CreateSaver (OneDriveAppId);

			// Add the start saving listener
			FindViewById (Resource.Id.startSaverButton).Click += async delegate {
				FindViewById (Resource.Id.result_table).Visibility = ViewStates.Invisible;

				var filename = FindViewById<EditText> (Resource.Id.file_name_edit_text).Text;
				var fileSizeString = FindViewById<EditText> (Resource.Id.file_size_edit_text).Text;
				int size;
				if (!int.TryParse (fileSizeString, out size)) {
					size = DefaultFileSizeKb;
				}

				// Create a file
				var file = await CreateExternalSdCardFile (filename, size);

				// Start the saver
				saver.StartSaving (this, filename, Android.Net.Uri.Parse ("file://" + file));
			};
		}