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

C# TransferMode类代码示例

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

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



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

示例1: Validate

 public static void Validate(TransferMode value)
 {
     if (!IsDefined(value))
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException("value", (int) value, typeof(TransferMode)));
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:TransferModeHelper.cs


示例2: Validate

 public static void Validate(TransferMode value)
 {
     if (!IsDefined(value))
     {
         throw Fx.Exception.AsError(new InvalidEnumArgumentException("value", (int)value, typeof(TransferMode)));
     }
 }
开发者ID:nuxleus,项目名称:WCFWeb,代码行数:7,代码来源:TransferModeHelper.cs


示例3: ServiceConfigurationAttribute

 public ServiceConfigurationAttribute(string behaviorConfiguration, bool customErrorHandler, TransferMode transferMode, params string[] bindingConfiguration)
 {
     CustomErrorHandler = customErrorHandler;
     TransferMode = transferMode;
     BehaviorConfiguration = behaviorConfiguration;
     BindingConfiguration = bindingConfiguration;
 }
开发者ID:tuesdaysiren,项目名称:WcfRestContrib,代码行数:7,代码来源:ServiceConfigurationAttribute.cs


示例4: Validate

 public static void Validate(TransferMode value, string parameterValue)
 {
     if (!IsDefined(value))
     {
         throw Error.InvalidEnumArgument(parameterValue, (int)value, typeof(TransferMode));
     }
 }
开发者ID:Vizzini,项目名称:aspnetwebstack,代码行数:7,代码来源:TransferModeHelper.cs


示例5: IsDefined

 public static bool IsDefined(TransferMode transferMode)
 {
     return transferMode == TransferMode.Buffered ||
            transferMode == TransferMode.Streamed ||
            transferMode == TransferMode.StreamedRequest ||
            transferMode == TransferMode.StreamedResponse;
 }
开发者ID:Vizzini,项目名称:aspnetwebstack,代码行数:7,代码来源:TransferModeHelper.cs


示例6: TransferFolder

        public TransferMode TransferFolder(string sourcePath, string targetPath, TransferMode mode, bool verified = true)
        {
            Ensure.That(sourcePath, () => sourcePath).IsValidPath();
            Ensure.That(targetPath, () => targetPath).IsValidPath();

            if (!_diskProvider.FolderExists(targetPath))
            {
                _diskProvider.CreateFolder(targetPath);
            }

            var result = mode;

            foreach (var subDir in _diskProvider.GetDirectoryInfos(sourcePath))
            {
                result &= TransferFolder(subDir.FullName, Path.Combine(targetPath, subDir.Name), mode, verified);
            }

            foreach (var sourceFile in _diskProvider.GetFileInfos(sourcePath))
            {
                var destFile = Path.Combine(targetPath, sourceFile.Name);

                result &= TransferFile(sourceFile.FullName, destFile, mode, true, verified);
            }

            if (mode.HasFlag(TransferMode.Move))
            {
                _diskProvider.DeleteFolder(sourcePath, true);
            }

            return result;
        }
开发者ID:Djohnnie,项目名称:Sonarr,代码行数:31,代码来源:DiskTransferService.cs


示例7: Init

        public override bool Init(ControlChannel controlClient, TransferMode mode)
        {
            var command = "LIST" + (string.IsNullOrWhiteSpace(infoTargetName) ? string.Empty : " " + infoTargetName);
            _dataClient = PrepareDataChannel(controlClient, mode, command);

            return true;            
        }
开发者ID:ERNICommunity,项目名称:TLAoP,代码行数:7,代码来源:DirectoryListingOperation.cs


示例8: IsDefined

 public static bool IsDefined(TransferMode v)
 {
     if (((v != TransferMode.Buffered) && (v != TransferMode.Streamed)) && (v != TransferMode.StreamedRequest))
     {
         return (v == TransferMode.StreamedResponse);
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:TransferModeHelper.cs


示例9: IsResponseStreamed

 public static bool IsResponseStreamed(TransferMode v)
 {
     if (v != TransferMode.StreamedResponse)
     {
         return (v == TransferMode.Streamed);
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:TransferModeHelper.cs


示例10: ControlChannel

 internal ControlChannel(Session host)
 {
     m_connection = new TcpClient();
     m_server = "localhost";
     m_port = 21;
     m_sessionHost = host;
     m_currentTransferMode = TransferMode.Unknown;
 }
开发者ID:avs009,项目名称:gsf,代码行数:8,代码来源:ControlChannel.cs


示例11: IsRequestStreamed

 public static bool IsRequestStreamed(TransferMode v)
 {
     if (v != TransferMode.StreamedRequest)
     {
         return (v == TransferMode.Streamed);
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:TransferModeHelper.cs


示例12: WcfConstantSettingConfig

        /// <summary>
        /// wcf服务端常量设置文件
        /// </summary>
        /// <param name="doc"></param>
        public WcfConstantSettingConfig(XmlDocument doc)
        {
            try
            {
                foreach (XmlNode elem in XmlHelper.Children(doc.DocumentElement, "NetTcpBinding"))
                {
                    XmlElement xe = XmlHelper.Child(elem, "readerQuotas");
                    int.TryParse(xe.GetAttribute("maxDepth"), out _maxDepth);
                    int.TryParse(xe.GetAttribute("maxStringContentLength"), out _maxStringContentLength);
                    int.TryParse(xe.GetAttribute("maxArrayLength"), out _maxArrayLength);
                    int.TryParse(xe.GetAttribute("maxBytesPerRead"), out _maxBytesPerRead);
                    int.TryParse(xe.GetAttribute("maxNameTableCharCount"), out _maxNameTableCharCount);

                    XmlElement xea = XmlHelper.Child(elem, "reliableSession");
                    Boolean.TryParse(xea.GetAttribute("enabled"), out _reliableSessionEnabled);
                    Boolean.TryParse(xea.GetAttribute("ordered"), out _reliableSessionOrdered);
                    TimeSpan.TryParse(xea.GetAttribute("inactivityTimeout"), out _reliableSessionInactivityTimeout);

                    XmlElement xe1 = XmlHelper.Child(elem, "host");
                    _addres = new Uri(xe1.GetAttribute("baseAddress"));
                    _binding = new NetTcpBinding();

                    XmlElement xe2 = XmlHelper.Child(elem, "behaviors");
                    TimeSpan.TryParse(xe2.GetAttribute("closeTimeout"), out _closeTimeout);
                    TimeSpan.TryParse(xe2.GetAttribute("openTimeout"), out _openTimeout);
                    TimeSpan.TryParse(xe2.GetAttribute("receiveTimeout"), out _receiveTimeout);
                    TimeSpan.TryParse(xe2.GetAttribute("sendTimeout"), out _sendTimeout);
                    Boolean.TryParse(xe2.GetAttribute("transactionFlow"), out _transactionFlow);
                    _transferMode = (TransferMode)Enum.Parse(typeof(TransferMode), xe2.GetAttribute("transferMode"));
                    _transactionProtocol = xe2.GetAttribute("transactionProtocol");
                    _hostNameComparisonMode = (HostNameComparisonMode)Enum.Parse(typeof(HostNameComparisonMode), xe2.GetAttribute("hostNameComparisonMode"));
                    int.TryParse(xe2.GetAttribute("listenBacklog"), out _listenBacklog);
                    int.TryParse(xe2.GetAttribute("maxBufferPoolSize"), out _maxBufferPoolSize);
                    int.TryParse(xe2.GetAttribute("maxBufferSize"), out _maxBufferSize);
                    int.TryParse(xe2.GetAttribute("maxConnections"), out _maxConnections);
                    int.TryParse(xe2.GetAttribute("maxReceivedMessageSize"), out _maxReceivedMessageSize);
                    bool.TryParse(xe2.GetAttribute("portSharingEnabled"), out _portSharingEnabled);
                    _securitymode = (SecurityMode)Enum.Parse(typeof(SecurityMode), xe2.GetAttribute("securitymode"));
                    _clientCredentialType = (MessageCredentialType)Enum.Parse(typeof(MessageCredentialType), xe2.GetAttribute("clientCredentialType"));
                    //_enableBinaryFormatterBehavior = bool.Parse(xe2.GetAttribute("enableBinaryFormatterBehavior"));

                    XmlElement xe3 = XmlHelper.Child(elem, "serviceDebug");
                    Boolean.TryParse(xe3.GetAttribute("includeExceptionDetailInFaults"), out _includeExceptionDetailInFaults);

                    XmlElement xe4 = XmlHelper.Child(elem, "serviceThrottling");
                    int.TryParse(xe4.GetAttribute("maxConcurrentCalls"), out _maxConcurrentCalls);
                    int.TryParse(xe4.GetAttribute("maxConcurrentInstances"), out _maxConcurrentInstances);
                    int.TryParse(xe4.GetAttribute("maxConcurrentSessions"), out _maxConcurrentSessions);

                    //XmlElement xe5 = XmlHelper.Child(elem, "dataContractSerializer");
                    //int.TryParse(xe5.GetAttribute("maxItemsInObjectGraph"), out _maxItemsInObjectGraph);
                }
            }
            catch (Exception oe)
            {
                throw new ArgumentException(oe.Message);
            }
        }
开发者ID:yaozd,项目名称:WCFPerformance,代码行数:62,代码来源:WcfConstantSettingConfig.cs


示例13: WebSocketTransportDuplexSessionChannel

 public WebSocketTransportDuplexSessionChannel(HttpChannelFactory<IDuplexSessionChannel> channelFactory, EndpointAddress remoteAddresss, Uri via)
     : base(channelFactory, channelFactory, EndpointAddress.AnonymousAddress, channelFactory.MessageVersion.Addressing.AnonymousUri, remoteAddresss, via)
 {
     Fx.Assert(channelFactory.WebSocketSettings != null, "channelFactory.WebSocketTransportSettings should not be null.");
     _webSocketSettings = channelFactory.WebSocketSettings;
     _transferMode = channelFactory.TransferMode;
     _maxBufferSize = channelFactory.MaxBufferSize;
     _transportFactorySettings = channelFactory;
 }
开发者ID:weshaggard,项目名称:wcf,代码行数:9,代码来源:WebSocketTransportDuplexSessionChannel.cs


示例14: transfer

        /*Initiates a TFTP file transfer from the server to the local machine.*/
        public bool transfer(IPEndPoint server, String filename, bool error, TransferMode mode)
        {
            if (DEBUG) { Console.WriteLine("Retrieving file " + filename + " from server at " + server.ToString() + (error ? " with errors " : " without errors ") + "using transfer mode " + (mode == TransferMode.NETASCII ? "netascii." : "octet.")); }
                IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);
                byte[] block;
                byte[] message = new byte[416];
                UInt16 blocknum;
                Int32 msgBytes = 0;
                Int32 index = 0;
                BinaryWriter fileWriter;
                UdpClient client = new UdpClient();
                fileWriter = new BinaryWriter(File.Create(filename, 512));
                requestData(client, server, filename, error, mode);
                do
                {
                    block = recieveData(client, ref sender);
                    if (DEBUG) { Console.WriteLine("Recieved datagram with length " + block.Length + " from " + sender.ToString() + "with op code " + HammingCode.getOpCode(block) + ":\n" + ASCII.GetString(block)); }

                    if (HammingCode.getOpCode(block) == 3)
                    {
                        blocknum = HammingCode.getBlockNum(block);

                        if (DEBUG) { Console.WriteLine("Recieved data packet with block number: " + blocknum); }
                        if (HammingCode.getMessage(block, block.Length, ref message, ref msgBytes))
                        {
                            fileWriter.Write(message, 0, msgBytes);
                            index += msgBytes;
                            acknowledge(client, sender, blocknum);
                        }
                        else
                        {
                            nacknowledge(client, sender, blocknum);
                            continue;
                        }
                    }
                    else if (HammingCode.getOpCode(block) == 5) //error
                    {
                        Console.WriteLine("Error encountered. Terminating file transfer.");
                        client.Close();
                        fileWriter.Close();
                        File.Delete(filename);
                        return false;
                    }
                    else //wtf?
                    {
                        Console.WriteLine("Recieved packet with unexpected op code. Terminating file transfer.");
                        client.Close();
                        fileWriter.Close();
                        File.Delete(filename);
                        return false;
                    }
                }
                while (block.Length > 515);
                fileWriter.Close();
                return true;
        }
开发者ID:vnwhlr,项目名称:Schoolwork,代码行数:57,代码来源:TFTP.cs


示例15: ServiceConfigurationAttribute

 public ServiceConfigurationAttribute(string behaviorConfiguration, bool customErrorHandler, TransferMode transferMode, 
     InstanceContextMode instanceContextMode, ConcurrencyMode concurencyMode, params string[] bindingConfiguration)
 {
     InstanceContextMode = instanceContextMode;
     ConcurrencyMode = concurencyMode;
     CustomErrorHandler = customErrorHandler;
     TransferMode = transferMode;
     BehaviorConfiguration = behaviorConfiguration;
     BindingConfiguration = bindingConfiguration;
 }
开发者ID:huoxudong125,项目名称:WcfRestContrib,代码行数:10,代码来源:ServiceConfigurationAttribute.cs


示例16: FileTransferDialog

 public FileTransferDialog(string file, string destinationdir, TransferMode mode)
 {
     InitializeComponent();
     m_filelist = new List<string>(1);
     m_filelist.Add(file);
     m_filecount = 1;
     m_destination = destinationdir;
     trans = mode;
     GetMaxBytesForTransfer();
     m_thrtransfer = new Thread(new ThreadStart(ThreadTransfer));
 }
开发者ID:ChaosEmerald95,项目名称:ExplorerPlus,代码行数:11,代码来源:FileTransferDialog.cs


示例17: SendAsync_Direct_Returns_OK_For_Successful_ObjectContent_Write

        public void SendAsync_Direct_Returns_OK_For_Successful_ObjectContent_Write(string uri, TransferMode transferMode)
        {
            // Arrange & Act
            server = CreateServer(transferMode);
            HttpResponseMessage response = new HttpClient().GetAsync(BaseUri(transferMode) + uri).Result;
            string responseString = response.Content.ReadAsStringAsync().Result;

            // Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Equal("\"echoString\"", responseString);
        }
开发者ID:normalian,项目名称:aspnetwebstack,代码行数:11,代码来源:HttpSelfHostServerTest.cs


示例18: GetModeString

 protected static string GetModeString(TransferMode mode)
 {
     switch (mode) {
     case TransferMode.Chunked:
         return "chunked";
     case TransferMode.ContentLength:
         return "length";
     default:
         return "default";
     }
 }
开发者ID:pjbeaman,项目名称:bugfree-octo-nemesis,代码行数:11,代码来源:AbstractPuppy.cs


示例19: AmqpChannelProperties

 internal AmqpChannelProperties()
 {
     this.brokerHost = AmqpDefaults.BrokerHost;
     this.brokerPort = AmqpDefaults.BrokerPort;
     this.transferMode = AmqpDefaults.TransferMode;
     this.defaultMessageProperties = null;
     this.amqpSecurityMode = AmqpSecurityMode.None;
     this.amqpTransportSecurity = null;
     this.amqpCredential = null;
     this.maxBufferPoolSize = AmqpDefaults.MaxBufferPoolSize;
     this.maxReceivedMessageSize = AmqpDefaults.MaxReceivedMessageSize;
 }
开发者ID:ncdc,项目名称:qpid,代码行数:12,代码来源:AmqpChannelHelpers.cs


示例20: SetBalance

        void SetBalance(ListParameter parameter, TransferMode transferMode)
        {
            int cyanRed = (parameter[0] as LongParameter).Value;
              int magentaGreen = (parameter[1] as LongParameter).Value;
              int yellowBlue = (parameter[2] as LongParameter).Value;

              if (cyanRed != 0 || magentaGreen != 0 || yellowBlue != 0)
            {
              ActiveDrawable.ColorBalance(transferMode, _preserveLuminosity,
                      cyanRed, magentaGreen, yellowBlue);
            }
        }
开发者ID:unhammer,项目名称:gimp-sharp,代码行数:12,代码来源:ColorBalanceEvent.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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