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


C# BinaryWriter.WriteString方法代码示例

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


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

示例1: WriteProxyMethod

        /// <summary>
        /// Writes proxy method invocation data to the specified writer.
        /// </summary>
        /// <param name="writer">Writer.</param>
        /// <param name="method">Method.</param>
        /// <param name="arguments">Arguments.</param>
        public static void WriteProxyMethod(BinaryWriter writer, MethodBase method, object[] arguments)
        {
            Debug.Assert(writer != null);
            Debug.Assert(method != null);

            writer.WriteString(method.Name);

            if (arguments != null)
            {
                writer.WriteBoolean(true);
                writer.WriteInt(arguments.Length);

                foreach (var arg in arguments)
                    writer.WriteObject(arg);
            }
            else
                writer.WriteBoolean(false);
        }
开发者ID:dheep-purdessy,项目名称:ignite,代码行数:24,代码来源:ServiceProxySerializer.cs

示例2: Write

        /** <inheritDoc /> */
        internal override void Write(BinaryWriter writer, bool keepBinary)
        {
            if (string.IsNullOrEmpty(Text))
                throw new ArgumentException("Text cannot be null or empty");

            if (string.IsNullOrEmpty(QueryType))
                throw new ArgumentException("QueryType cannot be null or empty");

            writer.WriteBoolean(Local);
            writer.WriteString(Text);
            writer.WriteString(QueryType);
            writer.WriteInt(PageSize);
        }
开发者ID:dheep-purdessy,项目名称:ignite,代码行数:14,代码来源:TextQuery.cs

示例3: WriteProxyMethod

        /// <summary>
        /// Writes proxy method invocation data to the specified writer.
        /// </summary>
        /// <param name="writer">Writer.</param>
        /// <param name="method">Method.</param>
        /// <param name="arguments">Arguments.</param>
        /// <param name="platform">The platform.</param>
        public static void WriteProxyMethod(BinaryWriter writer, MethodBase method, object[] arguments, 
            Platform platform)
        {
            Debug.Assert(writer != null);
            Debug.Assert(method != null);

            writer.WriteString(method.Name);

            if (arguments != null)
            {
                writer.WriteBoolean(true);
                writer.WriteInt(arguments.Length);

                if (platform == Platform.DotNet)
                {
                    // Write as is
                    foreach (var arg in arguments)
                        writer.WriteObject(arg);
                }
                else
                {
                    // Other platforms do not support Serializable, need to convert arrays and collections
                    var methodArgs = method.GetParameters();
                    Debug.Assert(methodArgs.Length == arguments.Length);

                    for (int i = 0; i < arguments.Length; i++)
                        WriteArgForPlatforms(writer, methodArgs[i], arguments[i]);
                }
            }
            else
                writer.WriteBoolean(false);
        }
开发者ID:RazmikMkrtchyan,项目名称:ignite,代码行数:39,代码来源:ServiceProxySerializer.cs

示例4: Write

        /** <inheritDoc /> */
        internal override void Write(BinaryWriter writer, bool keepBinary)
        {
            if (string.IsNullOrEmpty(Sql))
                throw new ArgumentException("Sql cannot be null or empty");

            if (string.IsNullOrEmpty(QueryType))
                throw new ArgumentException("QueryType cannot be null or empty");

            // 2. Prepare.
            writer.WriteBoolean(Local);
            writer.WriteString(Sql);
            writer.WriteString(QueryType);
            writer.WriteInt(PageSize);

            WriteQueryArgs(writer, Arguments);
        }
开发者ID:dheep-purdessy,项目名称:ignite,代码行数:17,代码来源:SqlQuery.cs


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