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


C# Core.PeerCast类代码示例

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


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

示例1: YellowPagesEditViewModel

        internal YellowPagesEditViewModel(PeerCast peerCast)
        {
            protocols = peerCast.YellowPageFactories
            .Select(factory => new YellowPageFactoryItem(factory)).ToArray();
              add = new Command(() =>
              {
            if (String.IsNullOrEmpty(Name)
            || SelectedProtocol == null)
              return;
            var factory = SelectedProtocol.Factory;
            var protocol = factory.Protocol;
            if (String.IsNullOrEmpty(protocol))
              return;

            Uri uri;
            var md = Regex.Match(Address, @"\A([^:/]+)(:(\d+))?\Z");
            if (md.Success &&
              Uri.CheckHostName(md.Groups[1].Value) != UriHostNameType.Unknown &&
              Uri.TryCreate(protocol + "://" + Address, UriKind.Absolute, out uri) &&
              factory.CheckURI(uri))
            {
            }
            else if (Uri.TryCreate(Address, UriKind.Absolute, out uri) &&
              factory.CheckURI(uri))
            {
            }
            else
            {
              return;
            }

            peerCast.AddYellowPage(protocol, Name, uri);
              });
        }
开发者ID:psjp,项目名称:peercaststation,代码行数:34,代码来源:YellowPagesEditViewModel.cs

示例2: OutputStreamBase

 public OutputStreamBase(
     PeerCast peercast,
     Stream input_stream,
     Stream output_stream,
     EndPoint remote_endpoint,
     AccessControlInfo access_control,
     Channel channel,
     byte[] header)
 {
     this.PeerCast = peercast;
       this.InputStream = input_stream;
       this.OutputStream = output_stream;
       this.RemoteEndPoint = remote_endpoint;
       this.AccessControl = access_control;
       this.Channel = channel;
       var ip = remote_endpoint as IPEndPoint;
       this.IsLocal = ip!=null ? Utils.IsSiteLocal(ip.Address) : true;
       this.IsStopped = false;
       this.mainThread = new Thread(MainProc);
       this.mainThread.Name = String.Format("{0}:{1}", this.GetType().Name, remote_endpoint);
       this.SyncContext = new QueuedSynchronizationContext();
       this.Logger = new Logger(this.GetType());
       if (header!=null) {
     this.recvStream.Write(header, 0, header.Length);
       }
       this.SendTimeout = 10000;
 }
开发者ID:psjp,项目名称:peercaststation,代码行数:27,代码来源:OutputStreamBase.cs

示例3: SettingViewModel

 internal SettingViewModel(PeerCastApplication peca_app)
 {
     this.pecaApp = peca_app;
       this.peerCast = peca_app.PeerCast;
       this.AddPortCommand = new Command(() => AddPort());
       this.RemovePortCommand = new Command(() => RemovePort(), () => SelectedPort!=null);
       this.AddYellowPageCommand = new Command(() => AddYellowPage());
       this.RemoveYellowPageCommand = new Command(() => RemoveYellowPage(), () => SelectedYellowPage!=null);
       this.CheckBandwidth = new CheckBandwidthCommand(this);
       channelCleanupMode = ChannelCleaner.Mode;
       channelCleanupInactiveLimit = ChannelCleaner.InactiveLimit/60000;
       maxRelays           = peerCast.AccessController.MaxRelays;
       maxRelaysPerChannel = peerCast.AccessController.MaxRelaysPerChannel;
       maxPlays            = peerCast.AccessController.MaxPlays;
       maxPlaysPerChannel  = peerCast.AccessController.MaxPlaysPerChannel;
       maxUpstreamRate           = peerCast.AccessController.MaxUpstreamRate;
       maxUpstreamRatePerChannel = peerCast.AccessController.MaxUpstreamRatePerChannel;
       isShowWindowOnStartup = pecaApp.Settings.Get<WPFSettings>().ShowWindowOnStartup;
       ports = new ObservableCollection<OutputListenerViewModel>(
     peerCast.OutputListeners
     .Select(listener => new OutputListenerViewModel(this, listener))
       );
       yellowPages = new ObservableCollection<YellowPageClientViewModel>(
     peerCast.YellowPages
     .Select(yp => new YellowPageClientViewModel(this, yp))
       );
 }
开发者ID:peca-dev,项目名称:peercaststation,代码行数:27,代码来源:SettingViewModel.cs

示例4: RelayTreeViewModel

 public RelayTreeViewModel(PeerCast peerCast)
 {
   this.peerCast = peerCast;
   this.RelayTree = new RelayTreeNodeViewModel[0];
   refresh = new Command(
     () => Update(this.channel),
     () => channel!=null);
 }
开发者ID:kumaryu,项目名称:peercaststation,代码行数:8,代码来源:RelayTreeViewModel.cs

示例5: PCPYellowPageClient

 public PCPYellowPageClient(PeerCast peercast, string name, Uri uri)
 {
     this.PeerCast = peercast;
       this.Name = name;
       this.Uri = uri;
       this.Logger = new Logger(this.GetType());
       this.AnnouncingStatus = AnnouncingStatus.Idle;
 }
开发者ID:psjp,项目名称:peercaststation,代码行数:8,代码来源:PCPYellowPageClient.cs

示例6: HTTPDummyOutputStream

 public HTTPDummyOutputStream(
     PeerCast peercast,
     Stream input_stream,
     Stream output_stream,
     EndPoint remote_endpoint)
     : base(peercast, input_stream, output_stream, remote_endpoint, null, null)
 {
     Logger.Debug("Initialized: Remote {0}", remote_endpoint);
 }
开发者ID:j0hn---,项目名称:peercaststation,代码行数:9,代码来源:HTTPDummyOutputStream.cs

示例7: BroadcastDialog

 public BroadcastDialog(PeerCast peercast)
 {
   peerCast = peercast;
   InitializeComponent();
   bcContentType.Items.AddRange(peerCast.ContentReaderFactories.Select(reader => new ContentReaderItem(reader)).ToArray());
   bcYP.Items.AddRange(peerCast.YellowPages.Select(yp => new YellowPageItem(yp)).ToArray());
   if (bcContentType.Items.Count>0) bcContentType.SelectedIndex = 0;
   if (bcYP.Items.Count>0) bcYP.SelectedIndex = 0;
 }
开发者ID:kumaryu,项目名称:peercaststation,代码行数:9,代码来源:BroadcastDialog.cs

示例8: PCPSourceConnection

 public PCPSourceConnection(
     PeerCast peercast,
     Channel  channel,
     Uri      source_uri,
     RemoteHostStatus remote_type)
     : base(peercast, channel, source_uri)
 {
     remoteType = remote_type;
 }
开发者ID:peca-dev,项目名称:peercaststation,代码行数:9,代码来源:PCPSourceStream.cs

示例9: BroadcastChannel

 public BroadcastChannel(
     PeerCast peercast,
     Guid channel_id,
     ChannelInfo channel_info,
     IContentReaderFactory content_reader_factory)
     : base(peercast, channel_id)
 {
     this.ChannelInfo = channel_info;
       this.ContentReaderFactory = content_reader_factory;
 }
开发者ID:psjp,项目名称:peercaststation,代码行数:10,代码来源:BroadcastChannel.cs

示例10: PCPPongOutputStream

 public PCPPongOutputStream(
     PeerCast peercast,
     Stream input_stream,
     Stream output_stream,
     IPEndPoint endpoint,
     byte[] header)
     : base(peercast, input_stream, output_stream, endpoint, null, header)
 {
     Logger.Debug("Initialized: Remote {0}", endpoint);
 }
开发者ID:j0hn---,项目名称:peercaststation,代码行数:10,代码来源:PCPPongOutputStream.cs

示例11: ConnectionListViewModel

        public ConnectionListViewModel(PeerCast peerCast)
        {
            this.peerCast = peerCast;

              close = new Command(
            () => connection.Disconnect(),
            () => connection != null && connection.IsDisconnectable);
              reconnect = new Command(
            () => connection.Reconnect(),
            () => connection != null && connection.IsReconnectable);
        }
开发者ID:psjp,项目名称:peercaststation,代码行数:11,代码来源:ConnectionListViewModel.cs

示例12: NotifyIconManager

        public NotifyIconManager(PeerCast peerCast)
        {
            notifyIcon = CreateNotifyIcon(peerCast);
              notifyIcon.BalloonTipClicked += (sender, e) => {
            if (newVersionInfo == null)
              return;

            new UpdaterWindow() {
              DataContext = new UpdaterViewModel(newVersionInfo)
            }.Show();
              };
        }
开发者ID:psjp,项目名称:peercaststation,代码行数:12,代码来源:NotifyIconManager.cs

示例13: SourceConnectionBase

 public SourceConnectionBase(
     PeerCast peercast,
     Channel  channel,
     Uri      source_uri)
 {
   this.PeerCast      = peercast;
   this.Channel       = channel;
   this.SourceUri     = source_uri;
   this.StoppedReason = StopReason.None;
   this.Logger        = new Logger(this.GetType());
   this.Status        = ConnectionStatus.Idle;
 }
开发者ID:kumaryu,项目名称:peercaststation,代码行数:12,代码来源:SourceConnectionBase.cs

示例14: HTTPDummyOutputStream

 public HTTPDummyOutputStream(
     PeerCast peercast,
     Stream input_stream,
     Stream output_stream,
     EndPoint remote_endpoint,
     AccessControlInfo access_control,
     HTTPRequest req)
     : base(peercast, input_stream, output_stream, remote_endpoint, access_control, null, null)
 {
     Logger.Debug("Initialized: Remote {0}", remote_endpoint);
       this.request = req;
 }
开发者ID:At-sushi,项目名称:peercaststation,代码行数:12,代码来源:HTTPDummyOutputStream.cs

示例15: SourceConnectionBase

 public SourceConnectionBase(
     PeerCast peercast,
     Channel channel,
     Uri source_uri)
 {
     this.PeerCast      = peercast;
       this.Channel       = channel;
       this.SourceUri     = source_uri;
       this.StoppedReason = StopReason.None;
       this.SyncContext   = new QueuedSynchronizationContext();
       this.Logger        = new Logger(this.GetType());
 }
开发者ID:At-sushi,项目名称:peercaststation,代码行数:12,代码来源:SourceConnectionBase.cs


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