public object Clone() { ConfigurationV4 result = new ConfigurationV4(); result.TeamProjectCollection = TeamProjectCollection; result.TeamProject = TeamProject; result.ChildItems.AddRange(ChildItems); result.BacklogItems.AddRange(BacklogItems); foreach (var state in States) { result.States.Add(state.Clone() as ICustomState); } result.SortFieldName = SortFieldName; result.SortDirection = SortDirection; result.RowSummaryFieldName = RowSummaryFieldName; result.ColumnSummaryFieldName = ColumnSummaryFieldName; result.LinkType = LinkType; result.QueryId = QueryId; result.ReportId = ReportId; result.ReportParameters.AddRange(ReportParameters); result.IsAutoRefreshChecked = IsAutoRefreshChecked; result.AutoRefreshDelay = AutoRefreshDelay; result.HideColumnSummaryFieldName = HideColumnSummaryFieldName; result.WorkItemSize = WorkItemSize; return result; }
private ConfigurationV4 ReadTaskboardConfigurationV4(StreamReader s, string configurationData) { Logger.Write(TraceCategory.Information, "V4 .tbconfig version is being loaded"); try { var serializer = new DataContractSerializer(typeof(ConfigurationV4), new[] { typeof(CustomState), typeof(WorkItemSize) }); return((ConfigurationV4)serializer.ReadObject(s.BaseStream)); } // this happens if old version of .tbconfig is being loaded catch (SerializationException) { Logger.Write(TraceCategory.Information, "V4 .tbconfig version could not be loaded"); s.BaseStream.Seek(0, new SeekOrigin()); ConfigurationV3 cfgV3 = ReadTaskboardConfigurationV3(s, configurationData); ConfigurationV4 cfg = new ConfigurationV4(); cfg.CopyFromConfigurationOld3(cfgV3); return(cfg); } }
public void CopyFromConfigurationOld4(ConfigurationV4 configOld4) { CopyFromConfigurationOld3(configOld4); HideColumnSummaryFieldName = configOld4.HideColumnSummaryFieldName; }