コード例 #1
0
ファイル: VsLaunchPoint.cs プロジェクト: dbremner/nupattern
        private void OnBeforeQueryStatus(object sender, EventArgs e)
        {
            var launchPoint = (VsLaunchPoint)sender;
            var command     = new VsMenuCommand
            {
                Enabled = launchPoint.Enabled,
                Text    = launchPoint.Text,
                Visible = launchPoint.Visible
            };

            launchPoint.OnQueryStatus(command);

            launchPoint.Enabled = command.Enabled;
            launchPoint.Visible = command.Visible;
            launchPoint.Text    = command.Text;
        }
コード例 #2
0
ファイル: VsLaunchPoint.cs プロジェクト: dbremner/nupattern
        private static void OnExecute(object sender, EventArgs e)
        {
            var launchPoint = (VsLaunchPoint)sender;
            var command     = new VsMenuCommand {
                Enabled = launchPoint.Enabled, Text = launchPoint.Text, Visible = launchPoint.Visible
            };
            var extension = launchPoint.OnQueryStatus(command);

            if (command.Enabled)
            {
                launchPoint.Execute(extension);
            }
            else
            {
                var tracer = Tracer.Get <VsLaunchPoint>();

                tracer.Warn(Resources.VsLaunchPoint_TraceNotEnabled, launchPoint);
            }
        }
コード例 #3
0
        private void OnBeforeQueryStatus(object sender, EventArgs e)
        {
            var launchPoint = (VsLaunchPoint)sender;
            var command = new VsMenuCommand
            {
                Enabled = launchPoint.Enabled,
                Text = launchPoint.Text,
                Visible = launchPoint.Visible
            };

            launchPoint.OnQueryStatus(command);

            launchPoint.Enabled = command.Enabled;
            launchPoint.Visible = command.Visible;
            launchPoint.Text = command.Text;
        }
コード例 #4
0
        private static void OnExecute(object sender, EventArgs e)
        {
            var launchPoint = (VsLaunchPoint)sender;
            var command = new VsMenuCommand { Enabled = launchPoint.Enabled, Text = launchPoint.Text, Visible = launchPoint.Visible };
            var extension = launchPoint.OnQueryStatus(command);

            if (command.Enabled)
            {
                launchPoint.Execute(extension);
            }
            else
            {
                var tracer = Tracer.Get<VsLaunchPoint>();

                tracer.Warn(Resources.VsLaunchPoint_TraceNotEnabled, launchPoint);
            }
        }