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


C# PropertyBag.AddValue方法代码示例

本文整理汇总了C#中PropertyBag.AddValue方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyBag.AddValue方法的具体用法?C# PropertyBag.AddValue怎么用?C# PropertyBag.AddValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PropertyBag的用法示例。


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

示例1: PopulateSslMeta

        private static void PopulateSslMeta(PropertyBag properties, SslStream stm)
        {
            properties.AddValue("SslProtocol", stm.SslProtocol);
            properties.AddValue("IsSigned", stm.IsSigned);
            properties.AddValue("IsMutallyAuthenticated", stm.IsMutuallyAuthenticated);
            properties.AddValue("IsEncrypted", stm.IsEncrypted);
            properties.AddValue("CipherAlgorithm", stm.CipherAlgorithm);
            properties.AddValue("CipherStrength", stm.CipherStrength);
            properties.AddValue("HashAlgorithm", stm.HashAlgorithm);
            properties.AddValue("HashStrength", stm.HashStrength);

            if(stm.LocalCertificate != null)
            {
                properties.AddValue("LocalCertificate", stm.LocalCertificate);
            }

            if (stm.RemoteCertificate != null)
            {
                properties.AddValue("RemoteCertificate", stm.RemoteCertificate);
                properties.AddValue("KeyExchangeAlgorithm", stm.KeyExchangeAlgorithm);
                properties.AddValue("KeyExchangeStrength", stm.KeyExchangeStrength);
            }
        }
开发者ID:michyer,项目名称:canape,代码行数:23,代码来源:SslNetworkLayer.cs

示例2: PopulateBag

        public override void PopulateBag(PropertyBag properties)
        {
            base.PopulateBag(properties);

            properties.AddValue("Url", Url);
            properties.AddValue("Headers", Headers);
        }
开发者ID:michyer,项目名称:canape,代码行数:7,代码来源:HttpProxyToken.cs

示例3: PopulateBagFromSocket

        /// <summary>
        /// Populate a property bag from a socket
        /// </summary>
        /// <param name="sock">The socket</param>
        /// <param name="properties">The property bag</param>
        public static void PopulateBagFromSocket(Socket sock, PropertyBag properties)
        {
            properties.AddValue("AddressFamily", sock.AddressFamily);
            properties.AddValue("SocketType", sock.SocketType);
            properties.AddValue("ProtocolType", sock.ProtocolType);

            try
            {
                // This could throw a socket exception if not a connected socket (e.g. UDP)
                AddEndpoint("RemoteEndpoint", sock.RemoteEndPoint, properties);
            }
            catch (SocketException)
            {
            }

            AddEndpoint("LocalEndpoint", sock.LocalEndPoint, properties);
        }
开发者ID:michyer,项目名称:canape,代码行数:22,代码来源:NetUtils.cs

示例4: AddEndpoint

        private static void AddEndpoint(string name, EndPoint ep, PropertyBag properties)
        {
            IPEndPoint ip = ep as IPEndPoint;
            properties.AddValue(name, ep);

            if(ip != null)
            {
                properties.AddValue(name + "Address", ip.Address);
                properties.AddValue(name + "Port", ip.Port);
            }
        }
开发者ID:michyer,项目名称:canape,代码行数:11,代码来源:NetUtils.cs

示例5: PopulateBag

        /// <summary>
        /// 
        /// </summary>
        /// <param name="properties"></param>
        public override void PopulateBag(PropertyBag properties)
        {
            base.PopulateBag(properties);

            if (Hostname != null)
            {
                properties.AddValue("Endpoint", new DnsEndPoint(Hostname, Port));
                properties.AddValue("Hostname", Hostname);
            }
            else
            {
                properties.AddValue("Endpoint", new IPEndPoint(Address, Port));
                properties.AddValue("Hostname", Address.ToString());
            }

            properties.AddValue("Protocol", ClientType == IpClientType.Tcp ? "TCP" : "UDP");
            properties.AddValue("Port", Port);
            properties.AddValue("Ipv6", Ipv6);
        }
开发者ID:michyer,项目名称:canape,代码行数:23,代码来源:IpProxyToken.cs


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