public BroadcastViewModel(PeerCast peerCast)
        {
            this.peerCast = peerCast;
              this.uiSettings = new UISettingsViewModel(PeerCastApplication.Current.Settings);
              start = new Command(OnBroadcast, () => CanBroadcast(StreamSource, ContentType, channelName));
              contentTypes = peerCast.ContentReaderFactories.ToArray();

              yellowPages = Enumerable.Repeat(new KeyValuePair<string,IYellowPageClient>("掲載なし", null),1)
            .Concat(peerCast.YellowPages.Select(yp => new KeyValuePair<string,IYellowPageClient>(yp.Name, yp)));
              if (contentTypes.Length > 0) contentType = contentTypes[0];

              this.SelectedSourceStream = SourceStreams.FirstOrDefault();
        }
Exemplo n.º 2
0
        public BroadcastViewModel(PeerCast peerCast)
        {
            this.peerCast   = peerCast;
            this.uiSettings = new UISettingsViewModel(PeerCastApplication.Current.Settings);
            start           = new Command(OnBroadcast, () => CanBroadcast(StreamSource, ContentType, channelName));
            contentTypes    = peerCast.ContentReaderFactories.ToArray();

            yellowPages = Enumerable.Repeat(new KeyValuePair <string, IYellowPageClient>("掲載なし", null), 1)
                          .Concat(peerCast.YellowPages.Select(yp => new KeyValuePair <string, IYellowPageClient>(yp.Name, yp)));
            if (contentTypes.Length > 0)
            {
                contentType = contentTypes[0];
            }

            this.SelectedSourceStream = SourceStreams.FirstOrDefault();
        }
        public ActionResult UpsertUISettings(UISettingsViewModel model)
        {
            if (!ModelState.IsValid)
            {
                this.InitViewTitleAndBreadcrumbs(
                    Resource.UISettings,
                    new[] { new Breadcrumb {
                                Title = Resource.Settings
                            } });
                return(View(model));
            }

            using (var transaction = ContextManager.NewTransaction())
            {
                adminService.UpsertUISettings(Mapper.Map <UISettingsModel>(model));

                transaction.Commit();
            }

            this.ShowMessage(MessageType.Success, Resource.ChangesSuccessfullySaved);
            return(RedirectToDefault());
        }