protected override void OnExecute(object param) { string CultureName = string.Empty; //02Oct2017 string FileName = string.Empty; //02Oct2017 //23Apr2015 const string FileName = @"./Config/menu.xml"; //FileName = string.Format(@"{0}menu.xml", BSkyAppData.BSkyAppDirConfigPath);//23Apr2015 //Added by Aaron 07/31/2020 //Comented line below //CultureName = Thread.CurrentThread.CurrentCulture.Name; //02Oct2017 //Added line below CultureName = "en-US"; FileName = string.Format(@"{0}menu.xml", BSkyAppData.RoamingUserBSkyConfigL18nPath);// + CultureName + "/");//02Oct2017 Window1 appwindow = LifetimeService.Instance.Container.Resolve <Window1>(); try { MenuEditor editor = new MenuEditor(""); editor.Owner = appwindow; editor.LoadXml(FileName); editor.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; editor.Activate(); editor.ShowDialog(); } catch (Exception ex) { MessageBox.Show(BSky.GlobalResources.Properties.Resources.ErrModifyingMenu, BSky.GlobalResources.Properties.Resources.ErrorOccurred); logService.WriteToLogLevel("Error:", LogLevelEnum.Error, ex); } }
private void menuEditorToolStripMenuItem_Click(object sender, EventArgs e) { if (CurrentBaseWindow != null && currentBaseWindow.CurrentControl.Count == 1) { if (this.CurrentBaseWindow.CurrentControl[0].GetType() == typeof(EIBMenuBar)) { MenuEditor menuedit = new MenuEditor((EIBMenuBar)this.CurrentBaseWindow.CurrentControl[0]); menuedit.ShowDialog(); } else { MessageBox.Show("Select menubar to open menu editor."); } } else { MessageBox.Show("Select single Control."); } }
public string SelectLocation(ref string newcommandname, ref string AboveBelowSibling) { MenuEditor editor = new MenuEditor(newcommandname); editor.LoadXml(FileName); editor.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; editor.Activate(); editor.ShowDialog(); if (editor.DialogResult.HasValue && editor.DialogResult.Value) { string str = editor.ElementLocation; newcommandname = editor.NewCommandName; AboveBelowSibling = (editor.NewCommandAboveBelowSibling != null)? editor.NewCommandAboveBelowSibling:string.Empty; //06Feb2013 XamlFile = (editor.XamlFile != null && editor.XamlFile.Length > 0) ? editor.XamlFile:string.Empty; //06Mar2013 XmlFile = (editor.XmlFile != null && editor.XmlFile.Length > 0) ? editor.XmlFile : string.Empty; //06Mar2013 return(str); } return(string.Empty); }
public string SelectLocation(ref string newcommandname, ref string AboveBelowSibling) { MenuEditor editor = new MenuEditor(newcommandname); editor.LoadXml(FileName); editor.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; editor.Activate(); editor.ShowDialog(); if (editor.DialogResult.HasValue && editor.DialogResult.Value) { string str = editor.ElementLocation; newcommandname = editor.NewCommandName; AboveBelowSibling = (editor.NewCommandAboveBelowSibling != null)? editor.NewCommandAboveBelowSibling:string.Empty;//06Feb2013 XamlFile = (editor.XamlFile!=null && editor.XamlFile.Length>0) ? editor.XamlFile:string.Empty; //06Mar2013 XmlFile = (editor.XmlFile != null && editor.XmlFile.Length > 0) ? editor.XmlFile : string.Empty; //06Mar2013 return str; } return string.Empty; }