Ejemplo n.º 1
0
		public void Save (System.Collections.Generic.List<Hanselman.Portable.Tweet> tweets)
		{

			var FileManager = new Foundation.NSFileManager ();
      var appGroupContainer = FileManager.GetContainerUrl("group.com.refractored.hanselman");
      if(appGroupContainer == null)
      {
        Console.WriteLine("You must go into apple developer console and create a new app group");
     
        return;
      }
			var path = System.IO.Path.Combine(appGroupContainer.Path, "tweets.xml");
			Console.WriteLine ("agcpath: " + path);


      var json = JsonConvert.SerializeObject(tweets);

      File.WriteAllText(path, json);


			/*var serializer = new XmlSerializer(typeof(List<Tweet>));
			using (var stream = File.Open(path, FileMode.CreateNew, FileAccess.ReadWrite))
			{
				serializer.Serialize(stream, tweets);
			}*/
		}
Ejemplo n.º 2
0
        public void Save(System.Collections.Generic.List <Hanselman.Portable.Tweet> tweets)
        {
            var FileManager       = new Foundation.NSFileManager();
            var appGroupContainer = FileManager.GetContainerUrl("group.com.refractored.hanselman");

            if (appGroupContainer == null)
            {
                Console.WriteLine("You must go into apple developer console and create a new app group");

                return;
            }
            var path = System.IO.Path.Combine(appGroupContainer.Path, "tweets.xml");

            Console.WriteLine("agcpath: " + path);


            var json = JsonConvert.SerializeObject(tweets);

            File.WriteAllText(path, json);


            /*var serializer = new XmlSerializer(typeof(List<Tweet>));
             * using (var stream = File.Open(path, FileMode.CreateNew, FileAccess.ReadWrite))
             * {
             *      serializer.Serialize(stream, tweets);
             * }*/
        }
Ejemplo n.º 3
0
		static string GetJSONPath (string outputFile)
		{
			var path = string.Empty;
			var FileManager = new Foundation.NSFileManager ();
			var appGroupContainer = FileManager.GetContainerUrl ("group.com.xamarin.kinderchat.security");
			if (appGroupContainer == null) {
				Console.WriteLine ("You must create the app group: \"group.com.xamarin.kinderchat.security\" in order to run the project.");
			} else {
				path = Path.Combine (appGroupContainer.Path, outputFile);
			}
			//Console.WriteLine ("Json file path: {0}", path);
			return path;
		}
Ejemplo n.º 4
0
        static string GetJSONPath(string outputFile)
        {
            var path              = string.Empty;
            var FileManager       = new Foundation.NSFileManager();
            var appGroupContainer = FileManager.GetContainerUrl("group.com.xamarin.kinderchat.security");

            if (appGroupContainer == null)
            {
                Console.WriteLine("You must create the app group: \"group.com.xamarin.kinderchat.security\" in order to run the project.");
            }
            else
            {
                path = Path.Combine(appGroupContainer.Path, outputFile);
            }
            //Console.WriteLine ("Json file path: {0}", path);
            return(path);
        }
Ejemplo n.º 5
0
        // This is the main entry point of the application.
        static void Main(string[] args)
        {
            VersionTracking.Track();
            var dbPath       = DataAcess.dbPath;
            var fileManager  = new Foundation.NSFileManager();
            var DoesDBExists = fileManager.FileExists(dbPath);

            if (!DoesDBExists)
            {
                using (var db = new SQLiteConnection(dbPath))
                {
                    db.CreateTable <Item>();
                    db.CreateTable <Order>();
                    db.CreateTable <OrderItem>();
                    db.CreateTable <Category>();
                    db.CreateTable <Customer>();
                    db.CreateTable <ItemBarcode>();
                    db.CreateTable <ItemCategory>();
                }
            }
            // if you want to use a different Application Delegate class from "AppDelegate"
            // you can specify it here.
            UIApplication.Main(args, null, "AppDelegate");
        }