Inheritance: ViewModelBase
Example #1
0
            public OutputListenerViewModel(SettingViewModel owner, System.Net.IPEndPoint endpoint)
            {
                this.owner = owner;
                if (endpoint.Address.Equals(System.Net.IPAddress.Any))
                {
                    address = "IPv4 Any";
                }
                else if (endpoint.Address.Equals(System.Net.IPAddress.IPv6Any))
                {
                    address = "IPv6 Any";
                }
                else
                {
                    address = endpoint.Address.ToString();
                }
                port               = endpoint.Port;
                globalRelay        = true;
                globalPlay         = false;
                globalInterface    = false;
                globalAuthRequired = true;
                localRelay         = true;
                localPlay          = true;
                localInterface     = true;
                localAuthRequired  = false;
                var authkey = AuthenticationKey.Generate();

                authId            = authkey.Id;
                authPassword      = authkey.Password;
                isOpen            = null;
                RegenerateAuthKey = new Command(DoRegenerateAuthKey);
            }
 internal SettingsDialog(PeerCastApplication app)
 {
   var viewmodel = new SettingViewModel(app);
   this.viewModel = viewmodel;
   this.DataContext = viewmodel;
   InitializeComponent();
 }
Example #3
0
 public OutputListenerViewModel(SettingViewModel owner, OutputListener model)
 {
     this.owner = owner;
     if (model.LocalEndPoint.Address.Equals(System.Net.IPAddress.Any))
     {
         address = "IPv4 Any";
     }
     else if (model.LocalEndPoint.Address.Equals(System.Net.IPAddress.IPv6Any))
     {
         address = "IPv6 Any";
     }
     else
     {
         address = model.LocalEndPoint.Address.ToString();
     }
     port               = model.LocalEndPoint.Port;
     globalRelay        = (model.GlobalOutputAccepts & OutputStreamType.Relay) != 0;
     globalPlay         = (model.GlobalOutputAccepts & OutputStreamType.Play) != 0;
     globalInterface    = (model.GlobalOutputAccepts & OutputStreamType.Interface) != 0;
     globalAuthRequired = model.GlobalAuthorizationRequired;
     localRelay         = (model.LocalOutputAccepts & OutputStreamType.Relay) != 0;
     localPlay          = (model.LocalOutputAccepts & OutputStreamType.Play) != 0;
     localInterface     = (model.LocalOutputAccepts & OutputStreamType.Interface) != 0;
     localAuthRequired  = model.LocalAuthorizationRequired;
     authId             = model.AuthenticationKey != null ? model.AuthenticationKey.Id : null;
     authPassword       = model.AuthenticationKey != null ? model.AuthenticationKey.Password : null;
     isOpen             = null;
     RegenerateAuthKey  = new Command(DoRegenerateAuthKey);
 }
 public OutputListenerViewModel(SettingViewModel owner, OutputListener model)
 {
   this.owner = owner;
   if (model.LocalEndPoint.Address.Equals(System.Net.IPAddress.Any)) {
     address = "IPv4 Any";
   }
   else if (model.LocalEndPoint.Address.Equals(System.Net.IPAddress.IPv6Any)) {
     address = "IPv6 Any";
   }
   else {
     address = model.LocalEndPoint.Address.ToString();
   }
   port    = model.LocalEndPoint.Port;
   globalRelay     = (model.GlobalOutputAccepts & OutputStreamType.Relay)!=0;
   globalPlay      = (model.GlobalOutputAccepts & OutputStreamType.Play)!=0;
   globalInterface = (model.GlobalOutputAccepts & OutputStreamType.Interface)!=0;
   globalAuthRequired = model.GlobalAuthorizationRequired;
   localRelay      = (model.LocalOutputAccepts & OutputStreamType.Relay)!=0;
   localPlay       = (model.LocalOutputAccepts & OutputStreamType.Play)!=0;
   localInterface  = (model.LocalOutputAccepts & OutputStreamType.Interface)!=0;
   localAuthRequired = model.LocalAuthorizationRequired;
   authId       = model.AuthenticationKey!=null ? model.AuthenticationKey.Id : null;
   authPassword = model.AuthenticationKey!=null ? model.AuthenticationKey.Password : null;
   isOpen = null;
   RegenerateAuthKey = new Command(DoRegenerateAuthKey);
 }
 internal YellowPageClientViewModel(
     SettingViewModel owner,
     IYellowPageClient model)
 {
     this.owner    = owner;
     this.name     = model.Name;
     this.uri      = model.Uri;
     this.protocol = owner.peerCast.YellowPageFactories.FirstOrDefault(factory => factory.Protocol == model.Protocol);
 }
        internal PeerCastAppViewModel(PeerCastApplication application)
        {
            this.application = application;
              var peerCast = application.PeerCast;
              channelList = new ChannelListViewModel(peerCast);
              setting = new SettingViewModel(application);

              peerCast.ChannelAdded += OnChannelChanged;
              peerCast.ChannelRemoved += OnChannelChanged;
        }
            public CheckBandwidthCommand(SettingViewModel owner)
            {
                this.owner = owner;
                Uri target_uri;

                if (AppSettingsReader.TryGetUri("BandwidthChecker", out target_uri))
                {
                    this.checker = new BandwidthChecker(target_uri);
                    this.checker.BandwidthCheckCompleted += checker_BandwidthCheckCompleted;
                }
                else
                {
                    canExecute = false;
                }
            }
Example #8
0
        internal MainViewModel(PeerCastApplication application)
        {
            this.application = application;
              var peerCast = application.PeerCast;
              channelList = new ChannelListViewModel(peerCast);
              setting = new SettingViewModel(application);

              timer = new DispatcherTimer(
            TimeSpan.FromSeconds(1),
            DispatcherPriority.Normal, (sender, e) => UpdateStatus(),
            Application.Current.Dispatcher);

              peerCast.ChannelAdded += OnChannelChanged;
              peerCast.ChannelRemoved += OnChannelChanged;
        }
 public OutputListenerViewModel(SettingViewModel owner, int new_port)
 {
   this.owner = owner;
   address = "IPv4 Any";
   port    = new_port;
   globalRelay     = true;
   globalPlay      = false;
   globalInterface = false;
   globalAuthRequired = true;
   localRelay      = true;
   localPlay       = true;
   localInterface  = true;
   localAuthRequired = false;
   var authkey = AuthenticationKey.Generate();
   authId       = authkey.Id;
   authPassword = authkey.Password;
   isOpen = null;
   RegenerateAuthKey = new Command(DoRegenerateAuthKey);
 }
Example #10
0
            public OutputListenerViewModel(SettingViewModel owner, int new_port)
            {
                this.owner         = owner;
                address            = "IPv4 Any";
                port               = new_port;
                globalRelay        = true;
                globalPlay         = false;
                globalInterface    = false;
                globalAuthRequired = true;
                localRelay         = true;
                localPlay          = true;
                localInterface     = true;
                localAuthRequired  = false;
                var authkey = AuthenticationKey.Generate();

                authId            = authkey.Id;
                authPassword      = authkey.Password;
                isOpen            = null;
                RegenerateAuthKey = new Command(DoRegenerateAuthKey);
            }
Example #11
0
 internal YellowPageClientViewModel(SettingViewModel owner)
 {
     this.owner    = owner;
     this.protocol = owner.peerCast.YellowPageFactories.FirstOrDefault();
 }
 public CheckBandwidthCommand(SettingViewModel owner)
 {
   this.owner = owner;
   Uri target_uri;
   if (AppSettingsReader.TryGetUri("BandwidthChecker", out target_uri)) {
     this.checker = new BandwidthChecker(target_uri);
     this.checker.BandwidthCheckCompleted += checker_BandwidthCheckCompleted;
   }
   else {
     canExecute = false;
   }
 }
 internal YellowPageClientViewModel(SettingViewModel owner)
 {
   this.owner = owner;
   this.protocol = owner.peerCast.YellowPageFactories.FirstOrDefault();
 }
 internal YellowPageClientViewModel(
     SettingViewModel owner,
     IYellowPageClient model)
 {
   this.owner       = owner;
   this.name        = model.Name;
   this.announceUri = model.AnnounceUri;
   this.channelsUri = model.ChannelsUri;
   this.protocol    = owner.peerCast.YellowPageFactories.FirstOrDefault(factory => factory.Protocol==model.Protocol);
 }
 internal YellowPageClientViewModel(SettingViewModel owner)
 {
     this.owner = owner;
     var yp_protocol = owner.peerCast.YellowPageFactories.FirstOrDefault();
     if (yp_protocol!=null) {
       protocol = yp_protocol.Protocol;
     }
 }
 internal YellowPageClientViewModel(
     SettingViewModel owner,
     IYellowPageClient model)
 {
     this.owner = owner;
     this.name     = model.Name;
     this.uri      = model.Uri;
     this.protocol = model.Protocol;
 }