本文整理汇总了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);
});
}
示例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;
}
示例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))
);
}
示例4: RelayTreeViewModel
public RelayTreeViewModel(PeerCast peerCast)
{
this.peerCast = peerCast;
this.RelayTree = new RelayTreeNodeViewModel[0];
refresh = new Command(
() => Update(this.channel),
() => channel!=null);
}
示例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;
}
示例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);
}
示例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;
}
示例8: PCPSourceConnection
public PCPSourceConnection(
PeerCast peercast,
Channel channel,
Uri source_uri,
RemoteHostStatus remote_type)
: base(peercast, channel, source_uri)
{
remoteType = remote_type;
}
示例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;
}
示例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);
}
示例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);
}
示例12: NotifyIconManager
public NotifyIconManager(PeerCast peerCast)
{
notifyIcon = CreateNotifyIcon(peerCast);
notifyIcon.BalloonTipClicked += (sender, e) => {
if (newVersionInfo == null)
return;
new UpdaterWindow() {
DataContext = new UpdaterViewModel(newVersionInfo)
}.Show();
};
}
示例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;
}
示例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;
}
示例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());
}