private IEnumerable <CompositeSelectableVm> ComputeModules(IEnumerable <LogEntryVm> arg) { var allFiles = AllEntries.Select(le => le.FileName).Distinct().Select(m => new SelectableVm(m, true)).OrderBy(m => m.Name); var allModules = allFiles.GroupBy(x => ModuleClassifier.GetModuleForFile(x.Name)).Select(x => new CompositeSelectableVm(x.Key, true, x.Select(y => y))); return(allModules.ToList()); }
public void UnindentItem(ISublistEntry entry) { var currentParent = _entryProvider.GetParent(entry, AllEntries); if (currentParent != null) { var parentOfParent = _entryProvider.GetParent(currentParent, AllEntries); if (parentOfParent != null) { entry.ParentId = parentOfParent.Id; parentOfParent.AddSubEntrySafely(entry); currentParent.SubEntries.Remove(entry); _entryProvider.ChangeEntry(entry); } else { entry.ParentId = 0; _entryProvider.ChangeEntry(entry); currentParent.SubEntries.Remove(entry); AllEntries.Add(entry); } RefreshAllEntries(); } }
private Registry(string content) { var entryBlocks = content .Split(new string[] { "\n%%\n" }, StringSplitOptions.RemoveEmptyEntries) .ToArray(); FileDate = parseFileDate(entryBlocks.First()); AllEntries = entryBlocks.Skip(1).Select(RegEntry.Parse).ToList(); PrimaryLanguages = AllEntries.OfType <LanguageEntry>().Where(_ => !_.IsPrivateUse).ToList(); PrivateUsePrimaryLanguages = AllEntries.OfType <LanguageEntry>().Single(_ => _.IsPrivateUse); ExtLanguages = AllEntries.OfType <ExtlangEntry>().ToList(); Scripts = AllEntries.OfType <ScriptEntry>().Where(_ => !_.IsPrivateUse).ToList(); PrivateUseScripts = AllEntries.OfType <ScriptEntry>().Single(_ => _.IsPrivateUse); Regions = AllEntries.OfType <RegionEntry>().Where(_ => !_.IsPrivateUse).ToList(); PrivateUseRegions = AllEntries.OfType <RegionEntry>().Where(_ => _.IsPrivateUse).ToList(); Variants = AllEntries.OfType <VariantEntry>().ToList(); Grandfathered = AllEntries.OfType <GrandfatheredEntry>().ToList(); Redundand = AllEntries.OfType <RedundantEntry>().ToList(); }
public void AddEntry(Entry entity, int todayIndex) { Db.Entries.InsertOnSubmit(entity); Db.SubmitChanges(); AllEntries.Add(entity); AllDates[todayIndex].Entries.Add(entity); }
/// <summary> /// Gets all change log entries of the specified type /// </summary> /// <param name="commitType"></param> /// <returns></returns> public ChangeLogEntryGroup this[CommitType commitType] { get { var entries = AllEntries.Where(x => x.Type == commitType); return(new ChangeLogEntryGroup(commitType, entries)); } }
public void DeleteEntry(Entry entity) { AllEntries.Remove(entity); // delete image in isolate storage using (IsolatedStorageFile isolatedStorage = IsolatedStorageFile.GetUserStoreForApplication()) { if (entity.ImgSrc != null && isolatedStorage.FileExists(entity.ImgSrc)) { isolatedStorage.DeleteFile(entity.ImgSrc); } } Db.Entries.DeleteOnSubmit(entity); Db.SubmitChanges(); }
public void CreateEntry(ISublistEntry parent) { var newEntry = new SublistEntry(); if (parent != null) { parent.AddSubEntrySafely(newEntry); } else { AllEntries.Add(newEntry); } _entryProvider.StoreNewEntry(newEntry); RefreshAllEntries(); }
public void DeleteSelectedEntries(IEnumerable <ISublistEntry> entries) { foreach (var sublistEntry in entries.ToList()) { _entryProvider.DeleteEntry(sublistEntry); var parent = _entryProvider.GetParent(sublistEntry, AllEntries); if (parent == null) { AllEntries.Remove(sublistEntry); } else { parent.SubEntries.Remove(sublistEntry); } } }
public void Add(Entry entry) { if (_quadrants == null && _entries.Count >= EntriesBeforeSplit) { Split(); } if (!_bounds.Contains(entry.Bounds)) { if (!_isRoot) { throw new InvalidOperationException("Should never attempt to add uncontained item to non-root node"); } var allEntries = AllEntries.ToList(); Clear(); _bounds = Rect.Union(_bounds, entry.Bounds); foreach (var e in allEntries) { Add(e); // NOTE: should never recurse } } if (null != _quadrants) { var midX = _bounds.X + _bounds.Width / 2; var midY = _bounds.Y + _bounds.Height / 2; var isNorth = entry.Bounds.Bottom < midY; var isSouth = !isNorth && entry.Bounds.Top >= midY; if (isNorth || isSouth) { var isWest = entry.Bounds.Right < midX; var isEast = !isWest && entry.Bounds.Left >= midX; if (isWest || isEast) { _quadrants[(isNorth ? 0 : 2) + (isWest ? 0 : 1)].Add(entry); return; } } _entries.Add(entry); } }
public void DeleteDateData(DateData entity) { AllDates.Remove(entity); Entry[] clone = new Entry[AllEntries.Count]; AllEntries.CopyTo(clone, 0); foreach (Entry e in clone) { if (e.Date == entity) { DeleteEntry(e); } } Db.Dates.DeleteOnSubmit(entity); Db.SubmitChanges(); }
public void IndentItem(ISublistEntry entry, ISublistEntry newParent) { if (newParent != null) { var oldParent = _entryProvider.GetParent(entry, AllEntries); if (oldParent != null && oldParent.SubEntries.First() == entry) { return; } entry.ParentId = newParent.Id; newParent.AddSubEntrySafely(entry); oldParent?.SubEntries.Remove(entry); AllEntries.Remove(entry); _entryProvider.ChangeEntry(entry); RefreshAllEntries(); } }
/// <summary> /// Called everytime the window is displayed. /// </summary> public void OnPresented() { this.ShowFirstColumn = Properties.SubSearchSettings.Default.ShowFirstColumn; this.GetFullPath = Properties.SubSearchSettings.Default.TargetDirectory; this.IsPathSet = string.IsNullOrWhiteSpace(GetFullPath); AllEntries.Clear(); if (Directory.Exists(GetFullPath)) { Task.Run(() => { // Fill grid content async: AddDirectoryContent(AllEntries, GetFullPath); }); } this.SelectedEntry = null; this.TotalEntries = AllEntries; }
private IEnumerable <SelectableVm> ComputeFilter(IEnumerable <LogEntryVm> arg, Func <LogEntryVm, string> selector) { return(AllEntries.Select(selector).Distinct().Select(m => new SelectableVm(m, true)).OrderBy(m => m.Name).ToList()); }
private IEnumerable <SelectableVm> ComputeLevels(IEnumerable <LogEntryVm> arg) { return(AllEntries.Select(le => le.Level).Distinct().Select(m => new SelectableVm(m, true)).OrderBy(m => m.Name).ToList()); }
/// <inheritdoc /> IEnumerator IEnumerable.GetEnumerator() => AllEntries.GetEnumerator();
/// <inheritdoc /> public IEnumerator <ChangeLogEntry> GetEnumerator() => AllEntries.GetEnumerator();