コード例 #1
0
        public static void DbCommaLoader <T>(DbDebugItem <T> debug, AttributeList list, DbCommaFunctionDelegate <T> function, TextFileHelper.TextFileHelperGetterDelegate getter, bool addAutomatically = true)
        {
            var table = debug.AbsractDb.Table;

#if SDE_DEBUG
            Z.StopAndRemoveWithoutDisplay(-1);
            Z.StopAndRemoveWithoutDisplay(-2);
            CLHelper.CR(-2);
#endif
            foreach (string[] elements in getter(File.ReadAllBytes(debug.FilePath)))
            {
#if SDE_DEBUG
                CLHelper.CS(-2);
                CLHelper.CR(-1);
#endif
                try {
                    if (!addAutomatically)
                    {
                        T id = (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFrom(elements[0]);

                        if (!table.ContainsKey(id))
                        {
                            Z.F();
                            continue;
                        }
                    }

                    function(debug, list, elements, table);
                }
                catch (Exception err) {
                    if (!debug.ReportException(err))
                    {
                        return;
                    }
                }
#if SDE_DEBUG
                CLHelper.CS(-1);
                CLHelper.CR(-2);
#endif
            }
#if SDE_DEBUG
            CLHelper.CS(-2);
            CLHelper.WA = ", method core : " + CLHelper.CD(-1) + "ms, loop getter : " + CLHelper.CD(-2) + "ms";
#endif
        }
コード例 #2
0
 public static void DbCommaLoader <T>(DbDebugItem <T> debug, AttributeList list, DbCommaFunctionDelegate <T> function, bool addAutomatically = true)
 {
     DbCommaLoader(debug, list, function, TextFileHelper.GetElementsByCommas, addAutomatically);
 }