[libagilejedi commit] r26 - in trunk/DXCORE Plugins/MigrationGenerator: . MigrationGenerator MigrationGenerator/Properties

0 views
Skip to first unread message

codesite...@google.com

unread,
Jan 29, 2009, 11:33:39 PM1/29/09
to libagileje...@googlegroups.com
Author: Daniel.Pupek
Date: Thu Jan 29 20:19:38 2009
New Revision: 26

Added:
trunk/DXCORE Plugins/MigrationGenerator/MigrationGenerator/
trunk/DXCORE Plugins/MigrationGenerator/MigrationGenerator.sln
trunk/DXCORE
Plugins/MigrationGenerator/MigrationGenerator/MigrationGenerator.cs
trunk/DXCORE
Plugins/MigrationGenerator/MigrationGenerator/MigrationGenerator.csproj
trunk/DXCORE Plugins/MigrationGenerator/MigrationGenerator/Properties/
trunk/DXCORE
Plugins/MigrationGenerator/MigrationGenerator/Properties/AssemblyInfo.cs

Log:


Added: trunk/DXCORE Plugins/MigrationGenerator/MigrationGenerator.sln
==============================================================================
--- (empty file)
+++ trunk/DXCORE Plugins/MigrationGenerator/MigrationGenerator.sln Thu Jan
29 20:19:38 2009
@@ -0,0 +1,24 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")
= "MigrationGenerator", "MigrationGenerator\MigrationGenerator.csproj", "{B654A442-398B-4ABC-8F8F-3CD61D09995E}"
+EndProject
+Global
+ GlobalSection(SubversionScc) = preSolution
+ Svn-Managed = True
+ Manager = AnkhSVN - Subversion Support for Visual Studio
+ EndGlobalSection
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B654A442-398B-4ABC-8F8F-3CD61D09995E}.Debug|Any CPU.ActiveCfg = Debug|
Any CPU
+ {B654A442-398B-4ABC-8F8F-3CD61D09995E}.Debug|Any CPU.Build.0 = Debug|Any
CPU
+ {B654A442-398B-4ABC-8F8F-3CD61D09995E}.Release|Any CPU.ActiveCfg =
Release|Any CPU
+ {B654A442-398B-4ABC-8F8F-3CD61D09995E}.Release|Any CPU.Build.0 = Release|
Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: trunk/DXCORE
Plugins/MigrationGenerator/MigrationGenerator/MigrationGenerator.cs
==============================================================================
--- (empty file)
+++ trunk/DXCORE
Plugins/MigrationGenerator/MigrationGenerator/MigrationGenerator.cs Thu Jan
29 20:19:38 2009
@@ -0,0 +1,235 @@
+using System;
+using System.ComponentModel;
+using System.Drawing;
+using System.Linq;
+using System.Windows.Forms;
+using DevExpress.CodeRush.Core;
+using DevExpress.CodeRush.PlugInCore;
+using DevExpress.CodeRush.StructuralParser;
+using DevExpress.CodeRush.Menus;
+using System.Resources;
+
+namespace MigrationGenerator
+{
+ public partial class MigrationGenerator : StandardPlugIn
+ {
+ // DXCore-generated code...
+ #region ContextMenuDemoPlugIn Variables
+
+ /// <summary>
+ /// Events object providing events in the environment.
+ /// </summary>
+ private DevExpress.CodeRush.PlugInCore.CodeRushEvents
codeRushEvents1;
+
+ /// <summary>
+ /// Components contained in this plugin.
+ /// </summary>
+ private System.ComponentModel.IContainer components;
+
+ /// <summary>
+ /// A flag indicating if the right mouse button is the currently
active button.
+ /// </summary>
+ private bool rightMouseButtonActivated = false;
+
+ /// <summary>
+ /// The demo context menu this plugin will be working with.
+ /// </summary>
+ private IMenuPopup demoContextMenu = null;
+
+ /// <summary>
+ /// A resource manager allowing us to internationalize strings.
+ /// </summary>
+ private ResourceManager resourceManager = null;
+
+ /// <summary>
+ /// The big feedback that will show when a demo button is clicked.
+ /// </summary>
+ private DevExpress.CodeRush.Core.BigFeedback bigFeedback1;
+
+ /// <summary>
+ /// A random number generator that will help us add a random
number of items
+ /// to the demo context menu.
+ /// </summary>
+ private Random random = new Random();
+
+ #endregion
+
+ /// <summary>
+ /// Executes initialization code.
+ /// </summary>
+ public override void InitializePlugIn()
+ {
+ base.InitializePlugIn();
+
+ // Create resource manager for string localization.
+ resourceManager = new
ResourceManager("CR_ContextMenuDemo.resources.DemoResources",
typeof(MigrationGenerator).Assembly);
+
+ // Handles a mouse-down event in the editor window.
+ codeRushEvents1.EditorMouseDown += new
EditorMouseEventHandler(codeRushEvents1_EditorMouseDown);
+
+ // Handles a mouse-up event in the editor window.
+ codeRushEvents1.EditorMouseUp += new
EditorMouseEventHandler(codeRushEvents1_EditorMouseUp);
+ }
+
+
+ #region Event Handlers
+
+ /// <summary>
+ /// Handles a mouse-button-down event in the editor window.
+ /// </summary>
+ /// <param name="ea">Event arguments.</param>
+ private void codeRushEvents1_EditorMouseDown(EditorMouseEventArgs
ea)
+ {
+ if (ea.Button == MouseButtons.Right)
+ {
+ // If the right mouse button was depressed, flag that it
is active.
+ // The context menu will be drawn if the right mouse
button is
+ // active and released.
+ this.rightMouseButtonActivated = true;
+ }
+
+ }
+
+ /// <summary>
+ /// Handles a mouse-button-up event in the editor window.
+ /// </summary>
+ /// <param name="ea">Event arguments.</param>
+ private void codeRushEvents1_EditorMouseUp(EditorMouseEventArgs ea)
+ {
+ if (!this.rightMouseButtonActivated)
+ {
+ // The right mouse button wasn't activated, so we don't
need
+ // to draw the context menu.
+ return;
+ }
+
+ try
+ {
+ // Retrieve the code editor context menu from the VSCore
manager.
+ MenuBar editorContextMenu =
DevExpress.CodeRush.VSCore.Manager.Menus.Bars[VsCommonBar.EditorContext];
+
+ // If we already have a demo context menu, clear the
contents so
+ // we can regenerate them with the newly available items.
+ if (this.demoContextMenu != null)
+ {
+ // Remove the items in descending order so the item
+ // collection doesn't reorder on you mid-removal.
+ for (int i = this.demoContextMenu.Count - 1; i >= 0;
i--)
+ {
+ this.demoContextMenu[i].Delete();
+ }
+
+ // Delete the menu itself
+ this.demoContextMenu.Delete();
+ this.demoContextMenu = null;
+ }
+
+ // Check to see if we've satisfied our context before
redrawing the
+ // menu. In this case, we'll ensure we're in an XML doc
comment
+ // before we show our test menu. Contexts are written
in "path"
+ // form and can be seen in the template editing option
page.
+ if
(!CodeRush.Context.Satisfied(@"Editor\Code\InXmlDocComment", true))
+ {
+ return;
+ }
+
+ // Add the demo context menu to the editor context menu.
+ this.demoContextMenu = editorContextMenu.AddPopup();
+
+ // Set the name of the context menu. Localize the string
via resources.
+ this.demoContextMenu.Caption = "Dan's first
Menu";//resourceManager.GetString("MenuCaption");
+
+ // Randomly select a number of test items to add to the
new context menu.
+ // By adding a random number of items, the context menu
should change
+ // when we select it, showing that different options can
be available at
+ // different times.
+ int numItemsToAdd = random.Next(4, 9);
+
+ // Add the menu items.
+ for (int i = 0; i < numItemsToAdd; i++)
+ {
+ // Get a "key" for the button. This will be used for
+ // the resource string key and for the button "tag."
+ string buttonKey = String.Format("TestItem{0}", i);
+
+ // Create a button object and add it to the context
menu.
+ IMenuButton newButton =
this.demoContextMenu.AddButton();
+
+ // Set the caption on the button. Localize the string
via resources.
+ newButton.Caption =
resourceManager.GetString(buttonKey);
+
+ // Set the tag on the button. This will be used to
uniquely
+ // identify the button when it is clicked and act on
it.
+ newButton.Tag = buttonKey;
+
+ // Place a separator at the fifth button to illustrate
+ // grouping of items.
+ if (i == 5)
+ {
+ newButton.BeginGroup = true;
+ }
+
+ // Add a button click event handler.
+ newButton.Click += new
MenuButtonClickEventHandler(contextMenuButton_Click);
+ }
+ }
+ finally
+ {
+ // The right mouse button has been released, so remove the
+ // active flag.
+ this.rightMouseButtonActivated = false;
+ }
+ }
+
+ /// <summary>
+ /// Handles the click event for demo context menu buttons.
+ /// </summary>
+ /// <param name="sender">The button being clicked.</param>
+ /// <param name="e">Event arguments.</param>
+ private void contextMenuButton_Click(object sender,
MenuButtonClickEventArgs e)
+ {
+ // Do something with the button click. In this case, we'll
show the
+ // big feedback with the name of the item clicked.
+ this.bigFeedback1.Text =
resourceManager.GetString(e.Button.Tag);
+ this.bigFeedback1.Show();
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.codeRushEvents1 = new
DevExpress.CodeRush.PlugInCore.CodeRushEvents(this.components);
+ this.bigFeedback1 = new
DevExpress.CodeRush.Core.BigFeedback(this.components);
+
((System.ComponentModel.ISupportInitialize)(this.codeRushEvents1)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
+ //
+ // bigFeedback1
+ //
+ this.bigFeedback1.Text = "DemoMenu";
+
((System.ComponentModel.ISupportInitialize)(this.codeRushEvents1)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
+
+ }
+
+ #endregion
+ #region FinalizePlugIn
+ public override void FinalizePlugIn()
+ {
+ //
+ // TODO: Add your finalization code here.
+ //
+
+ base.FinalizePlugIn();
+ }
+ #endregion
+
+
+ }
+}
\ No newline at end of file

Added: trunk/DXCORE
Plugins/MigrationGenerator/MigrationGenerator/MigrationGenerator.csproj
==============================================================================
--- (empty file)
+++ trunk/DXCORE
Plugins/MigrationGenerator/MigrationGenerator/MigrationGenerator.csproj Thu
Jan 29 20:19:38 2009
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)'
== '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.21022</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{B654A442-398B-4ABC-8F8F-3CD61D09995E}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>MigrationGenerator</RootNamespace>
+ <AssemblyName>MigrationGenerator</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|
AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\..\..\..\..\Program Files\Developer Express
Inc\DXCore for Visual Studio .NET\2.0\Bin\PlugIns</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|
AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\..\..\..\..\..\Program Files\Developer Express
Inc\DXCore for Visual Studio .NET\2.0\Bin\PlugIns</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ <Reference Include="EnvDTE" />
+ <Reference Include="EnvDTE80" />
+ <Reference Include="DevExpress.CodeRush.Common" />
+ <Reference Include="DevExpress.CodeRush.Core" />
+ <Reference Include="DevExpress.CodeRush.PlugInCore" />
+ <Reference Include="DevExpress.CodeRush.StructuralParser" />
+ <Reference Include="DevExpress.CodeRush.VSCore" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MigrationGenerator.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the
targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file

Added: trunk/DXCORE
Plugins/MigrationGenerator/MigrationGenerator/Properties/AssemblyInfo.cs
==============================================================================
--- (empty file)
+++ trunk/DXCORE
Plugins/MigrationGenerator/MigrationGenerator/Properties/AssemblyInfo.cs
Thu Jan 29 20:19:38 2009
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using DevExpress.CodeRush.Common;
+
+[assembly: DXCoreAssembly(DXCoreAssemblyType.PlugIn, "Migration
Generator", PlugInLoadType.Demand)]
+
+// General Information about an assembly is controlled through the
following
+// set of attributes. Change these attribute values to modify the
information
+// associated with an assembly.
+[assembly: AssemblyTitle("MigrationGenerator")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MigrationGenerator")]
+[assembly: AssemblyCopyright("Copyright © 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is
exposed to COM
+[assembly: Guid("0dcb112c-20df-4a2f-9943-6cb14d76a9e1")]
+
+// Version information for an assembly consists of the following four
values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Reply all
Reply to author
Forward
0 new messages