Example #1
0
 public void ExecuteAutoFlush()
 {
     // Only flush (i.e. commit transaction) if one is pending (based on the Timer)
     // and not under any bulk-mode.
     if (!m_flushPending)
     {
         return;
     }
     TraceLibrary.WriteLine(CeTraceLevel.Release, "SqliteDataConnectionBase.ExecuteAutoFlush");
     Flush();
 }
        private String GetString(String astringName, Assembly aassemblyCaller)
        {
            String astring = GetStringBare(astringName, aassemblyCaller);

            if (astring == null)
            {
                TraceLibrary.WriteLine(CeTraceLevel.Debug, this,
                                       "TextManager.GetString: missing " + astringName); // I18N OK <ccla>
                astring = MISSING_PREFIX + astringName;
            }
            return(astring);
        }
        public virtual double DoubleUnitFromString(Unit aunit, String astring)
        {
            //TODO 3: Prefer handler at higher-level, rather than silently defaulting to 0.0 here.
            double adouble = 0.0;
            bool   abool   = Double.TryParse(astring, NumberStyles.Any, NumberFormatInfo.CurrentInfo, out adouble);

            if (!abool)
            {
                TraceLibrary.WriteLine(CeTraceLevel.Debug, this, "DoubleUnitFromString", "cannot parse: " + astring);// I18N OK <ccla>
            }
            return(DoubleUnitFromDouble(aunit, adouble));
        }
Example #4
0
        private void HandleUnhandledException(object sender, UnhandledExceptionEventArgs t)
        {
            if (DbConnection.State != ConnectionState.Open)
            {
                return;
            }

            // Ensuring regular transaction is committed in the case of a UE to avoid
            // any data-loss.

            try
            {
                Flush();
            }
            catch (Exception ex)
            {
                TraceLibrary.WriteLine(CeTraceLevel.Release, ex.Message);
            }
        }