当前位置: 首页>>代码示例>>C#>>正文


C# Protocol类代码示例

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


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

示例1: ProtocolReporter

        /// <summary>
        /// Constructs a ProtocolReporter
        /// </summary>
        /// <param name="protocol">Protocol to attach to</param>
        public ProtocolReporter(Protocol protocol)
        {
            this.protocol = protocol;
            this.debug = new Debug(protocol.Name);

            this.protocol.AddListener(this);
        }
开发者ID:peteward44,项目名称:nbm-messenger,代码行数:11,代码来源:ProtocolReporter.cs

示例2: ContainsLayer

 public override bool ContainsLayer(Protocol layer)
 {
     if (layer == Protocol.UDP)
         return true;
     else
         return base.ContainsLayer(layer);
 }
开发者ID:zzz654321,项目名称:fireBwall,代码行数:7,代码来源:UDPPacket.cs

示例3: Test_CanApprove

        public void Test_CanApprove()
        {
            Procedure procedure = new Procedure();
            Protocol protocol = new Protocol(procedure);
            ProtocolAssignmentStep procedureStep = new ProtocolAssignmentStep(protocol);

            Assert.AreEqual(ProtocolStatus.PN, procedureStep.Protocol.Status);
            Assert.IsFalse(procedureStep.CanApprove);

            protocol.SubmitForApproval();

            Assert.AreEqual(ActivityStatus.SC, procedureStep.State);
            Assert.AreEqual(ProtocolStatus.AA, procedureStep.Protocol.Status);
            Assert.IsTrue(procedureStep.CanApprove);

            procedureStep.Start(new Staff());

            Assert.AreEqual(ActivityStatus.IP, procedureStep.State);
            Assert.AreEqual(ProtocolStatus.AA, procedureStep.Protocol.Status);
            Assert.IsTrue(procedureStep.CanApprove);

            procedureStep.Suspend();

            Assert.AreEqual(ActivityStatus.SU, procedureStep.State);
            Assert.AreEqual(ProtocolStatus.AA, procedureStep.Protocol.Status);
            Assert.IsFalse(procedureStep.CanApprove);

            procedureStep.Complete();

            Assert.AreEqual(ActivityStatus.CM, procedureStep.State);
            Assert.AreEqual(ProtocolStatus.AA, procedureStep.Protocol.Status);
            Assert.IsFalse(procedureStep.CanApprove);

            // TODO : test all other Protocol state conditions
        }
开发者ID:nhannd,项目名称:Xian,代码行数:35,代码来源:ProtocolAssignmentStepTests.cs

示例4: createProtocol

 public static void createProtocol(TreeView tree)
 {
     TreeNodeCollection treeCol = tree.Nodes;
     Protocol prot = new Protocol(treeCol[0].Text, treeCol[0].ImageKey, treeCol[0].SelectedImageKey);
     Block data = null;
     foreach (TreeNode t in treeCol[0].Nodes)
     {
         if (t.Name.Equals("block"))
         {
             data = prot.createBlock(t.Text, t.ImageKey, t.SelectedImageKey);
             createProtocol(t.Nodes, data);
         }
         else
         {
             if(t.Name.Equals("multi"))
             {
             Field f = prot.createField(t.Text, t.Name,  "", t.SelectedImageKey);
             string[] values = t.ImageKey.Split(';');
             foreach(string s in values)
                 {
                     string[] pair = s.Split(':');
                     ((MultiField)f).addKey(pair[0], pair[1]);
                 }
            } else prot.createField(t.Text, t.Name, t.ImageKey, t.SelectedImageKey);
         }
     }
     createXML(prot);
 }
开发者ID:vicban3d,项目名称:Hackaton,代码行数:28,代码来源:Facade.cs

示例5: Send

 public void Send(int msgno, MemoryStream stream)
 {
     Protocol protocol = new Protocol();
     protocol.msgno = msgno;
     protocol.stream = stream;
     mSendBuffer.PushBack(protocol);
 }
开发者ID:goome,项目名称:eternal-client,代码行数:7,代码来源:NetManager.cs

示例6: MessageSegment

 public MessageSegment(IChannel connection, Protocol protocol, EndPoint ep, byte[] data)
 {
     Protocol = protocol;
     EndPoint = ep;
     Data = data;
     Connection = connection;
 }
开发者ID:odinhaus,项目名称:Suffuz,代码行数:7,代码来源:MessageSegment.cs

示例7: Test_IsPreStep

        public void Test_IsPreStep()
        {
            Protocol protocol = new Protocol();
            ConcreteProtocolProcedureStep procedureStep = new ConcreteProtocolProcedureStep(protocol);

            Assert.IsTrue(procedureStep.IsPreStep);
        }
开发者ID:nhannd,项目名称:Xian,代码行数:7,代码来源:ProtocolProcedureStepTests.cs

示例8: Update

        public override void Update(Protocol.Types.Shortcut shortcut)
        {
            base.Update(shortcut);

            if (shortcut is ShortcutEmote)
                Emote = ObjectDataManager.Instance.Get<Emoticon>((shortcut as ShortcutEmote).emoteId);
        }
开发者ID:Ryuuke,项目名称:BehaviorIsManaged,代码行数:7,代码来源:EmoteShortcut.cs

示例9: Process

		public void Process(string s)
		{
			// split protocol, separator and actual value
			int separatorIndex = s.IndexOf(SEPARATOR);

			if (separatorIndex != -1)
			{
				switch(s.Substring(0, separatorIndex))
				{
					case XML_RPC:
						m_type = Protocol.XmlRpc;
						break;
					case SOAP:
						m_type = Protocol.Soap;
						break;
					case REST:
						m_type = Protocol.Rest;
						break;
                    case UIML:
                        // uiml:// style location
                        m_type = Protocol.Local;
                        m_value = Uiml.Utils.Location.Transform(s);
                        break;
				}

                if (m_value == string.Empty) // only if not already assigned
				    m_value = s.Substring(separatorIndex + SEPARATOR.Length);
			}
			else
			{
				// no separator, thus it's local
				m_type = Protocol.Local;
				m_value = s; // value is the complete string
			}
		}
开发者ID:jozilla,项目名称:Uiml.net,代码行数:35,代码来源:Location.cs

示例10: OpenDocument

        public static void OpenDocument(Protocol p, string url)
        {
            string cmd = "";

            url = url.Trim().ToLower();

            if ( url.Length > 0 ) {
                if ( p == Protocol.Email ) {
                    cmd += EmailProtocolPrefix;
                }
                else
                if ( p == Protocol.Http ) {
                    if ( !url.StartsWith( HttpProtocolPrefix ) ) {
                        cmd += HttpProtocolPrefix;
                    }
                }

                cmd += url;
                System.Diagnostics.Process.Start( cmd );
            } else {
                throw new ApplicationException( "Empty url" );
            }

            return;
        }
开发者ID:Baltasarq,项目名称:Tacto,代码行数:25,代码来源:ConnectionManager.cs

示例11: MessageOut

        public MessageOut(Protocol id)
        {
            data=new MemoryStream();
            writer=new BinaryWriter(data);

            writer.Write((UInt16)id);
        }
开发者ID:Postremus,项目名称:libraries,代码行数:7,代码来源:MessageOut.cs

示例12: ScanEndpoint

 private static ScanNetworkResult ScanEndpoint(CancellationToken userToken, DnsResolverBase resolver, Protocol protocol, IPEndpoint endpoint)
 {
     var status = Ping.PerformPing(endpoint, protocol);
     var hostName = status ? GetHostName(resolver, endpoint) : null;
     var result = new ScanNetworkResult(protocol, endpoint, hostName, status);
     return result;
 }
开发者ID:atanasmihaylov,项目名称:lanscan,代码行数:7,代码来源:Scanner.cs

示例13: RemoveRequest

 public void RemoveRequest(Protocol.Request request)
 {
     lock(_requests)
     {
         _requests.Remove(request.Id);
     }
 }
开发者ID:samfromdeath,项目名称:sharpfastcgi,代码行数:7,代码来源:SyncronizedRequestsRepository.cs

示例14: AddRequest

 public void AddRequest(Protocol.Request request)
 {
     lock(_requests)
     {
         _requests.Add(request.Id, request);
     }
 }
开发者ID:samfromdeath,项目名称:sharpfastcgi,代码行数:7,代码来源:SyncronizedRequestsRepository.cs

示例15: AddMessage

 public void AddMessage(Protocol.IMessage message, Interfaces.IUserAgent user)
 {
     lock (this)
     {
         mQueue.Enqueue(new MessageToken { Message = message, UserAgent = user });
     }
 }
开发者ID:GameHackers,项目名称:siqi,代码行数:7,代码来源:Desk.cs


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