public static void CopyTuplesDefault(TabGenerator <TKey> tabGenerator, List <ReadableTuple <TKey> > items, BaseDb gdb) { int max = tabGenerator.MaxElementsToCopyInCustomMethods < 0 ? gdb.AttributeList.Attributes.Count - tabGenerator.StartIndexInCustomMethods : tabGenerator.MaxElementsToCopyInCustomMethods; StringBuilder builder = new StringBuilder(); List <int> toRemove = (from attribute in gdb.AttributeList.Attributes.OrderByDescending(p => p.Index) where attribute.IsSkippable && !_isAttributeEnabled(attribute, gdb) select attribute.Index).ToList(); for (int i = 0; i < items.Count; i++) { ReadableTuple <TKey> item = items[i]; List <string> objs = item.GetRawElements().Skip(tabGenerator.StartIndexInCustomMethods).Take(max).Select(p => (p ?? "").ToString()).ToList(); foreach (var index in toRemove) { if (index < objs.Count) { objs.RemoveAt(index); } } builder.AppendLine(string.Join(",", objs.ToArray())); } Clipboard.SetDataObject(builder.ToString()); }
public static void CopyTuplesDefault(TabGenerator <TKey> tabGenerator, List <ReadableTuple <TKey> > items, DbAttribute[] attributes) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < items.Count; i++) { ReadableTuple <TKey> item = items[i]; List <string> objs = new List <string>(); for (int j = 0; j < attributes.Length; j++) { objs.Add((item.GetRawValue(attributes[j].Index) ?? "").ToString()); } builder.AppendLine(string.Join(",", objs.ToArray())); } Clipboard.SetDataObject(builder.ToString()); }