예제 #1
0
        public void TestDOM3()
        {
            string s        = null;
            string expected = "";

            Assert.AreEqual(expected, DOM.UpperCaseFirst(s));
        }
        public override ReactElement Render()
        {
            // If state has no valueyet, then the Store has not been initialised and its OnChange event has not been called - in this case, we are not ready to
            // render anything and so should return null here
            if (!state.IsDefined)
            {
                return(null);
            }

            // A good guideline to follow with stateful components is that the State reference should contain everything required to draw the components and
            // props should only be used to access a Dispatcher reference to deal with callbacks from those components
            return(DOM.Div(null,
                           new MessageEditor(
                               className: new NonBlankTrimmedString("message"),
                               message: state.Value.NewMessage,
                               onChange: newState => props.Dispatcher.Dispatch(new MessageEditStateChanged(newState)),
                               onSave: () =>
            {
                // No validation is required here since the MessageEditor shouldn't let OnSave be called if the current message state is invalid
                // (ie. if either field has a ValidationMessage). In some applications, it is preferred that validation messages not be shown
                // until a save request is attempted (in which case some additional validation WOULD be performed here), but this app keeps
                // things simpler by showing validation messages for all inputs until they have acceptable values (meaning that the first
                // time the form is draw, it has validation messages displayed even though the user hasn't interacted with it yet).
                props.Dispatcher.Dispatch(new MessageSaveRequested(
                                              new MessageDetails(
                                                  new NonBlankTrimmedString(state.Value.NewMessage.Title.Text),
                                                  new NonBlankTrimmedString(state.Value.NewMessage.Content.Text)
                                                  )
                                              ));
            }
                               ),
                           new MessageHistory(className: new NonBlankTrimmedString("history"), messages: state.Value.MessageHistory)
                           ));
        }
예제 #3
0
        public void TestDOM2()
        {
            string s        = "asDa";
            string expected = "AsDa";

            Assert.AreEqual(expected, DOM.UpperCaseFirst(s));
        }
예제 #4
0
    public GameObject AddDOM(DOM parent, int domID, Vector3 pos)
    {
        if (prefab == null)
        {
            prefab = Resources.Load <singleBall>("Prefabs/sBall");
            Debug.Log(prefab);
        }
        singleBall exp = Instantiate <singleBall>(prefab);

        //exp.gameObject.GetComponent<MeshRenderer>().sharedMaterial = parent.material;
        exp.gameObject.name = "String " + this.id + " DOM " + domID;
        //exp.absSpeed=decOffset;
        //exp.decExp=0.8f+Mathf.Min(decOffset/450.0f,0.1f);
        this.balls.Add(domID, exp);
        //	Dom dom = exp.gameObject.AddComponent<Dom>().
        //     Initialize(parent, domID, pos);
        //this.id = id;
        //this.mesh = parent.mesh;
        //this.material = parent.material;
        float rradius = 0.01651f * cfg.domScale * cfg.globalScale;

        exp.transform.parent        = parent.transform;
        exp.transform.localScale    = Vector3.one * rradius; //relative
        exp.transform.localPosition = pos;
        // this.doms.Add(domID, dom);
        this.maxZ = System.Math.Max(this.maxZ, pos.y);
        this.minZ = System.Math.Min(this.minZ, pos.y);
        return(exp.gameObject);
    }
예제 #5
0
        public override ReactElement Render()
        {
            var className = props.ClassName;

            if (!props.Messages.Any())
            {
                className += (className == "" ? "" : " ") + "zero-messages";
            }

            var messagesInv = props.Messages.Reverse();

            var messageElements = messagesInv
                                  .Select(savedMessage => DOM.Div(
                                              new Attributes {
                Key       = savedMessage.Id.ToString(),
                ClassName = "historical-message"
            },
                                              DOM.Span(new Attributes {
                ClassName = "title"
            },
                                                       savedMessage.Message.Title),
                                              DOM.Span(new Attributes {
                ClassName = "content"
            },
                                                       savedMessage.Message.Content)
                                              ));

            return(DOM.FieldSet(
                       new FieldSetAttributes {
                ClassName = className
            },
                       DOM.Legend(null, props.ClassName),
                       DOM.Div(messageElements)
                       ));
        }
        public void FillDetails()
        {
            NewUserDetails u = new NewUserDetails();

            u.FirstName    = "Random";
            u.LastName     = "Person";
            u.UserName     = "******" + DateTime.Now.Millisecond;
            u.CurrentEmail = "*****@*****.**";
            u.Password     = "******";
            u.BirthMonth   = 1;
            u.BirthDate    = "01";
            u.BirthYear    = "1980";
            u.Phone        = "+1-432-132-4552";


            DOM.Find("#FirstName").SendKeys(u.FirstName);
            DOM.Find("#LastName").SendKeys(u.LastName);
            DOM.Find("#GmailAddress").SendKeys(u.UserName);
            DOM.Find("#Passwd").SendKeys(u.Password);
            DOM.Find("#PasswdAgain").SendKeys(u.Password);
            DOM.Find("#BirthMonth").SendKeys(u.BirthMonth.ToString());
            DOM.Find("#BirthDay").SendKeys(u.BirthDate);
            DOM.Find("#BirthYear").SendKeys(u.BirthYear);
            DOM.Find("#RecoveryEmailAddress").SendKeys(u.CurrentEmail);
            DOM.Find("#submitbutton").Click();
        }
예제 #7
0
        public override void RunCase()
        {
            /*Step("Hovering over Portfolios");
             * DOM.Find("#tmbTab9").HoverOver();
             * Step("Clicking on create portfolio");
             * DOM.Find("#__tmbFlyout9 a[href*=CreateEditPortfolio]").Click();
             * Step("Waiting for the Create portfolio page to load.");
             * DomElement portfolioInput = DOM.Find("#summarySection_Toggle1_portfolioName");
             * Step("Create portfolio page loaded.");
             *
             * string portfolioname="SeleniumPortfolio_"+Utility.RandomNumber();
             * Step("Entering portfolio name as "+portfolioname);
             * portfolioInput.SendKeys(portfolioname);
             * Step("Now clicking on Save button");
             * DOM.Find("#bbBottom_mySave__saveBtn").Click();
             *
             * Step("Verifying if the portfolio got created.");
             *
             * if(!DOM.Find("#ctl27__textLabel").Text.Contains(portfolioname))
             * Error("Portfolio did not get created!");*/
            String hashTagsToLike            = "#hotwomen";
            String profilesFollowersToFollow = "https://www.instagram.com/thenotoriousmma/";

            GoTo.Url("https://www.instagram.com");

            DOM.Find("._fcn8k").Click();
            DOM.Find("input[name=username]").SendKeys("*****@*****.**");
            DOM.Find("input[name=password]").SendKeys("Coolermaster24");
            DOM.Find("button._ah57t._84y62._i46jh").Click();
            //follow(profilesFollowersToFollow);
            Unfollow();
        }
예제 #8
0
        public void Unfollow()
        {
            DOM.Find(".coreSpriteDesktopNavProfile").Click();
            DOM.Find("a[href*=following]").Click();
            String st     = "._4gt3b";
            String script = String.Format("var objDiv = document.getElementsByClassName(\"_4gt3b\")[0];objDiv.scrollTop = objDiv.scrollHeight;");

            for (int i = 0; i < 50; i++)
            {
                DOM.ExecuteJavascript(script);
                Wait(1000);
            }


            List <DomElement> followButtons = DOM.FindMany("._ah57t._6y2ah._i46jh._rmr7s").ToList();
            Random            rnd           = new Random();
            int counter = 0;

            foreach (var btn in followButtons)
            {
                counter++;
                btn.Click();
                Wait(rnd.Next(10, 15) * 1000);
                Console.WriteLine("Unfollowed " + counter + " accounts.");
            }
        }
예제 #9
0
 public override ReactElement Render()
 {
     return(DOM.Div(new Attributes {
         Style = TodoStyles.Container
     },
                    DOM.H4(
                        new Attributes {
         Style = props.Task.Done ? TodoStyles.TextDone : TodoStyles.TextNotDone
     },
                        props.Task.Description
                        ),
                    DOM.Button(
                        new ButtonAttributes
     {
         Style = props.Task.Done ? TodoStyles.ToggleButtonDone : TodoStyles.ToggleButtonNotDone,
         OnClick = e => props.OnChange(props.Task.With(_ => _.Done, value => !value))
     },
                        props.Task.Done ? "Not done yet!" : "Finished!"
                        ),
                    DOM.Button(
                        new ButtonAttributes
     {
         Style = TodoStyles.RemoveButton,
         OnClick = e => props.OnRemove()
     },
                        "Remove"
                        )
                    ));
 }
예제 #10
0
 public static ReactElement TodoItem(Todo todo, Action <int> onToggleComplete, Action <int> onDelete)
 {
     return(DOM.Div(
                new Attributes {
         Style = Styles.TodoItemStyle
     },
                DOM.Div(
                    new Attributes {
         Style = todo.IsCompleted ? Styles.TextStyleComplete : Styles.TextStyleNotComplete
     },
                    todo.Description
                    ),
                DOM.Button(new ButtonAttributes
     {
         Style = new ReactStyle {
             Margin = "5px"
         },
         OnClick = e => onToggleComplete(todo.Id),
         ClassName = "btn btn-primary"
     }, "Toggle complete"),
                DOM.Button(new ButtonAttributes
     {
         Style = new ReactStyle {
             Margin = "5px"
         },
         OnClick = e => onDelete(todo.Id),
         ClassName = "btn btn-danger"
     }, "Delete")
                ));
 }
        public override ReactElement Render()
        {
            var className = props.ClassName.IsDefined ? props.ClassName.Value : "";

            if (!props.Messages.Any())
            {
                className += (className == "" ? "" : " ") + "zero-messages";
            }

            var messageElements = props.Messages
                                  .Select(savedMessage => DOM.Div(new Attributes {
                Key = savedMessage.Id.ToString(), ClassName = "historical-message"
            },
                                                                  DOM.Span(new Attributes {
                ClassName = "title"
            }, savedMessage.Message.Title.Value),
                                                                  DOM.Span(new Attributes {
                ClassName = "content"
            }, savedMessage.Message.Content.Value)
                                                                  ));

            return(DOM.FieldSet(new FieldSetAttributes {
                ClassName = (className == "" ? null : className)
            },
                                DOM.Legend(null, "Message History"),
                                DOM.Div(messageElements)
                                ));
        }
예제 #12
0
 public override ReactElement Render()
 {
     return(DOM.Div(new Attributes {
         Style = Style.Margin(5).Padding(5).FontSize(18)
     },
                    DOM.H3(props.Label),
                    DOM.Label("Description"),
                    DOM.Input(new InputAttributes
     {
         Value = state.InputValue,
         OnChange = e => SetState(state.With(_ => _.InputValue, e.CurrentTarget.Value))
     }),
                    DOM.Button(
                        new ButtonAttributes
     {
         Disabled = string.IsNullOrWhiteSpace(state.InputValue),
         OnClick = e => AppendTodo(state.InputValue)
     },
                        "Add"
                        ),
                    DOM.Div(
                        state.Todos.Select((todo, index) => new TaskCard(
                                               task: todo,
                                               onChange: updatedTask => SetState(state.With(_ => _.Todos, index, updatedTask)),
                                               onRemove: () => SetState(state.With(_ => _.Todos, value => value.RemoveAt(index)))
                                               ))
                        )
                    ));
 }
예제 #13
0
        public static void Main()
        {
            var appRoot       = Document.GetElementById("app");
            var userInterface = DOM.Div("hello world");

            React.Render(userInterface, appRoot);
        }
예제 #14
0
 public bool GetKeyValueBool(string sSection, string sKey, bool bDefault)
 {
     if (DOM.ContainsKey(sSection))
     {
         if (DOM[sSection].ContainsKey(sKey))
         {
             if (DOM[sSection][sKey] != "FALSE" || DOM[sSection][sKey] != "false")
             {
                 return(true);
             }
             else
             {
                 return(bDefault);
             }
         }
         else
         {
             return(bDefault);
         }
     }
     else
     {
         return(bDefault);
     }
 }
예제 #15
0
    private Player GetPlayerProfile(string url)
    {
        var Document = new DOM(url);
            Player player = new Player();

            player.Id = Regex.Match(url, "playerid=(\\d*)").Groups[1].Value;
            player.Permalink = url;
            player.Name = Document.DocumentModel.SelectSingleNode("//h1[@class='h']").InnerText;
            player.ImageUrl = "http://svenskfotboll.se" + Document.DocumentModel.SelectSingleNode("//div[@class='player-image']/img/@src").InnerText;

            var TableRows = Document.DocumentModel.SelectNodes("//table[@class='clTblStatBox']//tr");

            player.ShirtNumber = Document.DocumentModel.SelectSingleNode("//table[@class='clTblStatBox']//thead").InnerText;
            player.ShirtNumber = Regex.Match(player.ShirtNumber, "Nr (\\d*)").Groups[1].Value;

            player.BirthDate = TableRows.GetCellValueByFirstColumn("Född:");

            var HeightAndWeight = TableRows.GetCellValueByFirstColumn("Längd/Vikt:");
            if (HeightAndWeight.Contains("/"))
            {
                player.Height = HeightAndWeight.Split('/')[0];
                player.Weight = HeightAndWeight.Split('/')[1];
            }

            player.MotherClub = TableRows.GetCellValueByFirstColumn("Moderklubb:");

            return player;
    }
예제 #16
0
    public Player GetByQuery(string name)
    {
        var SearchResultUrl = "http://svenskfotboll.se/sok/?q=" + name + "&search-type=0";
            var SearchDOM = new DOM(SearchResultUrl);
            if (SearchDOM != null)
            {

                var PlayerUrls = Regex.Match(SearchDOM.Html, "<a href=\"(http://svenskfotboll.se/.*/person/.playerid=\\d*)\"");

                if (PlayerUrls.Success)
                {
                    string PlayerProfileUrl = PlayerUrls.Groups[1].Value;

                    return GetPlayerProfile(PlayerProfileUrl);

                }

            }
            else
            {
                return null;
            }

            return null;
    }
예제 #17
0
        static void InnerHTML_binding_With_longPropertyPath(Assert Assert)
        {
            var model = new Model
            {
                UserInfo = new UserInfoContract
                {
                    StringProperty0 = "Test1"
                }
            };

            var div             = DOM.CreateElement("div");
            var htmlBindingInfo = new HTMLBindingInfo
            {
                Source      = model,
                SourcePath  = "UserInfo.StringProperty0",
                Target      = div,
                TargetPath  = "innerHTML",
                BindingMode = BindingMode.OneWay
            };

            htmlBindingInfo.Connect();

            model.UserInfo.StringProperty0 = "A";

            Assert.AreEqual("A", div.Html());

            div = TestHelper.BuildAndGetFirstLogicalChild("<div>{UserInfo.StringProperty0}</div>", model).Root;

            Assert.AreEqual("A", div.Html());

            model.UserInfo.StringProperty0 = "B";

            Assert.AreEqual("B", div.Html());
        }
예제 #18
0
        public override ReactElement Render()
        {
            // Margin : marge externe, Padding : marge interne
            var lblAtt = new LabelAttributes
            {
                Style = Style.Margin(20).Padding(5)
            };                                       //.FontSize(12)

            var iAtt = new InputAttributes {
                Type      = InputType.Checkbox,
                ClassName = props.ClassName.Value,
                Checked   = props.Checked,
                Disabled  = props.Disabled,
                OnChange  = e => props.OnChange(e.CurrentTarget.Value)
            };

            return
                (DOM.Span(
                     new Attributes {
                ClassName = props.ClassName.Value
            },
                     DOM.Label(lblAtt, props.Title.Value),
                     DOM.Input(iAtt)
                     ));
        }
예제 #19
0
        /// <summary>
        /// Creates a <see cref="RuleBook"/> by parsing the content of the
        /// indicated configuration file.
        /// </summary>
        /// <param name="filename">The configuration filename.</param>
        /// <returns>A <see cref="RuleBook"/> instance created using the
        ///	details in the configuration file.</returns>
        public static RuleBook Load(string filename)
        {
            RuleBook ruleBook = new RuleBook();

            FileStream  stream   = File.OpenRead(Application.PathTo(filename));
            XmlDocument document = XmlUtility.NonValidatingParse(stream);

            XmlNodeList list = DOM.GetChildElements(document.DocumentElement);

            foreach (XmlElement context in list)
            {
                if (context.LocalName.Equals("identifier"))
                {
                    string name = context.GetAttribute("name");

                    Property [] properties = LoadProperties(XPath.Paths(context, "property"));
                    IFormatter  formatter  = (IFormatter)LoadClass(XPath.Paths(context, "formatter"));

                    ruleBook.Add(new IdentifierRule(name, properties, formatter));
                }
                else
                {
                    log.Warn("Unexpected element '" + context.LocalName + "'");
                }
            }

            return(ruleBook);
        }
예제 #20
0
        public int GetKeyValueInt(string sSection, string sKey, int iDefault)
        {
            int value;

            if (DOM.ContainsKey(sSection))
            {
                if (DOM[sSection].ContainsKey(sKey))
                {
                    if (Int32.TryParse(DOM[sSection][sKey], out value))
                    {
                        return(value);
                    }
                    else
                    {
                        return(iDefault);
                    }
                }
                else
                {
                    return(iDefault);
                }
            }
            else
            {
                return(iDefault);
            }
        }
예제 #21
0
        public override ReactElement Render()
        {
            return(DOM.Div
                   (
                       new Attributes {
            },

                       new MessageEcho(new MessageEcho.Props
            {
                OnAdded = text =>
                {
                    var nextState = state;
                    nextState.Messages =
                        nextState.Messages
                        .Concat <string>(new string[] { text })
                        .ToArray();

                    SetState(nextState);
                }
            }),

                       DOM.UL
                       (
                           state.Messages.Select(msg => DOM.Li(msg))
                       )
                   ));
        }
예제 #22
0
 public override VNode Render()
 {
     return(Row(
                Styles.MainMenuItem,
                Div(Styles.Wicon & Styles.MR0P5, DOM.Icon(Icon)),
                Text(Name)
                ));
 }
예제 #23
0
 void InitializeCornerLabelDiv()
 {
     if (_cornerLabelDiv == null)
     {
         _cornerLabelDiv = DOM.div("ui corner label").AppendTo(_root);
         DOM.i("asterisk icon").AppendTo(_cornerLabelDiv);
         _root.AddClass("labeled");
     }
 }
예제 #24
0
 public override ReactElement Render()
 {
     return(DOM.Div(null,
                    new NavigationLinks(props.Navigator, new ClassName("main-nav")),
                    DOM.Div(new Attributes {
         ClassName = "content"
     }, "NOT FOUND")
                    ));
 }
예제 #25
0
 public override ReactElement Render()
 {
     return(DOM.Div(new Attributes {
         ClassName = "requested-at"
     },
                    "Page navigated to at ",
                    props.RequestedAt.ToString("HH:mm:ss")
                    ));
 }
예제 #26
0
 public override VNode Render()
 {
     return(Row(
                IsSelected ? Styles.SubMenuItemSelected : Styles.SubMenuItem,
                Action,
                Div(Styles.Wicon & Styles.MR0P5, DOM.Icon(Icon)),
                Text(Name)
                ));
 }
예제 #27
0
 private void CreateDOM(ref DOM _dom_temp, string _htmldoc)
 {
     _htmldoc = _htmldoc.Replace("\r\n", "");
     _htmldoc = _htmldoc.Replace("\r", "");
     _htmldoc = _htmldoc.Replace("\n", "");
     if (_htmldoc.Trim() != "")
     {
         _dom_temp.prepareDOM(_htmldoc);
     }
 }
예제 #28
0
        private static void Main()
        {
            var container = Document.CreateElement("div");

            Document.Body.AppendChild(container);
            React.Render(
                DOM.Div("This was rendered by React!"),
                container
                );
        }
예제 #29
0
        protected virtual void Render()
        {
            _root.Empty();

            _root.Css("height", "100%");

            (_textArea = DOM.textarea()).AppendTo(_root).Css("height", "100%");

            Window.SetTimeout(() => { Render(_textArea.Get(0)); }, 0);
        }
예제 #30
0
        private ReactElement GetOptionX(int index, string txt)
        {
            var optionX = DOM.Option(
                new OptionAttributes {
                Key = index, Value = txt
            },
                txt
                );

            return(optionX);
        }
예제 #31
0
 public I3String Initialize(DOM parent, int id, Vector3 pos)
 {
     this.id                 = id;
     this.mesh               = parent.cylMesh;
     this.material           = parent.material;
     this.radius            *= cfg.domScale * cfg.globalScale;
     transform.parent        = parent.transform;
     pos.y                   = 0; //y is up, seems so
     transform.localPosition = pos;
     return(this);
 }
예제 #32
0
 public override ReactElement Render()
 {
     return(DOM.Input(new InputAttributes
     {
         Type = InputType.Text,
         ClassName = props.ClassName.IsDefined ? props.ClassName.Value : null,
         Disabled = props.Disabled,
         Value = props.Content,
         OnChange = e => props.OnChange(e.CurrentTarget.Value)
     }));
 }
예제 #33
0
        public List<Match> ParseMatches(DOM document)
        {
            var matches = new List<Match>();
            try
            {
                var upcomingGamesSection = document.HtmlDoc.DocumentNode.SelectSingleNode("//section[@class='upcoming-games']");
                var matchRows = upcomingGamesSection.SelectNodes("//tr[@data-match-id]");
                var homeTeamNodes = upcomingGamesSection.SelectNodes("//span[@class='team home']");
                var awayTeamNodes = upcomingGamesSection.SelectNodes("//span[@class='team away']");
                var matchDates = upcomingGamesSection.SelectNodes("//span[@class='date-short matchTid']");
                var matchTimes = upcomingGamesSection.SelectNodes("//span[@class='time matchTid']");
                var locations = upcomingGamesSection.SelectNodes("//a[@class='location']");
                for (int i = 0; i < matchRows.Count; i++)
                {
                    var homeTeamNode = homeTeamNodes[i];
                    var homeTeamName = HttpUtility.HtmlDecode(homeTeamNode.InnerHtml);
                    var awayTeamNode = awayTeamNodes[i];
                    var awayTeamName = HttpUtility.HtmlDecode(awayTeamNode.InnerHtml);
                    var matchDate = matchDates[i].InnerText;
                    if (matchDate == "Imorgon")
                    {
                        var tomorrow = DateTime.Now.AddDays(1);
                        matchDate = string.Format("{0}/{1}", tomorrow.Day, tomorrow.Month);
                    }
                    if (matchDate == "Idag")
                    {
                        var today = DateTime.Now;
                        matchDate = string.Format("{0}/{1}", today.Day, today.Month);
                    }
                    var dateParts = matchDate.Split("/".ToCharArray());
                    var dayOfMonth = int.Parse(dateParts[0]);
                    var month = int.Parse(dateParts[1]);
                    var matchTime = matchTimes[i].InnerText;
                    var timeParts = matchTime.Split(":".ToCharArray());
                    var hour = int.Parse(timeParts[0]);
                    var minutes = int.Parse(timeParts[1]);
                    var matchDateComplete = new DateTime(DateTime.Now.Year, month, dayOfMonth, hour, minutes, 0);
                    var location = locations[i].InnerText;
                    matches.Add(Match.CreateNew(matchDateComplete, homeTeamName, awayTeamName, location));
                }
                return matches;

            }
            catch (Exception)
            {
                return matches;
            }
        }
예제 #34
0
    public List<Match> GetUpcomingMatches(int seriesID)
    {
        List<Match> Upcoming = (List<Match>)Utilities.GetFromCache(seriesID + ":Upcoming");

            if (Upcoming == null)
            {
                Upcoming = new List<Match>();

                DOM Document = new DOM(GetWidgetUrl("cominginleague", seriesID));

                var TableRows = Document.Query("tr");
                char[] querystringSplitChar = { '=' };

                int RowCount = 0;
                foreach (XmlNode Row in TableRows)
                {
                    try
                    {
                        if (RowCount > 2)
                        {
                            var Columns = Row.SelectNodes("td");

                            Match match = new Match();
                            match.Time = DateTime.Parse(Columns.ValueOfIndex(0));
                            match.MatchName = Columns.ValueOfIndex(1);
                            string MatchURI = Columns[1].SelectSingleNode("a").GetAttributeValue("href");
                            match.ID = MatchURI.Split(querystringSplitChar).LastOrDefault().ToString();

                            PopulateMatchDetails(match);
                            Upcoming.Add(match);

                        }
                        RowCount = RowCount + 1;
                    }
                    catch (Exception ex)
                    {

                    }
                }

                Utilities.InsertToCache(seriesID + ":Upcoming", Upcoming);

            }

            return Upcoming;
    }
예제 #35
0
    public List<TeamResults> GetScoreTable(int seriesID)
    {
        List<TeamResults> ScoreTable = (List<TeamResults>)Utilities.GetFromCache(seriesID + ":Scores");

            if (ScoreTable == null)
            {

                ScoreTable = new List<TeamResults>();

                DOM Document = new DOM(GetWidgetUrl("table", seriesID));

                var TableRows = Document.Query("table//tr");

                int RowCount = 0;
                foreach (XmlNode Row in TableRows)
                {
                    if (RowCount > 2)
                    {
                        var Columns = Row.SelectNodes("td");

                        TeamResults score = new TeamResults();

                        score.TeamName = Columns.ValueOfIndex(0);

                        score.MatchesPlayed = Columns.ValueOfIndex(1);
                        score.MatchesWon = Columns.ValueOfIndex(2);
                        score.MatchesDraw = Columns.ValueOfIndex(3);
                        score.MatchesLost = Columns.ValueOfIndex(4);
                        score.GoalsMadeAndReceived = Columns.ValueOfIndex(5);
                        score.Difference = Columns.ValueOfIndex(6);
                        score.Points = Columns.ValueOfIndex(7);

                        ScoreTable.Add(score);
                    }
                    RowCount = RowCount + 1;
                }
                    Utilities.InsertToCache(seriesID + ":Scores", ScoreTable);
                }

            return ScoreTable;
    }
예제 #36
0
    public List<Series> GetSeries()
    {
        List<Series> AllSeries = (List<Series>)Utilities.GetFromCache("AllSeries");

            if (AllSeries == null) {
                AllSeries = new List<Series>();
                DOM Document = new DOM("http://www.svenskfotboll.se");
                var Series = Document.Query("select[@id='ftid-stickybar']//option");
                foreach(XmlNode node in Series){
                    Series serie = new Series();
                    serie.ID = int.Parse(node.GetAttributeValue("value"));
                    serie.Name = node.InnerText;
                    AllSeries.Add(serie);
                }

               Utilities.InsertToCache("AllSeries", AllSeries);

            }

            return AllSeries;
    }
예제 #37
0
 public DOMImplementation(DOM.DOMImplementation other)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("DOMImplementation#", "DOMImplementation(const DOM::DOMImplementation&)", typeof(void), typeof(DOM.DOMImplementation), other);
 }
예제 #38
0
 public virtual short AcceptNode(DOM.Node n)
 {
     return (short) interceptor.Invoke("acceptNode#", "acceptNode(const DOM::Node&)", typeof(short), typeof(DOM.Node), n);
 }
예제 #39
0
 public HTMLTableElement(DOM.HTMLTableElement other)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("HTMLTableElement#", "HTMLTableElement(const DOM::HTMLTableElement&)", typeof(void), typeof(DOM.HTMLTableElement), other);
 }
예제 #40
0
 /// <remarks>
 ///  see tHead
 ///      </remarks>		<short>    see tHead      </short>
 public void SetTHead(DOM.HTMLTableSectionElement arg1)
 {
     interceptor.Invoke("setTHead#", "setTHead(const DOM::HTMLTableSectionElement&)", typeof(void), typeof(DOM.HTMLTableSectionElement), arg1);
 }
예제 #41
0
 /// <remarks>
 ///  see summary
 ///      </remarks>		<short>    see summary      </short>
 public void SetSummary(DOM.DOMString arg1)
 {
     interceptor.Invoke("setSummary#", "setSummary(const DOM::DOMString&)", typeof(void), typeof(DOM.DOMString), arg1);
 }
예제 #42
0
 /// <remarks>
 ///  see selectorText
 ///      </remarks>		<short>    see selectorText </short>
 public void SetSelectorText(DOM.DOMString arg1)
 {
     interceptor.Invoke("setSelectorText#", "setSelectorText(const DOM::DOMString&)", typeof(void), typeof(DOM.DOMString), arg1);
 }
예제 #43
0
 /// <remarks>
 ///  Introduced in DOM Level 3
 ///  This method makes available a DOMImplementation's specialized
 ///  interface.
 /// <param> name="feature" The name of the feature requested (case-insensitive)
 /// </param></remarks>		<return> Returns an alternate DOMImplementation which implements
 ///  the specialized APIs of the specified feature, if any, or null
 ///  if there is no alternate DOMImplementation object which implements
 ///  interfaces associated with that feature. Any alternate DOMImplementation
 ///  returned by this method must delegate to the primary core DOMImplementation
 ///  and not return results inconsistent with the primary DOMImplementation.
 ///      </return>
 /// 		<short>    Introduced in DOM Level 3  This method makes available a DOMImplementation's specialized  interface.</short>
 public DOM.DOMImplementation GetInterface(DOM.DOMString feature)
 {
     return (DOM.DOMImplementation) interceptor.Invoke("getInterface#", "getInterface(const DOM::DOMString&) const", typeof(DOM.DOMImplementation), typeof(DOM.DOMString), feature);
 }
예제 #44
0
 /// <remarks>
 ///  see bgColor
 ///      </remarks>		<short>    see bgColor      </short>
 public void SetBgColor(DOM.DOMString arg1)
 {
     interceptor.Invoke("setBgColor#", "setBgColor(const DOM::DOMString&)", typeof(void), typeof(DOM.DOMString), arg1);
 }
예제 #45
0
 /// <remarks>
 ///  Introduced in DOM Level 2
 ///  Creates an XML Document object of the specified type with its document
 ///  element. HTML-only DOM implementations do not need to implement this
 ///  method.
 /// <param> name="namespaceURI" The namespace URI of the document element to create.
 /// </param><param> name="qualifiedName" The qualified name of the document element to be
 ///  created.
 /// </param><param> name="doctype" The type of document to be created or null. When doctype
 ///  is not null, its Node.ownerDocument attribute is set to the document
 ///  being created.
 /// </param> NAMESPACE_ERR: Raised if the qualifiedName is malformed, if the
 ///  qualifiedName has a prefix and the namespaceURI is null, or if the
 ///  qualifiedName has a prefix that is "xml" and the namespaceURI is
 ///  different from "http://www.w3.org/XML/1998/namespace" [Namespaces].
 ///  WRONG_DOCUMENT_ERR: Raised if doctype has already been used with a
 ///  different document or was created from a different implementation.
 ///      </remarks>		<return> A new Document object.
 /// </return>
 /// 		<short>    Introduced in DOM Level 2 </short>
 public DOM.Document CreateDocument(DOM.DOMString namespaceURI, DOM.DOMString qualifiedName, DOM.DocumentType doctype)
 {
     return (DOM.Document) interceptor.Invoke("createDocument###", "createDocument(const DOM::DOMString&, const DOM::DOMString&, const DOM::DocumentType&)", typeof(DOM.Document), typeof(DOM.DOMString), namespaceURI, typeof(DOM.DOMString), qualifiedName, typeof(DOM.DocumentType), doctype);
 }
예제 #46
0
 public HTMLSelectElement(DOM.Node other)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("HTMLSelectElement#", "HTMLSelectElement(const DOM::Node&)", typeof(void), typeof(DOM.Node), other);
 }
예제 #47
0
 public DocumentFragment(DOM.Node other)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("DocumentFragment#", "DocumentFragment(const DOM::Node&)", typeof(void), typeof(DOM.Node), other);
 }
예제 #48
0
 public WebKitDOMCSSDeclarationStyle GetStyleFromElement(DOM.Element element, string pseudoElement = "") // this feature has not been implemented yet
 {
     return new WebKitDOMCSSDeclarationStyle(browser.WebView.computedStyleForElement((IDOMElement)element.GetWebKitObject(), pseudoElement));
 }
예제 #49
0
 /// <remarks>
 ///  Introduced in DOM Level 2
 ///  Creates an empty DocumentType node. Entity declarations and notations
 ///  are not made available. Entity reference expansions and default
 ///  attribute additions do not occur. It is expected that a future version
 ///  of the DOM will provide a way for populating a DocumentType.
 ///  HTML-only DOM implementations do not need to implement this method.
 /// <param> name="qualifiedName" The qualified name of the document type to be
 ///  created.
 /// </param><param> name="publicId" The external subset public identifier.
 /// </param><param> name="systemId" The external subset system identifier.
 /// </param> NAMESPACE_ERR: Raised if the qualifiedName is malformed.
 ///      </remarks>		<return> A new DocumentType node with Node.ownerDocument set to null.
 /// </return>
 /// 		<short>    Introduced in DOM Level 2 </short>
 public DOM.DocumentType CreateDocumentType(DOM.DOMString qualifiedName, DOM.DOMString publicId, DOM.DOMString systemId)
 {
     return (DOM.DocumentType) interceptor.Invoke("createDocumentType###", "createDocumentType(const DOM::DOMString&, const DOM::DOMString&, const DOM::DOMString&)", typeof(DOM.DocumentType), typeof(DOM.DOMString), qualifiedName, typeof(DOM.DOMString), publicId, typeof(DOM.DOMString), systemId);
 }
예제 #50
0
 /// <remarks>
 ///  see caption
 ///      </remarks>		<short>    see caption      </short>
 public void SetCaption(DOM.HTMLTableCaptionElement arg1)
 {
     interceptor.Invoke("setCaption#", "setCaption(const DOM::HTMLTableCaptionElement&)", typeof(void), typeof(DOM.HTMLTableCaptionElement), arg1);
 }
예제 #51
0
 /// <remarks>
 ///  Introduced in DOM Level 2
 ///  This method is from the HTMLDOMImplementation interface
 ///  Creates an HTMLDocument with the minimal tree made of these
 ///  elements: HTML,HEAD,TITLE and BODY.
 ///  It extends the core interface which can be used to create an
 ///  XHTML document by passing the XHTML namespace as the namespace
 ///  for the root element.
 /// <param> name="title" The title of the document to be set as the content
 ///  of the TITLE element, through a child Text node.
 /// </param></remarks>		<return> the HTMLdocument
 ///      </return>
 /// 		<short>    Introduced in DOM Level 2  This method is from the HTMLDOMImplementation interface </short>
 public DOM.HTMLDocument CreateHTMLDocument(DOM.DOMString title)
 {
     return (DOM.HTMLDocument) interceptor.Invoke("createHTMLDocument#", "createHTMLDocument(const DOM::DOMString&)", typeof(DOM.HTMLDocument), typeof(DOM.DOMString), title);
 }
예제 #52
0
 /// <remarks>
 ///  see cellSpacing
 ///      </remarks>		<short>    see cellSpacing      </short>
 public void SetCellSpacing(DOM.DOMString arg1)
 {
     interceptor.Invoke("setCellSpacing#", "setCellSpacing(const DOM::DOMString&)", typeof(void), typeof(DOM.DOMString), arg1);
 }
예제 #53
0
 /// <remarks>
 ///  Test if the DOM implementation implements a specific feature.
 /// <param> name="feature" The package name of the feature to test. In
 ///  Level 1, the legal values are "HTML" and "XML"
 ///  (case-insensitive).
 /// </param><param> name="version" This is the version number of the package name
 ///  to test. In Level 1, this is the string "1.0". If the version
 ///  is not specified, supporting any version of the feature will
 ///  cause the method to return <code>true</code> .
 /// </param>     </remarks>		<return> <code>true</code> if the feature is implemented in
 ///  the specified version, <code>false</code> otherwise.
 /// </return>
 /// 		<short>    Test if the DOM implementation implements a specific feature.</short>
 public bool HasFeature(DOM.DOMString feature, DOM.DOMString version)
 {
     return (bool) interceptor.Invoke("hasFeature##", "hasFeature(const DOM::DOMString&, const DOM::DOMString&)", typeof(bool), typeof(DOM.DOMString), feature, typeof(DOM.DOMString), version);
 }
예제 #54
0
 public CSSPageRule(DOM.CSSRule other)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("CSSPageRule#", "CSSPageRule(const DOM::CSSRule&)", typeof(void), typeof(DOM.CSSRule), other);
 }
예제 #55
0
 /// <remarks>
 ///  Introduced in DOM Level 2
 ///  This method is from the DOMImplementationCSS interface
 ///  Creates a new CSSStyleSheet.
 /// <param> name="title" The advisory title. See also the Style Sheet Interfaces
 ///  section.
 /// </param><param> name="media" The comma-separated list of media associated with the
 ///  new style sheet. See also the Style Sheet Interfaces section.
 /// </param></remarks>		<return> A new CSS style sheet.
 /// </return>
 /// 		<short>    Introduced in DOM Level 2  This method is from the DOMImplementationCSS interface </short>
 public DOM.CSSStyleSheet CreateCSSStyleSheet(DOM.DOMString title, DOM.DOMString media)
 {
     return (DOM.CSSStyleSheet) interceptor.Invoke("createCSSStyleSheet##", "createCSSStyleSheet(const DOM::DOMString&, const DOM::DOMString&)", typeof(DOM.CSSStyleSheet), typeof(DOM.DOMString), title, typeof(DOM.DOMString), media);
 }
예제 #56
0
파일: DOM_Element.cs 프로젝트: KDE/kimono
 public static bool KhtmlValidAttrName(DOM.DOMString name)
 {
     return (bool) staticInterceptor.Invoke("khtmlValidAttrName#", "khtmlValidAttrName(const DOM::DOMString&)", typeof(bool), typeof(DOM.DOMString), name);
 }
예제 #57
0
 /// <remarks>
 ///  see value
 ///      </remarks>		<short>    see value      </short>
 public void SetValue(DOM.DOMString arg1)
 {
     interceptor.Invoke("setValue#", "setValue(const DOM::DOMString&)", typeof(void), typeof(DOM.DOMString), arg1);
 }
예제 #58
0
 public AbstractView(DOM.AbstractView other)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("AbstractView#", "AbstractView(const DOM::AbstractView&)", typeof(void), typeof(DOM.AbstractView), other);
 }
예제 #59
0
 /// <remarks>
 ///  Add a new element to the collection of <code>OPTION</code>
 ///  elements for this <code>SELECT</code> .
 /// <param> name="element" The element to add.
 /// </param><param> name="before" The element to insert before, or 0 for the
 ///  tail of the list.
 /// </param>     </remarks>		<short>    Add a new element to the collection of <code>OPTION</code>  elements for this <code>SELECT</code> .</short>
 public void Add(DOM.HTMLElement element, DOM.HTMLElement before)
 {
     interceptor.Invoke("add##", "add(const DOM::HTMLElement&, const DOM::HTMLElement&)", typeof(void), typeof(DOM.HTMLElement), element, typeof(DOM.HTMLElement), before);
 }
예제 #60
0
 /// <remarks>
 ///  Introduced in DOM Level 2
 ///  This method is from the ViewCSS interface
 ///  This method is used to get the computed style as it is defined in
 ///  [CSS2].
 /// <param> name="elt" The element whose style is to be computed. This parameter
 ///  cannot be null.
 /// </param><param> name="pseudoElt" The pseudo-element or null if none.
 /// </param></remarks>		<return> The computed style. The CSSStyleDeclaration is read-only and
 ///  contains only absolute values.
 ///      </return>
 /// 		<short>    Introduced in DOM Level 2  This method is from the ViewCSS interface </short>
 public DOM.CSSStyleDeclaration GetComputedStyle(DOM.Element elt, DOM.DOMString pseudoElt)
 {
     return (DOM.CSSStyleDeclaration) interceptor.Invoke("getComputedStyle##", "getComputedStyle(const DOM::Element&, const DOM::DOMString&)", typeof(DOM.CSSStyleDeclaration), typeof(DOM.Element), elt, typeof(DOM.DOMString), pseudoElt);
 }