⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sharpdevelopmacro.xpt

📁 SharpDevelop2.0.0 c#开发免费工具
💻 XPT
字号:
<?xml version="1.0"?>
<Template originator   = "Daniel Grunwald"
          created      = "01/11/2005"
          lastModified = "01/11/2005">
	
	<!-- Template Header -->
	<TemplateConfiguration>
		<Name>${res:Templates.Project.SharpDevelopMacro.Name}</Name>
		<Category>SharpDevelop</Category>
		<Icon>C#.Project.ControlLibrary</Icon>
		<LanguageName>C#</LanguageName>
		<Description>${res:Templates.Project.SharpDevelopMacro.Description}</Description>
	</TemplateConfiguration>
	
	<!-- Actions -->
	<Actions>
		<Open filename = "${ProjectName}.addin"/>
	</Actions>
	
	<Combine name = "${ProjectName}" directory = ".">
		<Options>
			<StartupProject>${ProjectName}</StartupProject>
		</Options>
		
		<Project name = "${ProjectName}" directory = ".">
			<Options OutputType = "Library" />

			<ProjectItems>
				<Reference Include="System" />
				<Reference Include="System.Data" />
				<Reference Include="System.Drawing" />
				<Reference Include="System.Windows.Forms" />
				<Reference Include="System.Xml" />
			</ProjectItems>
			
			<Files>
				<File name="${ProjectName}.addin" copyToOutputDirectory="Always"><![CDATA[<AddIn name        = "${ProjectName}"
       author      = "${USER}"
       url         = ""
       description = "TODO: Put description here">
	
	<Runtime>
		<Import assembly = "${ProjectName}.dll"/>
	</Runtime>
	
	<Path name = "/Workspace/Tools">
		<MenuItem id = "${ProjectName}Command1"
		          label = "${ProjectName}"
		          class = "${StandardNamespace}.ToolCommand1"/>
	</Path>
</AddIn>
]]></File>
		<File name="Src/Command.cs">
			<![CDATA[${StandardHeader.C#}

using System;
using System.Text;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor;
using ICSharpCode.TextEditor;

namespace ${StandardNamespace}
{
	public class ToolCommand1 : AbstractMenuCommand
	{
		public override void Run()
		{
			// Here an example that shows how to access the current text document:
			
			ITextEditorControlProvider tecp = WorkbenchSingleton.Workbench.ActiveContent as ITextEditorControlProvider;
			if (tecp == null) {
				// active content is not a text editor control
				return;
			}
			// Get the active text area from the control:
			TextArea textArea = tecp.TextEditorControl.ActiveTextAreaControl.TextArea;
			if (!textArea.SelectionManager.HasSomethingSelected)
				return;
			// get the selected text:
			string text = textArea.SelectionManager.SelectedText;
			// reverse the text:
			StringBuilder b = new StringBuilder(text.Length);
			for (int i = text.Length - 1; i >= 0; i--)
				b.Append(text[i]);
			string newText = b.ToString();
			// ensure caret is at start of selection
			textArea.Caret.Position = textArea.SelectionManager.SelectionCollection[0].StartPosition;
			// deselect text
			textArea.SelectionManager.ClearSelection();
			// replace the selected text with the new text:
			// Replace() takes the arguments: start offset to replace, length of the text to remove, new text
			textArea.Document.Replace(textArea.Caret.Offset,
			                          text.Length,
			                          newText);
			// Redraw:
			textArea.Refresh();
		}
	}
}
]]></File>
		<File name="Configuration/AssemblyInfo.cs">
			<![CDATA[${StandardHeader.C#}

using System.Reflection;

[assembly: AssemblyTitle("${ProjectName}")]
[assembly: AssemblyDescription("Macro AddIn for SharpDevelop 2.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SharpDevelop")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):

[assembly: AssemblyVersion("1.0.*")]

]]></File>
			</Files>
		</Project>
	</Combine>
</Template>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -