Ejemplo n.º 1
0
        public void UnavailableCommandDisablesAndHidesItem()
        {
            Command command = new Command();
            ToolStripItemCommandAdapter adapter = new ToolStripItemCommandAdapter(item, "Click");

            command.AddCommandAdapter(adapter);

            command.Status = CommandStatus.Unavailable;

            Assert.IsFalse(item.Enabled);
            Assert.IsFalse(item.Visible);
        }
Ejemplo n.º 2
0
        public void DisabledCommandDisablesButShowsItem()
        {
            Command command = new Command();
            ToolStripItemCommandAdapter adapter = new ToolStripItemCommandAdapter(item, "Click");

            command.AddCommandAdapter(adapter);

            command.Status = CommandStatus.Disabled;

            Assert.IsFalse(item.Enabled);
            Assert.IsTrue(item.Visible);
        }