Beispiel #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById<Button> (Resource.Id.myButton);
            
            var locator = new StreamLocator();

            button.Click += delegate
            {
                button.Text = string.Format ("{0} clicks!", count++);

                var l = new StreamWriterFunction(locator);

                var file = Path.Combine(
                    System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), 
                    "myFile.txt");
                l.WriteToPath(file, button.Text);
            };

            FindViewById<TextView> (Resource.Id.textApp).Text = locator.AppFolder;
            FindViewById<TextView> (Resource.Id.textCurrent).Text = locator.CurrentPath;

        }
Beispiel #2
0
 public static IEnumerable <string> GetFileNames(string folder, string searchPattern)
 {
     return(StreamLocator.GetFileNames(folder, searchPattern));
 }
Beispiel #3
0
 public static System.IO.BinaryWriter BinaryWriterFor(string path)
 {
     return(StreamLocator.BinaryWriterFor(path));
 }
Beispiel #4
0
 public static System.IO.StreamWriter StreamWriterFor(string path)
 {
     return(StreamLocator.StreamWriterFor(path));
 }
 public StreamLocatorDelegate (StreamLocator locator)
 {
     this.locator = locator;
 }
 public StreamLocatorDelegate(StreamLocator locator)
 {
     this.locator = locator;
 }