Ejemplo n.º 1
0
        public ToggleTricksForm(LogicMode logicMode, string userLogicFilename, IEnumerable <string> tricksEnabled)
        {
            InitializeComponent();
            Result = tricksEnabled.ToList();

            var lines    = LogicUtils.ReadRulesetFromResources(logicMode, userLogicFilename);
            var itemList = LogicUtils.PopulateItemListFromLogicData(lines);

            var y      = 9;
            var deltaY = 23;
            var tricks = itemList.Where(io => io.IsTrick);

            foreach (var itemObject in tricks.OrderBy(io => io.Name))
            {
                var cTrick = new CheckBox();
                cTrick.Tag     = itemObject;
                cTrick.Checked = tricksEnabled.Contains(itemObject.Name);
                cTrick.Text    = itemObject.Name;
                TooltipBuilder.SetTooltip(cTrick, itemObject.TrickTooltip);
                cTrick.Location        = new Point(9, y);
                cTrick.Size            = new Size(pTricks.Width - 50, deltaY);
                cTrick.CheckedChanged += cTrick_CheckedChanged;
                pTricks.Controls.Add(cTrick);
                y += deltaY;
            }
        }
Ejemplo n.º 2
0
 public ToggleTricksForm(LogicMode logicMode, string userLogicFilename, IEnumerable <string> tricksEnabled)
 {
     InitializeComponent();
     Result    = tricksEnabled.ToHashSet();
     LogicFile = LogicUtils.ReadRulesetFromResources(logicMode, userLogicFilename);
     Write_Tricks();
 }