예제 #1
0
 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;
 }
예제 #2
0
 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;
 }
예제 #3
0
 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;
 }
예제 #4
0
파일: Main.cs 프로젝트: Scrier/testcomplete
        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;
              }
        }
예제 #5
0
        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();
        }
예제 #6
0
        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;
            }
        }
예제 #7
0
        /// <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);
            }
        }
예제 #8
0
 public TCPRTPSocketClient(ILogInterface logmgr, string strGuid)
     : base(logmgr, strGuid)
 {
 }
예제 #9
0
 public SocketClient(ILogInterface logmgr, string strGuid)
     : this()
 {
     m_Logger = logmgr;
     OurGuid = strGuid;
 }
예제 #10
0
 public SocketClient(ILogInterface logmgr, string strGuid)
     : this()
 {
     m_Logger = logmgr;
     OurGuid  = strGuid;
 }
예제 #11
0
        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;
        }
예제 #12
0
        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));
        }
예제 #13
0
 public ArchiveController(ILogInterface service, IMapper mapper, IHubContext <ArchiveHub> hubContext) : base(service, mapper)
 {
     _hubContext = hubContext;
 }
예제 #14
0
 /// <summary> 初始化日志信息 </summary>
 public static void Init(ILogInterface log)
 {
     Log = log;
 }
예제 #15
0
 public XMPPClient(SocketServer.ILogInterface loginterface)
     : this()
 {
     LogInterface = loginterface;
 }
예제 #16
0
 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;
 }
예제 #17
0
        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);
        }
예제 #18
0
 public TCPRTPSocketClient(ILogInterface logmgr, string strGuid) :
     base(logmgr, strGuid)
 {
 }
예제 #19
0
 public FileManagement(ApplicationSettings settings, ILogInterface log)
 {
     this.settings = settings;
     Logger        = log;
 }
예제 #20
0
        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);
        }