Exemplo n.º 1
0
        void RefreshView()
        {
            var allItems =
                creatureColorDefinitions.GetColors().Select(color => new CreatureColorViewObject(color)).ToArray();

            objectListView.SetObjects(allItems);
            objectListView.DisableObjects(allItems.Where(o => o.BlockedForEditing));
            // refreshing to force FormatCell
            objectListView.RefreshObjects(objectListView.Objects.Cast <object>().ToList());
        }
 void SetupColorValuesDict()
 {
     foreach (var currentColor in creatureColorDefinitions.GetColors())
     {
         if (!CreatureColorValuesForEntityId.ContainsKey(currentColor.CreatureColorId))
         {
             CreatureColorValuesForEntityId.Add(currentColor.CreatureColorId, 1.0f);
         }
     }
 }
 void RebuildItems()
 {
     rootToolStripMenuItem.DropDownItems.Clear();
     rootToolStripMenuItem.DropDownItems.AddRange(
         creatureColorDefinitions.GetColors()
         .Select(color =>
     {
         var newItem = new ToolStripMenuItem()
         {
             Text = color.DisplayName
         };
         newItem.Click +=
             (sender, args) => menuItemClickAction.Invoke(color.CreatureColorId);
         return(newItem);
     })
         .Cast <ToolStripItem>()
         .ToArray());
 }