/// <summary>
        /// Creates the window panels menus.
        /// </summary>
        /// <returns> A MenuItemCollection.</returns>
        private MenuItemCollection BuildWindowMenuItems()
        {
            MenuItemCollection mnWindowItems = new MenuItemCollection();

            // event
            EventHandler evt = null;

            mnWindowItems.Add("1Designer",new Ecyware.GreenBlue.Controls.MenuItem("mnuSessionScripting","&Session Scripting Designer",evt));
            mnWindowItems.Add("2TextBrowser",new Ecyware.GreenBlue.Controls.MenuItem("mnuTextViewer","Text Viewer",evt));
            mnWindowItems.Add("3HtmlBrowser",new Ecyware.GreenBlue.Controls.MenuItem("mnuHtmlViewer","HTML Viewer",evt));

            ToolbarItem recordSession = new ToolbarItem();
            ToolbarItem browserRequestFirstButton = new ToolbarItem();
            ToolbarItem permitPopupWindow = new ToolbarItem();

            // Record Session
            recordSession.Enabled = true;
            recordSession.Name = "tbRecordSession";
            recordSession.Text = "Record Session";
            recordSession.Toggle = true;
            recordSession.ImageIndex = 10;
            recordSession.Delimiter = true;
            recordSession.CheckedChangedDelegate = null;

            //  Browser Request First Button
            browserRequestFirstButton.Enabled = true;
            browserRequestFirstButton.Name = "tbBrowserFirst";
            browserRequestFirstButton.Text = "Allow Browser Navigate First";
            browserRequestFirstButton.Toggle = true;
            browserRequestFirstButton.ImageIndex = 13;
            browserRequestFirstButton.Delimiter = false;
            browserRequestFirstButton.CheckedChangedDelegate = null;

            //  Allow NewWindow Event
            permitPopupWindow.Enabled = true;
            permitPopupWindow.Name = "tbPermitPopup";
            permitPopupWindow.Text = "Block popups";
            permitPopupWindow.Toggle = true;
            permitPopupWindow.ImageIndex = 14;
            permitPopupWindow.Delimiter = false;
            permitPopupWindow.CheckedChangedDelegate = null;

            mnWindowItems.Add("4_RecordSession", recordSession);
            mnWindowItems.Add("5_BrowseFirst", browserRequestFirstButton);
            mnWindowItems.Add("6_NewWindow", permitPopupWindow);

            return mnWindowItems;
        }
 private void ApplySettingsToolbarItems(ToolbarItem toolbarItem)
 {
     // toolbars
     foreach ( CommandBarItem cmdTool in toolbar.Items )
     {
         if ( cmdTool.Text == toolbarItem.Text )
         {
             cmdTool.IsEnabled = toolbarItem.Enabled;
             cmdTool.IsVisible = toolbarItem.Visible;
             break;
         }
     }
 }
        /// <summary>
        /// Creates the menus for Edit Menu.
        /// </summary>
        /// <returns> A MenuItemCollection.</returns>
        private MenuItemCollection BuildEditMenuItems()
        {
            mnEditMenus = new MenuItemCollection();

            // event
            EventHandler findDialogEvt = new EventHandler(ShowFindDialog);
            EventHandler replaceDialogEvt = new EventHandler(ShowReplaceDialog);

            EventHandler recordSesionToggleEvent = new EventHandler(RecordSessionChanged);
            EventHandler browserRequestFirstToggleEvent = new EventHandler(BrowserRequestFirstChanged);
            EventHandler permitPopupWindowEvent = new EventHandler(PermitPopupWindowChanged);

            mnEditMenus.Add("1_Find",new Ecyware.GreenBlue.Controls.MenuItem("mnuFind","&Find",true,true,findDialogEvt));
            mnEditMenus.Add("2_Replace",new Ecyware.GreenBlue.Controls.MenuItem("mnuReplace","&Replace",true,true,replaceDialogEvt));

            ToolbarItem recordSession = new ToolbarItem();
            ToolbarItem browserRequestFirstButton = new ToolbarItem();
            ToolbarItem permitPopupWindow = new ToolbarItem();

            // Record Session
            recordSession.Enabled = true;
            recordSession.Name = "tbRecordSession";
            recordSession.Text = "Record Session";
            recordSession.Toggle = true;
            recordSession.ImageIndex = 10;
            recordSession.Delimiter = true;
            recordSession.CheckedChangedDelegate = recordSesionToggleEvent;

            //  Browser Request First Button
            browserRequestFirstButton.Enabled = true;
            browserRequestFirstButton.Name = "tbBrowserFirst";
            browserRequestFirstButton.Text = "Allow Browser Navigate First";
            browserRequestFirstButton.Toggle = true;
            browserRequestFirstButton.ImageIndex = 13;
            browserRequestFirstButton.Delimiter = false;
            browserRequestFirstButton.CheckedChangedDelegate = browserRequestFirstToggleEvent;

            //  Allow NewWindow Event
            permitPopupWindow.Enabled = true;
            permitPopupWindow.Name = "tbPermitPopup";
            permitPopupWindow.Text = "Block popups";
            permitPopupWindow.Toggle = true;
            permitPopupWindow.ImageIndex = 14;
            permitPopupWindow.Delimiter = false;
            permitPopupWindow.CheckedChangedDelegate = permitPopupWindowEvent;

            mnEditMenus.Add("2_RecordSession", recordSession);
            mnEditMenus.Add("3_BrowseFirst", browserRequestFirstButton);
            mnEditMenus.Add("4_NewWindow", permitPopupWindow);

            return mnEditMenus;
        }
 /// <summary>
 /// Updates any toolbar command.
 /// </summary>
 /// <param name="toolbarCmd"> The toolbar command.</param>
 /// <param name="enabled"> The enabled setting.</param>
 public void UpdateToolbar(ToolbarItem toolbarCmd, bool enabled)
 {
     toolbarCmd.Enabled = enabled;
     ApplyToolbarSettingsEventArgs args = new ApplyToolbarSettingsEventArgs(toolbarCmd);
     // update toolbar
     this.ApplyToolbarSettingsEvent(this, args);
 }
 /// <summary>
 /// Creates a new ApplyToolbarSettingsEventArgs.
 /// </summary>
 /// <param name="item"> The toolbar item to add.</param>
 public ApplyToolbarSettingsEventArgs(ToolbarItem item)
 {
     this.ToolbarCommand = item;
 }