protected virtual object?ConvertBack(object?original, object?parameter = null) { // Arrange var converter = new TConverter(); // Act var actual = converter.ConvertBack(original, FromTypes.ToArray(), parameter, CultureInfo.CurrentCulture); return(actual); }
public string CreateString(int cn, FromTypes fromt, string crit) { switch (fromt) { case FromTypes.UserVersion: return "Added "+cn+" versions because the contain user version "+crit; default: throw new Exception("Function CreateString 'string crit)' has no string for " + fromt.ToString()); } }
private void AddItems(Dictionary<string, VersionInfo> RetuDic, List<string> Criteria, Dictionary<string, List<VersionInfo>> Diction, FromTypes fromtypr, Status stat, string statusStr) { if (Criteria == null) { return; } int cn; string CstatusStr = ""; Stopwatch st = new Stopwatch(); st.Start(); foreach (string item in Criteria) { cn = 0; if (Diction.ContainsKey(item) == true && Diction[item] != null) { foreach (VersionInfo vers in Diction[item]) { cn++; RetuDic[vers.versionName] = vers; if (st.ElapsedMilliseconds > 250) { CstatusStr = CreateString(cn, fromtypr, item); CstatusStr += " so far"; stat.ReceiveStatus(CstatusStr + '\n' + statusStr,false); st.Reset(); st.Start(); } } } statusStr += '\n'+CreateString(cn, fromtypr, item); } }
public string CreateString(int cn, FromTypes fromt, int crit) { switch (fromt) { case FromTypes.DayOfMonth: return "Added " + cn + " versions that were created on day " + crit + " of the month"; case FromTypes.Hour: return "Added " + cn + " versions that were created at "+Util.intToTimeStr(crit); case FromTypes.Month: return "Added " + cn + " versions that were created in " + DateTimeFormatInfo.CurrentInfo.GetMonthName(crit) ; case FromTypes.Year: return "Added " + cn + " versions that were created in " + crit; default: throw new Exception("Function CreateString 'int crit)' has no string for " + fromt.ToString()); } }