Пример #1
0
        public object Clone()
        {
            var result = new ConfigurationV5 {
                TeamProjectCollection = TeamProjectCollection, 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;
            result.HideReportViewer = HideReportViewer;
            return(result);
        }
Пример #2
0
        public IConfiguration GetDefaultConfiguration()
        {
            ConfigurationV5 config = new ConfigurationV5();

            if (TfsInformationProvider.TeamProject != null)
            {
                config.TeamProject = TfsInformationProvider.TeamProject.Name;
            }
            if (TfsInformationProvider.TeamProjectCollection != null)
            {
                config.TeamProjectCollection = TfsInformationProvider.TeamProjectCollection.Uri.ToString();
            }
            FillDefaultBacklogItems(config);
            FillDefaultChildItems(config);
            FillDefaultCustomStates(config);

            return(config);
        }
Пример #3
0
 private IConfiguration ReadTaskboardConfigurationV5(StreamReader s, string configurationData)
 {
     Logger.Write(TraceCategory.Information, "V5 .tbconfig version is being loaded");
     try
     {
         var serializer = new DataContractSerializer(typeof(ConfigurationV5), new[] { typeof(CustomState), typeof(WorkItemSize) });
         return((IConfiguration)serializer.ReadObject(s.BaseStream));
     }
     // this happens if old version of .tbconfig is being loaded
     catch (SerializationException)
     {
         Logger.Write(TraceCategory.Information, "V5 .tbconfig version could not be loaded");
         s.BaseStream.Seek(0, new SeekOrigin());
         var cfgV4 = ReadTaskboardConfigurationV4(s, configurationData);
         var cfg   = new ConfigurationV5();
         cfg.CopyFromConfigurationOld4(cfgV4);
         return(cfg);
     }
 }