Ejemplo n.º 1
0
        //Melee properties


        public new static void Initialize()
        {
            FilePath = "Content\\entities\\weapon\\weapons.json";
            try
            {
                string RawFile = File.ReadAllText(FilePath);
                ExistingWeapons = JsonConvert.DeserializeObject <List <Weapon> >(RawFile);

                ExistingItems.AddRange(ExistingWeapons);
            }
            catch (FileNotFoundException e)
            {
                Console.WriteLine(e);
                ExistingWeapons = new List <Weapon>();
            }
        }
Ejemplo n.º 2
0
    /// <summary>
    /// External unigrid databound.
    /// </summary>
    protected object VariantGrid_OnExternalDataBound(object sender, string sourceName, object parameter)
    {
        DataRowView row = (DataRowView)parameter;

        switch (sourceName)
        {
        case UniGrid.SELECTION_EXTERNAL_DATABOUND:

            // Disable checkbox if variant already exists
            if (ExistingItems.Contains(ValidationHelper.GetString(row["RowNumber"], string.Empty)))
            {
                CMSCheckBox chkBox = (CMSCheckBox)sender;
                chkBox.Enabled = false;
            }

            break;
        }

        return(parameter);
    }
Ejemplo n.º 3
0
 private ItemPricingModel GetExistingItemPricing(int id)
 {
     return(ExistingItems.FirstOrDefault(price => price.Id == id));
 }