示例#1
0
        //private void do_logging(string s, bool newLine)
        //{
        //    string d = Path.GetDirectoryName(Zterm.Properties.Settings.Default.LogSavePath);

        //    if (!Directory.Exists(d))
        //    {
        //        Directory.CreateDirectory(d);
        //        Thread.Sleep(100);
        //    }

        //    StreamWriter sw = File.AppendText(Zterm.Properties.Settings.Default.LogSavePath);

        //    if (newLine)
        //        sw.WriteLine(s);
        //    else
        //        sw.Write(s);

        //    sw.Close();
        //}

        private void ConnectPorts(SendType st)
        {
            switch (st)
            {
            case SendType.Serial:
                if (!serialPort1.IsOpen)
                {
                    serialPort1.BaudRate = Zterm.Properties.Settings.Default.Baud;
                    serialPort1.PortName = Zterm.Properties.Settings.Default.COMPort;

                    serialPort1.Open();
                    toolStripStatusLabel1.Text          = "Connected";
                    toolStripSplitButtonConnect.Visible = false;
                    toolStripSplitButtonDisc.Visible    = true;
                }
                break;

            case SendType.TCP:
                if (!clientSocketControl1.IsConnected)
                {
                    clientSocketControl1.RemoteIpAddress = Zterm.Properties.Settings.Default.ipaddress;
                    clientSocketControl1.IpPortNumber    = Zterm.Properties.Settings.Default.ipPort;

                    clientSocketControl1.Connect();
                    toolStripStatusLabel1.Text          = "Connected";
                    toolStripSplitButtonConnect.Visible = false;
                    toolStripSplitButtonDisc.Visible    = true;
                }
                break;
            }
        }
        public async Task SendMessage(SendType type, string destination, string message, Priority priority = Priority.Medium)
        {
            switch (type)
            {
            case SendType.Message:
                await RfcPrivmsg(destination, message, priority);

                break;

            case SendType.Action:
                await RfcPrivmsg(destination, "\x1" + "ACTION " + message + "\x1", priority);

                break;

            case SendType.Notice:
                await RfcNotice(destination, message, priority);

                break;

            case SendType.CtcpRequest:
                await RfcPrivmsg(destination, "\x1" + message + "\x1", priority);

                break;

            case SendType.CtcpReply:
                await RfcNotice(destination, "\x1" + message + "\x1", priority);

                break;
            }
        }
示例#3
0
 private void txtsend_TextChanged(object sender, EventArgs e)
 {
     if (Status == SendType.FILE && txtsend.Text == "")
     {
         Status = SendType.MESSAGE;
     }
 }
示例#4
0
 private SendMessage(SendType type, string message, int timeout)
 {
     Type = type;
     Message = message;
     Timeout = timeout;
     NeedPrefix = true;
 }
        public async void SaveSendAsync_DisableSend_CantManagePolicies_throws(SendType sendType,
                                                                              SutProvider <SendService> sutProvider, Send send, List <Policy> policies)
        {
            SaveSendAsync_Setup(sendType, canManagePolicies: false, sutProvider, send, policies);

            await Assert.ThrowsAsync <BadRequestException>(() => sutProvider.Sut.SaveSendAsync(send));
        }
示例#6
0
        // API commands
        public void SendMessage(SendType type, string destination, string message, Priority priority)
        {
            switch (type)
            {
            case SendType.Message:
                RfcPrivmsg(destination, message, priority);
                break;

            case SendType.Action:
                RfcPrivmsg(destination, "\x1" + "ACTION " + message + "\x1", priority);
                break;

            case SendType.Notice:
                RfcNotice(destination, message, priority);
                break;

            case SendType.CtcpRequest:
                RfcPrivmsg(destination, "\x1" + message + "\x1", priority);
                break;

            case SendType.CtcpReply:
                RfcNotice(destination, "\x1" + message + "\x1", priority);
                break;
            }
        }
示例#7
0
        private void PrivateChat_Load(object sender, EventArgs e)
        {
            lbName.Text            = friendName;
            this.Text              = friendName;
            Status                 = SendType.MESSAGE;
            wbContent.DocumentText = "<html><body style=\"background-color:rgb(217,215,206)\"></body></html>";
            EmojiList              = new Dictionary <string, string>();
            string path = "";

            path = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Emoji", "cuoi.png");
            EmojiList.Add(":)", "<img src=\"" + path + "\" style='width:20px;height:20px'>");
            path = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Emoji", "buon.png");
            EmojiList.Add(":(", "<img src=\"" + path + "\"style='width:20px;height:20px'>");
            path = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Emoji", "so.png");
            EmojiList.Add(":-s", "<img src=\"" + path + "\"style='width:20px;height:20px'>");
            path = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Emoji", "yeu.png");
            EmojiList.Add("x-)", "<img src=\"" + path + "\"style='width:20px;height:20px'>");
            path = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Emoji", "like.png");
            EmojiList.Add("(y)", "<img src=\"" + path + "\"style='width:20px;height:20px'>");
            path = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Emoji", "ngacnhien.png");
            EmojiList.Add(":o", "<img src=\"" + path + "\"style='width:20px;height:20px'>");
            path = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Emoji", "khoc.png");
            EmojiList.Add(";-(", "<img src=\"" + path + "\"style='width:20px;height:20px'>");
            path = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Emoji", "hun.png");
            EmojiList.Add("(p)", "<img src=\"" + path + "\"style='width:20px;height:20px'>");
            path = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Emoji", "gian.png");
            EmojiList.Add(":-t", "<img src=\"" + path + "\"style='width:20px;height:20px'>");
            RefreshWeb();
            txtsend.Focus();
            Start();
        }
示例#8
0
        protected void BindPacket <T>(SendType sendType) where T : Packet, new()
        {
            var packet = new T();

#if VOXCAKE_NET_DEBUG
            if (!PacketExists(packet))
            {
#endif
            packet.SetSendType(sendType);

            var packetType = packet.GetType();
            if (packetType.GetInterface(I_BINDABLE_PACKET) != null)
            {
#if VOXCAKE_NET_DEBUG
                Debug.Log($"Binding to {packetType.Name}");
#endif
                PacketBinder.BindVariablesToPacket(packet, this);
            }
#if VOXCAKE_NET_DEBUG
            Debug.Log($"{packetType.Name}.Size = {packet.Size}");
#endif
            _packetCollection.Add(packet);
#if VOXCAKE_NET_DEBUG
        }

        else
        {
            Debug.LogError("Packet already exist");
        }
#endif

            Size += 1;
        }
示例#9
0
        public ReliableChannel(NetPeer peer, bool ordered, byte id) : base(peer)
        {
            _id             = id;
            _windowSize     = NetConstants.DefaultWindowSize;
            _ordered        = ordered;
            _pendingPackets = new PendingPacket[_windowSize];
            for (int i = 0; i < _pendingPackets.Length; i++)
            {
                _pendingPackets[i] = new PendingPacket();
            }

            if (_ordered)
            {
                _sendType        = SendType.ReliableOrdered;
                _receivedPackets = new NetPacket[_windowSize];
            }
            else
            {
                _sendType      = SendType.ReliableUnordered;
                _earlyReceived = new bool[_windowSize];
            }

            _localWindowStart  = 0;
            _localSeqence      = 0;
            _remoteSequence    = 0;
            _remoteWindowStart = 0;
            _outgoingAcks      = new NetPacket(PacketProperty.Ack, (_windowSize - 1) / BitsInByte + 2)
            {
                ChannelId = id
            };
        }
示例#10
0
    public static void SendCommand(SendType sendType, params string[] parameters)
    {
        switch (sendType)
        {
        case SendType.UNITY_LOADED:
            SendRawValue(AppProtocol.CreateCommand(AppProtocol.UnityToApp.UNITY_LOADED));
            break;

        case SendType.AVATAR_LOADING:
            SendRawValue(AppProtocol.CreateCommand(AppProtocol.UnityToApp.AVATAR_LOADING));
            break;

        case SendType.AVATAR_FINISH:
            SendRawValue(AppProtocol.CreateCommand(AppProtocol.UnityToApp.AVATAR_FINISH));
            break;

        case SendType.SPEECH_START:
            SendRawValue(AppProtocol.CreateCommand(AppProtocol.UnityToApp.SPEECH_START, parameters));
            break;

        case SendType.SPEECH_FINISH:
            SendRawValue(AppProtocol.CreateCommand(AppProtocol.UnityToApp.SPEECH_FINISH, parameters));
            break;

        case SendType.ERROR_PARAMS:
            SendRawValue(AppProtocol.CreateCommand(AppProtocol.UnityToApp.ERROR_PARAMS));
            break;

        case SendType.ERROR_COMMAND:
        default:
            SendRawValue(AppProtocol.CreateCommand(AppProtocol.UnityToApp.ERROR_COMMAND));
            break;
        }
    }
示例#11
0
        public void OnNetworkReceive(NetPeer peer, NetPacketReader reader, SendType sendType)
        {
            var packetType = reader.GetByte();

            if (packetType >= NetworkGeneral.PacketTypesCount)
            {
                return;
            }
            var pt = (PacketType)packetType;

            switch (pt)
            {
            case PacketType.Movement:
                OnMovement(reader, peer);
                break;

            case PacketType.Serialized:
                _packetProcessor.ReadAllPackets(reader, peer);
                break;

            default:
                Debug.Log($"[Server] OnNetworkReceive - Unhandled packet : {pt}");
                break;
            }
        }
示例#12
0
        public async void SaveSendAsync_DisableSend_Applies_throws(SendType sendType,
                                                                   SutProvider <SendService> sutProvider, Send send)
        {
            SaveSendAsync_Setup(sendType, disableSendPolicyAppliesToUser: true, sutProvider, send);

            await Assert.ThrowsAsync <BadRequestException>(() => sutProvider.Sut.SaveSendAsync(send));
        }
示例#13
0
 public unsafe bool SendP2PPacket(ulong steamid, byte[] data, int length, SendType eP2PSendType = SendType.Reliable, int nChannel = 0)
 {
     fixed(byte *p = data)
     {
         return(networking.SendP2PPacket(steamid, (IntPtr)p, (uint)length, (SteamNative.P2PSend)(int) eP2PSendType, nChannel));
     }
 }
示例#14
0
 public UdpClientBase(SendType type = SendType.Normal)
 {
     _sendType        = type;
     _isEndConnection = true;
     _callBackFunc    = null;
     useReceiveQueue(null);
 }
示例#15
0
 public static ISendMessage CreateSendMessage(this IClient client, IClientConnection connection, 
     String prefixHeader, String contents, String postfixHeader, SendType type, 
     params IMessageTarget[] receivers)
 {
     return client.CreateSendMessage(connection, prefixHeader, contents, postfixHeader, type,
         receivers);
 }
示例#16
0
        private void MessageSwich(SendType st, string msg)
        {
            switch (st)
            {
            case SendType.error:
                AddThread(rtb_dataswich, msg + "\r\n");
                break;

            case SendType.addSocket:
                AddClient(lv_client, msg);
                break;

            case SendType.message:
                AddThread(rtb_dataswich, msg + "\r\n");
                break;

            case SendType.removeSocket:
                RemoveClient(lv_client, msg);
                break;

            case SendType.file:
                break;

            default:
                break;
            }
        }
 public void SendNetSerializable <T>(NetManager manager, T packet, SendType options)
     where T : INetSerializable
 {
     _netDataWriter.Reset();
     WriteNetSerializable(_netDataWriter, packet);
     manager.SendToAll(_netDataWriter, options);
 }
示例#18
0
        /// <summary>
        /// 将消息类型转换为字符
        /// </summary>
        /// <param name="type">消息类型</param>
        /// <returns></returns>
        private string getTypeString(SendType type)
        {
            switch (type)
            {
            case SendType.Callback:
                return("01");

            case SendType.Text:
                return("02");

            case SendType.Login:
                return("03");

            case SendType.RunError:
                return("04");

            case SendType.File:
                return("05");

            case SendType.Picture:
                return("06");

            case SendType.Terminal:
                return("07");

            case SendType.TerminalError:
                return("08");

            case SendType.Task:
                return("09");
            }
            return("");
        }
示例#19
0
        public OperationRequest(Int32 _operationCode, Int32 _parameters, SendType _sendType = SendType.String)
        {
            operationCode = _operationCode;
            parameters    = _parameters.ToString();
            sendType      = _sendType;

            operationData = ToBytes();
        }
示例#20
0
文件: Messages.cs 项目: Crobol/Bot
 public IrcSendMessage(object sender, SendType sendType, string server, string channel, string message)
     : base(sender)
 {
     this.sendType = sendType;
     this.server = server;
     this.channel = channel;
     this.message = message;
 }
        public async void SaveSendAsync_DisableHideEmail_Applies_throws(SendType sendType,
                                                                        SutProvider <SendService> sutProvider, Send send, Policy policy)
        {
            SaveSendAsync_Setup(sendType, false, sutProvider, send);
            SaveSendAsync_HideEmail_Setup(true, sutProvider, send, policy);

            await Assert.ThrowsAsync <BadRequestException>(() => sutProvider.Sut.SaveSendAsync(send));
        }
示例#22
0
 public UdpServerBase(int id = -1, SendType type = SendType.Normal)
 {
     _id              = id;
     _sendType        = type;
     _isEndConnection = true;
     _callBackFunc    = null;
     _functions       = new InterfaceFunctions(this, _queue);
 }
示例#23
0
        public Microsoft.XLANGs.Core.StopConditions segment0(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment    __seg__  = _segments[0];
            Microsoft.XLANGs.Core.Context    __ctx__  = (Microsoft.XLANGs.Core.Context)_stateMgrs[0];
            __OrchestrationToBeCalled_1      __ctx1__ = (__OrchestrationToBeCalled_1)_stateMgrs[1];
            __OrchestrationToBeCalled_root_0 __ctx0__ = (__OrchestrationToBeCalled_root_0)_stateMgrs[0];

            switch (__seg__.Progress)
            {
            case 0:
                SendPort = new SendType(0, this);
                __ctx__.PrologueCompleted = true;
                if (!PostProgressInc(__seg__, __ctx__, 1))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.Initialized) != 0)
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Initialized);
                }
                goto case 1;

            case 1:
                __ctx1__      = new __OrchestrationToBeCalled_1(this);
                _stateMgrs[1] = __ctx1__;
                if (!PostProgressInc(__seg__, __ctx__, 2))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                goto case 2;

            case 2:
                __ctx0__.StartContext(__seg__, __ctx1__);
                if (!PostProgressInc(__seg__, __ctx__, 3))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                return(Microsoft.XLANGs.Core.StopConditions.Blocked);

            case 3:
                if (!__ctx0__.CleanupAndPrepareToCommit(__seg__))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Blocked);
                }
                if (!PostProgressInc(__seg__, __ctx__, 4))
                {
                    return(Microsoft.XLANGs.Core.StopConditions.Paused);
                }
                goto case 4;

            case 4:
                __ctx1__.Finally();
                ServiceDone(__seg__, (Microsoft.XLANGs.Core.Context)_stateMgrs[0]);
                __ctx0__.OnCommit();
                break;
            }
            return(Microsoft.XLANGs.Core.StopConditions.Completed);
        }
示例#24
0
 public MsgReference(Msg2Handle _msg, ClientReference _client, SendType _sendType = SendType.Unicast)
 {
     msg      = _msg;
     sendType = _sendType;
     if (_client != null)
     {
         client = _client;
     }
 }
示例#25
0
        public void SendMessage(ulong steamId, byte[] data, int length, SendType type = SendType.Reliable)
        {
            Connection?connection = FindConnection(steamId);

            if (connection.HasValue)
            {
                connection.Value.SendMessage(data, 0, length, type);
            }
        }
        public async void SaveSendAsync_DisableSend_DoesntApply_success(SendType sendType,
                                                                        SutProvider <SendService> sutProvider, Send send)
        {
            SaveSendAsync_Setup(sendType, disableSendPolicyAppliesToUser: false, sutProvider, send);

            await sutProvider.Sut.SaveSendAsync(send);

            await sutProvider.GetDependency <ISendRepository>().Received(1).CreateAsync(send);
        }
示例#27
0
 public object Excute(string hostName, string serviceName, object val, SendType sendType)
 {
     if (val != null)
     {
         return(proxyfunc(hostName, serviceName, (Tin)val, sendType));
     }
     else
     {
         return(proxyfunc(hostName, serviceName, default, sendType));
示例#28
0
        public async void SaveSendAsync_DisableSend_CanManagePolicies_success(SendType sendType,
                                                                              SutProvider <SendService> sutProvider, Send send, List <Policy> policies)
        {
            SaveSendAsync_DisableSend_Setup(sendType, canManagePolicies: true, sutProvider, send, policies);

            await sutProvider.Sut.SaveSendAsync(send);

            await sutProvider.GetDependency <ISendRepository>().Received(1).CreateAsync(send);
        }
        private void SaveSendAsync_Setup(SendType sendType, bool disableSendPolicyAppliesToUser,
                                         SutProvider <SendService> sutProvider, Send send)
        {
            send.Id   = default;
            send.Type = sendType;

            sutProvider.GetDependency <IPolicyRepository>().GetCountByTypeApplicableToUserIdAsync(
                Arg.Any <Guid>(), PolicyType.DisableSend).Returns(disableSendPolicyAppliesToUser ? 1 : 0);
        }
示例#30
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="strCron">cron表达式</param>
        /// <param name="pluginTimer">IPluginTimer对象</param>
        /// <param name="taskSendType">定时任务后的发送方式,SendType枚举</param>
        public TimerTask(string strCron, IPluginTimer pluginTimer, SendType taskSendType)
        {
            this.Cron         = strCron;
            this.PluginTimer  = pluginTimer;
            this.TaskSendType = taskSendType;

            this._strJobName     = PluginTimer.PluginName + "Job";
            this._strTriggerName = PluginTimer.PluginName + "Trigger";
        }
示例#31
0
 public UdpClientBase(int id = -1, SendType type = SendType.Normal) : base()
 {
     _id              = id;
     _sendType        = type;
     _isEndConnection = true;
     _callBackFunc    = null;
     _queue           = new BufferQueue();
     _functions       = new InterfaceFunctions(this, _queue);
 }
示例#32
0
 public MsgReference(ushort _id, MsgBody _msg, ClientReference _client, SendType _sendType = SendType.Unicast)
 {
     msg      = new Msg2Handle(_id, _msg);
     sendType = _sendType;
     if (_client != null)
     {
         client = _client;
     }
 }
示例#33
0
 public SendMessage(IClientConnection connection, String prefixHeader, String contents, String postfixHeader,
                    SendType type, IEnumerable <IMessageTarget> receivers)
 {
     Connection    = connection;
     PrefixHeader  = prefixHeader;
     Contents      = contents;
     PostfixHeader = postfixHeader;
     _receivers    = new HashSet <IMessageTarget>(receivers);
     Type          = type;
 }
示例#34
0
 public SendMessage(IClientConnection connection, String prefixHeader, String contents, String postfixHeader, 
     SendType type, IEnumerable<IMessageTarget> receivers)
 {
     Connection = connection;
     PrefixHeader = prefixHeader;
     Contents = contents;
     PostfixHeader = postfixHeader;
     _receivers = new HashSet<IMessageTarget>(receivers);
     Type = type;
 }
示例#35
0
文件: Client.cs 项目: samrg472/GcpD
 public void Send(SendType type, string msg)
 {
     lock (_lock) {
         try {
             if (Writer == null)
                 return;
             Writer.WriteLine(type.ToString() + SyntaxCode.PARAM_SPLITTER + msg);
             Writer.Flush();
         } catch (IOException) {
             StopHandling();
         }
     }
 }
示例#36
0
 // API commands
 /// <summary>
 /// 
 /// </summary>
 /// <param name="type"></param>
 /// <param name="destination"></param>
 /// <param name="message"></param>
 /// <param name="priority"></param>
 public void SendMessage(SendType type, string destination, string message, Priority priority)
 {
     switch(type) {
         case SendType.Message:
             RfcPrivmsg(destination, message, priority);
         break;
         case SendType.Action:
             RfcPrivmsg(destination, "\x1"+"ACTION "+message+"\x1", priority);
         break;
         case SendType.Notice:
             RfcNotice(destination, message, priority);
         break;
         case SendType.CtcpRequest:
             RfcPrivmsg(destination, "\x1"+message+"\x1", priority);
         break;
         case SendType.CtcpReply:
             RfcNotice(destination, "\x1"+message+"\x1", priority);
         break;
     }
 }
示例#37
0
 /// <summary>
 /// Konstruerar ett meddelande som ska skickas till roboten
 /// </summary>
 public Message(SendType type, byte[] param = null)
 {
     Type = (byte)type;
     Param = (param==null)?new byte[0]:param;
 }
示例#38
0
 /// <remarks/>
 public void SendSmsUDHAsync(string[] SmsText, string[] MobileNumber, string SenderNumber, SendType sendType, SmsMode smsMode, string[] UDH, object userState) {
     if ((this.SendSmsUDHOperationCompleted == null)) {
         this.SendSmsUDHOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendSmsUDHOperationCompleted);
     }
     this.InvokeAsync("SendSmsUDH", new object[] {
                 SmsText,
                 MobileNumber,
                 SenderNumber,
                 sendType,
                 smsMode,
                 UDH}, this.SendSmsUDHOperationCompleted, userState);
 }
示例#39
0
 /// <remarks/>
 public void SendSmsUDHAsync(string[] SmsText, string[] MobileNumber, string SenderNumber, SendType sendType, SmsMode smsMode, string[] UDH) {
     this.SendSmsUDHAsync(SmsText, MobileNumber, SenderNumber, sendType, smsMode, UDH, null);
 }
示例#40
0
 public long[] SendSmsUDH(string[] SmsText, string[] MobileNumber, string SenderNumber, SendType sendType, SmsMode smsMode, string[] UDH) {
     object[] results = this.Invoke("SendSmsUDH", new object[] {
                 SmsText,
                 MobileNumber,
                 SenderNumber,
                 sendType,
                 smsMode,
                 UDH});
     return ((long[])(results[0]));
 }
示例#41
0
文件: Client.cs 项目: samrg472/GcpD
 internal void SendError(SendType error, string type, string data)
 {
     string errorString = error.ToString();
     string numericalError = errorString.Substring(errorString.IndexOf('_') + 1);
     Send(SendType.ERROR, string.Format("Error{1}{2}{0}Type{1}{3}{0}{4}",
                                        SyntaxCode.PARAM_SPLITTER, SyntaxCode.VALUE_SPLITTER, numericalError,
                                        type,
                                        data.Substring(data.IndexOf(SyntaxCode.PARAM_SPLITTER) + 1)));
 }
 /// <summary>
 /// Send a message to IRC.
 /// </summary>
 /// <param name="Type">Supplies the type of message to send.</param>
 /// <param name="Destination">Supplies the message recipient (user or
 /// channel).</param>
 /// <param name="Message">Supplies the message to send.</param>
 private void SendMessage(SendType Type, string Destination, string Message)
 {
     Client.SendMessage(Type, Destination, Message.Replace('\r', ' ').Replace('\n', ' '));
 }
示例#43
0
文件: Sms.cs 项目: DudeFactory/sms.ru
 public IResponceFromServer Send(string[] to, string text, SendType sendType)
 {
     throw new NotImplementedException();
 }
示例#44
0
 private void SendIrcResponse(SendType sendType, string address, string channel, IEnumerable<string> response)
 {
     foreach (string line in response)
     {
         hub.Publish(new IrcSendMessage(this, sendType, address, channel, line.Trim()));
     }
 }
示例#45
0
 static void f_FunctionOutputHandler(SendType type, string destination, string message)
 {
     irc.SendMessage(type, destination, message);
 }
示例#46
0
 public void SendMessage(SendType type, string destination, string message)
 {
     _client.SendMessage((Meebey.SmartIrc4net.SendType) type, destination, message);
 }
示例#47
0
文件: Client.cs 项目: samrg472/GcpD
 public void SendError(SendType error, SendType type, string data)
 {
     SendError(error, type.ToString(), data);
 }
示例#48
0
文件: Client.cs 项目: samrg472/GcpD
 public void Send(SendType type)
 {
     Send(type, "");
 }
示例#49
0
        void InternalSendMessage( SendType sendType, string target, string message )
        {
            // remove all possible newline characters
            message = message
                .Replace( "\n", "" )
                .Replace( "\r", "" );

            // maximum amount of text we want to allow in a message until we split it into chunks
            const int MAX_LINE = 400;

            do
            {
                var messageChunk = message.Take( MAX_LINE ).ToActualString();
                message = message.Skip( MAX_LINE ).ToActualString();

                client.SendMessage( sendType, target, messageChunk );
            }
            while ( message.Length > 0 );
        }
示例#50
0
 private void send(string url, SendType type)
 {
     WebClient c = new WebClient();
     switch (type)
     {
         case SendType.Registration:
             c.DownloadStringCompleted += new DownloadStringCompletedEventHandler(RegistrationCompleted);
             break;
         case SendType.UpdateRegid:
             c.DownloadStringCompleted += new DownloadStringCompletedEventHandler(UpdateRegidCompleted);
             break;
         default: break;
     }
     c.DownloadStringAsync(new Uri(url));
 }
示例#51
0
 // send a url
 private void send(string url, SendType type)
 {
     WebClient c = new WebClient();
     switch (type)
     {
         case SendType.CheckPointQuery:
             c.DownloadStringCompleted += new DownloadStringCompletedEventHandler(DownloadCPQCompleted);
             break;
         case SendType.CheckIn:
             c.DownloadStringCompleted += new DownloadStringCompletedEventHandler(DownloadCICompleted);
             break;
         case SendType.CheckOut:
             c.DownloadStringCompleted += new DownloadStringCompletedEventHandler(DownloadCOCompleted);
             break;
         case SendType.GetN:
             c.DownloadStringCompleted += new DownloadStringCompletedEventHandler(DownloadGNCompleted);
             break;
         case SendType.UpdateRegid:
             c.DownloadStringCompleted += new DownloadStringCompletedEventHandler(UpdateRegidCompleted);
             break;
         default:
             break;
     }
     c.DownloadStringAsync(new Uri(url));
 }
示例#52
0
 public ISendMessage CreateSendMessage(IClientConnection connection, String prefixHeader, String contents, 
     String postfixHeader, SendType type, IEnumerable<IMessageTarget> receivers)
 {
     return new SendMessage(connection, prefixHeader, contents, postfixHeader, type, receivers);
 }
示例#53
0
        private void CaliculateSendType()
        {
            try
            {

                if (sendtypes == "ImmediateBusinessDays")
                {
                    this.sendType = SendType.ImmediateBusinessDays;
                }
                else if (sendtypes == "Daily")
                {
                    this.sendType = SendType.Daily;
                }
                else if (sendtypes == "Weekly")
                {
                    this.sendType = SendType.Weekly;
                }
                else
                {
                    this.sendType = SendType.ImmediateAlways;
                }

            }
            catch { }
        }
示例#54
0
        /// <summary>
        /// Provides the appropriate <c>Disposition</c> header value for the <paramref name="mode"/>
        /// </summary>
        /// <param name="mode">The mode to translate</param>
        /// <returns>A string representation suitable for inclusion in the sending mode section of the <c>Disposition</c> header value</returns>
        public static string ToString(SendType mode)
        {
            switch(mode)
            {
                default:
                    throw new NotSupportedException();

                case SendType.Automatic:
                    return Send_Automatic;

                case SendType.UserMediated:
                    return Send_Manual;
            }
        }
示例#55
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="type"></param>
 /// <param name="destination"></param>
 /// <param name="message"></param>
 public void SendMessage(SendType type, string destination, string message)
 {
     SendMessage(type, destination, message, Priority.Medium);
 }
 public S_FileTransferSendBegin(FileTransferConnect client, FileTransfer info, SendType type)
     : base(client)
 {
     this.info = info;
     this.type = type;
 }
示例#57
0
        void Send(uint8_t value, SendType type)
        {
            if (type != _sendType) { 

                _sendType = type;
                DigitalWrite(_rs_pin, type == SendType.Command ? PinState.Low : PinState.High);
            }

            // if there is a RW pin indicated, set it low to Write
            if (_rw_pin != 255)
            {
                DigitalWrite(_rw_pin, PinState.Low);
            }

            if ((_displayfunction & LCD_8BITMODE) == LCD_8BITMODE)
            {
                Write8bits(value);
            }
            else
            {
                Write4bits(value >> 4);
                Write4bits(value);
            }
        }
示例#58
0
文件: Program.cs 项目: Az1568/CVNBot
        /// <summary>
        /// Splitting messages by line breaks and in chucks if they're too long and forward to SendMessageF
        /// </summary>
        public static void SendMessageFMulti(SendType type, string destination, string message, bool IsDroppable, bool IsPriority)
        {

            if (message != "")
            {
                //Allow multiline
                foreach (string line in message.Split(new char[1] { '\n' }))
                {
                    //Chunk messages that are too long
                    foreach (string chunk in CVNBotUtils.stringSplit(line, 400))
                    {
                        // Ignore "" and "
                        if ((chunk.Trim() != "\"\"") && (chunk.Trim() != "\"")){
                            SendMessageF(type, destination, chunk, IsDroppable, IsPriority);
                        }
                    }
                }
            }
        }
示例#59
0
 public static void Reply(this IPluginHost host, IrcMessageData replyTo, SendType type, string message)
 {
     host.SendMessage(type, replyTo.Channel ?? replyTo.Ident, replyTo.Channel == null ? message : string.Concat(replyTo.Nick, ": ", message));
 }
示例#60
0
文件: Program.cs 项目: Az1568/CVNBot
        /// <summary>
        /// Route all irc.SendMessage() calls through this to use the queue
        /// </summary>
        public static void SendMessageF(SendType type, string destination, string message, bool IsDroppable, bool IsPriority)
        {
            QueuedMessage qm = new QueuedMessage();
            qm.type = type;
            qm.message = message;
            qm.destination = destination;
            qm.SentTime = DateTime.Now.Ticks;
            qm.IsDroppable = IsDroppable;

            if (IsPriority)
                lock (priQueue)
                    priQueue.Enqueue(qm);
            else
                lock (fcQueue)
                    fcQueue.Enqueue(qm);

            //logger.Info("Queued item");
        }