Permalink
Browse files

Added documentation

  • Loading branch information...
1 parent 9260c41 commit cf23a2d9d9699b187ce7b8d105947a2fbb6e6352 @cmrazek committed Jun 21, 2012
Showing with 2,094 additions and 85 deletions.
  1. +5 −0 .gitignore
  2. BIN Download/NppSharp_Setup_1.0.1.exe
  3. +25 −0 Help/Code.snippets
  4. +5 −0 Help/Content Layout.content
  5. BIN Help/Images/SimpleTest.png
  6. BIN Help/Images/SimpleTestOutput.png
  7. +73 −0 Help/NppSharp.shfbproj
  8. +90 −0 Help/Sample.aml
  9. +66 −0 Help/Welcome.aml
  10. +1 −1 NppSharp/AssemblyInfo.cpp
  11. +6 −6 NppSharp/NppInterface.h
  12. +2 −2 NppSharpCS/ColorPicker.cs
  13. +21 −0 NppSharpCS/ErrorForm.cs
  14. +572 −9 NppSharpCS/INpp.cs
  15. +869 −22 NppSharpCS/MenuCommand.cs
  16. +14 −0 NppSharpCS/NamespaceDoc.cs
  17. +1 −1 NppSharpCS/NppDisplayNameAttribute.cs
  18. +7 −0 NppSharpCS/NppException.cs
  19. +17 −12 NppSharpCS/NppScript.cs
  20. +3 −0 NppSharpCS/NppSeparatorAttribute.cs
  21. +3 −0 NppSharpCS/NppSharpCS.csproj
  22. +22 −0 NppSharpCS/NppShortcut.cs
  23. +7 −0 NppSharpCS/NppShortcutAttribute.cs
  24. +5 −0 NppSharpCS/NppSortOrderAttribute.cs
  25. +8 −0 NppSharpCS/NppToolbarIconAttribute.cs
  26. +26 −0 NppSharpCS/OutputStyle.cs
  27. +1 −0 NppSharpCS/OutputStyleDef.cs
  28. +68 −0 NppSharpCS/OutputView.cs
  29. +74 −2 NppSharpCS/Plugin.cs
  30. +46 −0 NppSharpCS/PluginCommand.cs
  31. +2 −2 NppSharpCS/Properties/AssemblyInfo.cs
  32. +10 −1 NppSharpCS/Res.Designer.cs
  33. +4 −1 NppSharpCS/Res.resx
  34. +0 −3 NppSharpCS/Script.cs
  35. +1 −1 NppSharpCS/ScriptManager.cs
  36. +2 −2 NppSharpCS/SettingsForm.Designer.cs
  37. +6 −1 README
  38. +5 −1 README.markdown
  39. +6 −0 Setup/Make.bat
  40. +21 −18 Setup/NppSharpSetup.nsi
  41. BIN Setup/Output/NppSharp Setup 1.0.exe
  42. BIN debug/NppSharp.dll
  43. BIN debug/NppSharpInterface.dll
  44. BIN release/NppSharp.dll
  45. BIN release/NppSharpInterface.dll
View
@@ -12,12 +12,17 @@
*.user
BuildLog.htm
+Thumbs.db
+/debug/*
+/Help/Output/*
/NppSharp/Debug/*.res
/NppSharp/Debug/*.dep
/NppSharp/Release/*.res
/NppSharp/Release/*.dep
/NppSharpCS/bin/*
/NppSharpCS/obj/*
+/release/*
/Setup/Bin/*
/Setup/Redist/*
+/Setup/Output/*
Binary file not shown.
View
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!-- This is an example code snippets file -->
+<examples>
+ <item id="SimpleTest#Code">
+ <sampleCode language="CSharp">
+using System;
+using System.Collections.Generic;
+using System.Text;
+using NppSharp;
+
+namespace ScriptEdit
+{
+ public class SimpleTest : NppScript
+ {
+ public void Test()
+ {
+ Output.Show();
+ Output.WriteLine("Hello");
+ }
+ }
+}
+ </sampleCode>
+ </item>
+</examples>
+
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Topics>
+ <Topic id="3ab31a3a-226e-45b7-b1eb-c68d3755dc77" visible="True" isDefault="true" title="Welcome" />
+ <Topic id="bd9bc6cd-319e-40c2-8f4e-352cbfdb8345" visible="True" isSelected="true" title="Sample" />
+</Topics>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <!-- The configuration and platform will be used to determine which
+ assemblies to include from solution and project documentation
+ sources -->
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{54f9174c-db99-4e2a-b5e2-2588d455de6b}</ProjectGuid>
+ <SHFBSchemaVersion>1.9.3.0</SHFBSchemaVersion>
+ <!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual
+ Studio adds them anyway -->
+ <AssemblyName>Documentation</AssemblyName>
+ <RootNamespace>Documentation</RootNamespace>
+ <Name>Documentation</Name>
+ <!-- SHFB properties -->
+ <OutputPath>.\Output\</OutputPath>
+ <HtmlHelpName>NppSharpDoc</HtmlHelpName>
+ <Language>en-US</Language>
+ <BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
+ <DocumentationSources>
+ <DocumentationSource sourceFile="..\NppSharpCS\NppSharpCS.csproj" xmlns="" />
+ </DocumentationSources>
+ <FrameworkVersion>.NET 2.0.50727</FrameworkVersion>
+ <HelpTitle>NppSharp Documentation</HelpTitle>
+ </PropertyGroup>
+ <!-- There are no properties for these groups. AnyCPU needs to appear in
+ order for Visual Studio to perform the build. The others are optional
+ common platform types that may appear. -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Win32' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Win32' ">
+ </PropertyGroup>
+ <ItemGroup>
+ <ContentLayout Include="Content Layout.content" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Sample.aml" />
+ <None Include="Welcome.aml" />
+ </ItemGroup>
+ <ItemGroup>
+ <CodeSnippets Include="Code.snippets" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Images\" />
+ </ItemGroup>
+ <ItemGroup>
+ <Image Include="Images\SimpleTestOutput.png">
+ <ImageId>SimpleTestOutput</ImageId>
+ <AlternateText>Output from SimpleTest</AlternateText>
+ </Image>
+ <Image Include="Images\SimpleTest.png">
+ <ImageId>SimpleTestMenuItem</ImageId>
+ <AlternateText>Test menu item appearing in NppSharp menu</AlternateText>
+ <CopyToMedia>False</CopyToMedia>
+ </Image>
+ </ItemGroup>
+ <!-- Import the SHFB build targets -->
+ <Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
+</Project>
View
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="utf-8"?>
+<topic id="bd9bc6cd-319e-40c2-8f4e-352cbfdb8345" revisionNumber="1">
+ <developerSampleDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!--
+ <summary>
+ <para>Optional summary abstract</para>
+ </summary>
+ -->
+ <introduction>
+ <!-- Uncomment this to generate an outline of the section and sub-section
+ titles. Specify a numeric value as the inner text to limit it to
+ a specific number of sub-topics when creating the outline. Specify
+ zero (0) to limit it to top-level sections only. -->
+ <!-- <autoOutline /> -->
+ <para>Required introduction</para>
+ </introduction>
+ <!-- <procedure>Optional procedures. See How To document for procedure layout example.</procedure> -->
+ <!-- <requirements>Optional requirements section</requirements> -->
+ <!-- <demonstrates>Optional info about what is demonstrated</demonstrates> -->
+ <!-- <codeExample>Optional code example</codeExample> -->
+ <!-- Add one or more top-level section elements. These are collapsible.
+ If using <autoOutline />, add an address attribute to identify it
+ and specify a title so that it can be jumped to with a hyperlink. -->
+ <section address="Section1">
+ <title>A Simple Test Script</title>
+ <content>
+ <!-- Uncomment this to create a sub-section outline
+ <autoOutline /> -->
+ <para>Below is a sample test script that writes a string to the output window.</para>
+ <codeReference>SimpleTest#Code</codeReference>
+ <para>
+ It uses the namespace <codeEntityReference qualifyHint="false">N:NppSharp</codeEntityReference>
+ to import the required classes from the plugin.
+ The SimpleTest class inherits from <codeEntityReference qualifyHint="false">T:NppSharp.NppScript</codeEntityReference>,
+ which provides the methods and properties needed in order to access Notepad++.
+ It then calls <codeEntityReference qualifyHint="false">T:NppSharp.OutputView</codeEntityReference>.<codeEntityReference qualifyHint="false" autoUpgrade="true">M:NppSharp.OutputView.Show</codeEntityReference>()
+ to make the output window visible (if it is not already) and
+ <codeEntityReference qualifyHint="false">T:NppSharp.OutputView</codeEntityReference>.<codeEntityReference qualifyHint="false" autoUpgrade="true">M:NppSharp.OutputView.WriteLine(System.String)</codeEntityReference>()
+ to perform the text output.
+ </para>
+ <para>
+ The above script will put the command &quot;Test&quot; into the NppSharp plugin menu.
+ <mediaLink>
+ <image xlink:href="SimpleTestMenuItem"/>
+ </mediaLink>
+ And will produce the following text in the output window:
+ <mediaLink>
+ <image xlink:href="SimpleTestOutput"/>
+ </mediaLink>
+ </para>
+ <para>
+ Obviously, real-world scripts will need to be more involved, but this helps illustrate the bare bones implementation of a user command.
+ </para>
+ </content>
+ </section>
+ <relatedTopics>
+ <!-- One or more of the following:
+ - A local link
+ - An external link
+ - A code entity reference
+
+ <link xlink:href="Other Topic's ID">Link text</link>
+ <externalLink>
+ <linkText>Link text</linkText>
+ <linkAlternateText>Optional alternate link text</linkAlternateText>
+ <linkUri>URI</linkUri>
+ </externalLink>
+ <codeEntityReference>API member ID</codeEntityReference>
+
+ Examples:
+
+ <link xlink:href="00e97994-e9e6-46e0-b420-5be86b2f8278">Some other topic</link>
+
+ <externalLink>
+ <linkText>SHFB on CodePlex</linkText>
+ <linkAlternateText>Go to CodePlex</linkAlternateText>
+ <linkUri>http://shfb.codeplex.com</linkUri>
+ </externalLink>
+
+ <codeEntityReference>T:TestDoc.TestClass</codeEntityReference>
+ <codeEntityReference>P:TestDoc.TestClass.SomeProperty</codeEntityReference>
+ <codeEntityReference>M:TestDoc.TestClass.#ctor</codeEntityReference>
+ <codeEntityReference>M:TestDoc.TestClass.#ctor(System.String,System.Int32)</codeEntityReference>
+ <codeEntityReference>M:TestDoc.TestClass.ToString</codeEntityReference>
+ <codeEntityReference>M:TestDoc.TestClass.FirstMethod</codeEntityReference>
+ <codeEntityReference>M:TestDoc.TestClass.SecondMethod(System.Int32,System.String)</codeEntityReference>
+ -->
+ </relatedTopics>
+ </developerSampleDocument>
+</topic>
View
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<topic id="3ab31a3a-226e-45b7-b1eb-c68d3755dc77" revisionNumber="1">
+ <developerOrientationDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!--
+ <summary>
+ <para>Optional summary abstract</para>
+ </summary>
+ -->
+ <introduction>
+ <para>
+ NppSharp is a Notepad++ plugin that allows you to write &apos;scripts&apos; in C#.
+ These scripts are compiled and loaded by the plugin. NppSharp provides
+ classes that allow these scripts to intuitively interface with Notepad++.
+ For more information, refer to the NppScript class (<see cref="T:NppSharp.NppScript" />) which provides this interface.
+ </para>
+ <para>
+ By default, scripts are given a .cs file extension and are can be placed
+ into the Notepad++\plugins\config\NppSharp directory.
+ </para>
+ <para>
+ Additionally, you can place any .NET assembly into this directory, and
+ NppSharp will attempt to load it as if it were a mere script. This has
+ the benefit of being able to split out your scripts into multiple files
+ in a project, and include other resources.
+ For large scripts, this is the recommended method.
+ </para>
+ </introduction>
+ <!-- <inThisSection>Optional description of content in this section</inThisSection> -->
+ <!-- <reference>Optional reference section</reference> -->
+ <!-- <relatedSections>Optional related sections info</relatedSections> -->
+ <!-- <externalResources>Optional external resources section</externalResources> -->
+ <relatedTopics>
+ <!-- One or more of the following:
+ - A local link
+ - An external link
+ - A code entity reference
+
+ <link xlink:href="Other Topic's ID">Link text</link>
+ <externalLink>
+ <linkText>Link text</linkText>
+ <linkAlternateText>Optional alternate link text</linkAlternateText>
+ <linkUri>URI</linkUri>
+ </externalLink>
+ <codeEntityReference>API member ID</codeEntityReference>
+
+ Examples:
+
+ <link xlink:href="00e97994-e9e6-46e0-b420-5be86b2f8278">Some other topic</link>
+
+ <externalLink>
+ <linkText>SHFB on CodePlex</linkText>
+ <linkAlternateText>Go to CodePlex</linkAlternateText>
+ <linkUri>http://shfb.codeplex.com</linkUri>
+ </externalLink>
+
+ <codeEntityReference>T:TestDoc.TestClass</codeEntityReference>
+ <codeEntityReference>P:TestDoc.TestClass.SomeProperty</codeEntityReference>
+ <codeEntityReference>M:TestDoc.TestClass.#ctor</codeEntityReference>
+ <codeEntityReference>M:TestDoc.TestClass.#ctor(System.String,System.Int32)</codeEntityReference>
+ <codeEntityReference>M:TestDoc.TestClass.ToString</codeEntityReference>
+ <codeEntityReference>M:TestDoc.TestClass.FirstMethod</codeEntityReference>
+ <codeEntityReference>M:TestDoc.TestClass.SecondMethod(System.Int32,System.String)</codeEntityReference>
+ -->
+ </relatedTopics>
+ </developerOrientationDocument>
+</topic>
@@ -31,7 +31,7 @@ using namespace System::Security::Permissions;
// You can specify all the value or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly:AssemblyVersionAttribute("1.0.*")];
+[assembly:AssemblyVersionAttribute("1.0.1.0")];
[assembly:ComVisible(false)];
@@ -117,10 +117,10 @@ namespace NppSharp
void OnFileLoadFailed();
void OnFileOrderChanged(unsigned int bufferId);
- virtual event EventHandler^ GetCommands;
- virtual event EventHandler^ RegisterToolbarIcons;
- virtual event EventHandler^ Ready;
- virtual event EventHandler^ Shutdown;
+ virtual event NppEventHandler^ GetCommands;
+ virtual event NppEventHandler^ RegisterToolbarIcons;
+ virtual event NppEventHandler^ Ready;
+ virtual event NppEventHandler^ Shutdown;
virtual event FileEventHandler^ FileClosing;
virtual event FileEventHandler^ FileClosed;
virtual event FileEventHandler^ FileOpening;
@@ -130,8 +130,8 @@ namespace NppSharp
virtual event FileEventHandler^ FileActivated;
virtual event LanguageTypeEventHandler^ LanguageChanged;
virtual event FileEventHandler^ StyleUpdate;
- virtual event EventHandler^ FileLoading;
- virtual event EventHandler^ FileLoadFailed;
+ virtual event NppEventHandler^ FileLoading;
+ virtual event NppEventHandler^ FileLoadFailed;
virtual event FileEventHandler^ FileOrderChanged;
virtual event ExecuteCommandEventHandler^ CommandExecuted;
@@ -30,7 +30,7 @@ internal partial class ColorPicker : UserControl
private Pen _nonePen = null;
private SolidBrush _colorBrush = null;
- public event EventHandler ColorChanged;
+ public event NppEventHandler ColorChanged;
public ColorPicker()
{
@@ -59,7 +59,7 @@ private void PickColor()
_color = dlg.Color;
Invalidate();
- EventHandler ev = ColorChanged;
+ NppEventHandler ev = ColorChanged;
if (ev != null) ev(this, new EventArgs());
}
}
@@ -24,22 +24,37 @@
namespace NppSharp
{
+ /// <summary>
+ /// A window that displays an error.
+ /// </summary>
public partial class ErrorForm : Form
{
private string _message = "";
private string _details = "";
+ /// <summary>
+ /// Constructs the error form.
+ /// </summary>
public ErrorForm()
{
InitializeComponent();
}
+ /// <summary>
+ /// Constructs the error form.
+ /// </summary>
+ /// <param name="message">The text to appear in the message tab.</param>
public ErrorForm(string message)
{
_message = message;
InitializeComponent();
}
+ /// <summary>
+ /// Constructs the error form.
+ /// </summary>
+ /// <param name="message">The text to appear in the message tab.</param>
+ /// <param name="details">The text to appear in the details tab.</param>
public ErrorForm(string message, string details)
{
_message = message;
@@ -74,12 +89,18 @@ private void Inception(Exception ex)
MessageBox.Show(this, ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
+ /// <summary>
+ /// Gets or sets the message text.
+ /// </summary>
public string Message
{
get { return _message; }
set { _message = value; }
}
+ /// <summary>
+ /// Gets or sets the details text.
+ /// </summary>
public string Details
{
get { return _details; }
Oops, something went wrong.

0 comments on commit cf23a2d

Please sign in to comment.