コード例 #1
0
        //IEnvironment env;

        public ImplHandlerLog(IEnvironment pEnv)
        {
            // env = pEnv;
            try
            {
                if (!ToolMobile.existsDir(_dir))
                {
                    ToolMobile.createDir(_dir);
                }

                string[] arr = ToolMobile.getFiles(_dir);
                if (arr.Length > 30)
                {
                    List <string> files = new List <string>(arr);
                    files.Sort();
                    for (int i = 0; i < files.Count - 5; ++i)
                    {
                        ToolMobile.deleteFile(_dir, files[i]);
                    }
                }
            }
            catch //(Exception exc)
            {
            }
        }
コード例 #2
0
 public override void init()
 {
     try
     {
         base.init();
         try
         {
             if (isDbNew)
             {
                 fillDb();
             }
         }
         catch (Exception exc)
         {
             try
             {
                 exit();
                 if (ToolMobile.existsFile(infoDataSource.dataSource))
                 {
                     ToolMobile.deleteFile(infoDataSource.dataSource);
                 }
             }
             catch { }
             throw exc;
         }
         //
     }
     catch (Exception exc)
     {
         exit();
         throw exc;
     }
 }
コード例 #3
0
        public override void delete(string dir, string name)
        {
            string path = correctPath(dir, name);

            //
            ToolMobile.deleteFile(path);
        }
コード例 #4
0
        protected override void connect()
        {
            if (!ToolMobile.existsFile(infoDataSource.dataSource))
            {
                isDbNew = true;
            }


            try
            {
                connection = SqlExecute.getConnection(infoDataSource.dataSource);
            }
            catch (Exception exc)
            {
                ToolMobile.setExceptionInner(exc);

                if (isDbNew && ToolMobile.existsFile(infoDataSource.dataSource))
                {
                    ToolMobile.deleteFile(infoDataSource.dataSource);
                }

                throw exc;
            }
        }