Example #1
0
        static int _m_Exists(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                System.Collections.Generic.List <string> gen_to_be_invoked = (System.Collections.Generic.List <string>)translator.FastGetCSObj(L, 1);



                {
                    System.Predicate <string> _match = translator.GetDelegate <System.Predicate <string> >(L, 2);

                    bool gen_ret = gen_to_be_invoked.Exists(
                        _match);
                    LuaAPI.lua_pushboolean(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
 protected void rptBindColumns_OnItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     try
     {
         if (!(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem))
         {
             return;
         }
         CheckBox     chkSelection = (e.Item.FindControl("chkXlNames") as CheckBox);
         DropDownList drpSPList    = (DropDownList)e.Item.FindControl("drpSPlistColumns");
         System.Collections.Generic.List <DictionaryEntry> XlColumns = DataAccessProvider.getXlColnames(xlConn, ddlSheetName.SelectedValue, excelPath, excelExten);
         drpSPList.DataSource     = XlColumns;
         drpSPList.DataTextField  = "Value";
         drpSPList.DataValueField = "Key";
         drpSPList.DataBind();
         if (XlColumns.Exists(o => o.Value.ToString().Trim().ToLower().Equals(chkSelection.Text.ToString().Trim().ToLower())))
         {
             drpSPList.SelectedValue = chkSelection.Text;
             chkSelection.Checked    = true;
         }
     }
     catch (Exception ex)
     {
         SPErrorLogs.LogExceptionToSPLog(oWebpartName, "rptBindColumns_OnItemDataBound", ex);
     }
 }
Example #3
0
        public List <Game> NewGamesFromSteam()
        {
            var steam         = new Steam(_db.GetAll().steamKey, _db.GetAll().steamId);
            var allSteamGames = Steam.GetFromSteam().Result.response.games;
            var newGames      = new System.Collections.Generic.List <Game>();

            foreach (var newGame in allSteamGames)
            {
                if (games.Exists(g => g.SteamApID == newGame.appid) == false)
                {
                    newGames.Add(new Game
                    {
                        Name    = newGame.name,
                        LogoURL = "http://media.steampowered.com/steamcommunity/public/images/apps/" + newGame.appid + "/" + newGame.img_logo_url + ".jpg",
                        SteamOriginalImageURL = newGame.img_logo_url + ".jpg",
                        Store      = "Steam",
                        System     = "PC",
                        Disabled   = false,
                        BuyDate    = null,
                        Price      = null,
                        PlayedTime = newGame.playtime_forever,
                        Purchased  = true,
                        SteamApID  = newGame.appid
                    });
                }
            }
            return(newGames);
        }
Example #4
0
        private void SaveAllApplicationsFound()
        {
            using (File.AppendText((string)Paths.AllApplications))
                ;
            System.Collections.Generic.List <string> stringList1 = new System.Collections.Generic.List <string>();
            System.Collections.Generic.List <string> stringList2 = new System.Collections.Generic.List <string>();
            string convertedName = "";
            string str1          = File.ReadAllText((string)Paths.AllApplications);

            char[] separator = new char[2] {
                '\n', '\r'
            };
            foreach (string str2 in str1.Split(separator, StringSplitOptions.RemoveEmptyEntries))
            {
                stringList1.Add(str2);
            }
            using (StreamWriter streamWriter = File.AppendText((string)Paths.AllApplications))
            {
                foreach (NameObject nameObject in (Collection <NameObject>) this.List)
                {
                    convertedName = this.ConvertApplicationName(nameObject.Name);
                    if (!stringList1.Exists((Predicate <string>)(token => convertedName.Equals(token))))
                    {
                        streamWriter.WriteLine(convertedName);
                    }
                }
            }
        }
Example #5
0
 /// <summary>
 /// 检查指定元素是否存在(名称唯一模式时,按名称匹配)。
 /// </summary>
 /// <param name="item">为null直接返回false。</param>
 /// <returns>返回true表示存在。</returns>
 public bool Contains(IParameterInfo item)
 {
     if (item == null)
     {
         return(false);
     }
     if (_nameOnly)
     {
         StringComparison comparison = _ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
         return(_list.Exists(p => string.Equals(p.Name, item.Name, comparison)));
     }
     return(_list.Contains(item));
 }
Example #6
0
 static public int Exists(IntPtr l)
 {
     try {
         System.Collections.Generic.List <WWWRequest> self = (System.Collections.Generic.List <WWWRequest>)checkSelf(l);
         System.Predicate <WWWRequest> a1;
         checkDelegate(l, 2, out a1);
         var ret = self.Exists(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #7
0
        static int _m_Exists(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            System.Collections.Generic.List <object> __cl_gen_to_be_invoked = (System.Collections.Generic.List <object>)translator.FastGetCSObj(L, 1);


            try {
                {
                    System.Predicate <object> match = translator.GetDelegate <System.Predicate <object> >(L, 2);

                    bool __cl_gen_ret = __cl_gen_to_be_invoked.Exists(match);
                    LuaAPI.lua_pushboolean(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Example #8
0
 public bool Exists(Predicate <T> match)
 {
     return(list.Exists(match));
 }
Example #9
0
        public bool comparardnis(string texto)
        {
            bool a = ListaMedicos.Exists(x => x.dni == texto);

            return(a);
        }
Example #10
0
        public bool comparardni(string texto)
        {
            bool a = ListaPacientes.Exists(x => x.dni == texto);

            return(a);
        }
        private static bool smethod_0()
        {
            System.Collections.Generic.List <string> list = File.ReadAllLines(LootsFile).ToList <string>();
            if (predicate_0 == null)
            {
                predicate_0 = new Predicate <string>(Override.smethod_6);
            }
            if (!list.Exists(predicate_0))
            {
                ConsoleSystem.PrintError("ERROR: Spawn list for \"AILootList\" not found in \"lootslist.cfg\".", false);
                return(false);
            }
            if (predicate_1 == null)
            {
                predicate_1 = new Predicate <string>(Override.smethod_7);
            }
            if (!list.Exists(predicate_1))
            {
                ConsoleSystem.PrintError("ERROR: Spawn list for \"AmmoSpawnList\" not found in \"lootslist.cfg\".", false);
                return(false);
            }
            if (predicate_2 == null)
            {
                predicate_2 = new Predicate <string>(Override.smethod_8);
            }
            if (!list.Exists(predicate_2))
            {
                ConsoleSystem.PrintError("ERROR: Spawn list for \"JunkSpawnList\" not found in \"lootslist.cfg\".", false);
                return(false);
            }
            if (predicate_3 == null)
            {
                predicate_3 = new Predicate <string>(Override.smethod_9);
            }
            if (!list.Exists(predicate_3))
            {
                ConsoleSystem.PrintError("ERROR: Spawn list for \"MedicalSpawnList\" not found in \"lootslist.cfg\".", false);
                return(false);
            }
            if (predicate_4 == null)
            {
                predicate_4 = new Predicate <string>(Override.smethod_10);
            }
            if (!list.Exists(predicate_4))
            {
                ConsoleSystem.PrintError("ERROR: Spawn list for \"WeaponSpawnList\" not found in \"lootslist.cfg\".", false);
                return(false);
            }
            if (predicate_5 == null)
            {
                predicate_5 = new Predicate <string>(Override.smethod_11);
            }
            if (!list.Exists(predicate_5))
            {
                ConsoleSystem.PrintError("ERROR: Spawn list for \"SupplyDropSpawnListMaster\" not found in \"lootslist.cfg\".", false);
                return(false);
            }
            DatablockDictionary._lootSpawnLists.Clear();
            Dictionary <string, LootSpawnList> dictionary = new Dictionary <string, LootSpawnList>();

            foreach (string str in list)
            {
                string str2 = str.Trim();
                if (!string.IsNullOrEmpty(str2) && !str2.StartsWith("//"))
                {
                    if (str2.Contains("//"))
                    {
                        str2 = str2.Split(new string[] { "//" }, StringSplitOptions.RemoveEmptyEntries)[0].Trim();
                    }
                    if ((!string.IsNullOrEmpty(str2) && str2.StartsWith("[")) && str2.EndsWith("]"))
                    {
                        str2             = str2.Substring(1, str2.Length - 2);
                        dictionary[str2] = ScriptableObject.CreateInstance <LootSpawnList>();
                    }
                }
            }
            LootSpawnList list2 = null;

            LootSpawnList.LootWeightedEntry item = null;
            System.Collections.Generic.List <LootSpawnList.LootWeightedEntry> list3 = null;
            foreach (string str3 in list)
            {
                string str4 = str3.Trim();
                if (!string.IsNullOrEmpty(str4) && !str4.StartsWith("//"))
                {
                    if (str4.Contains("//"))
                    {
                        str4 = str4.Split(new string[] { "//" }, StringSplitOptions.RemoveEmptyEntries)[0].Trim();
                    }
                    if (!string.IsNullOrEmpty(str4))
                    {
                        if (str4.StartsWith("[") && str4.EndsWith("]"))
                        {
                            string str5 = str4.Substring(1, str4.Length - 2);
                            list2      = dictionary[str5];
                            list2.name = str5;
                            DatablockDictionary._lootSpawnLists.Add(list2.name, list2);
                            list3 = new System.Collections.Generic.List <LootSpawnList.LootWeightedEntry>();
                        }
                        else if (str4.Contains("=") && (list2 != null))
                        {
                            string   str6;
                            string[] strArray = str4.Split(new char[] { '=' });
                            if ((strArray.Length >= 2) && ((str6 = strArray[0].ToUpper()) != null))
                            {
                                if (str6 == "PACKAGESTOSPAWN")
                                {
                                    if (strArray[1].Contains(","))
                                    {
                                        strArray = strArray[1].Split(new char[] { ',' });
                                    }
                                    else
                                    {
                                        strArray = new string[] { strArray[1], strArray[1] };
                                    }
                                    int.TryParse(strArray[0], out list2.minPackagesToSpawn);
                                    int.TryParse(strArray[1], out list2.maxPackagesToSpawn);
                                }
                                else if (str6 == "SPAWNONEOFEACH")
                                {
                                    bool.TryParse(strArray[1], out list2.spawnOneOfEach);
                                }
                                else if (str6 == "NODUPLICATES")
                                {
                                    bool.TryParse(strArray[1], out list2.noDuplicates);
                                }
                                else if (str6 == "PACKAGELIST")
                                {
                                    strArray = strArray[1].Split(new string[] { "\t" }, StringSplitOptions.RemoveEmptyEntries);
                                    item     = new LootSpawnList.LootWeightedEntry();
                                    if (!dictionary.ContainsKey(strArray[1]))
                                    {
                                        ConsoleSystem.LogError(string.Format("Package {0} has a reference to an spawn list named {1}, but it not exist.", list2.name, strArray[1]));
                                    }
                                    else
                                    {
                                        item.obj = dictionary[strArray[1]];
                                        float.TryParse(strArray[0], out item.weight);
                                        int.TryParse(strArray[2], out item.amountMin);
                                        int.TryParse(strArray[3], out item.amountMax);
                                        list3.Add(item);
                                        list2.LootPackages = list3.ToArray();
                                    }
                                }
                                else if (str6 == "PACKAGEITEM")
                                {
                                    strArray = strArray[1].Split(new string[] { "\t" }, StringSplitOptions.RemoveEmptyEntries);
                                    item     = new LootSpawnList.LootWeightedEntry {
                                        obj = DatablockDictionary.GetByName(strArray[1])
                                    };
                                    if (item.obj == null)
                                    {
                                        ConsoleSystem.LogError(string.Format("Package {0} has a reference to an item named {1}, but it not exist.", list2.name, strArray[1]));
                                    }
                                    else
                                    {
                                        float.TryParse(strArray[0], out item.weight);
                                        int.TryParse(strArray[2], out item.amountMin);
                                        int.TryParse(strArray[3], out item.amountMax);
                                        list3.Add(item);
                                        list2.LootPackages = list3.ToArray();
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(true);
        }