/// <summary> /// Inits the viewmodel with the specified sys info, and setups the default categories. /// </summary> /// <param name="sysInfo">The sys info.</param> /// <param name="attachedFiles">path to the attachment</param> /// <author>Jurie.smit</author> /// <datetime>2013/01/14-09:19 AM</datetime> private void Init(SystemInfoTO sysInfo, Dictionary<string, string> attachedFiles) { Comment = null; ServerLogAttachmentPath = attachedFiles.Where(f => f.Key.Equals("ServerLog", StringComparison.CurrentCulture)).Select(v => v.Value).SingleOrDefault(); StudioLogAttachmentPath = attachedFiles.Where(f => f.Key.Equals("StudioLog", StringComparison.CurrentCulture)).Select(v => v.Value).SingleOrDefault(); Comment = GenerateDefaultComment(sysInfo); SetCaretPosition(); Categories.AddRange(new List<string> { "General", "Compliment", "Feature request", "Bug", "Feedback" }); if(attachedFiles.Count > 0) SelectedCategory = "Feedback"; }
/// <summary> /// Generates the default comment. /// </summary> /// <param name="sysInfo">The sys info.</param> /// <returns></returns> /// <author>Jurie.smit</author> /// <datetime>2013/01/14-09:20 AM</datetime> private static string GenerateDefaultComment(SystemInfoTO sysInfo) { var sb = new StringBuilder(); sb.Append("Comments : "); sb.Append(Environment.NewLine); sb.Append(Environment.NewLine); sb.Append(Environment.NewLine); sb.Append("OS version : "); sb.Append(sysInfo.Name + " "); sb.Append(sysInfo.Edition + " "); sb.Append(sysInfo.ServicePack + " "); sb.Append(sysInfo.Version + " "); sb.Append(sysInfo.OsBits); sb.Append(Environment.NewLine); sb.Append("Product Version : "); sb.Append(VersionInfo.FetchVersionInfo() + " "); sb.Append(sysInfo.ApplicationExecutionBits + "-bit"); return sb.ToString(); }