Exemplo n.º 1
0
    static void CreateWindow()
    {
        Rect       wr     = new Rect(0, 0, 500, 500);
        MenuEditor window = EditorWindow.CreateWindow <MenuEditor>("大窗口来了");

        window.Show();
    }
        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);
            }
        }
Exemplo n.º 3
0
        protected override Control GetEditControl(string PropName, object CurrentValue, object CurrentObj)
        {
            MenuEditor w = new MenuEditor();

            if (CurrentValue != null)
            {
                w.ElementLocation = CurrentValue.ToString();
            }
            return(w);
        }
Exemplo n.º 4
0
 protected override object GetEditedValue(Control EditControl, string PropertyName, object oldValue, object currentObj)
 {
     if (EditControl is MenuEditor)
     {
         MenuEditor w = EditControl as MenuEditor;
         if (w.DialogResult.HasValue && w.DialogResult.Value)
         {
             return(w.ElementLocation);
         }
         return(oldValue);
     }
     return(oldValue);
 }
Exemplo n.º 5
0
 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.");
     }
 }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        private void OnWizardCreate()
        {
            SetupExtensions();
            SetupBuildSettingsScene();
            SetupSettings <ProjectSettings>(ProjectSettings.FileName);
            SetupSettings <NetworkSettings>(NetworkSettings.FileName);
            SetupSettings <ResolutionSettings>(ResolutionSettings.FileName);
            SetupSettings <Dialog.DialogSettingsInstaller>("DialogSettings");
            SetupSettings <Loading.LoadingSettingsInstaller>("LoadingSettings");
            SetupSettings <TapEffect.TapEffectSettingsInstaller>("TapEffectSettings");
            SetupSettings <Toast.ToastSettingsInstaller>("ToastSettings");
            SetupSettings <Transition.TransitionSettingsInstaller>("TransitionSettings");
            SetupSettings <Sound.SoundSettingsInstaller>("SoundSettings");
            SetupAssemblyDefinitionFiles();
            SetupUnitTest();
            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();

            // ADX2 symbol
            if (Directory.Exists(Path.Combine(Application.dataPath, "Plugins/CriWare")))
            {
                MenuEditor.AddSymbols(ADX2_Symbol);
            }
            else
            {
                MenuEditor.RemoveSymbols(ADX2_Symbol);
            }

            // gRPC symbol
            if (Directory.Exists(Path.Combine(Application.dataPath, "Plugins/Grpc.Core")))
            {
                MenuEditor.AddSymbols(gRPC_Symbol);
            }
            else
            {
                MenuEditor.RemoveSymbols(gRPC_Symbol);
            }
        }
 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;
 }