コード例 #1
0
        private void OnTimerCallback(object state)
        {
            //if (ChoGuard.IsDisposed(this))
            //    return;

            Pause();
            try
            {
                if (_timerServiceCallback != null)
                {
                    _timerServiceCallback.Run((T)state, _timeout);
                }
                //new Action<T>(OnTimerServiceCallback).WaitFor((T)state, _timeout);
            }
            catch (TimeoutException ex)
            {
                if (!_silent)
                {
                    throw new ChoTimerServiceException(String.Format("{1}: Timeout [{0} ms] elapsed prior to completion of the method.", _timeout, _name), ex);
                }
                else
                {
                    ChoProfile.GetContext(Name).AppendIf(ChoTrace.ChoSwitch.TraceError, String.Format("Timeout [{0} ms] elapsed prior to completion of the method.", _timeout));
                }
            }
            //if (ChoGuard.IsDisposed(this))
            //    return;
            Continue();
        }
コード例 #2
0
        private static void iniDocument_IgnoredEntry(object sender, ChoIniDocumentEventArgs e)
        {
            if (e == null || e.IniDocumentStates == null)
            {
                return;
            }

            foreach (ChoIniDocumentState iniDocumentState in e.IniDocumentStates)
            {
                ChoProfile.RegisterIfNotExists(iniDocumentState.IniFilePath, new ChoBufferProfileEx(ChoFileProfileSettings.GetFullPath(ChoReservedDirectoryName.Others,
                                                                                                                                       ChoPath.AddExtension(Path.GetFileName(iniDocumentState.IniFilePath), ChoReservedFileExt.Ignore)),
                                                                                                    "Entries Ignored are..."));
                ChoProfile.GetContext(iniDocumentState.IniFilePath).AppendLine(iniDocumentState.ToString());
            }
        }