public static Collection <TRecordType> CreateFromUrl(string name, string url) { var collection = Collection <TRecordType> .Create(name); CoroutineHost.Instance.StartCoroutine(DownloadFromUrl(collection, url)); return(collection); }
static Accounts() { Error = new Error() { error = 500, reason = "You have not attempted to login yet!" }; Users = Collection <MongoDocument> .Create("users"); }
/// <summary> /// Creates a new Mongo-style collection. /// Throws an exception if a collection with the given name already exists. If you want a way to get an /// existing collection instance if it already exists, use Collection<TRecordType>.Create(name) /// </summary> /// <param name="name">Name. If null, returns a local-only collection.</param> public Collection(string name) : base() { var doesCollectionAlreadyExist = LiveData.Instance.Collections.Contains(name); var isNameEmpty = string.IsNullOrEmpty(name); var isCollectionTemporary = doesCollectionAlreadyExist && LiveData.Instance.Collections [name] as TemporaryCollection != null; if (!isNameEmpty && doesCollectionAlreadyExist && !isCollectionTemporary) { throw new ArgumentException(string.Format("A collection with name {0} already exists", name)); } Collection <TRecordType> .Create(name, instance : this); }
static Accounts() { Error = new Error() { error = 500, reason = "You have not attempted to login yet!" }; // Check that we're connected to the server. If we're not, print an error. if (!LiveData.Instance.Connected) { Debug.LogError("Meteor.Accounts: You are not connected to a server. Before you access methods on this service, make sure to connect."); } Users = Collection <MongoDocument> .Create("users"); }