Inheritance: TabItemViewModel
Exemple #1
0
        //URLから適当なViewを開く
        public static TabItemViewModel Replace(TabItemViewModel old, string url)
        {
            if(Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift)) {

                System.Diagnostics.Process.Start(url);
                return null;
            }

            if(url.StartsWith("http://www.nicovideo.jp/watch/")) {

                var vm = new VideoViewModel(url);
                App.ViewModelRoot.ReplaceTabAndSetCurrent(old, vm);
                return vm;
            } else if(url.StartsWith("http://www.nicovideo.jp/user/")) {

                var vm = new UserViewModel(url);
                App.ViewModelRoot.ReplaceTabAndSetCurrent(old, vm);
                return vm;
            } else if(url.StartsWith("http://www.nicovideo.jp/mylist/")) {

                var vm = new PublicMylistViewModel(url);
                App.ViewModelRoot.ReplaceTabAndSetCurrent(old, vm);
                return vm;
            } else if(url.StartsWith("http://com.nicovideo.jp/community/")) {

                var vm = new CommunityViewModel(url);
                App.ViewModelRoot.ReplaceTabAndSetCurrent(old, vm);
                return vm;
            } /*else if(url.StartsWith("http://live.nicovideo.jp/watch/")) {

                var vm = new LiveViewModel(url);
                App.ViewModelRoot.ReplaceTabAndSetCurrent(old, vm);
                return vm;
            }*/ else {

                System.Diagnostics.Process.Start(url);
                return null;
            }
        }
Exemple #2
0
        //URLから適当なViewを開く
        public static TabItemViewModel Open(string url, bool addtab = true)
        {
            /*if(Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift)) {

                System.Diagnostics.Process.Start(url);
                return null;
            }*/

            if(url.StartsWith("http://www.nicovideo.jp/watch/")) {

                var vm = new VideoViewModel(url);

                if(addtab) {

                    App.ViewModelRoot.AddTabAndSetCurrent(vm);
                }
                return vm;
            } else if(url.StartsWith("http://www.nicovideo.jp/user/")) {

                var vm = new UserViewModel(url);

                if(addtab) {

                    App.ViewModelRoot.AddTabAndSetCurrent(vm);
                }
                return vm;
            } else if(url.StartsWith("http://www.nicovideo.jp/mylist/")) {

                var vm = new PublicMylistViewModel(url);

                if(addtab) {

                    App.ViewModelRoot.AddTabAndSetCurrent(vm);
                }
                return vm;
            } else if(url.StartsWith("http://com.nicovideo.jp/community/")) {

                var vm = new CommunityViewModel(url);

                if(addtab) {

                    App.ViewModelRoot.AddTabAndSetCurrent(vm);
                }
                return vm;
            } /*else if(url.StartsWith("http://live.nicovideo.jp/watch/")) {

                var vm = new LiveViewModel(url);
                App.ViewModelRoot.AddTabAndSetCurrent(vm);
                return vm;
            }*/ else {

                System.Diagnostics.Process.Start(url);
                return null;
            }
        }
 public UserMylistViewModel(UserViewModel vm)
     : base("マイリスト")
 {
     User = vm;
     UserMylistList = new DispatcherCollection<NicoNicoUserMylistEntry>(DispatcherHelper.UIDispatcher);
 }
        public UserVideoViewModel(UserViewModel vm) : base("投稿動画") {

            User = vm;
            UserVideoList = new DispatcherCollection<SearchResultEntryViewModel>(DispatcherHelper.UIDispatcher);
        }
Exemple #5
0
 public UserMylistViewModel(UserViewModel vm) : base("マイリスト")
 {
     User           = vm;
     UserMylistList = new DispatcherCollection <NicoNicoUserMylistEntry>(DispatcherHelper.UIDispatcher);
 }
        public UserNicoRepoViewModel(UserViewModel user) : base("ニコレポ") {

            User = user;
            UserNicoRepoList = new DispatcherCollection<NicoRepoResultEntryViewModel>(DispatcherHelper.UIDispatcher);

        }
 public NicoNicoUser(UserViewModel vm, string pageUrl)
 {
     Owner = vm;
     UserPage = pageUrl;
 }