private static void RenderDNF(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_DNF)) { builder.Append("<b>Didn't find it: </b>"); builder.Append(((bool) list.GetCriteria(FilterList.KEY_DNF)).ToString()); builder.Append("\n"); } }
private static void RenderFoundOn(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_FOUNDON)) { builder.Append(Catalog.GetString("<b>Last found by you on: </b>")); builder.Append(((DateTime) list.GetCriteria(FilterList.KEY_FOUNDON)).ToLongDateString()); builder.Append("\n"); } }
private static void RenderStatus(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_STATUS)) { builder.Append(Catalog.GetString("<b>Status: </b>")); bool[] status = (bool[]) list.GetCriteria(FilterList.KEY_STATUS); if (status[0]) builder.Append(Catalog.GetString("Found ")); if (status[1]) builder.Append(Catalog.GetString("Unfound ")); if (status[2]) builder.Append(Catalog.GetString("Mine ")); if (status[3]) builder.Append(Catalog.GetString("Available ")); if (status[4]) builder.Append(Catalog.GetString("Disabled ")); if (status[5]) builder.Append(Catalog.GetString("Archived ")); builder.Append("\n"); } }
private void SetAttributeTabFilters(FilterList list) { bool atLeastOne = false; if (list.Contains(FilterList.KEY_INCATTRS)) { atLeastOne = true; attributePage.IncludeAttributes = (List<String>) list.GetCriteria(FilterList.KEY_INCATTRS); } if (list.Contains(FilterList.KEY_EXCATTRS)) { atLeastOne = true; attributePage.MustHaveNegAttributes = (List<String>) list.GetCriteria(FilterList.KEY_EXCATTRS); } if (list.Contains(FilterList.KEY_INCNOATTRS)) { atLeastOne = true; attributePage.MustNotHaveIncludeAttributes = (List<String>) list.GetCriteria(FilterList.KEY_INCNOATTRS); } if (list.Contains(FilterList.KEY_EXCNOATTRS)) { atLeastOne = true; attributePage.MustNotHaveNegAttributes = (List<String>) list.GetCriteria(FilterList.KEY_EXCNOATTRS); } if (atLeastOne) { attrPageLabel.Markup = "<b>" + Catalog.GetString("Attributes") + "</b>"; } }
private static void RenderNoChildren(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_NOCHILDREN)) { builder.Append("<b>Does not have any children of type: </b>"); builder.Append(Catalog.GetString(list.GetCriteria(FilterList.KEY_NOCHILDREN) as string)); builder.Append("\n"); } }
private static void RenderPlacedBy(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_PLACEDBY)) { builder.Append(Catalog.GetString("<b>Placed By: </b>")); builder.Append(list.GetCriteria(FilterList.KEY_PLACEDBY)); builder.Append("\n"); } }
private static void RenderCacheTerr(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_TERRAIN_VAL)) { builder.Append(Catalog.GetString("<b>Terrain: </b>")); string op = list.GetCriteria(FilterList.KEY_TERRAIN_OP) as string; if (op == "==") builder.Append(Catalog.GetString("Equal to")); else if (op == ">") builder.Append(Catalog.GetString("Greater Than")); else if (op == ">=") builder.Append(Catalog.GetString("Greater Than or Equal To")); else if (op == "<=") builder.Append(Catalog.GetString("Less Than or Equal To")); else if (op == "<") builder.Append(Catalog.GetString("Less Than")); builder.Append(" "); builder.Append(list.GetCriteria(FilterList.KEY_TERRAIN_VAL)); builder.Append("\n"); } }
private static void RenderInfoWithin(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_INFO_DAYS)) { builder.Append(Catalog.GetString("<b>Updated within: </b>")); builder.Append(((int)list.GetCriteria(FilterList.KEY_INFO_DAYS)).ToString()); builder.Append(Catalog.GetString(" days")); builder.Append("\n"); } }
private void SetLocationPageFilters(FilterList list) { bool atLeastOne = false; if (list.Contains(FilterList.KEY_COUNTRY)) { placementPage.Country = list.GetCriteria(FilterList.KEY_COUNTRY) as string; atLeastOne = true; } if (list.Contains(FilterList.KEY_STATE)) { placementPage.Province = list.GetCriteria(FilterList.KEY_STATE) as string; atLeastOne = true; } if (list.Contains(FilterList.KEY_PLACEDBY)) { placementPage.PlacedBy = list.GetCriteria(FilterList.KEY_PLACEDBY) as string; atLeastOne = true; } if (list.Contains(FilterList.KEY_PLACEBEFORE)) { placementPage.PlaceBefore = (DateTime) list.GetCriteria(FilterList.KEY_PLACEBEFORE); atLeastOne = true; } if (list.Contains(FilterList.KEY_PLACEAFTER)) { placementPage.PlaceAfter = (DateTime) list.GetCriteria(FilterList.KEY_PLACEAFTER); atLeastOne = true; } if (list.Contains(FilterList.KEY_DIST)) { placementPage.Distance = (double) list.GetCriteria(FilterList.KEY_DIST); placementPage.DistOp = list.GetCriteria(FilterList.KEY_DIST_OP) as string; atLeastOne = true; } if (list.Contains(FilterList.KEY_DIST_LAT)) { placementPage.DistLat = (double) list.GetCriteria(FilterList.KEY_DIST_LAT); atLeastOne = true; } if (list.Contains(FilterList.KEY_DIST_LON)) { placementPage.DistLon = (double) list.GetCriteria(FilterList.KEY_DIST_LON); atLeastOne = true; } if (atLeastOne) dateLabel.Markup = "<b>" + Catalog.GetString("Placement/Location") + "</b>"; }
private void SetUpdatedPageFilters(FilterList list) { bool atLeastOne = false; if (list.Contains(FilterList.KEY_INFOBEFORE)) { updatedPage.InfoBefore = (DateTime) list.GetCriteria(FilterList.KEY_INFOBEFORE); atLeastOne = true; } if (list.Contains(FilterList.KEY_INFOAFTER)) { updatedPage.InfoAfter = (DateTime) list.GetCriteria(FilterList.KEY_INFOAFTER); atLeastOne = true; } if (list.Contains(FilterList.KEY_INFO_DAYS)) { updatedPage.InfoWithin = (int) list.GetCriteria(FilterList.KEY_INFO_DAYS); atLeastOne = true; } if (list.Contains(FilterList.KEY_INFO_NDAYS)) { updatedPage.InfoNotWithin = (int) list.GetCriteria(FilterList.KEY_INFO_NDAYS); atLeastOne = true; } if (list.Contains(FilterList.KEY_FOUNDON)) { updatedPage.FoundOn = (DateTime) list.GetCriteria(FilterList.KEY_FOUNDON); atLeastOne = true; } if (list.Contains(FilterList.KEY_FOUNDBEFORE)) { updatedPage.FoundBefore = (DateTime) list.GetCriteria(FilterList.KEY_FOUNDBEFORE); atLeastOne = true; } if (list.Contains(FilterList.KEY_FOUNDAFTER)) { updatedPage.FoundAfter = (DateTime) list.GetCriteria(FilterList.KEY_FOUNDAFTER); atLeastOne = true; } if (list.Contains(FilterList.KEY_LFOUND_BEFORE)) { updatedPage.FoundAnyoneBefore = (DateTime) list.GetCriteria(FilterList.KEY_LFOUND_BEFORE); atLeastOne = true; } if (list.Contains(FilterList.KEY_LFOUND_AFTER)) { updatedPage.FoundAnyoneAfter = (DateTime) list.GetCriteria(FilterList.KEY_LFOUND_AFTER); atLeastOne = true; } if (atLeastOne) updateLabel.Markup = "<b>" + Catalog.GetString("Updated/Found") + "</b>"; }
private void SetDiffTerTabFilters(FilterList list) { bool atLeastOne = false; if (list.Contains(FilterList.KEY_TERRAIN_VAL)) { atLeastOne = true; difficultyPage.TerrValue = list.GetCriteria (FilterList.KEY_TERRAIN_VAL) as string; difficultyPage.TerrOperator = list.GetCriteria (FilterList.KEY_TERRAIN_OP) as string; } if (list.Contains(FilterList.KEY_DIFF_VAL)) { atLeastOne = true; difficultyPage.DifficultyValue = list.GetCriteria (FilterList.KEY_DIFF_VAL) as string; difficultyPage.DifficultyOperator = list.GetCriteria (FilterList.KEY_DIFF_OP) as string; } if (list.Contains(FilterList.KEY_CACHETYPE)) { atLeastOne = true; difficultyPage.SelectedCacheTypes = list.GetCriteria(FilterList.KEY_CACHETYPE) as List<string>; } if (list.Contains(FilterList.KEY_CACHE_SOURCE)) { atLeastOne = true; difficultyPage.CacheSources = list.GetCriteria(FilterList.KEY_CACHE_SOURCE) as List<String>; } if (atLeastOne) { diffLabel.Markup = "<b>" + Catalog.GetString("Difficulty/Terrain/Type") + "</b>"; } }
private void SetContainerTabFilters(FilterList list) { bool atLeastOne = false; if (list.Contains(FilterList.KEY_CONTAINER)) { contPage.ContainerTypes = list.GetCriteria(FilterList.KEY_CONTAINER) as List<string>; atLeastOne = true; } if (list.Contains(FilterList.KEY_FTF)) { bool ftf = (bool) list.GetCriteria(FilterList.KEY_FTF); if (ftf) contPage.hasFTF = true; else contPage.hasNoFTF = true; atLeastOne = true; } if (list.Contains(FilterList.KEY_DNF)) { bool ftf = (bool) list.GetCriteria(FilterList.KEY_DNF); if (ftf) contPage.hasDNF = true; else contPage.hasNoDNF = true; atLeastOne = true; } if (list.Contains(FilterList.KEY_DESCRIPTION)) { contPage.DescriptionKeyWords = list.GetCriteria(FilterList.KEY_DESCRIPTION) as string; atLeastOne = true; } if (list.Contains(FilterList.KEY_STATUS)) { contPage.Status = list.GetCriteria(FilterList.KEY_STATUS) as bool[]; atLeastOne = true; } if (atLeastOne) contLabel.Markup = "<b>" + Catalog.GetString("Container/Description/Status") + "</b>"; }
private void SetChildrenTabFilters(FilterList list) { bool atLeastOne = false; if (list.Contains(FilterList.KEY_CHILDREN)) { childrenPage.ChildrenFilter = list.GetCriteria(FilterList.KEY_CHILDREN) as string; atLeastOne = true; } if (list.Contains(FilterList.KEY_NOCHILDREN)) { childrenPage.NoChildrenFilter = list.GetCriteria(FilterList.KEY_NOCHILDREN) as string; atLeastOne = true; } if (list.Contains(FilterList.KEY_NOTES)) { childrenPage.HasNotes = (Boolean) list.GetCriteria(FilterList.KEY_NOTES); atLeastOne = true; } if (list.Contains(FilterList.KEY_CORRECTED)) { childrenPage.HasCorrectedCoords = true; atLeastOne = true; } if (list.Contains(FilterList.KEY_NOCORRECTED)) { childrenPage.DoesNotHaveCorrectedCoords = true; atLeastOne = true; } if (list.Contains(FilterList.KEY_U1)) { childrenPage.User1 = list.GetCriteria(FilterList.KEY_U1) as string; atLeastOne = true; } if (list.Contains(FilterList.KEY_U2)) { childrenPage.User2 = list.GetCriteria(FilterList.KEY_U2) as string; atLeastOne = true; } if (list.Contains(FilterList.KEY_U3)) { childrenPage.User3 = list.GetCriteria(FilterList.KEY_U3) as string; atLeastOne = true; } if (list.Contains(FilterList.KEY_U4)) { childrenPage.User4 = list.GetCriteria(FilterList.KEY_U4) as string; atLeastOne = true; } if (atLeastOne) { labelChildren.Markup = "<b>" + Catalog.GetString("Notes/Children/Corrected") + "</b>"; } }
private static void RenderFTF(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_FTF)) { builder.Append("<b>First to find: </b>"); builder.Append(((bool) list.GetCriteria(FilterList.KEY_FTF)).ToString()); builder.Append("\n"); } }
private static void RenderCacheTypes(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_CACHETYPE)) { builder.Append(Catalog.GetString("<b>Cache Types: </b>")); bool isFirst = false; foreach(string type in (List<String>) list.GetCriteria(FilterList.KEY_CACHETYPE)) { if (!isFirst) isFirst = true; else builder.Append(", "); builder.Append(Catalog.GetString(Geocache.GetCTypeString((Geocache.CacheType)Enum.Parse(typeof(Geocache.CacheType),type)))); } builder.Append("\n"); } }
private static void RenderInfoAfter(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_INFOAFTER)) { builder.Append(Catalog.GetString("<b>Last updated on or after: </b>")); builder.Append(((DateTime) list.GetCriteria(FilterList.KEY_INFOAFTER)).ToLongDateString()); builder.Append("\n"); } }
private static void RenderChildren(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_CHILDREN)) { builder.Append("<b>Has at least one child of type: </b>"); builder.Append(Catalog.GetString(list.GetCriteria(FilterList.KEY_CHILDREN) as string)); builder.Append("\n"); } }
private static void RenderMustNotHaveAttributes(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_INCNOATTRS) || list.Contains(FilterList.KEY_EXCNOATTRS)) { builder.Append("<b>Must not have the following attributes: </b>"); bool isFirst = false; if (list.Contains(FilterList.KEY_INCNOATTRS)) { List<string> str = (List<String>) list.GetCriteria(FilterList.KEY_INCNOATTRS); foreach(String attr in str) { if (!isFirst) isFirst = true; else builder.Append(","); builder.Append(attr); builder.Append(" "); } } if (list.Contains(FilterList.KEY_EXCNOATTRS)) { List<string> str = (List<String>) list.GetCriteria(FilterList.KEY_EXCNOATTRS); foreach(String attr in str) { if (!isFirst) isFirst = true; else builder.Append(","); builder.Append("<span fgcolor='red' strikethrough='true'>" + attr + "</span> "); } } builder.Append("\n"); } }
private static void RenderContainer(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_CONTAINER)) { builder.Append(Catalog.GetString("<b>Container: </b>")); bool isFirst = false; foreach(string container in (List<String>) list.GetCriteria(FilterList.KEY_CONTAINER)) { if (!isFirst) isFirst = true; else builder.Append(", "); builder.Append(container); } builder.Append("\n"); } }
private static void RenderPlacedBefore(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_PLACEBEFORE)) { builder.Append(Catalog.GetString("<b>Placed on or before: </b>")); builder.Append(((DateTime) list.GetCriteria(FilterList.KEY_PLACEBEFORE)).ToLongDateString()); builder.Append("\n"); } }
private static void RenderCountry(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_COUNTRY)) { builder.Append(Catalog.GetString("<b>Country: </b>")); builder.Append(list.GetCriteria(FilterList.KEY_COUNTRY) as string); builder.Append("\n"); } }
private static void RenderState(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_STATE)) { builder.Append(Catalog.GetString("<b>State/Province: </b>")); builder.Append(list.GetCriteria(FilterList.KEY_STATE) as string); builder.Append("\n"); } }
private static void RenderDescription(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_DESCRIPTION)) { builder.Append(Catalog.GetString("Description Contains:")); builder.Append(list.GetCriteria(FilterList.KEY_DESCRIPTION)); builder.Append("\n"); } }
private static void RenderUserData(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_U1)) { builder.Append(Catalog.GetString("<b>User 1 contains: </b>")); builder.Append(list.GetCriteria(FilterList.KEY_U1)as string); builder.Append("\n"); } if (list.Contains(FilterList.KEY_U2)) { builder.Append(Catalog.GetString("<b>User 2 contains: </b>")); builder.Append(list.GetCriteria(FilterList.KEY_U2)as string); builder.Append("\n"); } if (list.Contains(FilterList.KEY_U3)) { builder.Append(Catalog.GetString("<b>User 3 contains: </b>")); builder.Append(list.GetCriteria(FilterList.KEY_U3)as string); builder.Append("\n"); } if (list.Contains(FilterList.KEY_U4)) { builder.Append(Catalog.GetString("<b>User 4 contains: </b>")); builder.Append(list.GetCriteria(FilterList.KEY_U4)as string); builder.Append("\n"); } }
private static void RenderCacheSource(FilterList list, StringBuilder builder) { if (list.Contains(FilterList.KEY_CACHE_SOURCE)) { builder.Append(Catalog.GetString("<b>Cache Sources: </b>")); bool isFirst = false; foreach(string type in (List<String>) list.GetCriteria(FilterList.KEY_CACHE_SOURCE)) { if (type.Contains("LC")) continue; if (!isFirst) isFirst = true; else builder.Append(", "); if (type.Contains("GC")) builder.Append("Geocaching.com"); if (type.Contains("O")) builder.Append("OpenCaching (.eu/.us/.jp)"); if (type.Contains("NC")) builder.Append("NaviCache"); if (type.Contains("TC")) builder.Append("Terracaching.com"); if (type.Contains("WM")) builder.Append("Waymarking.com"); } builder.Append("\n"); } }