Beispiel #1
0
        void optionOk_Click(object sender, EventArgs e)
        {
            var formData = getFormData();

            cfg.saveFromForm(formData);

            setStartUpMenu2(!bool.Parse(cfg.get("IsStartUp")));

            //main cookie
            var importer = nicoSessionComboBox1.Selector.SelectedImporter;

            if (importer != null && importer.SourceInfo != null)
            {
                var si = importer.SourceInfo;

                if (isCookieFileSiteiChkBox.Checked)
                {
                    SourceInfoSerialize.save(si.GenerateCopy(si.BrowserName, si.ProfileName, cookieFileText.Text), false);
                }
                else
                {
                    SourceInfoSerialize.save(si, false);
                }
            }



            DialogResult = DialogResult.OK;
            Close();
        }
Beispiel #2
0
        void optionOk_Click(object sender, EventArgs e)
        {
            var formData = getFormData();

            cfg.saveFromForm(formData);
            Close();

            //main cookie
            var importer = nicoSessionComboBox1.Selector.SelectedImporter;

            if (importer == null || importer.SourceInfo == null)
            {
                return;
            }
            var si = importer.SourceInfo;

            if (isCookieFileSiteiChkBox.Checked)
            {
                SourceInfoSerialize.save(si.GenerateCopy(si.BrowserName, si.ProfileName, cookieFileText.Text), false);
            }
            else
            {
                SourceInfoSerialize.save(si, false);
            }
        }
Beispiel #3
0
        async private Task <CookieContainer> getBrowserCookie(bool isSub)
        {
            var si = SourceInfoSerialize.load(isSub);

//			var importer = await SunokoLibrary.Application.CookieGetters.Default.GetInstanceAsync(si, false);
            ICookieImporter importer = await SunokoLibrary.Application.CookieGetters.Default.GetInstanceAsync(si, false).ConfigureAwait(false);

//			var importers = new SunokoLibrary.Application.CookieGetters(true, null);
//			var importera = (await SunokoLibrary.Application.CookieGetters.Browsers.IEProtected.GetCookiesAsync(TargetUrl));
//			foreach (var rr in importer.Cookies)
//				util.debugWriteLine(rr);
            //importer = await importers.GetInstanceAsync(si, true);
            if (importer == null)
            {
                return(null);
            }

            CookieImportResult result = await importer.GetCookiesAsync(TargetUrl).ConfigureAwait(false);

            if (result.Status != CookieImportState.Success)
            {
                return(null);
            }

            //if (result.Cookies["user_session"] == null) return null;
            //var cookie = result.Cookies["user_session"].Value;

            //util.debugWriteLine("usersession " + cookie);

            var cc = new CookieContainer();

            cc.PerDomainCapacity = 200;
            foreach (Cookie _c in result.Cookies)
            {
                try {
                    if (_c.Name == "age_auth" || _c.Name.IndexOf("user_session") > -1)
                    {
                        cc.Add(new Cookie(_c.Name, _c.Value, "/", ".nicovideo.jp"));
                    }
                } catch (Exception e) {
                    util.debugWriteLine("cookie add browser " + _c.ToString() + e.Message + e.Source + e.StackTrace + e.TargetSite);
                }
            }
//			result.AddTo(cc);

            var c       = cc.GetCookies(TargetUrl)["user_session"];
            var secureC = cc.GetCookies(TargetUrl)["user_session_secure"];

            //cc = setUserSession(cc, c, secureC);


            return(cc);
        }
Beispiel #4
0
        private void setFormFromConfig()
        {
            mailText.Text = cfg.get("accountId");
            passText.Text = cfg.get("accountPass");

            if (cfg.get("browserNum") == "1")
            {
                useAccountLoginRadioBtn.Checked = true;
            }
            else
            {
                useCookieRadioBtn.Checked = true;
            }

            setInitQualityRankList(cfg.get("qualityRank"));

            setEngineType(cfg.get("EngineMode"));
//          isDefaultEngineChkBox_UpdateAction();

//			setPlayerType();

            anotherPlayerPathText.Text = cfg.get("anotherPlayerPath");
//			isUsePlayerChkBox.Checked = bool.Parse(cfg.get("IsUsePlayer"));
//			isUsePlayerChkBox_UpdateAction();
            latencyList.Text = cfg.get("latency");

            isCookieFileSiteiChkBox.Checked = bool.Parse(cfg.get("iscookie"));
            isCookieFileSiteiChkBox_UpdateAction();
            cookieFileText.Text = cfg.get("cookieFile");

            var si = SourceInfoSerialize.load(false);

            nicoSessionComboBox1.Selector.SetInfoAsync(si);

            isMinimizedChkBox.Checked      = bool.Parse(cfg.get("Isminimized"));
            isMinimizeNotifyChkBox.Checked = bool.Parse(cfg.get("IsMinimizeNotify"));
        }
Beispiel #5
0
        /*
         * void checkBoxShowAll_CheckedChanged(object sender, EventArgs e)
         * { nicoSessionComboBox1.Selector.IsAllBrowserMode = checkBoxShowAll.Checked;
         * //           cfg.set("isAllBrowserMode", nicoSessionComboBox1.Selector.IsAllBrowserMode.ToString());
         * }
         */
        private void setFormFromConfig()
        {
            mailText.Text = cfg.get("accountId");
            passText.Text = cfg.get("accountPass");

            if (cfg.get("browserNum") == "1")
            {
                useAccountLoginRadioBtn.Checked = true;
            }
            else
            {
                useCookieRadioBtn.Checked = true;
            }
            useSecondLoginChkBox.Checked       = bool.Parse(cfg.get("issecondlogin"));
            isDefaultBrowserPathChkBox.Checked = bool.Parse(cfg.get("IsdefaultBrowserPath"));
            isDefaultBrowserPathChkBox_UpdateAction();
            browserPathText.Text = cfg.get("browserPath");
            appliAPathText.Text  = cfg.get("appliAPath");
            appliBPathText.Text  = cfg.get("appliBPath");
            appliCPathText.Text  = cfg.get("appliCPath");
            appliDPathText.Text  = cfg.get("appliDPath");
            appliEPathText.Text  = cfg.get("appliEPath");
            appliFPathText.Text  = cfg.get("appliFPath");
            appliGPathText.Text  = cfg.get("appliGPath");
            appliHPathText.Text  = cfg.get("appliHPath");
            appliIPathText.Text  = cfg.get("appliIPath");
            appliJPathText.Text  = cfg.get("appliJPath");
            argAText.Text        = cfg.get("appliAArgs");
            argBText.Text        = cfg.get("appliBArgs");
            argCText.Text        = cfg.get("appliCArgs");
            argDText.Text        = cfg.get("appliDArgs");
            argEText.Text        = cfg.get("appliEArgs");
            argFText.Text        = cfg.get("appliFArgs");
            argGText.Text        = cfg.get("appliGArgs");
            argHText.Text        = cfg.get("appliHArgs");
            argIText.Text        = cfg.get("appliIArgs");
            argJText.Text        = cfg.get("appliJArgs");
            nameAText.Text       = cfg.get("appliAName");
            nameBText.Text       = cfg.get("appliBName");
            nameCText.Text       = cfg.get("appliCName");
            nameDText.Text       = cfg.get("appliDName");
            nameEText.Text       = cfg.get("appliEName");
            nameFText.Text       = cfg.get("appliFName");
            nameGText.Text       = cfg.get("appliGName");
            nameHText.Text       = cfg.get("appliHName");
            nameIText.Text       = cfg.get("appliIName");
            nameJText.Text       = cfg.get("appliJName");
            isStartTimeAllCheckChkBox.Checked = bool.Parse(cfg.get("IsStartTimeAllCheck"));

            isRecentCheckRadioBtn.Checked = bool.Parse(cfg.get("IscheckRecent"));
            isCheck30minRadioBtn.Checked  = bool.Parse(cfg.get("Ischeck30min"));
            isCheckOnAirRadioBtn.Checked  = bool.Parse(cfg.get("IscheckOnAir"));
            isChangeIconChkBox.Checked    = bool.Parse(cfg.get("IschangeIcon"));
            isCheckRecentChkBox_Update();
            //var a = ColorTranslator.FromHtml(cfg.get("recentColor"));
            recentColorBtn.BackColor       = recentSampleColorText.BackColor = ColorTranslator.FromHtml(cfg.get("recentColor"));
            isAlartListColorRecent.Checked = bool.Parse(cfg.get("IsAlartListRecentColor"));
            //a = ColorTranslator.FromHtml(cfg.get("followerOnlyColor"));
            followerOnlyColorBtn.BackColor   = followerOnlySampleColorText.BackColor = ColorTranslator.FromHtml(cfg.get("followerOnlyColor"));
            isFollowerOnlyOtherColor.Checked = bool.Parse(cfg.get("IsFollowerOnlyOtherColor"));
            isFollowerOnlyOtherColor.Enabled = isCheckOnAirRadioBtn.Checked;
            IsFollowerOnlyOtherColorChecked_update();

            isTasktrayStartChkBox.Checked              = bool.Parse(cfg.get("IstasktrayStart"));
            isdragComChkBox.Checked                    = bool.Parse(cfg.get("IsdragCom"));
            doublecmodeList.Text                       = cfg.get("doublecmode");
            isNotAllMatchNotifyNoRecentChkBox.Checked  = bool.Parse(cfg.get("IsNotAllMatchNotifyNoRecent"));
            delThumbChkBox.Checked                     = bool.Parse(cfg.get("delThumb"));
            IsConfirmFollowChkBox.Checked              = bool.Parse(cfg.get("IsConfirmFollow"));
            alartCacheIconChkBox.Checked               = bool.Parse(cfg.get("alartCacheIcon"));
            IsAddAlartedComUserChkBox.Checked          = bool.Parse(cfg.get("IsAddAlartedComUser"));
            isAddAlartedUserToUserListChkBox.Checked   = bool.Parse(cfg.get("IsAddAlartedUserToUserList"));
            IsExistInHistoryListNotAlartChkBox.Checked = bool.Parse(cfg.get("IsExistInHistoryListNotAlart"));

            rssUpdateIntervalList.Text        = cfg.get("rssUpdateInterval");
            userNameUpdateIntervalList.Text   = cfg.get("userNameUpdateInterval");
            isLogChkBtn.Checked               = bool.Parse(cfg.get("log"));
            isBroadLogChkBox.Checked          = bool.Parse(cfg.get("IsbroadLog"));
            isLogFileChkBox.Checked           = bool.Parse(cfg.get("IsLogFile"));
            maxHistoryDisplayList.Text        = cfg.get("maxHistoryDisplay");
            maxNotAlartDisplayList.Text       = cfg.get("maxNotAlartDisplay");
            maxLogDisplayList.Text            = cfg.get("maxLogDisplay");
            isStartUpChkBox.Checked           = bool.Parse(cfg.get("IsStartUp"));
            isAllowMultiProcessChkBox.Checked = bool.Parse(cfg.get("IsAllowMultiProcess"));

            poplocList.Text              = cfg.get("poploc");
            poptimeList.Text             = cfg.get("poptime");
            IsclosepopupChkBox.Checked   = bool.Parse(cfg.get("Isclosepopup"));
            IsfixpopupChkBox.Checked     = bool.Parse(cfg.get("Isfixpopup"));
            IssmallpopupChkBox.Checked   = bool.Parse(cfg.get("Issmallpopup"));
            isTopMostPopupChkBox.Checked = bool.Parse(cfg.get("IsTopMostPopup"));
            isColorPopupChkBox.Checked   = bool.Parse(cfg.get("IsColorPopup"));
            popupOpacityList.Text        = cfg.get("popupOpacity");
            mailFromText.Text            = cfg.get("mailFrom");
            mailToText.Text              = cfg.get("mailTo");
            mailSmtpText.Text            = cfg.get("mailSmtp");
            mailPortText.Text            = cfg.get("mailPort");
            mailUserText.Text            = cfg.get("mailUser");
            mailPassText.Text            = cfg.get("mailPass");
            isMailSslChkBox.Checked      = bool.Parse(cfg.get("IsmailSsl"));
            soundPathAText.Text          = cfg.get("soundPathA");
            soundPathBText.Text          = cfg.get("soundPathB");
            soundPathCText.Text          = cfg.get("soundPathC");
            //isDefaultSoundChkBtn.Checked = bool.Parse(cfg.get("IsSoundDefault"));
            volumeBar.Value            = int.Parse(cfg.get("soundVolume"));
            volumeABar.Value           = int.Parse(cfg.get("soundAVolume"));
            volumeBBar.Value           = int.Parse(cfg.get("soundBVolume"));
            volumeCBar.Value           = int.Parse(cfg.get("soundCVolume"));
            onlyIconColorBtn.BackColor = ColorTranslator.FromHtml(cfg.get("onlyIconColor"));
            setOnlyIconColor(onlyIconColorBtn.BackColor);
            setDefaultBehavior(cfg.get("defaultBehavior"));
            textColorBtn.BackColor             = sampleColorText.ForeColor = ColorTranslator.FromHtml(cfg.get("defaultTextColor"));
            backColorBtn.BackColor             = sampleColorText.BackColor = ColorTranslator.FromHtml(cfg.get("defaultBackColor"));
            defaultSoundList.SelectedIndex     = int.Parse(cfg.get("defaultSound"));
            isDefaultSoundIdChkBox.Checked     = bool.Parse(cfg.get("IsDefaultSoundId"));
            isDefaultAutoReserveChkBox.Checked = bool.Parse(cfg.get("IsDefaultAutoReserve"));

            isRssChkBox.Checked                 = bool.Parse(cfg.get("IsRss"));
            isPushChkBox.Checked                = bool.Parse(cfg.get("IsPush"));
            isAppPushChkBox.Checked             = bool.Parse(cfg.get("IsAppPush"));
            isTimeTableChkBox.Checked           = bool.Parse(cfg.get("IsTimeTable"));
            isAutoReserveChkBox.Checked         = bool.Parse(cfg.get("IsAutoReserve"));
            isOverwriteOldReserveChkBox.Checked = bool.Parse(cfg.get("IsOverwriteOldReserve"));

            thresholdpageList.Value       = int.Parse(cfg.get("thresholdpage"));
            brodoubleList.SelectedIndex   = int.Parse(cfg.get("brodouble"));
            alartAddLiveBox.SelectedIndex = int.Parse(cfg.get("alartAddLive"));

            liveListUpdateMinutesList.Value = decimal.Parse(cfg.get("liveListUpdateMinutes"));
            liveListCacheIconChkBox.Checked = bool.Parse(cfg.get("liveListCacheIcon"));
            liveListGetIconChkBox.Checked   = bool.Parse(cfg.get("liveListGetIcon"));

            isCookieFileSiteiChkBox.Checked = bool.Parse(cfg.get("iscookie"));
            isCookieFileSiteiChkBox_UpdateAction();
            cookieFileText.Text     = cfg.get("cookieFile");
            checkBoxShowAll.Checked = bool.Parse(cfg.get("IsBrowserShowAll"));

            evenRowsColorBtn.BackColor = ColorTranslator.FromHtml(cfg.get("evenRowsColor"));
            fontList.Value             = decimal.Parse(cfg.get("fontSize"));

            var si = SourceInfoSerialize.load(false);

            nicoSessionComboBox1.Selector.SetInfoAsync(si);
        }