コード例 #1
0
 public static void Initialize(Package package)
 {
     if (Instance == null)
     {
         Instance = new UE4Helper(package);
     }
 }
コード例 #2
0
        /// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        private void MenuItemCallback(object sender, EventArgs e)
        {
            UE4Helper.Initialize(this.package);

            if (!UE4Helper.Instance.CheckHelperRequisites())
            {
                return;
            }

            IVsUIShell    uiShell = (IVsUIShell)ServiceProvider.GetService(typeof(SVsUIShell));
            AddFileDialog dialog  = new AddFileDialog(uiShell);
            //get the owner of this dialog
            IntPtr hwnd;

            uiShell.GetDialogOwnerHwnd(out hwnd);
            dialog.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
            uiShell.EnableModeless(0);
            try
            {
                WindowHelper.ShowModal(dialog, hwnd);
            }
            finally
            {
                // This will take place after the window is closed.
                uiShell.EnableModeless(1);
            }
        }
コード例 #3
0
        /// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        private void MenuItemCallback(object sender, EventArgs e)
        {
            UE4Helper.Initialize(this.package);

            if (!UE4Helper.Instance.CheckHelperRequisites())
            {
                return;
            }

            UE4Helper.Instance.UseVersionSelectorToGenerateProjectFiles();
        }