public ConfigurationDataBasicLoginWithAlternateLink(string instructionMessageOptional = null)
 {
     Username = new StringItem { Name = "Username" };
     Password = new StringItem { Name = "Password" };
     Instructions = new DisplayItem(instructionMessageOptional) { Name = "" };
     AlternateLink = new StringItem { Name = "Alternate Link" };
 }
Esempio n. 2
0
        public void ExchangeItems(int index1, int index2)
        {
            StringItem temp = fList[index1];

            fList[index1] = fList[index2];
            fList[index2] = temp;
        }
        //////////////////////////////////////////////////////////////////////////
        private ListViewItem AddStringToList(StringItem StrItem, bool RespectOrder)
        {
            ListViewItem Item = new ListViewItem(StrItem.ID);
            Item.SubItems.Add(StrItem.Value);
            Item.Tag = StrItem;

            bool Found = false;

            if(RespectOrder)
            {
                foreach(ListViewItem It in ListStrings.Items)
                {
                    StringItem Str = It.Tag as StringItem;
                    if(Str != null && Str.Order > StrItem.Order)
                    {
                        ListStrings.Items.Insert(It.Index, Item);
                        Found = true;
                        break;
                    }
                }
            }

            if (!Found)
            {
                ListStrings.Items.Add(Item);
            }

            return Item;
        }
Esempio n. 4
0
        public void Should_FailEqualityForDifferetObjectTypes()
        {
            var stringItem = new StringItem("lena", 4);
            var obj        = "test";

            Assert.IsFalse(stringItem.Equals(obj));
        }
        public ConfigurationDataAPILoginWithUserAndPasskeyAndFilter(string FilterInstructions)
        {
            Passkey = new StringItem {
                Name = "Passkey", Value = string.Empty
            };

            KeyHint = new DisplayItem("<ul><li>Visit the security tab on your user settings page to access your ApiUser and ApiKey <li>If you haven't yet generated a key, you may have to first generate one using the checkbox below your keys</ul>")
            {
                Name = "API Authentication"
            };
            User = new StringItem {
                Name = "ApiUser", Value = string.Empty
            };
            Key = new StringItem {
                Name = "ApiKey", Value = string.Empty
            };

            FilterExample = new DisplayItem(FilterInstructions)
            {
                Name = ""
            };
            FilterString = new StringItem {
                Name = "Filters (optional)"
            };
        }
Esempio n. 6
0
        public override void OnTapBegin(PVDragContext dc)
        {
            Rectangle rc     = Area.GetBounds(dc.context);
            Rectangle bounds = rc;
            int       index;
            Font      usedFont = GetUsedFont();

            //CalcCells(dc.context.g, usedFont, rc);
            index = GetCellIndex(ref bounds, ref rc, dc.startPoint, false);
            if (LockLast && index == Objects.Count - 1)
            {
                index = -1;
            }

            if (index >= 0)
            {
                startTapIndex    = index;
                moveTapIndex     = index;
                startObjectIndex = DrawnObjects[index];
                StringItem si = Objects[startObjectIndex];
                startObjectWidth  = (int)si.ItemWidth / 2;
                startObjectHeight = (int)si.ItemHeight / 2;
                startTapOffset.X  = dc.startPoint.X - Convert.ToInt32(si.ItemX);
                startTapOffset.Y  = dc.startPoint.Y - Convert.ToInt32(si.ItemY);
            }

            base.OnTapBegin(dc);
        }
Esempio n. 7
0
        /// <summary>
        /// Parses the string item.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="content">The content.</param>
        private void ParseStringItem(Text text, string content)
        {
            Page page = GetPage(text);;

            if (!String.IsNullOrWhiteSpace(content))
            {
                StringItem stringItemObject = new StringItem();

                MatchCollection sentenceItemCollection = Regex.Matches(content, @"(\S+)", RegexOptions.Multiline);
                foreach (Match sentenceItemMatch in sentenceItemCollection)
                {
                    MatchCollection potentialWordCollection = Regex.Matches(sentenceItemMatch.Value, @"([a-zA-Z]+)");
                    foreach (Match potentialWordItemMatch in potentialWordCollection)
                    {
                        Group  groupWord = potentialWordItemMatch.Groups[1];
                        string word      = groupWord.Value;

                        if (!String.IsNullOrEmpty(word))
                        {
                            Word item = new Word(word);
                            stringItemObject.Add(item);
                        }
                    }
                }
                page.Add(stringItemObject);
            }
        }
Esempio n. 8
0
 public ConfigurationDataPhxBit()
     : base()
 {
     PassKey = new HiddenItem { Name = "PassKey", Value = "" };
     CredentialsWarning = new DisplayItem("<b>Credentials Configuration</b> (<i>Private Tracker</i>),<br /><br /> <ul><li><b>Username</b> is your account name on this tracker.</li><li><b>Password</b> is your password associated to your account name.</li></ul>") { Name = "Credentials" };
     Username = new StringItem { Name = "Username (Required)", Value = "" };
     Password = new StringItem { Name = "Password (Required)", Value = "" };
     PagesWarning = new DisplayItem("<b>Preferences Configuration</b> (<i>Tweak your search settings</i>),<br /><br /> <ul><li><b>Max Pages to Process</b> let you specify how many page (max) Jackett can process when doing a search. Setting a value <b>higher than 4 is dangerous</b> for you account ! (<b>Result of too many requests to tracker...that <u>will be suspect</u></b>).</li></ul>") { Name  = "Preferences" };
     Pages = new StringItem { Name = "Max Pages to Process (Required)", Value = "4" };
     SecurityWarning = new DisplayItem("<b>Security Configuration</b> (<i>Read this area carefully !</i>),<br /><br /> <ul><li><b>Latency Simulation</b> will simulate human browsing with Jacket by pausing Jacket for an random time between each request, to fake a real content browsing.</li><li><b>Browser Simulation</b> will simulate a real human browser by injecting additionals headers when doing requests to tracker.</li></ul>") { Name = "Security" };
     Latency = new BoolItem() { Name = "Latency Simulation (Optional)", Value = false };
     Browser = new BoolItem() { Name = "Browser Simulation (Optional)", Value = true };
     LatencyWarning = new DisplayItem("<b>Latency Configuration</b> (<i>Required if latency simulation enabled</i>),<br /><br/> <ul><li>By filling this range, <b>Jackett will make a random timed pause</b> <u>between requests</u> to tracker <u>to simulate a real browser</u>.</li><li>MilliSeconds <b>only</b></li></ul>") { Name = "Simulate Latency" };
     LatencyStart = new StringItem { Name = "Minimum Latency (ms)", Value = "1589" };
     LatencyEnd = new StringItem { Name = "Maximum Latency (ms)", Value = "3674" };
     HeadersWarning = new DisplayItem("<b>Browser Headers Configuration</b> (<i>Required if browser simulation enabled</i>),<br /><br /> <ul><li>By filling these fields, <b>Jackett will inject headers</b> with your values <u>to simulate a real browser</u>.</li><li>You can get <b>your browser values</b> here: <a href='https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending' target='blank'>www.whatismybrowser.com</a></li></ul><br /><i><b>Note that</b> some headers are not necessary because they are injected automatically by this provider such as Accept_Encoding, Connection, Host or X-Requested-With</i>") { Name = "Injecting headers" };
     HeaderAccept = new StringItem { Name = "Accept", Value = "" };
     HeaderAcceptLang = new StringItem { Name = "Accept-Language", Value = "" };
     HeaderDNT = new BoolItem { Name = "DNT", Value = false };
     HeaderUpgradeInsecure = new BoolItem { Name = "Upgrade-Insecure-Requests", Value = false };
     HeaderUserAgent = new StringItem { Name = "User-Agent", Value = "" };
     DevWarning = new DisplayItem("<b>Development Facility</b> (<i>For Developers ONLY</i>),<br /><br /> <ul><li>By enabling development mode, <b>Jackett will bypass his cache</b> and will <u>output debug messages to console</u> instead of his log file.</li><li>By enabling Hard Drive Cache, <b>This provider</b> will <u>save each query answers from tracker</u> in temp directory, in fact this reduce drastically HTTP requests when building a provider at parsing step for example. So, <b> Jackett will search for a cached query answer on hard drive before executing query on tracker side !</b> <i>DEV MODE must be enabled to use it !</li></ul>") { Name = "Development" };
     DevMode = new BoolItem { Name = "Enable DEV MODE (Developers ONLY)", Value = false };
     HardDriveCache = new BoolItem { Name = "Enable HARD DRIVE CACHE (Developers ONLY)", Value = false };
     HardDriveCacheKeepTime = new StringItem { Name = "Keep Cached files for (ms)", Value = "300000" };
     }
Esempio n. 9
0
        public void GroupEditsTest()
        {
            var doc       = Doc.New();
            var string1ID = default(Guid);
            var string2ID = default(Guid);
            var editID    = NewID();

            Assert.IsFalse(doc.HasItem(string1ID));
            Assert.IsFalse(doc.HasItem(string2ID));
            Assert.IsFalse(doc.CanUndo);
            Assert.IsFalse(doc.CanRedo);
            doc = doc.GroupEdits(editID, d =>
            {
                d = StringItem.Create(d, out string1ID, "abc");
                d = StringItem.Create(d, out string2ID, "xyz");
                return(d);
            });
            Assert.IsTrue(doc.HasItem(string1ID));
            Assert.IsTrue(doc.HasItem(string2ID));
            Assert.IsTrue(doc.CanUndo);
            Assert.IsFalse(doc.CanRedo);
            doc = doc.Undo();
            Assert.IsFalse(doc.HasItem(string1ID));
            Assert.IsFalse(doc.HasItem(string2ID));
            Assert.IsFalse(doc.CanUndo);
            Assert.IsTrue(doc.CanRedo);
            doc = doc.Redo();
            Assert.IsTrue(doc.HasItem(string1ID));
            Assert.IsTrue(doc.HasItem(string2ID));
            Assert.IsTrue(doc.CanUndo);
            Assert.IsFalse(doc.CanRedo);
        }
Esempio n. 10
0
        public override async Task <ConfigurationData> GetConfigurationForSetup()
        {
            var loginPage = await RequestStringWithCookies(LandingUrl);

            CQ  dom         = loginPage.Content;
            var qCaptchaImg = dom.Find("img#regimage").First();

            if (qCaptchaImg.Length > 0)
            {
                var CaptchaUrl   = qCaptchaImg.Attr("src");
                var captchaImage = await RequestBytesWithCookies(CaptchaUrl, loginPage.Cookies, RequestType.GET, LandingUrl);

                var CaptchaImage = new ImageItem {
                    Name = "Captcha Image"
                };
                var CaptchaText = new StringItem {
                    Name = "Captcha Text"
                };

                CaptchaImage.Value = captchaImage.Content;

                configData.AddDynamic("CaptchaImage", CaptchaImage);
                configData.AddDynamic("CaptchaText", CaptchaText);
            }
            else
            {
                logger.Debug(string.Format("{0}: No captcha image found", ID));
            }

            return(configData);
        }
Esempio n. 11
0
        public ConfigurationDataTVstore(JToken json)
        {
            var configData = new ConfigurationDataTVstore();

            dynamic configArray = JsonConvert.DeserializeObject(json.ToString());

            foreach (var config in configArray)
            {
                var propertyName = UppercaseFirst((string)config.id);
                switch (propertyName)
                {
                case "Username":
                    Username = new StringItem {
                        Name = propertyName, Value = config.value
                    };
                    break;

                case "Password":
                    Password = new StringItem {
                        Name = propertyName, Value = config.value
                    };
                    break;

                default:
                    break;
                }
            }
        }
Esempio n. 12
0
        public void Should_FailEqualityForDifferentStringLength()
        {
            var stringItem  = new StringItem("lena", 5);
            var stringItem2 = new StringItem("lena", 2);

            Assert.IsFalse(stringItem.Equals(stringItem2));
        }
Esempio n. 13
0
        public void TestConstruction()
        {
            StringItem val = new StringItem("Howdy");

            Assert.IsNotNull(val);
            Assert.AreEqual("Howdy", val.StringValue);
        }
 public ConfigurationDataBasicLoginWithRSSAndDisplay()
 {
     Username = new StringItem { Name = "Username" };
     Password = new StringItem { Name = "Password" };
     RSSKey = new HiddenItem { Name = "RSSKey" };
     DisplayText = new DisplayItem(""){ Name = "" };
 }
Esempio n. 15
0
        public void TestRecords()
        {
            Interpreter interp = new Interpreter();

            interp.Run("[ 2 'tacos' ] [ 'count' 'type' ] REC");
            Assert.AreEqual(1, interp.stack.Count);

            RecordItem rec = (RecordItem)interp.StackPop();

            // Get value
            interp.StackPush(rec);
            interp.Run("'type' REC@");
            Assert.AreEqual(1, interp.stack.Count);
            dynamic val = interp.StackPop();

            Assert.AreEqual("tacos", val.StringValue);

            // Set value
            interp.StackPush(rec);
            interp.Run("'burritos' 'type' REC!");
            StringItem typeValue = (StringItem)rec.GetValue("type");

            Assert.AreEqual("burritos", typeValue.StringValue);

            // Set value
            interp.StackPush(rec);
            interp.Run("'tostadas' 'type' <REC!");
            typeValue = (StringItem)rec.GetValue("type");
            Assert.AreEqual("tostadas", typeValue.StringValue);
            Assert.AreEqual(1, interp.stack.Count);
        }
Esempio n. 16
0
        public ConfigurationDataNCore(JToken json)
        {
            ConfigurationDataNCore configData = new ConfigurationDataNCore();

            dynamic configArray = JsonConvert.DeserializeObject(json.ToString());
            foreach (var config in configArray)
            {
                string propertyName = UppercaseFirst((string)config.id);
                switch (propertyName)
                {
                    case "Username":
                        Username = new StringItem { Name = propertyName, Value = config.value };
                        break;
                    case "Password":
                        Password = new StringItem { Name = propertyName, Value = config.value };
                        break;
                    case "Hungarian":
                        Hungarian = new BoolItem { Name = propertyName, Value = config.value };
                        break;
                    case "English":
                        English = new BoolItem { Name = propertyName, Value = config.value };
                        break;
                    default:
                        break;
                }
            }
        }
Esempio n. 17
0
        public void Should_BeEqualIfStringItemsEqual()
        {
            var stringItem  = new StringItem("lena", 4);
            var stringItem2 = new StringItem("lena", 4);

            Assert.IsTrue(stringItem.Equals(stringItem2));
        }
Esempio n. 18
0
 public ConfigurationDataNCore()
 {
     Username = new StringItem { Name = "Username", Value = "" };
     Password = new StringItem { Name = "Password", Value = "" };
     Hungarian = new BoolItem { Name = "Hungarian", Value = true };
     English = new BoolItem { Name = "English", Value = true };
 }
Esempio n. 19
0
        public static Hashtable GetPara(string strParament)
        {
            if (strParament == null || strParament.IndexOf("=") == -1)
            {
                return(null);
            }
            else if (!StringItem.IsSafeWordPara(strParament))
            {
                return(null);
            }

            Hashtable htPara = new Hashtable();

            Cuter cPara = StringItem.GetWebServiceArgument(strParament);

            string[] strParaments = cPara.GetArrCuter();
            foreach (string strPara in strParaments)
            {
                if (strPara.IndexOf("=") != -1)
                {
                    Cuter       cP = new Cuter(strPara, "=");
                    HttpContext hc = HttpContext.Current;
                    try
                    {
                        htPara.Add(cP.GetCuter(0), hc.Server.UrlDecode(cP.GetCuter(1)));
                    }
                    catch
                    {}
                }
            }

            return(htPara);
        }
        internal StringItem ToStringItem()
        {
            StringItem si = new StringItem();
            si.Val = this.Val;
            if (this.Unused != null) si.Unused = this.Unused.Value;
            if (this.Calculated != null) si.Calculated = this.Calculated.Value;
            if (this.Caption != null && this.Caption.Length > 0) si.Caption = this.Caption;
            if (this.PropertyCount != null) si.PropertyCount = this.PropertyCount.Value;
            if (this.FormatIndex != null) si.FormatIndex = this.FormatIndex.Value;
            if (this.BackgroundColor != null && this.BackgroundColor.Length > 0) si.BackgroundColor = new HexBinaryValue(this.BackgroundColor);
            if (this.ForegroundColor != null && this.ForegroundColor.Length > 0) si.ForegroundColor = new HexBinaryValue(this.ForegroundColor);
            if (this.Italic != false) si.Italic = this.Italic;
            if (this.Underline != false) si.Underline = this.Underline;
            if (this.Strikethrough != false) si.Strikethrough = this.Strikethrough;
            if (this.Bold != false) si.Bold = this.Bold;

            foreach (SLTuplesType tt in this.Tuples)
            {
                si.Append(tt.ToTuples());
            }

            foreach (int i in this.MemberPropertyIndexes)
            {
                if (i != 0) si.Append(new MemberPropertyIndex() { Val = i });
                else si.Append(new MemberPropertyIndex());
            }

            return si;
        }
Esempio n. 21
0
 public UCStringItem(StringItem item)
 {
     this.Item = item;
     InitializeComponent();
     Number             = item.Number;
     textCheckList.Text = item.Value;
 }
Esempio n. 22
0
        //public BoolItem TranslateMediaNamesToEnglish { get; private set; }

        public ConfigurationDataHDCity()
            : base()
        {
            FormatExplication = new DisplayItem("<b>HDCity naming formats:</b><br/>HDCity tv shows usually have this format (<i>Tv Show Name Temporada 1</i> or <i> TV Show 2x03) <br/> " +
                                                "sonarr and other english applications requires (<i> TV Show Name S02E15)<br/>Check <b>TV Show English Format</b> if you want jackett automatically replace the format")
            {
                Name = "Format"
            };
            TVShowEnglishMode = new BoolItem()
            {
                Name = "TV Show English Format", Value = false
            };

            ResultFilters = new DisplayItem("<b>Filters:</b><br/>If the field <i>Filters</i> is not empty, Jackett will expect a regular expression.<br/>" +
                                            "This regular expression will be used for filter results, for exemple maybe you want jackett only return result where the name have \"dual\" or \"subs\"<br/>" +
                                            "All the titles will be lower case for easiest regular expression matching.")
            {
                Name = "Regular expresions Filters"
            };

            TVShowsFilter = new StringItem {
                Name = "TV Show Filters", Value = "(dual|triaudio|multi)|((es|spa|cast?)( *)[ /|-]( *)(eng?|v( *)(\\.?)( *)o)( *))|((eng?|v( *)(\\.?)( *)o)( *)[ /|-]( *)(es|spa|cast?))"
            };
            MoviesFilter = new StringItem {
                Name = "Movies Filters", Value = ""
            };

            /*TranslateExplication = new DisplayItem("<b>Translations:</b><br/>Sonarr and Couch potato will always check for Original/English media names<br/>"+
             *  "Check <b>Automated Translations</b> if you want Jackett try to transform the names for better matchings")
             * { Name = "Translations" };
             * TranslateMediaNamesToEnglish = new BoolItem() { Name = "Automatic Translation", Value = false };*/
        }
Esempio n. 23
0
 public ConfigurationDataXthor()
     : base()
 {
     CredentialsWarning = new DisplayItem("<b>Credentials Configuration</b> (<i>Private Tracker</i>),<br /><br /> <ul><li><b>PassKey</b> is your private key on your account</li></ul>")
     {
         Name = "Credentials"
     };
     PassKey = new StringItem {
         Name = "PassKey", Value = ""
     };
     PagesWarning = new DisplayItem("<b>Preferences Configuration</b> (<i>Tweak your search settings</i>),<br /><br /> <ul><li><b>Freeleech Only</b> let you search <u>only</u> for torrents which are marked Freeleech.</li></ul>")
     {
         Name = "Preferences"
     };
     Freeleech = new BoolItem()
     {
         Name = "Freeleech Only (Optional)", Value = false
     };
     DevWarning = new DisplayItem("<b>Development Facility</b> (<i>For Developers ONLY</i>),<br /><br /> <ul><li>By enabling development mode, <b>Jackett will bypass his cache</b> and will <u>output debug messages to console</u> instead of his log file.</li><li>By enabling Hard Drive Cache, <b>This provider</b> will <u>save each query answers from tracker</u> in temp directory, in fact this reduce drastically HTTP requests when building a provider at parsing step for example. So, <b> Jackett will search for a cached query answer on hard drive before executing query on tracker side !</b> <i>DEV MODE must be enabled to use it !</li></ul>")
     {
         Name = "Development"
     };
     DevMode = new BoolItem {
         Name = "Enable DEV MODE (Developers ONLY)", Value = false
     };
     HardDriveCache = new BoolItem {
         Name = "Enable HARD DRIVE CACHE (Developers ONLY)", Value = false
     };
     HardDriveCacheKeepTime = new StringItem {
         Name = "Keep Cached files for (ms)", Value = "300000"
     };
 }
Esempio n. 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Random rnd = new Random();

            int intUserID = Convert.ToInt32(Session["UserID"]);
            int intPage   = Convert.ToInt32(Request.QueryString["Page"].ToString());

            intUserID = Convert.ToInt32(Request.QueryString["UserID"].ToString());

            if (intPage < 0 || !intPage.Equals(intPage))
            {
                intPage = 1;
            }

            DataTable dt = SqlLibrary.ShowFansList(intPage, intUserID);

            if (dt != null)
            {
                int i = 1;
                foreach (DataRow dr in dt.Rows)
                {
                    int      intUserIDT = (int)dr["UserId"];
                    DateTime dtnow      = DateTime.Now;
                    DateTime Birthday   = (DateTime)dr["Birthday"];
                    this.sb.Append("<div class=\"pic" + i + "\">");
                    if (Convert.ToString((bool)dr["Online"]) == "True")
                    {
                        this.sb.Append("<div class=\"headpic\"><a href=\"javascript:;\" onclick=\"ShowMsgBox(" + (int)dr["UserId"] + ",'" + (string)dr["NickName"].ToString().Trim() + "')\" title=\"昵称:" + (string)dr["NickName"].ToString() + "&#13;地区:" + (string)dr["Province"].ToString() + " " + (string)dr["City"].ToString() + "&#13;年龄:" + Convert.ToString(dtnow.Year - Birthday.Year) + "&#13;性别:" + (Convert.ToString((bool)dr["Sex"]) == "True" ? "男" : "女") + "\"><img src=\"http://ishow.xba.com.cn/image/" + (string)dr["Bmp"].ToString().Trim() + "?tmp=" + rnd.Next(000000, 999999).ToString() + "\" width=\"150\" height=\"130\" alt=\"昵称:" + (string)dr["NickName"].ToString() + "&#13;地区:" + (string)dr["Province"].ToString() + " " + (string)dr["City"].ToString() + "&#13;年龄:" + Convert.ToString(dtnow.Year - Birthday.Year) + "&#13;性别:" + (Convert.ToString((bool)dr["Sex"]) == "True" ? "男" : "女") + "\"/></a></div>");
                        //this.sb.Append("<div class=\"headpic\"><a href=\"#\" title='" + (string)dr["NickName"].ToString().Trim() + "'><img src=\"http://ishow.xba.com.cn/image/" + (string)dr["Bmp"].ToString().Trim() + "?tmp=" + rnd.Next(000000, 999999).ToString() + "\" width=\"150\" height=\"130\" alt='" + (string)dr["NickName"].ToString().Trim() + "' /></a></div>");
                    }
                    else
                    {
                        this.sb.Append("<div class=\"headpic\"><a href=\"javascript:;\" onclick=\"ShowMsgBox(" + (int)dr["UserId"] + ",'" + (string)dr["NickName"].ToString().Trim() + "')\" title=\"昵称:" + (string)dr["NickName"].ToString() + "&#13;地区:" + (string)dr["Province"].ToString() + " " + (string)dr["City"].ToString() + "&#13;年龄:" + Convert.ToString(dtnow.Year - Birthday.Year) + "&#13;性别:" + (Convert.ToString((bool)dr["Sex"]) == "True" ? "男" : "女") + "\"><img src=\"http://ishow.xba.com.cn/image/" + (string)dr["Bmp"].ToString().Trim() + "\" width=\"150\" height=\"130\" alt=\"昵称:" + (string)dr["NickName"].ToString() + "&#13;地区:" + (string)dr["Province"].ToString() + " " + (string)dr["City"].ToString() + "&#13;年龄:" + Convert.ToString(dtnow.Year - Birthday.Year) + "&#13;性别:" + (Convert.ToString((bool)dr["Sex"]) == "True" ? "男" : "女") + "\"/></a></div>");
                    }
                    this.sb.Append("<div class=\"show_text\">");
                    this.sb.Append("<div class=\"headname\"><a href=\"#\" title='" + (string)dr["NickName"].ToString().Trim() + "'>" + StringItem.StringTruncat((string)dr["NickName"].ToString().Trim(), 10, "...") + "</a></div>");
                    this.sb.Append("<div class=\"headtime\">" + StringItem.FormatDate((DateTime)dr["CreateTime"], "hh:mm") + "</div>");

                    if (intUserID == intUserIDT)
                    {
                        this.sb.Append("<div class=\"sms\"></div>");
                        this.sb.Append("<div class=\"headadd\"><img src=\"Images/add.jpg\" onMouseOver='this.src=\"Images/add_hover.jpg\"' onMouseOut='this.src=\"Images/add.jpg\"' /></div>");
                    }
                    else
                    {
                        this.sb.Append("<div class=\"sms\"><a href=\"javascript:;\" onclick=\"ShowMsgBox(" + (int)dr["UserId"] + ",'" + (string)dr["NickName"].ToString().Trim() + "')\" ><img src=\"Images/pao.jpg\" alt=\"联系我\" onMouseOver='this.src=\"Images/pao_hover.jpg\"' onMouseOut='this.src=\"Images/pao.jpg\"' /></a></div>");
                        this.sb.Append("<div class=\"headadd\"><a href=\"javascript:;\" onclick=\"AddConcern(" + intUserID + "," + intUserIDT + ")\" ><img src=\"Images/add.jpg\" alt=\"添加对该用户的关注\" onMouseOver='this.src=\"Images/add_hover.jpg\"' onMouseOut='this.src=\"Images/add.jpg\"' /></a></div>");
                    }
                    this.sb.Append("</div>\r\n");
                    this.sb.Append("</div>\r\n");
                    i++;
                }
                this.strContent = this.sb.ToString();
                dt.Dispose();
            }
            else
            {
                this.strContent = "很遗憾,还没有人成为你的粉丝,你需要散发出更多的魅力呦O(∩_∩)O~";
            }
        }
Esempio n. 25
0
        /// <summary>
        /// Searches the weakest item (least occurrence and oldest access)
        /// in StringCollection_Shown and returns its list index.
        /// </summary>
        /// <returns></returns>
        private static int GetWeakestItem(ref StringItem si)
        {
            double occ      = double.MaxValue;
            int    j_merker = 0;
            long   last     = long.MaxValue;

            // search items with least occurrence
            for (int j = 0; j < StringCollection_Shown.Count; j++)
            {
                double j_weight = StringCollection_Shown.Values[j].Occurrence;
                if (j_weight <= occ)
                {
                    occ = j_weight;
                }
            }
            // search from the items with least occurrence this with oldest access
            for (int j = 0; j < StringCollection_Shown.Count; j++)
            {
                double j_weight = StringCollection_Shown.Values[j].Occurrence;
                long   j_last   = StringCollection_Shown.Values[j].LastAccessTime;
                if ((j_weight == occ) && (j_last <= last))
                {
                    last     = j_last;
                    si       = StringCollection_Shown.Values[j];
                    j_merker = j;
                }
            }
            return(j_merker);
        }
Esempio n. 26
0
        public override DataItem LoadFromString(string data, UndoRedoManager undoRedo)
        {
            var item = new StringItem(this, undoRedo);

            item.Value = data;
            return(item);
        }
Esempio n. 27
0
        public void Should_FailEqualityForDifferentDataTypes()
        {
            var stringItem  = new StringItem("lena", 4);
            var numericItem = new F4(5);

            Assert.IsFalse(stringItem.Equals(numericItem));
        }
Esempio n. 28
0
 public ConfigurationSonarr()
 {
     Host = new StringItem { Name = "Host", Value = "http://localhost" };
     Port = new StringItem { Name = "Port", Value = "8989" };
     ApiKey = new StringItem { Name = "API Key" };
     ApiInfo = new DisplayItem("API Key can be found in Sonarr > Settings > General > Security") { Name = "API Info" };
 }
Esempio n. 29
0
 public BmtvConfig()
 {
     Username = new StringItem { Name = "Username" };
     Password = new StringItem { Name = "Password" };
     CaptchaImage = new ImageItem { Name = "Captcha Image" };
     CaptchaText = new StringItem { Name = "Captcha Text" };
 }
Esempio n. 30
0
 public ConfigurationDataWiHD()
     : base()
 {
     CredentialsWarning = new DisplayItem("<b>Credentials Configuration</b> (<i>Private Tracker</i>),<br /><br /> <ul><li><b>Username</b> is your account name on this tracker.</li><li><b>Password</b> is your password associated to your account name.</li></ul>") { Name = "Credentials" };
     Username = new StringItem { Name = "Username (Required)", Value = "" };
     Password = new StringItem { Name = "Password (Required)", Value = "" };
     PagesWarning = new DisplayItem("<b>Preferences Configuration</b> (<i>Tweak your search settings</i>),<br /><br /> <ul><li><b>Max Pages to Process</b> let you specify how many page (max) Jackett can process when doing a search. Setting a value <b>higher than 4 is dangerous</b> for you account ! (<b>Result of too many requests to tracker...that <u>will be suspect</u></b>).</li><li><b>Exclusive Only</b> let you search <u>only</u> for torrents which are marked Exclusive.</li><li><b>Freeleech Only</b> let you search <u>only</u> for torrents which are marked Freeleech.</li><li><b>Reseed Only</b> let you search <u>only</u> for torrents which need to be seeded.</li></ul>") { Name  = "Preferences" };
     Pages = new StringItem { Name = "Max Pages to Process (Required)", Value = "4" };
     Exclusive = new BoolItem() { Name = "Exclusive Only (Optional)", Value = false };
     Freeleech = new BoolItem() { Name = "Freeleech Only (Optional)", Value = false };
     Reseed = new BoolItem() { Name = "Reseed Needed Only (Optional)", Value = false };
     SecurityWarning = new DisplayItem("<b>Security Configuration</b> (<i>Read this area carefully !</i>),<br /><br /> <ul><li><b>Latency Simulation</b> will simulate human browsing with Jacket by pausing Jacket for an random time between each request, to fake a real content browsing.</li><li><b>Browser Simulation</b> will simulate a real human browser by injecting additionals headers when doing requests to tracker.</li></ul>") { Name = "Security" };
     Latency = new BoolItem() { Name = "Latency Simulation (Optional)", Value = true };
     Browser = new BoolItem() { Name = "Browser Simulation (Optional)", Value = true };
     LatencyWarning = new DisplayItem("<b>Latency Configuration</b> (<i>Required if latency simulation enabled</i>),<br /><br/> <ul><li>By filling this range, <b>Jackett will make a random timed pause</b> <u>between requests</u> to tracker <u>to simulate a real browser</u>.</li><li>MilliSeconds <b>only</b></li></ul>") { Name = "Simulate Latency" };
     LatencyStart = new StringItem { Name = "Minimum Latency (ms)", Value = "1589" };
     LatencyEnd = new StringItem { Name = "Maximum Latency (ms)", Value = "3674" };
     HeadersWarning = new DisplayItem("<b>Browser Headers Configuration</b> (<i>Required if browser simulation enabled</i>),<br /><br /> <ul><li>By filling these fields, <b>Jackett will inject headers</b> with your values <u>to simulate a real browser</u>.</li><li>You can get <b>your browser values</b> here: <a href='https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending' target='blank'>www.whatismybrowser.com</a></li></ul><br /><i><b>Note that</b> some headers are not necessary because they are injected automatically by this provider such as Accept_Encoding, Connection, Host or X-Requested-With</i>") { Name = "Injecting headers" };
     HeaderAccept = new StringItem { Name = "Accept", Value = "" };
     HeaderAcceptLang = new StringItem { Name = "Accept-Language", Value = "" };
     HeaderDNT = new BoolItem { Name = "DNT", Value = false };
     HeaderUpgradeInsecure = new BoolItem { Name = "Upgrade-Insecure-Requests", Value = false };
     HeaderUserAgent = new StringItem { Name = "User-Agent", Value = "" };
     DevWarning = new DisplayItem("<b>Devlopement Facility</b> (<i>For Developers ONLY</i>),<br /><br /> <ul><li>By enabling devlopement mode, <b>Jackett will bypass his cache</b> and will <u>output debug messages to console</u> instead of his log file.</li></ul>") { Name = "Devlopement" };
     DevMode = new BoolItem { Name = "Enable DEV MODE (Developers ONLY)", Value = false };
 }
Esempio n. 31
0
        public override async Task <ConfigurationData> GetConfigurationForSetup()
        {
            var loginPage = await RequestWithCookiesAsync(LandingUrl);

            var parser      = new HtmlParser();
            var dom         = parser.ParseDocument(loginPage.ContentString);
            var qCaptchaImg = dom.QuerySelector("img#regimage");

            if (qCaptchaImg != null)
            {
                var captchaUrl           = qCaptchaImg.GetAttribute("src");
                var captchaImageResponse = await RequestWithCookiesAsync(captchaUrl, loginPage.Cookies, RequestType.GET, LandingUrl);

                var captchaText = new StringItem {
                    Name = "Captcha Text"
                };
                var captchaImage = new ImageItem {
                    Name = "Captcha Image", Value = captchaImageResponse.ContentBytes
                };

                configData.AddDynamic("CaptchaText", captchaText);
                configData.AddDynamic("CaptchaImage", captchaImage);
            }
            else
            {
                logger.Debug($"{Id}: No captcha image found");
            }

            return(configData);
        }
 public ConfigurationDataRecaptchaLogin(string instructionMessageOptional = null)
 {
     Username = new StringItem { Name = "Username" };
     Password = new StringItem { Name = "Password" };
     Captcha = new RecaptchaItem() { Name = "Recaptcha" };
     Instructions = new DisplayItem(instructionMessageOptional) { Name = "" };
 }
Esempio n. 33
0
        public void Should_FailEqualityForDifferentStringValues()
        {
            var stringItem  = new StringItem("lena", 4);
            var stringItem2 = new StringItem("test", 4);

            Assert.IsFalse(stringItem.Equals(stringItem2));
        }
Esempio n. 34
0
 public virtual void TestStringItem()
 {
     var writtenItem = new StringItem
         ("one");
     var readItem = (StringItem
         ) WriteAndRead(writtenItem);
     Assert.AreEqual(writtenItem._name, readItem._name);
 }
Esempio n. 35
0
        public IActionResult UpdateStringItem(int id, StringItem item)
        {
            var newItem = _stringService.UpdateItem(id, item);
            var result  = new JsonResult(newItem);

            result.StatusCode = 202;
            return(result);
        }
Esempio n. 36
0
        public IActionResult AddString([FromBody] StringItem item)
        {
            _stringService.AddString(item);
            var result = new JsonResult(item);

            result.StatusCode = 201;
            return(result);
        }
 public ConfigurationDataCaptchaLogin()
 {
     Username = new StringItem { Name = "Username" };
     Password = new StringItem { Name = "Password" };
     CaptchaImage = new ImageItem { Name = "Captcha Image" };
     CaptchaText = new StringItem { Name = "Captcha Text" };
     CaptchaCookie = new HiddenItem("") { Name = "Captcha Cookie" };
 }
Esempio n. 38
0
        public void Should_CreateCorrectStringItem()
        {
            var stringItem = new StringItem("lena", 4);

            Assert.IsTrue(stringItem.Value == "lena");
            Assert.IsTrue(stringItem.Length == 4);
            Assert.IsTrue(stringItem.Type == Format.A);
        }
Esempio n. 39
0
        private void reLoadButtonItem(BoxExchangeEditor bx, List <string> src)
        {
            var viewlist = bx.TargetBox.Items.OfType <StringItem>().Values();
            var diflist  = src.Except(viewlist).ToList();

            diflist.Insert(0, (bx.DuplicationSpecific.First() as StringItem).Value);

            bx.SourceBox.ItemsSource = StringItem.Items(diflist.Distinct());
        }
 /// <param name="instructionMessageOptional">Enter any instructions the user will need to setup the tracker</param>
 public ConfigurationDataCaptchaLogin(string instructionMessageOptional = null)
 {
     Username = new StringItem { Name = "Username" };
     Password = new StringItem { Name = "Password" };
     CaptchaImage = new ImageItem { Name = "Captcha Image" };
     CaptchaText = new StringItem { Name = "Captcha Text" };
     CaptchaCookie = new HiddenItem("") { Name = "Captcha Cookie" };
     Instructions = new DisplayItem(instructionMessageOptional) { Name = "" };
 }
Esempio n. 41
0
 public void AllStrSetValue()
 {
     foreach (var data in m_strInfo)
     {
         StringItem strItem = data.m_strKey.strItem;
         strItem.data = SetValue(data.m_strKey.strItem.id);
         data.m_strKey.SetText();
     }
 }
 public ConfigurationDataBlueTigers(string displayInstructions)
 {
     Username = new StringItem { Name = "Username", Value = "" };
     Password = new StringItem { Name = "Password", Value = "" };
     Instructions = new DisplayItem(displayInstructions) { Name = "" };
     French = new BoolItem { Name = "French", Value = true };
     English = new BoolItem { Name = "English", Value = true };
     Spanish = new BoolItem { Name = "Spanish", Value = true };
 }
 public ConfigurationDataBasicLogin()
 {
     Username = new StringItem {
         Name = "Username"
     };
     Password = new StringItem {
         Name = "Password"
     };
 }
Esempio n. 44
0
 public NxtGnConfigurationData()
 {
     Username = new StringItem {
         Name = "Username"
     };
     Password = new StringItem {
         Name = "Password"
     };
 }
 public ConfigurationDataBasicLoginWithFilter(string FilterInstructions)
 {
     Username = new StringItem { Name = "Username" };
     Password = new StringItem { Name = "Password" };
     FilterExample = new DisplayItem(FilterInstructions)
     {
         Name = ""
     };
     FilterString = new StringItem { Name = "Filters (optional)" };
 }
        //////////////////////////////////////////////////////////////////////////
        private ListViewItem AddStringToIgnoreList(StringItem StrItem)
        {
            ListViewItem Item = new ListViewItem(StrItem.Value);

            Item.SubItems.Add(IgnoreReasonToString(StrItem.IgnoreReason));
            Item.Tag = StrItem;

            ListIgnored.Items.Add(Item);

            return Item;
        }
Esempio n. 47
0
 public ConfigurationDataXthor()
     : base()
 {
     CredentialsWarning = new DisplayItem("<b>Credentials Configuration</b> (<i>Private Tracker</i>),<br /><br /> <ul><li><b>PassKey</b> is your private key on your account</li></ul>") { Name = "Credentials" };
     PassKey = new StringItem { Name = "PassKey", Value = "" };
     PagesWarning = new DisplayItem("<b>Preferences Configuration</b> (<i>Tweak your search settings</i>),<br /><br /> <ul><li><b>Freeleech Only</b> let you search <u>only</u> for torrents which are marked Freeleech.</li></ul>") { Name  = "Preferences" };
     Freeleech = new BoolItem() { Name = "Freeleech Only (Optional)", Value = false };
     DevWarning = new DisplayItem("<b>Development Facility</b> (<i>For Developers ONLY</i>),<br /><br /> <ul><li>By enabling development mode, <b>Jackett will bypass his cache</b> and will <u>output debug messages to console</u> instead of his log file.</li><li>By enabling Hard Drive Cache, <b>This provider</b> will <u>save each query answers from tracker</u> in temp directory, in fact this reduce drastically HTTP requests when building a provider at parsing step for example. So, <b> Jackett will search for a cached query answer on hard drive before executing query on tracker side !</b> <i>DEV MODE must be enabled to use it !</li></ul>") { Name = "Development" };
     DevMode = new BoolItem { Name = "Enable DEV MODE (Developers ONLY)", Value = false };
     HardDriveCache = new BoolItem { Name = "Enable HARD DRIVE CACHE (Developers ONLY)", Value = false };
     HardDriveCacheKeepTime = new StringItem { Name = "Keep Cached files for (ms)", Value = "300000" };
     }
 public ConfigurationDataCookie()
 {
     Cookie = new StringItem { Name = "Cookie" };
     CookieHint = new DisplayItem(
     "<ol><li>Login to BeyondHD in your browser <li>Open the developer console, go the network tab <li>Find 'cookie' in the request headers <li>Copy & paste it to here</ol>")
     {
         Name = "CookieHint"
     };
     CookieExample = new DisplayItem(
     "Example cookie header (usually longer than this):<br><code>PHPSESSID=8rk27odm; ipsconnect_63ad9c=1; more_stuff=etc;</code>")
     {
         Name = "CookieExample"
     };
 }
Esempio n. 49
0
 public ConfigurationDataRuTor(string defaultUrl)
 {
     Url = new StringItem { Name = "Url", Value = defaultUrl };
     StripRussian = new BoolItem() { Name = "StripRusNamePrefix", Value = true };
 }
Esempio n. 50
0
    /// <summary>
    /// Shows a bunch of strings using the ScreenWriter that contains
    /// just lots of debug info
    /// </summary>
    private void ShowDebug()
    {
        // Always draw the frame counter
        int startRightX = SPW.world.ScreenWidth - 200;
        int y = 10;
        sw[ "frameNumber" ] = new StringItem( currentFrame.ToString(), startRightX, y += 20, 1.0f, Color.White );
        sw[ "gameState" ] = new StringItem( "gameState: " + gameState, startRightX, y += 20, 1.0f, Color.Gray );
        sw[ "netState" ] = new StringItem( "netState: " + netState, startRightX, y += 20, 1.0f, Color.Gray );
        sw[ "delaystring" ] = new StringItem( "avg delay: " + Controller.delayMetrics.averageMessageDelay, startRightX, y += 20, 1.0f, Color.Gray );

        sw[ "delaystring1" ] = new StringItem( "last transit: " + Controller.delayMetrics.LastMessageTransportTime, startRightX, y += 20, 1.0f, Color.Gray );
        // sw[ "delaystring2" ] = new StringItem( "sum delay: " + Controller.delayMetrics.TotalFrameDelay, startRightX, y += 20, 1.0f, Color.Gray );
        // sw[ "delaystring3" ] = new StringItem( "total msgs: " + Controller.delayMetrics.TotalMessagesReceived, startRightX, y += 20, 1.0f, Color.Gray );
        sw[ "delaystring4" ] = new StringItem( "frames diff: " + Controller.framesAhead, startRightX, y += 20, 1.0f, Color.Gray );
        sw[ "delaystring5" ] = new StringItem( "(+ means ahead)", startRightX, y += 20, 1.0f, Color.Gray );

        /*
        if( c.netConn.listenerThread != null )
        {
          sw[ "delaystring5.5" ] = new StringItem( "listen thread " + ( c.netConn.listenerThread.IsAlive ? "alive" : "dead" ), startRightX, y += 20, 1.0f, Color.Gray );
          sw[ "delaystring5.6" ] = new StringItem( "thread id " + c.netConn.listenerThread.ManagedThreadId, startRightX, y += 20, 1.0f, Color.Gray );
        }
        */

        sw[ "delaystring6" ] = new StringItem( "last sync: " + Controller.frameOtherGuyWasOnAtLastSync, startRightX, y += 40, 1.0f, Color.Gray );
    }
Esempio n. 51
0
 public ConfigurationDataUrl(Uri defaultUrl)
 {
     Url = new StringItem { Name = "Url", Value = defaultUrl.ToString() };
 }
Esempio n. 52
0
			public NxtGnConfigurationData()
			{
				Username = new StringItem { Name = "Username" };
				Password = new StringItem { Name = "Password" };
			}
Esempio n. 53
0
 public PretomeConfiguration() : base()
 {
     Pin = new StringItem { Name = "Login Pin Number" };
 }
Esempio n. 54
0
 public NxtGnConfigurationData()
 {
     Username = new StringItem { Name = "Username" };
     Password = new StringItem { Name = "Password" };
     DisplayText = new DisplayItem("") { Name = "" };
     AlternateLink = new StringItem { Name = "AlternateLinks" };
 }
Esempio n. 55
0
 public StringItem(StringItem other)
     : base(other)
 {
 }
 public ConfigurationDataBasicLogin()
 {
     Username = new StringItem { Name = "Username" };
     Password = new StringItem { Name = "Password" };
 }
Esempio n. 57
0
 public ConfigurationDataBasicLoginFrenchTorrentDb()
 {
     Cookie = new StringItem { Name = "Cookie" };
 }
Esempio n. 58
0
 public NxtGnConfigurationData()
 {
     Username = new StringItem { Name = "Username" };
     Password = new StringItem { Name = "Password" };
     OnlyDanishCategories = new BoolItem { Name = "Only Danish Categories" };
 }
Esempio n. 59
0
 public ConfigurationDataUrl(string defaultUrl)
 {
     Url = new StringItem { Name = "Url", Value = defaultUrl };
 }
 public ConfigurationDataRecaptchaLogin()
 {
     Username = new StringItem { Name = "Username" };
     Password = new StringItem { Name = "Password" };
     Captcha = new RecaptchaItem() { Name = "Recaptcha" };
 }