當前位置: 首頁>>代碼示例>>C#>>正文


C# BinaryWriter.WriteBoolean方法代碼示例

本文整理匯總了C#中BinaryWriter.WriteBoolean方法的典型用法代碼示例。如果您正苦於以下問題:C# BinaryWriter.WriteBoolean方法的具體用法?C# BinaryWriter.WriteBoolean怎麽用?C# BinaryWriter.WriteBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BinaryWriter的用法示例。


在下文中一共展示了BinaryWriter.WriteBoolean方法的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.WriteBoolean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。