private MediaTimer(System.DateTime dtDue, DelegateTimerFired del, string strGuid, ILogInterface logmgr) { DueTime = dtDue; CallBack = del; Id = Interlocked.Increment(ref BaseTimerId); Guid = strGuid; m_logmgr = logmgr; }
internal QuickTimer(PeriodicTimerWatch objWatch, int nMsTimer, DelegateTimerFired del, string strGuid, ILogInterface logmgr) { Period = nMsTimer; watch = objWatch; CallBack = del; Id = Interlocked.Increment(ref BaseTimerId); Guid = strGuid; m_logmgr = logmgr; m_bCanceled = false; }
public static void Init(string logType, string where, string what, bool bVerbose, bool eVerbose, bool tVerbose, string ITD_ITR, string version, string misc) { if (myLog != null) myLog.Close(); switch (logType) { case "DB": myLog = new DBLog(where, what, bVerbose, eVerbose, tVerbose, ITD_ITR, version, misc); break; case "TEXT": default: myLog = new TextFileLog(where, what, bVerbose, eVerbose, tVerbose); break; } }
public void Connect(ILogInterface log) { LogMessage("Calling XMPPClient::Connect()"); string strCurrentAccountName = this.JID.BareJID.Replace("@", "").Replace(" ", "").Replace("/", "_").Replace("\\", ""); AvatarStorage.AccountFolder = strCurrentAccountName; if (this.XMPPAccount.AccountName == null) { this.XMPPAccount.AccountName = strCurrentAccountName; } this.RosterItems.Clear(); XMPPConnection = new XMPPConnection(this, log); XMPPConnection.OnStanzaReceived += new System.Net.XMPP.XMPPConnection.DelegateStanza(XMPPConnection_OnStanzaReceived); XMPPConnection.Connect(); }
static public void Init(string logType, string where, string what, bool bVerbose, bool eVerbose, bool tVerbose, string ITD_ITR, string version, string misc) { if (myLog != null) { myLog.Close(); } switch (logType) { case "DB": myLog = new DBLog(where, what, bVerbose, eVerbose, tVerbose, ITD_ITR, version, misc); break; case "TEXT": default: myLog = new TextFileLog(where, what, bVerbose, eVerbose, tVerbose); break; } }
/// <summary> 获取指定类型的日志服务 </summary> public T GetLogService <T>() where T : class, ILogInterface, new() { // Todo :查找指定类型的日志 ILogInterface t = _cache.Find(l => l is T); if (t != null) { return(t as T); } else { // Todo :新生成添加到缓存 T n = new T(); _cache.Add(n); return(n); } }
public TCPRTPSocketClient(ILogInterface logmgr, string strGuid) : base(logmgr, strGuid) { }
public SocketClient(ILogInterface logmgr, string strGuid) : this() { m_Logger = logmgr; OurGuid = strGuid; }
public static IMediaTimer CreateTimer(int nMilliseconds, DelegateTimerFired del, string strGuid, ILogInterface logmgr) { lock (LockInit) { if (Initialized == false) { PrepareStuff(); Initialized = true; } } System.DateTime dtDue = DateTime.Now.AddMilliseconds(Convert.ToDouble(nMilliseconds)); MediaTimer objNewTimer = new MediaTimer(dtDue, del, strGuid, logmgr); AddSorted(objNewTimer); return objNewTimer; }
public static IMediaTimer CreateTimer(int nMilliseconds, DelegateTimerFired del, string strGuid, ILogInterface logmgr, int nAvgDevMs) { int nIndex = 0; lock (LockCurrentTimerThread) { CurrentTimerThread++; if (CurrentTimerThread > (Timers.Count - 1)) { CurrentTimerThread = 0; } nIndex = CurrentTimerThread; } return(Timers[nIndex].CreateTimer(nMilliseconds, del, strGuid, logmgr, nAvgDevMs)); }
public ArchiveController(ILogInterface service, IMapper mapper, IHubContext <ArchiveHub> hubContext) : base(service, mapper) { _hubContext = hubContext; }
/// <summary> 初始化日志信息 </summary> public static void Init(ILogInterface log) { Log = log; }
public XMPPClient(SocketServer.ILogInterface loginterface) : this() { LogInterface = loginterface; }
private MediaTimer(System.DateTime dtDue, DelegateTimerFired del, string strGuid, object objTag) { DueTime = dtDue; CallBack = del; Id = Interlocked.Increment(ref BaseTimerId); Guid = strGuid; m_logmgr = null; Tag = objTag; }
public static int AccuracyAndLag = 1; /// account for cpu... fire within 5 ms public static IMediaTimer CreateTimer(int nMilliseconds, DelegateTimerFired del, string strGuid, ILogInterface logmgr) { lock (LockInit) { if (Initialized == false) { PrepareStuff(); Initialized = true; } } System.DateTime dtDue = DateTime.Now.AddMilliseconds(Convert.ToDouble(nMilliseconds)); MediaTimer objNewTimer = new MediaTimer(dtDue, del, strGuid, logmgr); AddSorted(objNewTimer); return(objNewTimer); }
public FileManagement(ApplicationSettings settings, ILogInterface log) { this.settings = settings; Logger = log; }
public IMediaTimer CreateTimer(int nMilliseconds, DelegateTimerFired del, string strGuid, ILogInterface logmgr, int nAvgDevMs) { lock (LockInit) { if (Initialized == false) { PrepareStuff(); Initialized = true; } } PeriodicTimerWatch watch = null; lock (GlobalWatchesLock) { if (GlobalWatches.ContainsKey(nMilliseconds) == false) { watch = new PeriodicTimerWatch(nMilliseconds); GlobalWatches.Add(nMilliseconds, watch); GlobalWatchesSorted.Add(watch); foreach (PeriodicTimerWatch nextwatch in GlobalWatchesSorted) { nextwatch.LockTimeForSort(); } GlobalWatchesSorted.Sort(); EventNewTimer.Set(); } else { watch = GlobalWatches[nMilliseconds]; } } QuickTimer objNewTimer = new QuickTimer(watch, nMilliseconds, del, strGuid, logmgr, nAvgDevMs); watch.AddTimer(objNewTimer); return(objNewTimer); }