public ViewToolBarCommand(ICommandTarget commandTarget, CsUnitControl csUnitCtrl) : base(commandTarget, csUnitCtrl, "&View", "&Tool Bar", _menuPosition) { ConfigCurrentUser config = new ConfigCurrentUser(); CommandTarget.ToolBarVisible = config.ToolBarVisible; Checked = config.ToolBarVisible; }
protected override void Execute(object sender, EventArgs args) { CommandTarget.ToolBarVisible = !CommandTarget.ToolBarVisible; ConfigCurrentUser config = new ConfigCurrentUser(); config.ToolBarVisible = CommandTarget.ToolBarVisible; ToolStripMenuItem.Checked = CommandTarget.ToolBarVisible; }
private void MainForm_Load(object sender, EventArgs e) { var config = new ConfigCurrentUser(); Location = config.MainFormLocation; Size = config.MainFormSize; Command.CreateCommands(this, _csUnitControl); Command.FillToolStrip(_toolStrip); if( _clh.HasOption("recipe") ) { if( Utils.FileExists(_clh.GetOptionValueFor("recipe"), true)) { RecipeFactory.Load(_clh.GetOptionValueFor("recipe")); } } else if( _clh.HasOption("assembly") ) { if( Utils.FileExists(_clh.GetOptionValueFor("assembly"), true)) { var assemblyPathName = _clh.GetOptionValueFor("assembly"); if( !Path.IsPathRooted(assemblyPathName) ) { assemblyPathName = Path.Combine(Environment.CurrentDirectory, assemblyPathName); } RecipeFactory.Current.AddAssembly(assemblyPathName); } } else switch(config.StartupLoadItem) { case "Recipe": if( config.RecentRecipies.Count > 0 && Utils.FileExists(config.RecentRecipies[0], true) ) { RecipeFactory.Load(config.RecentRecipies[0]); } break; case "Assembly": if( config.RecentAssemblies.Count > 0 && Utils.FileExists(config.RecentAssemblies[0], true)) { RecipeFactory.Current.AddAssembly(config.RecentAssemblies[0]); } break; } // Setup the xml handler if( _clh.HasOption("xml") ) { _xmlWriter = new DefaultXmlWriter(RecipeFactory.Current, _clh.GetOptionValueFor("xml")); } // Automatically start the recipe if( _clh.HasOption("autorun") ) { if(RecipeFactory.Current != null) { var testRun = new TestRun(new AllTestsCriterion()); RecipeFactory.Current.RunTests(testRun); } } }