Beispiel #1
0
        private dynamic ParseDelete(string statement)
        {
            dynamic delete = new ExpandoObject();

            delete.Type = "DELETE";
            if (!statement.Contains("WHERE"))
            {
                var tableName = SubstringExtensions.Between(statement, "DELETE FROM", ";", true);
                delete.Table = tableName;
            }
            else
            {
                var tableName = SubstringExtensions.Between(statement, "DELETE FROM", "WHERE", true);
                delete.Table = tableName;

                dynamic wherExpandoObject = new ExpandoObject();
                var     whereText         = SubstringExtensions.Between(statement, "WHERE", ";", true);
                int     counter           = 0;
                foreach (var oper in ComparisonOperators)
                {
                    if (whereText.Contains(oper))
                    {
                        dynamic critera = new ExpandoObject();
                        critera.Left     = SubstringExtensions.Before(whereText, oper);
                        critera.Operator = oper;
                        critera.Right    = SubstringExtensions.After(whereText, oper);
                        AddProperty(wherExpandoObject, counter++.ToString(), critera);
                    }
                }
                AddProperty(delete, "Where", wherExpandoObject);
            }

            return(delete);
        }
        /// <summary>
        /// Clears and re-creates the dropdown selection of League of Legends versions
        /// </summary>
        internal void UpdateMainTopBarVersions()
        {
            try
            {
                //Get current selected verions
                string currentVersion = "";
                if (dropDownButtonRiotVersion.Text.Contains(" "))
                {
                    currentVersion = SubstringExtensions.Before(dropDownButtonRiotVersion.Text, " ");
                }
                else
                {
                    currentVersion = dropDownButtonRiotVersion.Text;
                }

                //If the selected version is still current then add back in the " Current LoL"
                if (currentVersion == form1.getAllVersionAvailable.realm.V)
                {
                    currentVersion += " Current LoL";
                }

                popupMenuVersions.ItemLinks.Clear();
                foreach (string s in form1.getAllVersionAvailable.versions)
                {
                    BarButtonItem barButtonItemNew = new BarButtonItem();

                    if (form1.getAllVersionAvailable.realm.V == s)
                    {
                        barButtonItemNew.Caption = s + " Current LoL";
                        if (currentVersion.Length < 2)
                        {
                            dropDownButtonRiotVersion.Text = barButtonItemNew.Caption;
                        }
                        else
                        {
                            dropDownButtonRiotVersion.Text = currentVersion;
                        }
                    }
                    else
                    {
                        barButtonItemNew.Caption = s;
                    }
                    barButtonItemNew.ItemClick += barButtonItemVersionList_ItemClick;
                    barButtonItemNew.Name       = s;
                    popupMenuVersions.AddItem(barButtonItemNew);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
        private static void ItemCorrection(ItemStatic temp)
        {
            string        descriptionMain;
            List <string> uniqueDescriptions = new List <string>();

            if (temp.SanitizedDescription.Contains("UNIQUE"))
            {
                descriptionMain = SubstringExtensions.Before(temp.SanitizedDescription, "UNIQUE");
                int i = 0;
                while ((i = temp.Description.IndexOf("UNIQUE", i)) != -1)
                {
                    int j = temp.Description.IndexOf("<br>", i);
                    if (j == -1)
                    {
                        j = temp.Description.Length;
                    }

                    string uniqueDescription = temp.Description.Substring(i, j - i);

                    if (!uniqueDescription.Contains("UNIQUE Active") &&                  //Todo: All of these should instead of being ignored should be filtered on the Stats Tab and Activatable Items or On/Off
                        !uniqueDescription.Contains("UNIQUE Passive - Point Runner:") &&
                        !uniqueDescription.Contains("UNIQUE Passive - Furor:") &&
                        !uniqueDescription.Contains("UNIQUE Passive - Captain:") &&
                        !uniqueDescription.Contains("UNIQUE Passive - Spellblade:") &&
                        !uniqueDescription.Contains("Falling below 50% Health grants"))
                    {
                        uniqueDescriptions.Add(uniqueDescription);
                    }
                    i++;
                }
            }
            else
            {
                descriptionMain = temp.SanitizedDescription;
            }


            StatCorrection(descriptionMain, temp.Stats);
            int ind = 0;

            temp.UniqueStats = new List <KeyValuePair <string, StatsStatic> >();
            foreach (string s in uniqueDescriptions)
            {
                if (s.Contains("UNIQUE Passive:") || s.Contains("UNIQUE Aura:"))
                {
                    if (temp.Name.Contains("Ionia"))
                    {
                        string tempNametest = SubstringExtensions.Before(temp.Name, " - ");
                    }
                    else
                    {
                        string tempNametest = temp.Name;
                    }

                    string tempName = (temp.Name.Contains(" - ")) ? SubstringExtensions.Before(temp.Name, " - ") : temp.Name;
                    temp.UniqueStats.Add(new KeyValuePair <string, StatsStatic>(tempName + "~" + s, new StatsStatic()));
                }
                else if (s.Contains("UNIQUE Passive - Enhanced Movement"))
                {
                    temp.UniqueStats.Add(new KeyValuePair <string, StatsStatic>(SubstringExtensions.Before(s, ":"), new StatsStatic()));
                    temp.UniqueStats[ind].Value.FlatMovementSpeedMod = temp.Stats.FlatMovementSpeedMod;
                    temp.Stats.FlatMovementSpeedMod = 0.0;
                }
                else
                {
                    temp.UniqueStats.Add(new KeyValuePair <string, StatsStatic>(SubstringExtensions.Before(s, ":"), new StatsStatic()));
                }
                StatCorrection(s, temp.UniqueStats[ind].Value);
                ind++;
            }
        }