string GetUnseccessfulSearchMessage(ISearchHistoryEntry so) { var msg = new StringBuilder(); msg.Append("No messages found"); msg.Append(" ("); GetUserFriendlySearchHistoryEntryDescription(so, msg); msg.Append(")"); return(msg.ToString()); }
bool IEquatable <ISearchHistoryEntry> .Equals(ISearchHistoryEntry other) { var e = other as UserDefinedSearchHistoryEntry; if (e == null) { return(false); } return(ReferenceEquals(e.uds, uds)); }
bool IEquatable <ISearchHistoryEntry> .Equals(ISearchHistoryEntry other) { var e = other as SearchHistoryEntry; if (e == null) { return(false); } return(normalizedTemplate == e.normalizedTemplate); }
void ISearchHistory.Add(ISearchHistoryEntry entry) { if (!entry.IsValid) { return; } items.RemoveAll(i => i.Equals(entry)); items.Add(entry); while (items.Count > maxItemsCount) { items.RemoveAt(0); } FireOnChange(); SaveSearchHistory(); }
public static void GetUserFriendlySearchHistoryEntryDescription( ISearchHistoryEntry entry, StringBuilder stringBuilder) { ISimpleSearchHistoryEntry simple; IUserDefinedSearchHistoryEntry uds; if ((simple = entry as ISimpleSearchHistoryEntry) != null) { GetUserFriendlySearchOptionsDescription(simple.Options, stringBuilder); } else if ((uds = entry as IUserDefinedSearchHistoryEntry) != null) { GetUserFriendlySearchHistoryEntryDescription(uds.UDS, stringBuilder); } }