示例#1
0
        void upb_ProjectClosed(object sender, PackageEventArgs e)
        {
            txtNewSoftDir.DataBindings.Clear();
            txtPackagePath.DataBindings.Clear();
            rtfPath.DataBindings.Clear();

            txtAfterExecuteArgs.DataBindings.Clear();
            txtAppName.DataBindings.Clear();
            txtAppVersion.DataBindings.Clear();
            txtDesc.DataBindings.Clear();
            txtPreExecuteArgs.DataBindings.Clear();
            txtPublishUrl.DataBindings.Clear();
            txtTimeout.DataBindings.Clear();
            chkHideBefore.DataBindings.Clear();
            chkHideAfter.DataBindings.Clear();
            fileAfterExecute.DataBindings.Clear();
            filePreExecute.DataBindings.Clear();
            txtUrl.DataBindings.Clear();
            txtPing.DataBindings.Clear();

            chkOptAutoExitProcess.DataBindings.Clear();
            chkOptAutoKillProcess.DataBindings.Clear();
            chkOptForceUpdate.DataBindings.Clear();
            chkOptMustUpdate.DataBindings.Clear();
            chkAutoEndAppDirProcesses.DataBindings.Clear();
            chkStillProptUserInfo.DataBindings.Clear();
            chkAutoCloseSucceed.DataBindings.Clear();
            chkOptError.DataBindings.Clear();
            chkOptRequireAdminPrivilege.DataBindings.Clear();
            txtPackageExtension.DataBindings.Clear();
            chkCleanTargetDirectory.DataBindings.Clear();
            chkRandomPackageName.DataBindings.Clear();
            txtCompFlag.DataBindings.Clear();
        }
示例#2
0
 public void OnPackageReceived(object sender, PackageEventArgs <ClientPackageInfo> e)
 {
     Task.Run(() =>
     {
         //先gzip压缩  再转为16进制字符串
         var body = DataHelper.Compress(e.Package.Data);
         var pack = new PackJson()
         {
             Host    = PackJson.Host,
             UserId  = PackJson.UserId,
             Content = body
         };
         var json      = JsonHelper.Instance.Serialize(pack);
         var jsonBytes = Encoding.UTF8.GetBytes(json);
         //03 02 数据长度(4) 正文数据(n)   ---tcp响应包
         var sendBytes = new List <byte>()
         {
             0x3, 0x2
         };
         sendBytes.AddRange(BitConverter.GetBytes(jsonBytes.Length).Reverse());
         sendBytes.AddRange(jsonBytes);
         //转发给服务器
         NatClient.Send(sendBytes.ToArray());
         HandleLog.WriteLine($"<---- {PackJson.UserId} 收到报文{e.Package.Data.Length}字节");
     });
 }
 internal void NotifyReferenceRemoved(PackageEventArgs e)
 {
     if (PackageReferenceRemoved != null)
     {
         PackageReferenceRemoved(this, e);
     }
 }
示例#4
0
 public PackageManagementEventArgs(
     IDotNetProject project,
     PackageEventArgs e)
     : this(project, e.Identity, e.InstallPath)
 {
     PackageFilePath = GetPackageFilePath(e);
 }
示例#5
0
 /// <summary>
 /// 触发重新发送事件
 /// </summary>
 /// <param name="e">包含事件的参数</param>
 protected virtual void OnPackageResend(PackageEventArgs e)
 {
     if (PackageResend != null)
     {
         PackageResend(this, e);
     }
 }
 internal void NotifyUninstalled(PackageEventArgs e)
 {
     if (PackageUninstalled != null)
     {
         PackageUninstalled(this, e);
     }
 }
		public PackageManagementEventArgs (
			IDotNetProject project,
			PackageEventArgs e)
			: this (project, e.Identity, e.InstallPath)
		{
			PackageFilePath = GetPackageFilePath (e);
		}
示例#8
0
 void ServerProcessor_AudioCommandPacketReceived(object sender, PackageEventArgs e)
 {
     if (AudioCommandPacketReceived != null)
     {
         AudioCommandPacketReceived(this, GetProxyPacketEventArgs(e).Value);
     }
 }
 internal void NotifyInstalling(PackageEventArgs e)
 {
     if (PackageInstalling != null)
     {
         PackageInstalling(this, e);
     }
 }
示例#10
0
 void ServerProcessor_DestroyObjectPacketReceived(object sender, PackageEventArgs e)
 {
     if (DestroyObjectPacketReceived != null)
     {
         DestroyObjectPacketReceived(this, GetProxyPacketEventArgs(e).Value);
     }
 }
示例#11
0
 void ServerProcessor_CommsIncomingPacketReceived(object sender, PackageEventArgs e)
 {
     if (CommsIncomingPacketReceived != null)
     {
         CommsIncomingPacketReceived(this, GetProxyPacketEventArgs(e).Value);
     }
 }
示例#12
0
 void ServerProcessor_GameMessagePacketReceived(object sender, PackageEventArgs e)
 {
     if (GameMessagePacketReceived != null)
     {
         GameMessagePacketReceived(this, GetProxyPacketEventArgs(e).Value);
     }
 }
示例#13
0
 void ServerProcessor_EngGridUpdatePacketReceived(object sender, PackageEventArgs e)
 {
     if (EngGridUpdatePacketReceived != null)
     {
         EngGridUpdatePacketReceived(this, GetProxyPacketEventArgs(e).Value);
     }
 }
示例#14
0
 void ServerProcessor_IntelPacketReceived(object sender, PackageEventArgs e)
 {
     if (IntelPacketReceived != null)
     {
         IntelPacketReceived(this, GetProxyPacketEventArgs(e).Value);
     }
 }
示例#15
0
 void ServerProcessor_ObjectStatusUpdatePacketReceived(object sender, PackageEventArgs e)
 {
     if (ObjectStatusUpdatePacketReceived != null)
     {
         ObjectStatusUpdatePacketReceived(this, GetProxyPacketEventArgs(e).Value);
     }
 }
示例#16
0
        void ServerProcessor_PackageReceived(object sender, PackageEventArgs e)
        {
            Guid             TargetID = Guid.Empty;
            Guid             SourceID = e.ID;
            PacketProcessing pp       = null;



            if (!filteredPackets.Contains((uint)e.ReceivedPacket.PacketType))
            {
                KeyValuePair <PacketProcessing, ProxyPackageEventArgs> key = GetProxyPacketEventArgs(e);
                pp = key.Key;

                if (proxyType == ProxyType.OneServerConnectionToOneClientConnection)
                {
                    pp.Send(TargetID, e.ReceivedPacket);
                }
                else
                {
                    pp.Send(e.ReceivedPacket);
                }
                if (PackageReceived != null)
                {
                    System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(RaisePackageRecieved), key.Value);
                }
            }
            //@@@
        }
示例#17
0
 void ServerProcessor_ShipAction2PacketReceived(object sender, PackageEventArgs e)
 {
     if (ShipAction2PacketReceived != null)
     {
         ShipAction2PacketReceived(this, GetProxyPacketEventArgs(e).Value);
     }
 }
示例#18
0
 /// <summary>
 /// 当数据发送失败时调用
 /// </summary>
 /// <param name="e">包含事件的参数</param>
 protected virtual void OnPackageSendFailure(PackageEventArgs e)
 {
     if (PackageSendFailure != null)
     {
         PackageSendFailure(this, e);
     }
 }
示例#19
0
        private void OnPackageReceived(object sender, PackageEventArgs <MyPackageInfo> e)
        {
            var client = sender as EasyClient <MyPackageInfo>;

            if (AllClientMessageList.ContainsKey(client.LocalEndPoint.ToString()))
            {
                AllClientMessageList[client.LocalEndPoint.ToString()].Add(new ClientMessage
                {
                    MsgType    = MessageType.Receive,
                    MsgTime    = DateTime.Now,
                    MsgContent = Encoding.Default.GetString(e.Package.AllData)
                });
            }
            else
            {
                ClientMessage cmsg = new ClientMessage
                {
                    MsgType    = MessageType.Receive,
                    MsgTime    = DateTime.Now,
                    MsgContent = Encoding.Default.GetString(e.Package.AllData)
                };
                AllClientMessageList.Add(client.LocalEndPoint.ToString(), new ObservableCollection <ClientMessage> {
                    cmsg
                });
            }
        }
示例#20
0
 void connector_GamesMessagePacketReceived(object sender, PackageEventArgs e)
 {
     //GameStart and GameOver are all that matter.
     if (e != null && e.ReceivedPacket != null)
     {
         GameMessagePacket p = e.ReceivedPacket.Package as GameMessagePacket;
         if (p != null)
         {
             if (p.SubPacketType == GameMessageSubPackets.GameMessageSubPacketTypes.GameEndSubPacket)
             {
                 plyr.Stop();
                 GameInProgress = false;
                 View.GameEnded();
             }
             if (p.SubPacketType == GameMessageSubPackets.GameMessageSubPacketTypes.EndSimulationSubPacket)
             {
                 plyr.Stop();
                 GameInProgress = false;
                 View.SimulationEnded();
             }
             if (p.SubPacketType == GameMessageSubPackets.GameMessageSubPacketTypes.AllShipSettingsSubPacket)
             {
                 AllShipSettingsSubPacket allships = p.SubPacket as AllShipSettingsSubPacket;
                 if (allships != null && allships.Ships != null && !shipSelected)
                 {
                     SelectedShip = View.GetShipSelection(allships.Ships);
                     shipSelected = true;
                     SelectStationAndReady();
                 }
             }
         }
     }
 }
示例#21
0
 /// <summary>
 /// 触发解压缩失败事件
 /// </summary>
 /// <param name="e">事件包含的参数</param>
 protected static void OnDecompressFailed(PackageEventArgs e)
 {
     if (DecompressFailed != null)
     {
         DecompressFailed(typeof(MessagePacker), e);
     }
 }
示例#22
0
        private void TcpClient_NewPackageReceived(object sender, PackageEventArgs <StringPackageInfo> e)
        {
            try
            {
                WriteInfo($"接收 {e.Package.Body}");

                if (!isLineDebug)
                {
                    return;
                }

                TransData transData = TransData.GetInstance(e.Package.Parameters);
                SetTreeNodeStatus(transData);
                if (transData.Status == "OK")
                {
                    Protocol item = lstProtocol.Find(li => li.IsSend == false && li.ParentID != "null");
                    if (item != null)
                    {
                        Thread.Sleep(60);
                        var data = Encoding.UTF8.GetBytes(item.Content.Trim() + Environment.NewLine);
                        tcpClient.Send(new ArraySegment <byte>(data, 0, data.Length));
                        item.IsSend = true;
                    }
                    else
                    {
                        LblSuccessNotice("");
                    }
                }
            }
            catch (Exception ex)
            {
                WriteInfo($"接收 {e.Package.Body},错误:{ex.ToString()}");
            }
        }
示例#23
0
 void OnEnabledPackage(object sender, PackageEventArgs e)
 {
     //// if a new solution is being created this means packages are enabled for the first time
     //// so gNav should show by default
     if (!isOpeningSolution)
     {
         // if the user explicitly added a 'AutoShowGuidanceNavigator' set to 0 in the registry
         // the following condition won't match and then we'll refrain from showing
         if (AutoShowGuidanceNavigator())
         {
             ShowGuidanceNavigatorWindow();
         }
     }
     // if a solution is being opened
     else
     {
         DTE dte = (DTE)GetService(typeof(DTE));
         if (dte.Globals.get_VariableExists(GNavAutoClosedKey))
         {
             bool autoClosed = (bool)dte.Globals[GNavAutoClosedKey];
             if (autoClosed)
             {
                 ShowGuidanceNavigatorWindow();
             }
         }
     }
 }
示例#24
0
 /// <summary>
 /// 自由线程,检测未发送的数据并发出
 /// </summary>
 void CheckUnConfirmedQueue()
 {
     //异步调用委托
     if (cucqCallpack == null)
     {
         cucqCallpack = (s) => OnPackageSendFailure(s as PackageEventArgs);
     }
     if (resendCallback == null)
     {
         resendCallback = (s) => OnPackageResend(s as PackageEventArgs);
     }
     do
     {
         if (SendList.Count > 0)
         {
             PacketNetWorkMsg[] array = null;
             lock (SendList)
             {
                 array = SendList.ToArray();
             }
             //挨个重新发送并计数
             Array.ForEach(array, s =>
             {
                 s.SendTimes++;
                 if (s.SendTimes >= MaxResendTimes)
                 {
                     //发送失败啊
                     PackageEventArgs e = new PackageEventArgs();
                     if (SeiClient.NeedPostMessage)
                     {
                         SeiClient.SendSynchronizeMessage(cucqCallpack, e);
                     }
                     else
                     {
                         OnPackageSendFailure(e);//触发发送失败事件
                     }
                     SendList.Remove(s);
                 }
                 else
                 {
                     //重新发送
                     AsyncSendPacket(s);
                     PackageEventArgs e = new PackageEventArgs()
                     {
                         PacketMsg = s
                     };
                     if (SeiClient.NeedPostMessage)
                     {
                         SeiClient.SendASynchronizeMessage(resendCallback, e);
                     }
                     else
                     {
                         OnPackageResend(e);//触发重新发送事件
                     }
                 }
             });
         }
         Thread.Sleep(CheckQueueTimeInterval);
     } while (IsInitialized);
 }
示例#25
0
 private static void OnPagckageReceived(object sender, PackageEventArgs <MyPackageInfo> e)
 {
     if (e.Package.Data.Length > 1 || e.Package.Header.Length > 0)
     {
         SendNoticeMessage(e.Package);
     }
     //LogHelper.Log.Info("收到服务消息【Byte】:"+"head:"+BitConverter.ToString(e.Package.Header)+" body:"+BitConverter.ToString(e.Package.Data));
 }
示例#26
0
 void OnEnabledDisabledPackage(object sender, PackageEventArgs e)
 {
     enabledGuidancePackages = rms.GetEnabledPackages();
     if (BindedPackagesChange != null)
     {
         BindedPackagesChange(sender, e);
     }
 }
		void upb_ProjectClosed(object sender, PackageEventArgs e)
		{
			chkUseIncreaseUpdate.DataBindings.Clear();
			chkCreateCompatiblePackage.DataBindings.Clear();
			chkCompressUpdateInfo.DataBindings.Clear();
			txtPackagePassword.DataBindings.Clear();
			requiredMinVersion.DataBindings.Clear();
		}
示例#28
0
 void upb_ProjectClosed(object sender, PackageEventArgs e)
 {
     chkUseIncreaseUpdate.DataBindings.Clear();
     chkCreateCompatiblePackage.DataBindings.Clear();
     chkCompressUpdateInfo.DataBindings.Clear();
     txtPackagePassword.DataBindings.Clear();
     requiredMinVersion.DataBindings.Clear();
 }
示例#29
0
        void OnPackageUpdated(object sender, PackageEventArgs e)
        {
            var packages = Client.GetPackages(ContentView.Folder);

            RunOnUiThread(delegate {
                ContentView.PackageContent.AddPackages(packages);
            });
        }
示例#30
0
        void ServerProcessor_VersionPacketReceived(object sender, PackageEventArgs e)
        {
            if (VersionPacketReceived != null)
            {
                KeyValuePair <PacketProcessing, ProxyPackageEventArgs> key = GetProxyPacketEventArgs(e);

                VersionPacketReceived(this, key.Value);
            }
        }
        /// <summary>
        /// Vytvori asynchronne volanie na metodu zabezpecujucu vytvorenie eventu
        /// oznamujuceho prijatie dat
        /// </summary>
        /// <param name="e">EventArgs obsahujuci data</param>
        protected virtual void OnReceivedFrame(PackageEventArgs e)
        {
            PackageEventHandler handler = this.m_receivedFrameEvent;

            if (handler != null)
            {
                handler(this, e);
            }
        }
示例#32
0
        void PackageUpdated(object sender, PackageEventArgs e)
        {
            List <Package> packages = Client.GetPackages(ContentView.Folder);

            InvokeOnMainThread(delegate
            {
                ContentView.UpdatePackages(packages);
            });
        }
示例#33
0
 private void Client_NewPackageReceived1(object sender, PackageEventArgs<MyPackageInfo> e)
 {
     this.Dispatcher.BeginInvoke(new Action(() =>
     {
         Console.WriteLine(e.Package.Key);
         if (JData == null)
             JData = e.Package.JData;
     }));
 }
示例#34
0
 private static void Client_NewPackageReceived(object sender, PackageEventArgs <MyPackageInfo> e)
 {
     try
     {
         Console.WriteLine(e.Package.Body);
     }
     catch (Exception ee)
     {
         Console.WriteLine(ee);
     }
 }
示例#35
0
        private void SocketClient_NewPackageReceived(object sender, PackageEventArgs <MyPackageInfo> e)
        {
            string body = Encoding.UTF8.GetString(e.Package.Data);
            //TODO:通过header区分消息类型
            string header = Encoding.UTF8.GetString(e.Package.Header);

            switch (header)
            {
            default:
                break;
            }
        }
		/// <summary>
		/// 下载包成功,但是文件不符
		/// </summary>
		/// <param name="e"></param>
		protected virtual void OnPackageDownloadMismatch(PackageEventArgs e)
		{

		}
示例#37
0
 private void OnNotifyPackageEvent( PackageEventArgs e )
 {
     if( NotifyPackageEvent != null )
     {
         NotifyPackageEvent.Invoke( this, e );
     }
 }
 private void OnAddPackageRequest(object sender, PackageEventArgs e)
 {
     AddPackage(e.PackageInfo);
 }
 private void Source_PackageInstalled(object sender, PackageEventArgs e)
 {
     NotifyInstalled(new PackageOperationEventArgs(e.InstallPath, e.Identity, null));
 }
		/// <summary>
		/// 重试下载包
		/// </summary>
		/// <param name="e"></param>
		protected virtual void OnPackageDownloadRetry(PackageEventArgs e)
		{

		}
		void PackageReferenceAdded (object sender, PackageEventArgs e)
		{
			packageManagementEvents.OnPackageInstalled (project, e);
		}
		/// <summary>
		/// 解压缩包完成
		/// </summary>
		/// <param name="e"></param>
		protected virtual void OnDecompressPackageFinished(PackageEventArgs e)
		{

		}
 void UpdatePackage(object sender, PackageEventArgs e)
 {
     UpdatePackage(e.Id);
 }
		void PackageUninstalled (object sender, PackageEventArgs e)
		{
			packageManagementEvents.OnPackageUninstalled (project, e);
		}
 void UpdatePackage(object sender, PackageEventArgs e)
 {
     UpdateStatusLabel("Downloaded Complete");
     ContentView.ZoomTo(currentCity.Center);
 }
		static string GetPackageFilePath (PackageEventArgs e)
		{
			var folderNuGetProject = e.Project as FolderNuGetProject;
			return folderNuGetProject?.GetInstalledPackageFilePath (e.Identity);
		}
		void upb_ProjectLoaded(object sender, PackageEventArgs e)
		{
			BindProject(e.AuProject);
		}
		/// <summary>
		/// 下载包失败
		/// </summary>
		/// <param name="e"></param>
		protected virtual void OnPackageDownloadFinished(PackageEventArgs e)
		{

		}