private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            var sc = Log.Template.FindName("LogScroll", Log) as ScrollViewer;

            sc?.ScrollToEnd();
            showChat.IsChecked    = ConfigData.ShowChat;
            showPresent.IsChecked = ConfigData.ShowPresent;
            try
            {
                var isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User |
                                                            IsolatedStorageScope.Domain |
                                                            IsolatedStorageScope.Assembly, null, null);
                var settingsreader =
                    new XmlSerializer(typeof(StoreModel));
                var reader = new StreamReader(new IsolatedStorageFileStream(
                                                  "settings.xml", FileMode.Open, isoStore));
                settings = (StoreModel)settingsreader.Deserialize(reader);
                reader.Close();
            }
            catch (Exception)
            {
                settings = new StoreModel();
            }

            settings.SaveConfig();
            settings.toStatic();
            OptionDialog.LayoutRoot.DataContext = settings;
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();
            web.Source=new Uri("http://soft.ceve-market.org/bilibili_dm/app.htm?"+DateTime.Now.Ticks); //f**k you IE cache
            b.Disconnected += b_Disconnected;
            b.ReceivedDanmaku += b_ReceivedDanmaku;
            b.ReceivedRoomCount += b_ReceivedRoomCount;
            try
            {
                IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User |
                                                                            IsolatedStorageScope.Domain |
                                                                            IsolatedStorageScope.Assembly, null, null);
                System.Xml.Serialization.XmlSerializer settingsreader =
                    new System.Xml.Serialization.XmlSerializer(typeof (StoreModel));
                StreamReader reader = new StreamReader(new IsolatedStorageFileStream(
                    "settings.xml", FileMode.Open, isoStore));
                settings = (StoreModel) settingsreader.Deserialize(reader);
                reader.Close();
                
            }
            catch (Exception)
            {
                settings=new StoreModel();
                
            }
            settings.SaveConfig();
            settings.toStatic();
            OptionDialog.LayoutRoot.DataContext = settings;

            timer = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, FuckMicrosoft,
                this.Dispatcher);
            timer.Start();
            
            DataGrid.ItemsSource = Ranking;
            DataGrid2.ItemsSource = SessionItems;
//            fulloverlay.Show();
            logging("投喂记录不会在弹幕模式上出现, 这不是bug");
//            for (int i = 0; i < 150; i++)
//            {
//                logging("投喂记录不会在弹幕模式上出现, 这不是bug");
//            }
        }
Example #3
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            Full.IsChecked      = fulloverlay_enabled;
            SideBar.IsChecked   = overlay_enabled;
            SaveLog.IsChecked   = savelog_enabled;
            SSTP.IsChecked      = sendssp_enabled;
            ShowItem.IsChecked  = showvip_enabled;
            ShowError.IsChecked = showerror_enabled;
            var sc = Log.Template.FindName("LogScroll", Log) as ScrollViewer;

            sc?.ScrollToEnd();

            var shit = new Thread(() =>
            {
                var bbb = 5;
                while (true)
                {
                    var r = new Random();

                    lock (_danmakuQueue)
                    {
                        for (var i = 0; i < bbb; i++)
                        {
                            var a1 = r.NextDouble().ToString();
                            var b1 = r.NextDouble().ToString();
                            _danmakuQueue.Enqueue(new DanmakuModel

                            {
                                CommentUser = "******",
                                CommentText = b1,
                                MsgType     = MsgTypeEnum.Comment
                            });
                        }
                    }
                    lock (Static)
                    {
                        Static.DanmakuCountRaw += bbb;
                    }

                    Thread.Sleep(1000);
                }
            }
                                  );

            shit.IsBackground = true;

            //            shit.Start();



            try
            {
                var isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User |
                                                            IsolatedStorageScope.Domain |
                                                            IsolatedStorageScope.Assembly, null, null);
                var settingsreader =
                    new XmlSerializer(typeof(StoreModel));
                var reader = new StreamReader(new IsolatedStorageFileStream(
                                                  "settings.xml", FileMode.Open, isoStore));
                settings = (StoreModel)settingsreader.Deserialize(reader);
                reader.Close();
            }
            catch (Exception)
            {
                settings = new StoreModel();
            }
            settings.SaveConfig();
            settings.toStatic();
            OptionDialog.LayoutRoot.DataContext = settings;
        }
Example #4
0
        public MainWindow()
        {
            InitializeComponent();
            DateTime dt       = new DateTime(2000, 1, 1);
            Assembly assembly = Assembly.GetExecutingAssembly();
            String   version  = assembly.FullName.Split(',')[1];

            String fullversion = version.Split('=')[1];
            int    dates       = int.Parse(fullversion.Split('.')[2]);

            int seconds = int.Parse(fullversion.Split('.')[3]);

            dt = dt.AddDays(dates);
            dt = dt.AddSeconds(seconds * 2);
            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                this.Title += "   版本号: " +
                              System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString();
            }
            else
            {
                this.Title += "   *傻逼版本*";
            }
            this.Title += "   编译时间: " + dt.ToString();

            InitPlugins();
            this.Closed         += MainWindow_Closed;
            web.Source           = new Uri("http://soft.ceve-market.org/bilibili_dm/app.htm?" + DateTime.Now.Ticks); //f**k you IE cache
            b.Disconnected      += b_Disconnected;
            b.ReceivedDanmaku   += b_ReceivedDanmaku;
            b.ReceivedRoomCount += b_ReceivedRoomCount;
            try
            {
                IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User |
                                                                            IsolatedStorageScope.Domain |
                                                                            IsolatedStorageScope.Assembly, null, null);
                System.Xml.Serialization.XmlSerializer settingsreader =
                    new System.Xml.Serialization.XmlSerializer(typeof(StoreModel));
                StreamReader reader = new StreamReader(new IsolatedStorageFileStream(
                                                           "settings.xml", FileMode.Open, isoStore));
                settings = (StoreModel)settingsreader.Deserialize(reader);
                reader.Close();
            }
            catch (Exception)
            {
                settings = new StoreModel();
            }
            settings.SaveConfig();
            settings.toStatic();
            OptionDialog.LayoutRoot.DataContext = settings;

            timer = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, FuckMicrosoft,
                                        this.Dispatcher);
            timer.Start();

            DataGrid.ItemsSource  = Ranking;
            DataGrid2.ItemsSource = SessionItems;
//            fulloverlay.Show();
            logging("投喂记录不会在弹幕模式上出现, 这不是bug");
//            for (int i = 0; i < 150; i++)
//            {
//                logging("投喂记录不会在弹幕模式上出现, 这不是bug");
//            }
            PluginGrid.ItemsSource = Plugins;

            if (DateTime.Today.Month == 4 && DateTime.Today.Day == 1)
            {
                //MAGIC!
                timer_magic = new DispatcherTimer(new TimeSpan(0, 30, 0), DispatcherPriority.Normal, (sender, args) =>
                {
                    var query = this.Plugins.Where(p => p.PluginName.Contains("点歌"));
                    if (query.Any())
                    {
                        query.First().MainReceivedDanMaku(new ReceivedDanmakuArgs()
                        {
                            Danmaku = new DanmakuModel()
                            {
                                MsgType     = MsgTypeEnum.Comment,
                                CommentText = "点歌 34376018",
                                CommentUser = "******",
                                isAdmin     = true,
                                isVIP       = true,
                            }
                        });
                    }
                }, this.Dispatcher);
                timer_magic.Start();
            }
        }
Example #5
0
        public MainWindow()
        {
            InitializeComponent();
            DateTime dt = new DateTime(2000, 1, 1);
            Assembly assembly = Assembly.GetExecutingAssembly();
            String version = assembly.FullName.Split(',')[1];

            String fullversion = version.Split('=')[1];
            int dates = int.Parse(fullversion.Split('.')[2]);

            int seconds = int.Parse(fullversion.Split('.')[3]);
            dt = dt.AddDays(dates);
            dt = dt.AddSeconds(seconds * 2);
            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                this.Title += "   版本号: " +
                System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString();
            }
            else
            {
                this.Title += "   *傻逼版本*";
            }
            this.Title += "   编译时间: " + dt.ToString();

            InitPlugins();
            this.Closed += MainWindow_Closed;
            web.Source=new Uri("http://soft.ceve-market.org/bilibili_dm/app.htm?"+DateTime.Now.Ticks); //f**k you IE cache
            b.Disconnected += b_Disconnected;
            b.ReceivedDanmaku += b_ReceivedDanmaku;
            b.ReceivedRoomCount += b_ReceivedRoomCount;
            try
            {
                IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User |
                                                                            IsolatedStorageScope.Domain |
                                                                            IsolatedStorageScope.Assembly, null, null);
                System.Xml.Serialization.XmlSerializer settingsreader =
                    new System.Xml.Serialization.XmlSerializer(typeof (StoreModel));
                StreamReader reader = new StreamReader(new IsolatedStorageFileStream(
                    "settings.xml", FileMode.Open, isoStore));
                settings = (StoreModel) settingsreader.Deserialize(reader);
                reader.Close();
                
            }
            catch (Exception)
            {
                settings=new StoreModel();
                
            }
            settings.SaveConfig();
            settings.toStatic();
            OptionDialog.LayoutRoot.DataContext = settings;

            timer = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, FuckMicrosoft,
                this.Dispatcher);
            timer.Start();
            
            DataGrid.ItemsSource = Ranking;
            DataGrid2.ItemsSource = SessionItems;
//            fulloverlay.Show();
            logging("投喂记录不会在弹幕模式上出现, 这不是bug");
//            for (int i = 0; i < 150; i++)
//            {
//                logging("投喂记录不会在弹幕模式上出现, 这不是bug");
//            }
            PluginGrid.ItemsSource = Plugins;
        }