• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# FmdcEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中FmdcEventArgs的典型用法代码示例。如果您正苦于以下问题:C# FmdcEventArgs类的具体用法?C# FmdcEventArgs怎么用?C# FmdcEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FmdcEventArgs类属于命名空间,在下文中一共展示了FmdcEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: hubConnection_ProtocolChange

 void hubConnection_ProtocolChange(object sender, FmdcEventArgs e)
 {
     Hub hubConnection = sender as Hub;
     if (hubConnection != null)
     {
         hubConnection.Protocol.Update += new FmdcEventHandler(prot_Update);
     }
 }
开发者ID:musakasim,项目名称:flowlib,代码行数:8,代码来源:ReceiveMainChatOrPMFromHub.cs


示例2: hubConnection_ProtocolChange

 void hubConnection_ProtocolChange(object sender, FmdcEventArgs e)
 {
     Hub hubConnection = sender as Hub;
     IProtocol prot = e.Data as IProtocol;
     if (prot != null)
     {
         prot.Update -= hubConnection_Update;
     }
     hubConnection.Protocol.Update += new FmdcEventHandler(hubConnection_Update);
 }
开发者ID:musakasim,项目名称:flowlib,代码行数:10,代码来源:PassiveSearch.cs


示例3: hubConnection_ProtocolChange

 void hubConnection_ProtocolChange(object sender, FmdcEventArgs e)
 {
     Hub hubConnection = sender as Hub;
     IProtocol prot = e.Data as IProtocol;
     if (prot != null)
     {
         prot.MessageReceived -= Protocol_MessageReceived;
         prot.MessageToSend -= Protocol_MessageToSend;
         prot.Update -= hubConnection_Update;
     }
     hubConnection.Protocol.MessageReceived += new FlowLib.Events.FmdcEventHandler(Protocol_MessageReceived2);
     hubConnection.Protocol.MessageToSend += new FlowLib.Events.FmdcEventHandler(Protocol_MessageToSend);
     hubConnection.Protocol.Update += new FlowLib.Events.FmdcEventHandler(hubConnection_Update);
 }
开发者ID:musakasim,项目名称:flowlib,代码行数:14,代码来源:ActiveSearch.cs


示例4: protRcvd

 public void protRcvd(object sender, FmdcEventArgs e)
 {
     Hub hub = (sender as Hub);
     switch(e.Action)
     {
     case Actions.StatusChange:
         HubStatus status = (e.Data as HubStatus);
         if(status.Code.Equals("Connected"))
         {
             this.hublist.Add(hub.Name, hub);
         }
         else if(status.Code.Equals("Disconnected"))
         {
             this.hublist.Remove(hub.Name);
         }
         break;
     }
 }
开发者ID:BGCX261,项目名称:zpoc3-svn-to-git,代码行数:18,代码来源:Core.cs


示例5: prot_Update

        void prot_Update(object sender, FmdcEventArgs e)
        {
            switch (e.Action)
            {
                case Actions.MainMessage:
                    MainMessage msgMain = e.Data as MainMessage;
                    System.Console.Write(string.Format("[{0}] <{1}> {2}\r\n",
                        System.DateTime.Now.ToLongTimeString(),
                        msgMain.From,
                        msgMain.Content));
                    break;

                case Actions.PrivateMessage:
                    PrivateMessage msgPriv = e.Data as PrivateMessage;
                    System.Console.Write(string.Format("[{0}] PM:{1}\r\n",
                        System.DateTime.Now.ToLongTimeString(),
                        msgPriv.Content));
                    break;
            }
        }
开发者ID:musakasim,项目名称:flowlib,代码行数:20,代码来源:ReceiveMainChatOrPMFromHub.cs


示例6: Protocol_RequestTransfer

 void Protocol_RequestTransfer(object sender, FmdcEventArgs e)
 {
     ITransfer trans = sender as ITransfer;
     TransferRequest req = e.Data as TransferRequest;
     req = transferManager.GetTransferReq(req.Key);
     if (trans != null && req != null)
     {
         e.Handled = true;
         e.Data = req;
         transferManager.RemoveTransferReq(req.Key);
     }
 }
开发者ID:musakasim,项目名称:flowlib,代码行数:12,代码来源:ActiveDownloadFilelistFromUser.cs


示例7: PassiveConnectToUser_UpdateBase

 void PassiveConnectToUser_UpdateBase(object sender, FmdcEventArgs e)
 {
 }
开发者ID:musakasim,项目名称:flowlib,代码行数:3,代码来源:ActiveDownloadFilelistFromUser.cs


示例8: OnUpdate

 void OnUpdate(object sender, FmdcEventArgs e)
 {
 }
开发者ID:BGCX261,项目名称:zpoc3-svn-to-git,代码行数:3,代码来源:UPnPProtocol.cs


示例9: OnMessageReceived

 void OnMessageReceived(object sender, FmdcEventArgs e)
 {
 }
开发者ID:BGCX261,项目名称:zpoc3-svn-to-git,代码行数:3,代码来源:UPnPProtocol.cs


示例10: OnSend

 public bool OnSend(IConMessage msg)
 {
     FmdcEventArgs e = new FmdcEventArgs(Actions.CommandOutgoing, msg);
     MessageToSend(con, e);
     if (!e.Handled)
     {
         return true;
     }
     return false;
 }
开发者ID:BGCX261,项目名称:zpoc3-svn-to-git,代码行数:10,代码来源:UPnPProtocol.cs


示例11: ActOnInMessage

 public void ActOnInMessage(IConMessage message)
 {
     UdpMessage msg = message as UdpMessage;
     if (msg != null)
     {
         // Device Found
         UPnPDevice device = ParseSSDP(msg.Raw, msg.RemoteAddress);
         FmdcEventArgs e = new FmdcEventArgs(0, device);
         Update(con, e);
         if (!e.Handled)
         {
             string key = device.Information.Sender.ToString();
             // Do device exist in our list?
             if (this.con.RootDevices.ContainsKey(key))
             {
                 // Don't add this device. It already exist in our list.
             }
             else
             {
                 // We don't have this device yet. Add it.
                 con.RootDevices.Add(key, device);
                 FmdcEventArgs e2 = new FmdcEventArgs(Actions.UPnPRootDeviceFound, device);
                 Update(con, e2);
             }
         }
     }
 }
开发者ID:BGCX261,项目名称:zpoc3-svn-to-git,代码行数:27,代码来源:UPnPProtocol.cs


示例12: hubConnection_ProtocolChange

 void hubConnection_ProtocolChange(object sender, FmdcEventArgs e)
 {
     Hub hubConnection = sender as Hub;
     if (hubConnection != null)
     {
         hubConnection.Protocol.Update += new FmdcEventHandler(prot_Update);
         if (Program.DEBUG)
         {
             hubConnection.Protocol.MessageReceived += new FmdcEventHandler(Protocol_MessageReceived);
             hubConnection.Protocol.MessageToSend += new FmdcEventHandler(Protocol_MessageToSend);
         }
     }
 }
开发者ID:oscarmike67,项目名称:seriebot,代码行数:13,代码来源:DcBot.cs


示例13: hubConnection_ConnectionStatusChange

        void hubConnection_ConnectionStatusChange(object sender, FmdcEventArgs e)
        {
            switch (e.Action)
            {
                case TcpConnection.Connecting:
                    Program.WriteLine("*** Hub Connecting...");
                    break;
                case TcpConnection.Connected:
                    Program.WriteLine("*** Hub Connected.");
                    break;
                case TcpConnection.Disconnected:
                    Program.Write("*** Hub Disconnected.");
                    Program.Write(e.Data);
                    Program.WriteLine();
                    break;
                default:
                    Program.Write("*** Hub has Unknown connection status.");
                    Program.Write(e.Data);
                    Program.WriteLine();
                    break;
            }

            Program.WriteLine();
        }
开发者ID:oscarmike67,项目名称:seriebot,代码行数:24,代码来源:DcBot.cs


示例14: downloadManager_DownloadCompleted

 void downloadManager_DownloadCompleted(object sender, FmdcEventArgs e)
 {
     DownloadItem item = sender as DownloadItem;
     Source source = e.Data as Source;
     DownloadHandler.TryHandleDownload(this, item, source);
 }
开发者ID:oscarmike67,项目名称:seriebot,代码行数:6,代码来源:DcBot.cs


示例15: d_SegmentStarted

 void d_SegmentStarted(object sender, FmdcEventArgs e)
 {
     SegmentStarted(sender, e);
 }
开发者ID:musakasim,项目名称:flowlib,代码行数:4,代码来源:DownloadManager.cs


示例16: trans_SecureUpdate

        // Security, Windows Mobile doesnt support SSLStream so we disable this feature for it.
        void trans_SecureUpdate(object sender, FmdcEventArgs e)
        {
            switch (e.Action)
            {
                case Actions.SecuritySelectLocalCertificate:
                    LocalCertificationSelectionInfo lc = e.Data as LocalCertificationSelectionInfo;
                    if (lc != null)
                    {
                        string file = System.AppDomain.CurrentDomain.BaseDirectory + "FlowLib.cer";
                        lc.SelectedCertificate = X509Certificate.CreateFromCertFile(file);
                        e.Data = lc;
                    }

                    break;
                case Actions.SecurityValidateRemoteCertificate:
                    CertificateValidationInfo ct = e.Data as CertificateValidationInfo;
                    if (ct != null)
                    {
                        ct.Accepted = true;
                        e.Data = ct;
                        e.Handled = true;
                    }
                    break;
            }
        }
开发者ID:musakasim,项目名称:flowlib,代码行数:26,代码来源:ActiveEmptySharingUsingTLS.cs


示例17: OnUpdateSetting

 protected void OnUpdateSetting(object sender, FmdcEventArgs e)
 {
 }
开发者ID:BGCX261,项目名称:zpoc3-svn-to-git,代码行数:3,代码来源:SettingItem.cs


示例18: hubConnection_SecureUpdate

 void hubConnection_SecureUpdate(object sender, FmdcEventArgs e)
 {
     CertificateValidationInfo info = e.Data as CertificateValidationInfo;
     if (info != null)
     {
         info.Accepted = true;
     }
 }
开发者ID:oscarmike67,项目名称:seriebot,代码行数:8,代码来源:DcBot.cs


示例19: ActOnOutMessage

        public void ActOnOutMessage(FlowLib.Events.FmdcEventArgs e)
        {
            string key = null;
            UPnPDevice device = null;
            switch (e.Action)
            {
                case Actions.UPnPDeviceDescription:
                    key = e.Data as string;
                    if (key != null)
                    {
                        try
                        {
                            if (con.RootDevices.ContainsKey(key))
                            {
                                device = con.RootDevices[key];
                                System.Net.HttpWebRequest httpRequest = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(device.Information.DescriptionURL);
                                WebResponse webResponse = httpRequest.GetResponse();
                                System.IO.StreamReader sr = new System.IO.StreamReader(webResponse.GetResponseStream());
                                string ret = sr.ReadToEnd();
                                sr.Close();

                                FmdcEventArgs e2 = new FmdcEventArgs(Actions.UPnPDeviceDescription, ret);
                                Update(con, e2);
                                if (!e2.Handled)
                                {
                                    ParseDescription(ref device, ret);
                                    Update(con, new FmdcEventArgs(Actions.UPnPDeviceUpdated, device));
                                }
                            }
                        }
                        catch (System.Exception)
                        {
                            // TODO: Make exception handling
                        }
                    }
                    break;
                case Actions.UPnPFunctionCall:
                    UPnPFunction func = e.Data as UPnPFunction;
                    if (func != null)
                    {
                        try
                        {
                            #region Create Envelope
                            System.Text.StringBuilder sb = new System.Text.StringBuilder();
                            sb.Append("<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">");
                            sb.Append("<s:Body>");
                            sb.Append("<u:" + func.Name + " xmlns:u=\"" + func.Service.Information.serviceType + "\">");
                            foreach (KeyValuePair<string, string> argument in func.Arguments)
                            {
                                sb.AppendFormat("<{0}>{1}</{0}>", argument.Key, argument.Value);
                            }
                            sb.Append("</u:" + func.Name + ">");
                            sb.Append("</s:Body>");
                            sb.Append("</s:Envelope>");
                            #endregion
                            #region Create Request
                            byte[] body = System.Text.Encoding.UTF8.GetBytes(sb.ToString());
                            string url = null;
                            // Is ControlURL relative or absolute?
                            if (func.Service.Information.ControlURL.StartsWith("/"))
                            {
                                url = "http://" + func.Service.Device.Information.URLBase + func.Service.Information.ControlURL;
                            }
                            else
                            {
                                url = func.Service.Information.ControlURL;
                            }

                            WebRequest wr = WebRequest.Create(url);//+ controlUrl);
                            wr.Headers.Clear();
                            wr.Method = "POST";
                            wr.ContentType = "text/xml; charset=\"utf-8\"";
                            wr.Headers.Add("SOAPAction", "\"" + func.Service.Information.serviceType +
                            "#" + func.Name + "\"");
                            wr.ContentLength = body.Length;
                            #endregion
                            #region Call Service function
                            // TODO: Add error handling in this (If server returns code 500 or something)
                            System.IO.Stream stream = wr.GetRequestStream();
                            stream.Write(body, 0, body.Length);
                            stream.Flush();
                            stream.Close();
                            WebResponse wres = wr.GetResponse();
                            System.IO.StreamReader sr = new
                            System.IO.StreamReader(wres.GetResponseStream());
                            string xml = sr.ReadToEnd();
                            sr.Close();
                            #endregion
                            #region Parse returning data
                            XmlDocument document = new XmlDocument();
                            document.LoadXml(xml);
                            SortedList<string, string> tmpList = new SortedList<string, string>(func.Arguments);
                            foreach (KeyValuePair<string, string> argument in func.Arguments)
                            {
                                XmlNodeList nodes = document.GetElementsByTagName(argument.Key);
                                if (nodes.Count == 1)
                                {
                                    tmpList[argument.Key] = nodes[0].InnerText;
                                }
                            }
//.........这里部分代码省略.........
开发者ID:BGCX261,项目名称:zpoc3-svn-to-git,代码行数:101,代码来源:UPnPProtocol.cs


示例20: Protocol_Error

 void Protocol_Error(object sender, FmdcEventArgs e)
 {
     Transfer trans = sender as Transfer;
     if (trans != null && trans.User != null)
     {
         switch ((TransferErrors)e.Action)
         {
             case TransferErrors.INACTIVITY:
                 //SendMessage(Actions.PrivateMessage, trans.User.ID, "Unhandled error occured: Inactivity");
                 break;
             case TransferErrors.NO_FREE_SLOTS:
                 SendMessage(Actions.PrivateMessage, trans.User.ID, "You have no free slots. Make sure to have atleast one slot free and try again.");
                 break;
             case TransferErrors.FILE_NOT_AVAILABLE:
                 SendMessage(Actions.PrivateMessage, trans.User.ID, "Unhandled error occured: I was unable to get your filelist.");
                 break;
             case TransferErrors.USERID_MISMATCH:
                 SendMessage(Actions.PrivateMessage, trans.User.ID, "Unhandled error occured: User Id missmatch");
                 break;
             case TransferErrors.UNKNOWN:
             default:
                 SendMessage(Actions.PrivateMessage, trans.User.ID, "Unhandled error occured: " + e.Data);
                 break;
         }
     }
 }
开发者ID:oscarmike67,项目名称:seriebot,代码行数:26,代码来源:DcBot.cs



注:本文中的FmdcEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FocusNavigationDirection类代码示例发布时间:2022-05-24
下一篇:
C# FlushType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap