Beispiel #1
0
	public void Sync (List<string> urls, int photosAmountPerTime, SyncPhotosGO.SyncPhotosGOCompletedHandler syncPhotosGOCompleted) {
		this.syncPhotosGOCompleted = syncPhotosGOCompleted;

		//List validation
		if (urls != null && urls.Count > 0) {
			//Create packages of strings
			packages = new List<List<string>> ();
			List<string> package = null;
			for (int i = 0; i < urls.Count; i++) {
				string url = urls[i];

				if (i % photosAmountPerTime == 0) {
					package = new List<string> ();
					packages.Add (package);
				}

				package.Add (url);
			}

			CreateDownloadPackage(0);

			Debug.Log ("packages.Count: " + packages.Count);
			foreach (List<string> list in packages)
				Debug.Log ("list.Count: " + list.Count);

		} else {
			syncPhotosGOCompleted (null);
		}
	}
Beispiel #2
0
	public static void Sync (List<string> urls, int photosAmountPerTime, SyncPhotosGO.SyncPhotosGOCompletedHandler syncPhotosGOCompleted) {
		new SyncPhotosManager ().Sync (urls, photosAmountPerTime, syncPhotosGOCompleted);
	}