public Manifestation(string id, string name, string description, DateTime date, ManifestationType type, string iconPath, bool smokingAllowed, bool inside, bool outside, string price, string alcohol, string expectedPublic, ObservableCollection <ManifestationTag> tags) { this.id = id; this.name = name; this.description = description; this.date = date; this.type = type; string newPath = Directory.GetCurrentDirectory() + @iconPath.Split('/').Last(); if (!File.Exists(newPath) && newPath != null && !string.IsNullOrEmpty(newPath) && !string.IsNullOrWhiteSpace(newPath)) { File.Copy(@iconPath, @newPath, true); } this.iconPath = newPath; this.smokingAllowed = smokingAllowed; this.inside = inside; this.outside = outside; this.price = price; this.alcohol = alcohol; this.expectedPublic = expectedPublic; this.tags = tags; this.x = -1; this.y = -1; }
public ManifestationType(ManifestationType type) { if (type != null) { id = type.Id; name = type.Name; description = type.Description; iconPath = type.IconPath; } }
public static void DeleteType(ManifestationType type) { for (int i = 0; i < getInstance().Types.Count; i++) { if (type.Id.Equals(getInstance().Types[i].Id)) { getInstance().Types.RemoveAt(i); SaveTypes(); break; } } }
public static void UpdateType(string oldId, ManifestationType type) { for (int i = 0; i < getInstance().Types.Count; i++) { if (oldId.Equals(getInstance().Types[i].Id)) { getInstance().Types[i] = type; SaveTypes(); break; } } }
public Manifestation(Manifestation manifestation) { id = manifestation.id; name = manifestation.name; description = manifestation.description; date = manifestation.date; handicap = manifestation.handicap; type = new ManifestationType(manifestation.type); iconPath = manifestation.iconPath; inside = manifestation.inside; outside = manifestation.outside; smokingAllowed = manifestation.smokingAllowed; price = manifestation.price; alcohol = manifestation.alcohol; expectedPublic = manifestation.expectedPublic; tags = new ObservableCollection <ManifestationTag>(manifestation.tags); x = manifestation.X; y = manifestation.Y; }
public static void AddType(ManifestationType type) { getInstance().types.Add(type); SaveTypes(); }