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


C# Channel.ToString方法代码示例

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


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

示例1: Should_return_the_correct_site_based_on_the_originating_site_header

        public void Should_return_the_correct_site_based_on_the_originating_site_header()
        {
            var router = new OriginatingSiteHeaderRouter();

            var message = new TransportMessage();

            var defaultChannel = new Channel
                                     {
                                         Type = "http",
                                         Address = "http://x.y"

                                     };

            message.Headers.Add(Headers.OriginatingSite, defaultChannel.ToString());

            Assert.AreEqual(defaultChannel, router.GetDestinationSitesFor(message).First().Channel);
        }
开发者ID:kashyapus,项目名称:NServiceBus,代码行数:17,代码来源:When_routing_a_reply_message.cs

示例2: DownloadLatestVersion

        /// <summary>
        /// Downloads the latest build for the given channel into the "/Update" folder.
        /// </summary>
        public static bool DownloadLatestVersion( Channel channel )
        {
            try
            {
                Directory.CreateDirectory( @"LANdrop\Update" );
                string fileName = Path.Combine( @"LANdrop\Update", String.Format( "LANdrop_{0}{1}.exe", ChannelFunctions.ToUrlPart( LastVersionInfo[channel].Channel ), LastVersionInfo[channel].BuildNumber ) );
                string tempFileName = fileName + ".part";

                // Download the file.
                new WebClient( ).DownloadFile( ServerAddress + "/files/" + channel.ToString( ).ToLower( ) + "/" + LastVersionInfo[channel].BuildNumber + "/LANdrop.exe", tempFileName );

                // Success! Remove other updates and the .part suffix.
                foreach ( var file in new DirectoryInfo( @"LANdrop\Update" ).GetFiles( "LANdrop_" + ChannelFunctions.ToUrlPart( channel ) + "*.exe" ) )
                    File.Delete( file.FullName );

                File.Move( tempFileName, fileName );
                LastDownloadedBuild[channel] = LastVersionInfo[channel];
                return true;
            }
            catch ( WebException ) { return false; }
        }
开发者ID:phillco,项目名称:LANdrop,代码行数:24,代码来源:BuildDownloader.cs

示例3: Emit

        /// <summary>
        ///     Emit a message to all listeners
        /// </summary>
        /// <param name="channel">The channel to emit on</param>
        /// <param name="data">The data to send</param>
        /// <param name="global">Should the data be sent to other processes</param>
        private static void Emit(Channel channel, string data, bool global = false)
        {
            if (global)
            {
                var transport = new JObject {{"channel", channel.ToString()}, {"data", data}};
                if (channel != Channel.Log)
                    Log.Entry(LogName, transport.ToString());
                SendMessage(transport.ToString());

                // If this bus instance is a client, wait for the event to be bounced-back before processing
                if (_client != null)
                    return;
            }
            if (channel != Channel.Log)
                Log.Entry(LogName, "Emmiting message on channel: " + channel);

            if (!Registrar.ContainsKey(channel)) return;
            try
            {
                var json = JObject.Parse(data);
                foreach (var action in Registrar[channel])
                    action.Invoke(json);
            }
            catch (Exception ex)
            {
                Log.Error(LogName, "Unable to parse data");
                Log.Error(LogName, ex);
            }
        }
开发者ID:jbob182,项目名称:zazzles,代码行数:35,代码来源:Bus.cs

示例4: GetMute

 public bool GetMute(Channel channel)
 {
     return UPnP.InvokeAction<bool>(_service, "GetMute", InstanceId, channel.ToString());
 }
开发者ID:NathanHowell,项目名称:Sonority,代码行数:4,代码来源:RenderingControl.cs

示例5: SetVolumeDB

 public void SetVolumeDB(Channel channel, short desiredVolume)
 {
     UPnP.InvokeAction(_service, "SetVolumeDB", InstanceId, channel.ToString(), desiredVolume);
 }
开发者ID:NathanHowell,项目名称:Sonority,代码行数:4,代码来源:RenderingControl.cs

示例6: SetRelativeVolume

 public ushort SetRelativeVolume(Channel channel, int adjustment)
 {
     return UPnP.InvokeAction<ushort>(_service, "SetRelativeVolume", InstanceId, channel.ToString(), adjustment);
 }
开发者ID:NathanHowell,项目名称:Sonority,代码行数:4,代码来源:RenderingControl.cs

示例7: SetMute

 public void SetMute(Channel channel, bool desiredMute)
 {
     UPnP.InvokeAction(_service, "SetMute", InstanceId, channel.ToString(), desiredMute);
 }
开发者ID:NathanHowell,项目名称:Sonority,代码行数:4,代码来源:RenderingControl.cs

示例8: SetLoudness

 public void SetLoudness(Channel channel, bool desiredLoudness)
 {
     UPnP.InvokeAction(_service, "SetLoudness", InstanceId, channel.ToString(), desiredLoudness);
 }
开发者ID:NathanHowell,项目名称:Sonority,代码行数:4,代码来源:RenderingControl.cs

示例9: RestoreVolumePriorToRamp

 public void RestoreVolumePriorToRamp(Channel channel)
 {
     UPnP.InvokeAction(_service, "RestoreVolumePriorToRamp", InstanceId, channel.ToString());
 }
开发者ID:NathanHowell,项目名称:Sonority,代码行数:4,代码来源:RenderingControl.cs

示例10: RampToVolume

 public uint RampToVolume(Channel channel, RampType rampType, short desiredVolume)
 {
     return UPnP.InvokeAction<uint>(_service, "RampToVolume", InstanceId, channel.ToString(), rampType.ToString(), desiredVolume);
 }
开发者ID:NathanHowell,项目名称:Sonority,代码行数:4,代码来源:RenderingControl.cs

示例11: GetVolumeDBRange

 public void GetVolumeDBRange(Channel channel)
 {
     // TODO: return MinValue/MaxValue
     object[] results = UPnP.InvokeAction(_service, "GetVolumeDBRange", InstanceId, channel.ToString());
 }
开发者ID:NathanHowell,项目名称:Sonority,代码行数:5,代码来源:RenderingControl.cs

示例12: GetVolumeDB

 public short GetVolumeDB(Channel channel)
 {
     return UPnP.InvokeAction<short>(_service, "GetVolumeDB", InstanceId, channel.ToString());
 }
开发者ID:NathanHowell,项目名称:Sonority,代码行数:4,代码来源:RenderingControl.cs

示例13: ToUrlPart

 public static string ToUrlPart( Channel channel )
 {
     return channel.ToString( ).ToLower( );
 }
开发者ID:phillco,项目名称:LANdrop,代码行数:4,代码来源:Channel.cs

示例14: ChannelToIndex

 private int ChannelToIndex(Channel channel)
 {
     string s = channel.ToString();
     s = s.Replace("Channel", "");
     int index = Convert.ToInt32(s) - 1;
     if (index >= 11) // we skip channel 10 so subtract one to get the track number
         index--;
     return index;
 }
开发者ID:jg1lbert,项目名称:textplayer,代码行数:9,代码来源:MidiDevice.cs

示例15: AddChannel

        TSQueue<float> AddChannel(Channel channel)
        {
            lock(dictionary)
            {
                //Check if channel is already in use
                if(dictionary.ContainsKey(channel))
                    throw new Exception(String.Format("Session already uses {0}", channel.ToString()[0])); //!!Possible bug

                TTLChannel ttlChannel = GetChannel(encoder, channel);
                TSQueue<float> queue = new TSQueue<float>();
                dictionary.Add(channel, new ChannelQueue(ttlChannel, queue));
                return queue;
            }
        }
开发者ID:Faham,项目名称:emophiz,代码行数:14,代码来源:LiveSessionComEvent.cs


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