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


C# FileInfo.CheckIfValidSendData方法代码示例

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


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

示例1: SendAsync

        /// <summary>
        /// Sends the specified <paramref name="file"/> as a binary data asynchronously
        /// using the WebSocket connection.
        /// </summary>
        /// <remarks>
        /// This method doesn't wait for the send to be complete.
        /// </remarks>
        /// <param name="file">
        /// A <see cref="FileInfo"/> that represents the file to send.
        /// </param>
        /// <param name="completed">
        /// An Action&lt;bool&gt; delegate that references the method(s) called when the send is
        /// complete. A <see cref="bool"/> passed to this delegate is <c>true</c> if the send is
        /// complete successfully; otherwise, <c>false</c>.
        /// </param>
        public void SendAsync(FileInfo file, Action<bool> completed)
        {
            var msg = _readyState.CheckIfOpen () ?? file.CheckIfValidSendData ();
              if (msg != null) {
            _logger.Error (msg);
            error (msg);

            return;
              }

              sendAsync (Opcode.Binary, file.OpenRead (), completed);
        }
开发者ID:jijamw,项目名称:websocket-sharp,代码行数:27,代码来源:WebSocket.cs

示例2: Send

        /// <summary>
        /// Sends the specified <paramref name="file"/> as a binary data
        /// using the WebSocket connection.
        /// </summary>
        /// <param name="file">
        /// A <see cref="FileInfo"/> that represents the file to send.
        /// </param>
        public void Send(FileInfo file)
        {
            var msg = _readyState.CheckIfOpen () ?? file.CheckIfValidSendData ();
              if (msg != null) {
            _logger.Error (msg);
            error (msg);

            return;
              }

              send (Opcode.Binary, file.OpenRead ());
        }
开发者ID:jijamw,项目名称:websocket-sharp,代码行数:19,代码来源:WebSocket.cs

示例3: SendAsync

        /// <summary>
        /// Sends the specified <paramref name="file"/> as a binary data
        /// asynchronously using the WebSocket connection.
        /// </summary>
        /// <remarks>
        /// This method doesn't wait for the send to be complete.
        /// </remarks>
        /// <param name="file">
        /// A <see cref="FileInfo"/> that represents the file to send.
        /// </param>
        /// <param name="completed">
        /// An Action&lt;bool&gt; delegate that references the method(s) called when
        /// the send is complete. A <see cref="bool"/> passed to this delegate is
        /// <c>true</c> if the send is complete successfully; otherwise, <c>false</c>.
        /// </param>
        public void SendAsync(FileInfo file, Action<bool> completed)
        {
            var msg = checkIfCanSend (() => file.CheckIfValidSendData ());
              if (msg != null) {
            _logger.Error (msg);
            error (msg);

            return;
              }

              sendAsync (Opcode.BINARY, file.OpenRead (), completed);
        }
开发者ID:uken,项目名称:websocket-sharp,代码行数:27,代码来源:WebSocket.cs

示例4: SendAsync

        /// <summary>
        /// Sends the specified <paramref name="file"/> as binary data asynchronously using
        /// the WebSocket connection.
        /// </summary>
        /// <remarks>
        /// This method doesn't wait for the send to be complete.
        /// </remarks>
        /// <param name="file">
        /// A <see cref="FileInfo"/> that represents the file to send.
        /// </param>
        /// <param name="completed">
        /// An <c>Action&lt;bool&gt;</c> delegate that references the method(s) called when
        /// the send is complete. A <see cref="bool"/> passed to this delegate is <c>true</c>
        /// if the send is complete successfully.
        /// </param>
        public void SendAsync(FileInfo file, Action<bool> completed)
        {
            var msg = _readyState.CheckIfAvailable (false, true, false, false) ??
                file.CheckIfValidSendData ();

              if (msg != null) {
            _logger.Error (msg);
            error ("An error has occurred in sending the data.", null);

            return;
              }

              sendAsync (Opcode.Binary, file.OpenRead (), completed);
        }
开发者ID:cswiedler,项目名称:websocket-sharp,代码行数:29,代码来源:WebSocket.cs

示例5: Send

        /// <summary>
        /// Sends the specified <paramref name="file"/> as a binary data
        /// using the WebSocket connection.
        /// </summary>
        /// <param name="file">
        /// A <see cref="FileInfo"/> that represents the file to send.
        /// </param>
        public void Send(FileInfo file)
        {
            var msg = checkIfCanSend (() => file.CheckIfValidSendData ());
              if (msg != null) {
            _logger.Error (msg);
            error (msg);

            return;
              }

              send (Opcode.BINARY, file.OpenRead ());
        }
开发者ID:uken,项目名称:websocket-sharp,代码行数:19,代码来源:WebSocket.cs


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