當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。