private static void AttachId(MapHashable entry, Guid?parentId = null) { if (parentId.HasValue) { entry.ParentId = parentId; } }
public void PersistEntry(MapHashable entry) { lock (Locking) { this.conn.InsertOrReplace(entry, typeof(MapHashable)); } }
private async Task UpdateImageAsync(MapHashable entry) { string filePath = $"Map/{entry.Id}.png"; var fileHash = Convert.ToBase64String(this.cache.GetSha1HashFromFile(filePath) ?? new byte[0]); if (fileHash != entry.Hash) { var imageStream = await this.webHandler.GetImageStreamAsync(entry.Id); await this.cache.WriteFileAsync(filePath, imageStream); } }
private UIViewController CreateTabFor(MapHashable map) { var screen = new UIViewController(); var image = Mvx.IocConstruct <ImageLoader>().LoadImage(map.ImagePath); var imageView = new UIImageView(new CGRect(new CGPoint(0, 100), CGSize.Subtract(screen.View.Frame.Size, new CGSize(0, 200)))) { ContentMode = UIViewContentMode.ScaleAspectFit, Image = image }; screen.Add(imageView); screen.NavigationItem.Title = map.Title; screen.TabBarItem = new UITabBarItem(map.Title, null, this.tabCount++); return(screen); }
private void UpdateEntry(MapHashable entry) { this.repo.PersistEntry(entry); }