Exemplo n.º 1
0
        public static void DbWriterComma(DbDebugItem <string> debug, AbstractDb <string> db)
        {
            try {
                StringLineStream lines = new StringLineStream(debug.OldPath, ',', false);
                lines.Remove(db);
                string line;

                int numOfElements = debug.AbsractDb.Table.AttributeList.Attributes.Count;
                var v             = debug.AbsractDb.Table.AttributeList.Attributes.FirstOrDefault(p => (p.Visibility & VisibleState.Hidden) == VisibleState.Hidden);

                if (v != null)
                {
                    numOfElements = debug.AbsractDb.Table.AttributeList.Attributes.IndexOf(v);
                }

                foreach (ReadableTuple <string> tuple in db.Table.FastItems.Where(p => !p.Normal).OrderBy(p => p.Key))
                {
                    line = string.Join(",", tuple.GetRawElements().Take(numOfElements).Select(p => (p ?? "").ToString()).ToArray());
                    lines.Write(tuple.Key, line);
                }

                lines.WriteFile(debug.FilePath);
            }
            catch (Exception err) {
                debug.ReportException(err);
            }
        }
Exemplo n.º 2
0
        public static void DbConstantsWriter <TKey>(DbDebugItem <TKey> debug, AbstractDb <TKey> db)
        {
            try {
                StringLineStream lines = new StringLineStream(debug.OldPath);
                lines.Remove(db);
                string line;

                foreach (ReadableTuple <TKey> tuple in db.Table.FastItems.Where(p => !p.Normal).OrderBy(p => p.GetKey <TKey>()))
                {
                    string key = tuple.GetKey <string>();

                    int item2 = tuple.GetValue <int>(2);

                    if (item2 == 0)
                    {
                        line = string.Join("\t", tuple.GetRawElements().Take(2).Select(p => (p ?? "").ToString()).ToArray());
                    }
                    else
                    {
                        line = string.Join("\t", tuple.GetRawElements().Take(3).Select(p => (p ?? "").ToString()).ToArray());
                    }

                    lines.Write(key, line);
                }

                lines.WriteFile(debug.FilePath);
            }
            catch (Exception err) {
                debug.ReportException(err);
            }
        }
Exemplo n.º 3
0
        public static void Writer(DbDebugItem <string> debug, AbstractDb <string> db)
        {
            try {
                StringLineStream lines = new StringLineStream(debug.OldPath);
                lines.Remove(db);
                string line;

                foreach (ReadableTuple <string> tuple in db.Table.FastItems.Where(p => !p.Normal).OrderBy(p => p.GetValue <int>(1)))
                {
                    line = string.Join(",", tuple.GetRawElements().Skip(1).Select(p => (p ?? "").ToString()).ToArray());
                    lines.Write(tuple.Key, line);
                }

                lines.WriteFile(debug.FilePath);
            }
            catch (Exception err) {
                debug.ReportException(err);
            }
        }