예제 #1
0
파일: Class124.cs 프로젝트: jollitycn/JGNet
 public Class124(IAgileLogger iagileLogger_0, string string_1, Stream stream_1, ulong ulong_2)
 {
     this.emptyAgileLogger_0 = (EmptyAgileLogger)iagileLogger_0;
     this.string_0           = string_1;
     this.stream_0           = stream_1;
     this.ulong_1            = ulong_2;
     if (cbGeneric_1 == null)
     {
         cbGeneric_1 = new CbGeneric <string>(Class124.smethod_0);
     }
     this.FileTransCompleted += cbGeneric_1;
     if (cbFileTransDisruptted_1 == null)
     {
         cbFileTransDisruptted_1 = new CbFileTransDisruptted(Class124.smethod_1);
     }
     this.FileTransDisruptted += cbFileTransDisruptted_1;
     if (cbFileSendedProgress_1 == null)
     {
         cbFileSendedProgress_1 = new CbFileSendedProgress(Class124.smethod_2);
     }
     this.FileTransProgress += cbFileSendedProgress_1;
     if (ulong_2 == 0L)
     {
         this.stream_0.Flush();
         this.stream_0.Close();
         new CbGeneric(this.method_0).BeginInvoke(null, null);
     }
 }
예제 #2
0
 public void ActionOnEachNode(CbGeneric <MNode <TVal> > action)
 {
     if (this.root != null)
     {
         this.DoActionOnEach(action, this.root);
     }
 }
예제 #3
0
 public FileHandler()
 {
     if (cbGeneric_4 == null)
     {
         cbGeneric_4 = new CbGeneric <TransferingProject>(FileHandler.smethod_0);
     }
     this.FileTransStarted += cbGeneric_4;
     if (cbGeneric_5 == null)
     {
         cbGeneric_5 = new CbGeneric <TransferingProject>(FileHandler.smethod_1);
     }
     this.FileResumedTransStarted += cbGeneric_5;
     if (cbFileSendedProgress_1 == null)
     {
         cbFileSendedProgress_1 = new CbFileSendedProgress(FileHandler.smethod_2);
     }
     this.FileTransProgress += cbFileSendedProgress_1;
     if (cbGeneric_6 == null)
     {
         cbGeneric_6 = new CbGeneric <TransferingProject, FileTransDisrupttedType>(FileHandler.smethod_3);
     }
     this.FileTransDisruptted += cbGeneric_6;
     if (cbGeneric_7 == null)
     {
         cbGeneric_7 = new CbGeneric <TransferingProject>(FileHandler.smethod_4);
     }
     this.FileTransCompleted += cbGeneric_7;
 }
예제 #4
0
파일: Class5.cs 프로젝트: jollitycn/JGNet
 public Class5(Class8 class8_1, IPEndPoint ipendPoint_1, CbGeneric <Interface5, IMessageHandler> pointer, int int_5) : base(class8_1.method_2(), ipendPoint_1, pointer, int_5)
 {
     this.int_3    = 0;
     this.class8_0 = class8_1;
     this.byte_0   = new byte[this.class8_0.cXkPpBiZo7()];
     this.int_4    = GenericKMP.Next <byte>(class8_1.method_4());
 }
예제 #5
0
 private void DoActionOnEach(CbGeneric <MNode <TVal> > action, MNode <TVal> node)
 {
     action(node);
     foreach (MNode <TVal> child in node.Children)
     {
         this.DoActionOnEach(action, child);
     }
 }
예제 #6
0
 public MessageForbiddenHandler()
 {
     if (cbGeneric_1 == null)
     {
         cbGeneric_1 = new CbGeneric <IMessageHandler>(MessageForbiddenHandler.smethod_0);
     }
     this.MessageForbidden += cbGeneric_1;
 }
예제 #7
0
 public WorkProcesser(int int_0, CbGeneric <IMessageHandler> handler)
 {
     this.cbGeneric_0 = handler;
     this.workerEngine_0.WorkerThreadCount = int_0;
     this.workerEngine_0.WorkProcesser     = this;
     this.workerEngine_0.Initialize(0x186a0);
     this.workerEngine_0.Start();
 }
예제 #8
0
 public Class4(Stream stream_1, IPEndPoint ipendPoint_1, CbGeneric <Interface5, IMessageHandler> pointer, int int_3)
 {
     this.stream_0     = stream_1;
     this.ipendPoint_0 = ipendPoint_1;
     this.cbGeneric_0  = pointer;
     this.int_0        = int_3;
     this.class47_0    = new Class47(new CbGeneric <IMessageHandler>(this.method_0));
 }
예제 #9
0
 public Class6(Stream stream_1, int int_5, int int_6, IPEndPoint ipendPoint_1, CbGeneric <Interface5, IMessageHandler> pointer, int int_7) : base(stream_1, ipendPoint_1, pointer, int_7)
 {
     this.int_3      = 0;
     this.int_4      = 0;
     this.nullable_0 = null;
     this.bool_1     = false;
     this.int_3      = int_6;
     this.byte_0     = new byte[int_5];
 }
예제 #10
0
 public int AddCallback(int spanInSecs, CbGeneric <T> _callback, T _callbackPara)
 {
     lock (this.locker)
     {
         ++this.idCount;
         this.dicTask.Add(this.idCount, new CallbackTask <T>(this.idCount, spanInSecs, _callback, _callbackPara));
         return(this.idCount);
     }
 }
예제 #11
0
        public static void PlayAudioAsyn()
        {
            if (!SystemSettings.Singleton.PlayAudio4Message)
            {
                return;
            }

            var cbPlayAudio = new CbGeneric <string, int>(PlayAudio);

            cbPlayAudio.BeginInvoke(audioFilePath, 1, null, null);
        }
예제 #12
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public Updater()
        {
            mRapidPassiveEngine = RapidEngineFactory.CreatePassiveEngine();
            mRapidPassiveEngine.AutoReconnect          = true;
            mRapidPassiveEngine.ConnectionInterrupted += new CbGeneric(RapidPassiveEngine_ConnectionInterrupted);
            mRapidPassiveEngine.RelogonCompleted      += new CbGeneric <LogonResponse>(RapidPassiveEngine_RelogonCompleted);

            Event_UpdateStarted    += new CbGeneric(Updater_UpdateStarted);
            Event_UpdateDisruptted += new CbGeneric <string>(Updater_UpdateDisruptted);
            Event_UpdateCompleted  += new CbGeneric(Updater_UpdateCompleted);
        }
예제 #13
0
        public static void SpringEventSafelyAsyn(IAgileLogger agileLogger, string eventPath, Delegate theEvent)
        {
            if (theEvent == null)
            {
                return;
            }

            CbGeneric <IAgileLogger, string, Delegate> cb = new CbGeneric <IAgileLogger, string, Delegate>(EventHelper.SpringEventSafely);

            cb.BeginInvoke(agileLogger, eventPath, theEvent, null, null);
        }
예제 #14
0
 public AsynDelayActor(int delayMSecs, CbGeneric <object> action, object arg)
 {
     if (this.delayInMSecs < 0)
     {
         throw new ArgumentException("The value of delayMSecs is invalid. ");
     }
     this.handler      = action;
     this.delayInMSecs = delayMSecs;
     this.argument     = arg;
     new CbGeneric(this.Action).BeginInvoke(null, null);
 }
예제 #15
0
        public static void SpringEventSafelyAsyn <T1, T2>(IAgileLogger agileLogger, string eventPath, Delegate theEvent, T1 t1, T2 t2)
        {
            if (theEvent == null)
            {
                return;
            }

            CbGeneric <IAgileLogger, string, Delegate, T1, T2> cb = new CbGeneric <IAgileLogger, string, Delegate, T1, T2>(EventHelper.SpringEventSafely <T1, T2>);

            cb.BeginInvoke(agileLogger, eventPath, theEvent, t1, t2, null, null);
        }
예제 #16
0
        public DignosticLogger(IDiagnosticsViewer viewer, string logFilePath, int logSpanInSecs)
        {
            this.diagnosticsViewer = viewer;
            this.agileLogger       = new FileAgileLogger(logFilePath);
            this.spanInSecs        = logSpanInSecs;

            if (this.diagnosticsViewer != null)
            {
                CbGeneric cb = new CbGeneric(this.LogThread);
                cb.BeginInvoke(null, null);
            }
        }
예제 #17
0
        public CallbackTask(int _id, int iniSecs, CbGeneric <T> _callback, T _callbackPara)
        {
            this.iD           = _id;
            this.leftSeconds  = iniSecs;
            this.callbackPara = _callbackPara;
            this.callback     = _callback;

            if (this.leftSeconds <= 0)
            {
                throw new ArgumentException("The Left Seconds must greater than 0!");
            }
        }
예제 #18
0
 public FileReceiver(IAgileLogger iagileLogger_0, string string_3, string string_4, ulong ulong_2, string string_5)
 {
     this.diYatLwGC          = new EventSafeTrigger(new EmptyAgileLogger(), "XrZokLIgmVlcsHl3C7.nxZXDMlUfKsyJYxeVn");
     this.emptyAgileLogger_0 = new EmptyAgileLogger();
     this.ulong_0            = 0L;
     this.HtwoUmmJj          = "";
     this.object_0           = 0;
     this.int_0              = 0;
     this.byte_0             = 0;
     this.filePackage_0      = new FilePackage[0x100];
     this.int_1              = 0;
     this.bool_0             = false;
     this.emptyAgileLogger_0 = (EmptyAgileLogger)iagileLogger_0;
     this.HtwoUmmJj          = string_3;
     if (File.Exists(string_4))
     {
         File.Delete(string_4);
     }
     this.string_0 = string_4;
     this.string_1 = string_4 + string_5;
     while (File.Exists(this.string_1))
     {
         this.string_1 = this.string_1 + string_5;
     }
     this.string_2     = FileHelper.GetFileNameNoPath(string_4);
     this.fileStream_0 = new FileStream(this.string_1, FileMode.OpenOrCreate);
     this.ulong_1      = ulong_2;
     if (cbGeneric_1 == null)
     {
         cbGeneric_1 = new CbGeneric <string>(FileReceiver.smethod_0);
     }
     this.FileTransCompleted += cbGeneric_1;
     if (cbFileTransDisruptted_1 == null)
     {
         cbFileTransDisruptted_1 = new CbFileTransDisruptted(FileReceiver.smethod_1);
     }
     this.FileTransDisruptted += cbFileTransDisruptted_1;
     if (cbFileSendedProgress_1 == null)
     {
         cbFileSendedProgress_1 = new CbFileSendedProgress(FileReceiver.nAuyhuNgq);
     }
     this.FileTransProgress += cbFileSendedProgress_1;
     if (ulong_2 == 0L)
     {
         this.fileStream_0.Flush();
         this.fileStream_0.Close();
         if (!File.Exists(this.string_0))
         {
             File.Move(this.string_1, this.string_0);
         }
         new CbGeneric(this.method_0).BeginInvoke(null, null);
     }
 }
예제 #19
0
 public OutConnectionManager()
 {
     if (cbGeneric_1 == null)
     {
         cbGeneric_1 = new CbGeneric <string, IPEndPoint, bool>(OutConnectionManager.smethod_0);
     }
     this.SomeOneConnected += cbGeneric_1;
     if (cbGeneric_2 == null)
     {
         cbGeneric_2 = new CbGeneric <string>(OutConnectionManager.smethod_1);
     }
     this.Event_1 += cbGeneric_2;
 }
예제 #20
0
파일: Class125.cs 프로젝트: jollitycn/JGNet
 public Class125()
 {
     if (cbGeneric_2 == null)
     {
         cbGeneric_2 = new CbGeneric <string, IPEndPoint, bool>(Class125.OnSomeOneConnected);
     }
     this.SomeOneConnected += cbGeneric_2;
     if (cbGeneric_3 == null)
     {
         cbGeneric_3 = new CbGeneric <string>(Class125.smethod_1);
     }
     this.OnSomeOneDisconnected += cbGeneric_3;
 }
예제 #21
0
파일: Class142.cs 프로젝트: jollitycn/JGNet
 public CycleEngine()
 {
     if (cbSimpleInt_1 == null)
     {
         cbSimpleInt_1 = new CbSimpleInt(CycleEngine.smethod_0);
     }
     this.Event_0 += cbSimpleInt_1;
     if (cbGeneric_1 == null)
     {
         cbGeneric_1 = new CbGeneric <Interface5>(CycleEngine.smethod_1);
     }
     this.Event_1 += cbGeneric_1;
 }
예제 #22
0
        public AsynDelayActor(int delayMSecs, CbGeneric<object> action, object arg)
        {
            if (delayInMSecs < 0)
            {
                throw new ArgumentException("The value of delayMSecs is invalid. ");
            }

            this.handler = action;
            this.delayInMSecs = delayMSecs;
            this.argument = arg;
            CbGeneric cb = new CbGeneric(this.Action);
            cb.BeginInvoke(null, null);
        }
예제 #23
0
        private void button2_Click(object sender, EventArgs e)
        {
            //停止采集
            this.capturer.Stop();
            this.button2.Enabled   = false;
            this.button1.Enabled   = true;
            this.comboBox1.Enabled = true;

            //清除最后一帧的显示
            CbGeneric cb = new CbGeneric(this.AfterStop);

            cb.BeginInvoke(null, null);
        }
예제 #24
0
 //停止声卡采集、停止录制
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         CbGeneric cb = new CbGeneric(this.StopRecordAsyn);
         cb.BeginInvoke(null, null);
     }
     catch (Exception ee)
     {
         MessageBox.Show(ee.Message);
     }
 }
예제 #25
0
        /// <summary>
        /// Start.
        /// </summary>
        /// <param name="serverIP">server ip</param>
        /// <param name="serverPort">server port</param>
        /// <param name="callerExe">callerExe</param>
        public void Start(string serverIP, int serverPort, string callerExe)
        {
            try
            {
                Random random = new Random();
                for (int i = 0; i < 100; i++)
                {
                    string        userID        = random.Next(1000000).ToString("00000");
                    string        logonPassword = string.Empty;
                    LogonResponse logonResponse = mRapidPassiveEngine.Initialize(userID, logonPassword, serverIP, serverPort, null);
                    if (logonResponse.LogonResult == LogonResult.Succeed)
                    {
                        break;
                    }
                }

                if (!File.Exists(UpdateConfiguration.ConfigurationPath))
                {
                    mUpdateConfiguration.Save();
                }
                else
                {
                    mUpdateConfiguration = (UpdateConfiguration)AgileConfiguration.Load(UpdateConfiguration.ConfigurationPath);
                }

                GetUpdateInfo(out mFileRelativePathListNeedDownloaded, out mFileListNeedRemoved);
                mFileCountNeedUpdated = mFileRelativePathListNeedDownloaded.Count;
                Event_FileCountNeedUpdated?.Invoke(mFileCountNeedUpdated);

                if (mFileCountNeedUpdated == 0 && mFileListNeedRemoved.Count == 0)
                {
                    return;
                }
                Event_UpdateStarted?.Invoke();

                Process[] processes = Process.GetProcessesByName(callerExe.Substring(0, callerExe.Length - 4));
                foreach (Process process in processes)
                {
                    process.Kill();
                }

                CbGeneric cbGeneric = new CbGeneric(UdpateThread);
                cbGeneric.BeginInvoke(null, null);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                Event_UpdateDisruptted?.Invoke(Resources.ConnectionFailed);
            }
        }
예제 #26
0
 private void Do_ActionOnUI(bool showMessageBoxOnException, CbGeneric method)
 {
     try
     {
         method();
     }
     catch (Exception exception)
     {
         this.agileLogger.Log(exception, method.Method.Name, ErrorLevel.Standard);
         if (showMessageBoxOnException)
         {
             MessageBox.Show(exception.Message);
         }
     }
 }
예제 #27
0
 private void Do_ActionOnUI <T1, T2, T3, T4>(bool showMessageBoxOnException, CbGeneric <T1, T2, T3, T4> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
 {
     try
     {
         method(arg1, arg2, arg3, arg4);
     }
     catch (Exception exception)
     {
         this.agileLogger.Log(exception, method.Method.Name, ErrorLevel.Standard);
         if (showMessageBoxOnException)
         {
             MessageBox.Show(exception.Message);
         }
     }
 }
예제 #28
0
        public void ActionOnUI(bool showMessageBoxOnException, bool beginInvoke, CbGeneric method)
        {
            if (this.control.InvokeRequired)
            {
                if (beginInvoke)
                {
                    this.control.BeginInvoke(new CbGeneric <bool, CbGeneric>(this.Do_ActionOnUI), showMessageBoxOnException, method);
                    return;
                }
                this.control.Invoke(new CbGeneric <bool, CbGeneric>(this.Do_ActionOnUI), showMessageBoxOnException, method);
                return;
            }

            this.Do_ActionOnUI(showMessageBoxOnException, method);
        }
예제 #29
0
 private void Do_ActionOnUI <T1>(bool showMessageBoxOnException, CbGeneric <T1> method, T1 args)
 {
     try
     {
         method(args);
     }
     catch (Exception ee)
     {
         this.agileLogger.Log(ee, method.Method.Name, ESBasic.Loggers.ErrorLevel.Standard);
         if (showMessageBoxOnException)
         {
             MessageBox.Show(ee.Message);
         }
     }
 }
예제 #30
0
파일: P2PClass.cs 프로젝트: jollitycn/JGNet
 public P2PClass(Interface26 interface26_0, P2PSessionMessageTypeRoom p2PSessionMessageTypeRoom_1, IAgileLogger iagileLogger_0)
 {
     if (cbGeneric_2 == null)
     {
         cbGeneric_2 = new CbGeneric <P2PChannelState>(P2PClass.smethod_0);
     }
     this.P2PChannelOpened += cbGeneric_2;
     if (cbGeneric_3 == null)
     {
         cbGeneric_3 = new CbGeneric <P2PChannelState>(P2PClass.smethod_1);
     }
     this.P2PChannelClosed           += cbGeneric_3;
     this.object_0                    = interface26_0;
     this.p2PSessionMessageTypeRoom_0 = p2PSessionMessageTypeRoom_1;
     this.emptyAgileLogger_0          = (EmptyAgileLogger)iagileLogger_0;
 }
예제 #31
0
        public void Start()
        {
            //配置文件中记录着各个文件的版本信息。
            if (!File.Exists(UpdateConfiguration.ConfigurationPath))
            {
                this.updateConfiguration.Save();
            }
            else
            {
                this.updateConfiguration = (UpdateConfiguration)UpdateConfiguration.Load(UpdateConfiguration.ConfigurationPath);
            }

            //启动升级线程
            CbGeneric cb = new CbGeneric(this.UdpateThread);
            cb.BeginInvoke(null, null);
        }
예제 #32
0
        /// <summary>
        /// 发送图片消息
        /// </summary>
        /// <param name="img">待发送的Img对象</param>
        /// <param name="imgId">Img对象的ID</param>
        /// <param name="destUserID">目的ID</param>
        public void SendImage(Image img,string imgId,string destUserID)
        {
            //根据ID和img生成byte数组
            byte[] blob = ImageUtil.customizeImg(imgId, img);

            //通过委托异步调用
            CbGeneric<byte[], string> cb = new CbGeneric<byte[], string>(this.SendBlobThread);
            cb.BeginInvoke(blob, destUserID, null, null);
        }
예제 #33
0
 /// <summary>
 /// 异步停止引擎。
 /// </summary>
 public void StopAsyn()
 {
     CbGeneric cb = new CbGeneric(this.Stop);
     cb.BeginInvoke(null, null);
 }
예제 #34
0
        public static void PlayAudioAsyn()
        {
            if (!SystemSettings.Singleton.PlayAudio4Message)
            {
                return;
            }

            CbGeneric<string, int> cbPlayAudio = new CbGeneric<string, int>(PlayAudio);
            cbPlayAudio.BeginInvoke(audioFilePath, 1, null, null);
        }
예제 #35
0
 /// <summary>
 /// 处理用户上线事件
 /// </summary>
 /// <param name="userData"></param>
 private void SomeOneConnect(UserData userData)
 {
     //获得UserID
     string userID = userData.UserID;
     //转发其离线消息
     List<Msg> msgs = userDBManager.queryMsgs(userID);
     if (msgs.Count > 0)
     {
         foreach (Msg s in msgs)
         {
             //得到:类型号 SPLIT 内容
             int infoType = s.Type;
             if (infoType == 2)        //图片消息
             {
                 byte[] info = System.Text.Encoding.UTF8.GetBytes(s.Content);
                 CbGeneric<byte[], string> cb = new CbGeneric<byte[], string>(this.SendBlobThread);
                 cb.BeginInvoke(info, userID, null, null);
             }
             else                      //文本格式消息,不单纯是文本消息
             {
                 byte[] info = System.Text.Encoding.UTF8.GetBytes(s.Content);
                 this.engine.CustomizeController.Send(userID, infoType, info);
             }
         }
         //清空未读消息
         userDBManager.deleteMsg(userID);
     }
 }