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

C# UInt16类代码示例

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

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



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

示例1: Write

		public override void Write(UInt16 val)
		{
			val = Utilities.SwapBytes(val);
			base.Write(val);

			if (AutoFlush) Flush();
		}
开发者ID:svarogg,项目名称:System.Drawing.PSD,代码行数:7,代码来源:BinaryReverseWriter.cs


示例2: OnPort

 private void OnPort(IPeerWireClient client, UInt16 port)
 {
     if (Port != null)
     {
         Port(client, port);
     }
 }
开发者ID:alex-kir,项目名称:System.Net.Torrent,代码行数:7,代码来源:DHTPortExtension.cs


示例3: UInt16

        public static byte[] UInt16(UInt16 i, Endianness e = Endianness.Machine)
        {
            byte[] bytes = BitConverter.GetBytes(i);

            if (NeedsFlipping(e)) Array.Reverse(bytes);

            return bytes;
        }
开发者ID:HaKDMoDz,项目名称:eStd,代码行数:8,代码来源:Pack.cs


示例4: SystemBootEventArgs

 public SystemBootEventArgs(UInt16 major, UInt16 minor, UInt16 patch, UInt16 build, UInt16 ll_version, Byte protocol_version, Byte hw)
 {
     this.major = major;
     this.minor = minor;
     this.patch = patch;
     this.build = build;
     this.ll_version = ll_version;
     this.protocol_version = protocol_version;
     this.hw = hw;
 }
开发者ID:shariat,项目名称:bglib,代码行数:10,代码来源:BGLib.cs


示例5: Write

 public static void Write(this BinaryWriter writer, UInt16 value, bool invertEndian = false)
 {
     if (invertEndian)
     {
         writer.WriteInvertedBytes(BitConverter.GetBytes(value));
     }
     else
     {
         writer.Write(value);
     }
 }
开发者ID:r2d2rigo,项目名称:BinaryEndiannessExtensions,代码行数:11,代码来源:BinaryWriterExtensions.cs


示例6: WriteFixedString

            public void WriteFixedString(string data, UInt16 fixedCount)
            {
                FWriter.Write((UInt16)data.Length);

                byte[] str = UnicodeEncoding.Unicode.GetBytes(data);

                FWriter.Write(str);

                for (int i = 0; i < (fixedCount - data.Length); ++i)
                {
                    FWriter.Write((UInt16)0);
                }
            }
开发者ID:lythm,项目名称:orb3d,代码行数:13,代码来源:PacketStream.cs


示例7: IsAtWordBoundary

        //------------------------------------------------------
        //
        //  Internal Methods
        //
        //------------------------------------------------------

        #region Internal Methods

        // Returns true if position points to a word break in the supplied
        // char array.  position is an inter-character offset -- 0 points
        // to the space preceeding the first char, 1 points between the
        // first and second char, etc.
        //
        // insideWordDirection specifies whether we're looking for a word start
        // or word end.  If insideWordDirection == LogicalDirection.Forward, then
        // text = "abc def", position = 4 will return true, but if the direction is
        // backward, no word boundary will be found (looking backward position is
        // at the edge of whitespace, not a word).
        //
        // This method requires at least MinContextLength chars ahead of and
        // following position to give accurate results, but no more.
        internal static bool IsAtWordBoundary(char[] text, int position, LogicalDirection insideWordDirection)
        {
            CharClass[] classes = GetClasses(text);

            // If the inside text is blank, it's not a word boundary.
            if (insideWordDirection == LogicalDirection.Backward)
            {
                if (position == text.Length)
                {
                    return true;
                }
                if (position == 0 || IsWhiteSpace(text[position - 1], classes[position - 1]))
                {
                    return false;
                }
            }
            else
            {
                if (position == 0)
                {
                    return true;
                }
                if (position == text.Length || IsWhiteSpace(text[position], classes[position]))
                {
                    return false;
                }
            }

            UInt16[] charType3 = new UInt16[2];

            SafeNativeMethods.GetStringTypeEx(0 /* ignored */, SafeNativeMethods.CT_CTYPE3, new char[] { text[position - 1], text[position] }, 2, charType3);

            // Otherwise we're at a word boundary if the classes of the surrounding text differ.
            return IsWordBoundary(text[position - 1], text[position]) ||
                   (
                    !IsSameClass(charType3[0], classes[position - 1], charType3[1], classes[position]) &&
                    !IsMidLetter(text, position - 1, classes) &&
                    !IsMidLetter(text, position, classes) 
                   );
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:61,代码来源:SelectionWordBreaker.cs


示例8: FindImplSlotForCurrentType

        private static bool FindImplSlotForCurrentType(EEType* pTgtType,
                                        EEType* pItfType,
                                        UInt16 itfSlotNumber,
                                        UInt16* pImplSlotNumber)
        {
            bool fRes = false;

            // If making a call and doing virtual resolution don't look into the dispatch map,
            // take the slot number directly.
            if (!pItfType->IsInterface)
            {
                *pImplSlotNumber = itfSlotNumber;

                // Only notice matches if the target type and search types are the same
                // This will make dispatch to sealed slots work correctly
                return pTgtType == pItfType;
            }

            if (pTgtType->HasDispatchMap)
            {
                // For variant interface dispatch, the algorithm is to walk the parent hierarchy, and at each level
                // attempt to dispatch exactly first, and then if that fails attempt to dispatch variantly. This can
                // result in interesting behavior such as a derived type only overriding one particular instantiation
                // and funneling all the dispatches to it, but its the algorithm.

                bool fDoVariantLookup = false; // do not check variance for first scan of dispatch map 

                fRes = FindImplSlotInSimpleMap(
                    pTgtType, pItfType, itfSlotNumber, pImplSlotNumber, fDoVariantLookup);

                if (!fRes)
                {
                    fDoVariantLookup = true; // check variance for second scan of dispatch map
                    fRes = FindImplSlotInSimpleMap(
                     pTgtType, pItfType, itfSlotNumber, pImplSlotNumber, fDoVariantLookup);
                }
            }

            return fRes;
        }
开发者ID:krytarowski,项目名称:corert,代码行数:40,代码来源:DispatchResolve.cs


示例9: SetAdvParametersEventArgs

 public SetAdvParametersEventArgs(UInt16 result)
 {
     this.result = result;
 }
开发者ID:hstdesigns,项目名称:htw_projects,代码行数:4,代码来源:BGLib.cs


示例10: RegReadEventArgs

 public RegReadEventArgs(UInt16 address, Byte value)
 {
     this.address = address;
     this.value = value;
 }
开发者ID:hstdesigns,项目名称:htw_projects,代码行数:5,代码来源:BGLib.cs


示例11: SetFilteringEventArgs

 public SetFilteringEventArgs(UInt16 result)
 {
     this.result = result;
 }
开发者ID:hstdesigns,项目名称:htw_projects,代码行数:4,代码来源:BGLib.cs


示例12: ConnectSelectiveEventArgs

 public ConnectSelectiveEventArgs(UInt16 result, Byte connection_handle)
 {
     this.result = result;
     this.connection_handle = connection_handle;
 }
开发者ID:hstdesigns,项目名称:htw_projects,代码行数:5,代码来源:BGLib.cs


示例13: EndProcedureEventArgs

 public EndProcedureEventArgs(UInt16 result)
 {
     this.result = result;
 }
开发者ID:hstdesigns,项目名称:htw_projects,代码行数:4,代码来源:BGLib.cs


示例14: ToString

 public static string ToString(UInt16 value)
 {
     return value.ToString();
 }
开发者ID:nguyenkien,项目名称:api,代码行数:4,代码来源:XmlConvert.cs


示例15: SetAdvDataEventArgs

 public SetAdvDataEventArgs(UInt16 result)
 {
     this.result = result;
 }
开发者ID:hstdesigns,项目名称:htw_projects,代码行数:4,代码来源:BGLib.cs


示例16: IOPortConfigIrqEventArgs

 public IOPortConfigIrqEventArgs(UInt16 result)
 {
     this.result = result;
 }
开发者ID:hstdesigns,项目名称:htw_projects,代码行数:4,代码来源:BGLib.cs


示例17: DeleteBondingEventArgs

 public DeleteBondingEventArgs(UInt16 result)
 {
     this.result = result;
 }
开发者ID:hstdesigns,项目名称:htw_projects,代码行数:4,代码来源:BGLib.cs


示例18: PasskeyEntryEventArgs

 public PasskeyEntryEventArgs(UInt16 result)
 {
     this.result = result;
 }
开发者ID:hstdesigns,项目名称:htw_projects,代码行数:4,代码来源:BGLib.cs


示例19: EncryptStartEventArgs

 public EncryptStartEventArgs(Byte handle, UInt16 result)
 {
     this.handle = handle;
     this.result = result;
 }
开发者ID:hstdesigns,项目名称:htw_projects,代码行数:5,代码来源:BGLib.cs


示例20: ReadMultipleEventArgs

 public ReadMultipleEventArgs(Byte connection, UInt16 result)
 {
     this.connection = connection;
     this.result = result;
 }
开发者ID:hstdesigns,项目名称:htw_projects,代码行数:5,代码来源:BGLib.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# UInt256类代码示例发布时间:2022-05-24
下一篇:
C# UInt128类代码示例发布时间: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