public PhotoStorageMongo(IPhotoRepository <T> photoRepository) { Log.Instance.LogAsInfo($"{nameof(PhotoStorageMongo<T>)}.{nameof(PhotoStorageMongo<T>)}: Constructor is stratring."); _db = photoRepository; _cache = new PhotoCache(); Log.Instance.LogAsInfo($"{nameof(PhotoStorageMongo<T>)}.{nameof(PhotoStorageMongo<T>)}: Constructor is stratring."); }
public void Initialize() { EventManager = new EventManager(); Backend = gameObject.AddComponent <Backend>(); Backend.InitializeFirebase(); NativeShare = gameObject.AddComponent <ZagravaNativeShare>(); PhotoCache = new PhotoCache(); PhotoCache.LoadCache(); Tutorials = new TutorialManager(); Initialized = true; }
public PhotoQuery(PhotoStore store, params IQueryCondition [] conditions) { this.store = store; this.store.ItemsChanged += MarkChanged; cache = new PhotoCache(store, temp_table); reverse_lookup = new Dictionary <uint, int> (); SetCondition(OrderByTime.OrderByTimeDesc); foreach (IQueryCondition condition in conditions) { SetCondition(condition); } RequestReload(); }
// Constructor public PhotoQuery(PhotoStore store, params IQueryCondition [] conditions) { this.store = store; // Note: this is to let the query pick up // photos that were added or removed over dbus this.store.ItemsAddedOverDBus += delegate { RequestReload(); }; this.store.ItemsRemovedOverDBus += delegate { RequestReload(); }; this.store.ItemsChanged += MarkChanged; cache = new PhotoCache(store, temp_table); reverse_lookup = new Dictionary <uint, int> (); SetCondition(OrderByTime.OrderByTimeDesc); foreach (IQueryCondition condition in conditions) { SetCondition(condition); } store.QueryToTemp(temp_table, (Tag [])null, null, Range, RollSet, RatingRange, OrderByTime); }
public void RequestReload() { uint timer = Log.DebugTimerStart(); IQueryCondition[] condition_array; int i = 0; if (untagged) { condition_array = new IQueryCondition[conditions.Count + 1]; condition_array[0] = new UntaggedCondition(); i = 1; } else { condition_array = new IQueryCondition[conditions.Count + 2]; // condition_array[0] = new ConditionWrapper (extra_condition); condition_array[1] = new ConditionWrapper(terms != null ? terms.SqlCondition() : null); i = 2; } foreach (IQueryCondition condition in Conditions.Values) { condition_array[i] = condition; i++; } store.QueryToTemp(temp_table, condition_array); count = -1; cache = new PhotoCache(store, temp_table); reverse_lookup = new Dictionary <uint, int> (); if (Changed != null) { Changed(this); } Log.DebugTimerPrint(timer, "Reloading the query took {0}"); }
public void RequestReload() { uint timer = Log.DebugTimerStart(); if (untagged) { store.QueryToTemp(temp_table, new UntaggedCondition(), Range, RollSet, RatingRange, OrderByTime); } else { store.QueryToTemp(temp_table, terms, extra_condition, Range, RollSet, RatingRange, OrderByTime); } count = -1; cache = new PhotoCache(store, temp_table); reverse_lookup = new Dictionary <uint, int> (); if (Changed != null) { Changed(this); } Log.DebugTimerPrint(timer, "Reloading the query took {0}"); }