-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from IvoKrugers/develop
Output filter pad Ignore .png and .ttf in one click Local Repository. See [readme](https://github.com/IvoKrugers/EssentialsAddin)
- Loading branch information
Showing
33 changed files
with
982 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<ProduceReferenceAssembly>true</ProduceReferenceAssembly> | ||
<ReleaseVersion>1.2</ReleaseVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="gdk-sharp"> | ||
<HintPath>..\..\..\..\..\Library\Frameworks\Mono.framework\Versions\6.8.0\lib\mono\gac\gdk-sharp\2.12.0.0__35e10195dab3c99f\gdk-sharp.dll</HintPath> | ||
</Reference> | ||
|
||
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f"> | ||
<HintPath>..\..\..\..\..\Library\Frameworks\Mono.framework\Versions\6.8.0\lib\mono\gac\glib-sharp\2.12.0.0__35e10195dab3c99f\glib-sharp.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
</Project> |
54 changes: 54 additions & 0 deletions
54
EssentialsAddin.Unitttests/EssentialsAddin.Unitttests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{F5B2B011-8011-464E-A81B-332A58EC7449}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>EssentialsAddin.Unitttests</RootNamespace> | ||
<AssemblyName>EssentialsAddin.Unitttests</AssemblyName> | ||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> | ||
<ReleaseVersion>1.2</ReleaseVersion> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug</OutputPath> | ||
<DefineConstants>DEBUG;</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="nunit.framework"> | ||
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath> | ||
</Reference> | ||
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> | ||
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="TextBufferExtensionsTests.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\EssentialsAddin\EssentialsAddin.csproj"> | ||
<Project>{06AAEAAA-1031-4096-BA41-394CACC5CC92}</Project> | ||
<Name>EssentialsAddin</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\EssentialsAddin.Lib\EssentialsAddin.Lib.csproj"> | ||
<Project>{8BECCA94-FBC6-4F83-AFBC-1FBBB3A8A914}</Project> | ||
<Name>EssentialsAddin.Lib</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
131 changes: 131 additions & 0 deletions
131
EssentialsAddin.Unitttests/TextBufferExtensionsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
using System; | ||
using Gtk; | ||
using NUnit.Framework; | ||
|
||
namespace TextBufferExtensions | ||
{ | ||
public class Tests | ||
{ | ||
[TestFixture] | ||
public class GetTextFromBuffer | ||
{ | ||
|
||
TextTag _debugTag; | ||
TextTag _indentTag; | ||
TextTagTable _tagTable; | ||
TextBuffer _buffer; | ||
|
||
[SetUp] | ||
public void Setup() | ||
{ | ||
_debugTag = new TextTag("debug"); | ||
_indentTag = new TextTag("indent") { Indent = 4}; | ||
_tagTable = new TextTagTable(); | ||
_tagTable.Add(_debugTag); | ||
_tagTable.Add(_indentTag); | ||
_buffer = new TextBuffer(_tagTable); | ||
} | ||
|
||
[Test] | ||
public void TestBufferWithDebugLineAtBeginning() | ||
{ | ||
// Arrange | ||
var iter = _buffer.StartIter; | ||
_buffer.InsertWithTags(ref iter, $"1. Debug line.", _debugTag); | ||
_buffer.InsertWithTags(ref iter, $"2. normal line"); | ||
_buffer.InsertWithTags(ref iter, $"3. normal line"); | ||
|
||
// Act | ||
var text = EssentialsAddin.Lib.TextBufferExtensions.GetTextFromBuffer(_buffer, _debugTag); | ||
|
||
// Assert | ||
Assert.AreEqual( $"1. Debug line.\n", text); | ||
} | ||
|
||
[Test] | ||
public void TestBufferWithDebugLineAtEnd() | ||
{ | ||
// Arrange | ||
var iter = _buffer.StartIter; | ||
|
||
_buffer.InsertWithTags(ref iter, $"1. normal line"); | ||
_buffer.InsertWithTags(ref iter, $"2. normal line"); | ||
_buffer.InsertWithTags(ref iter, $"3. Debug line.", _debugTag); | ||
|
||
// Act | ||
var text = EssentialsAddin.Lib.TextBufferExtensions.GetTextFromBuffer(_buffer, _debugTag); | ||
|
||
// Assert | ||
Assert.AreEqual( $"3. Debug line.\n", text); | ||
} | ||
|
||
[Test] | ||
public void TestBufferWithDebugLineInTheMiddle() | ||
{ | ||
// Arrange | ||
var iter = _buffer.StartIter; | ||
|
||
_buffer.InsertWithTags(ref iter, $"1. normal line"); | ||
_buffer.InsertWithTags(ref iter, $"2. Debug line.", _debugTag); | ||
_buffer.InsertWithTags(ref iter, $"3. normal line"); | ||
|
||
// Act | ||
var text = EssentialsAddin.Lib.TextBufferExtensions.GetTextFromBuffer(_buffer, _debugTag); | ||
|
||
// Assert | ||
Assert.AreEqual( $"2. Debug line.\n", text); | ||
} | ||
|
||
[Test] | ||
public void TestBufferWithDebugLineInTheMiddleAndSurroundingLinesWithIndentTag() | ||
{ | ||
// Arrange | ||
var iter = _buffer.StartIter; | ||
|
||
_buffer.InsertWithTags(ref iter, $"1. normal line",_indentTag); | ||
_buffer.InsertWithTags(ref iter, $"2. Debug line.", _debugTag); | ||
_buffer.InsertWithTags(ref iter, $"3. normal line", _indentTag); | ||
|
||
// Act | ||
var text = EssentialsAddin.Lib.TextBufferExtensions.GetTextFromBuffer(_buffer, _debugTag); | ||
|
||
// Assert | ||
Assert.AreEqual( $"2. Debug line.\n", text); | ||
} | ||
|
||
[Test] | ||
public void TestBufferWithDebugLinesOnly() | ||
{ | ||
// Arrange | ||
var iter = _buffer.StartIter; | ||
|
||
_buffer.InsertWithTags(ref iter, $"1. Debug line.", _debugTag); | ||
_buffer.InsertWithTags(ref iter, $"2. Debug line.", _debugTag); | ||
|
||
// Act | ||
var text = EssentialsAddin.Lib.TextBufferExtensions.GetTextFromBuffer(_buffer, _debugTag); | ||
|
||
// Assert | ||
Assert.AreEqual($"1. Debug line.2. Debug line.\n", text); | ||
} | ||
|
||
[Test] | ||
public void TestBufferWithDebugLinesInTheMiddleAndSurroundingLinesWithIndentTag() | ||
{ | ||
// Arrange | ||
var iter = _buffer.StartIter; | ||
|
||
_buffer.InsertWithTags(ref iter, $"1. normal line", _indentTag); | ||
_buffer.InsertWithTags(ref iter, $"2. Debug line.", _debugTag); | ||
_buffer.InsertWithTags(ref iter, $"3. Debug line.", _debugTag); | ||
_buffer.InsertWithTags(ref iter, $"4. normal line", _indentTag); | ||
|
||
// Act | ||
var text = EssentialsAddin.Lib.TextBufferExtensions.GetTextFromBuffer(_buffer, _debugTag); | ||
|
||
// Assert | ||
Assert.AreEqual($"2. Debug line.3. Debug line.\n",text); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="NUnit" version="3.12.0" targetFramework="net472" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,6 @@ public enum AddinCommands | |
ShowProperties, | ||
NewInstanceVS, | ||
ShowSolutionFilterPad, | ||
ShowAppOutputFilterPad | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
EssentialsAddin/CommandHandlers/AppOutputFilterPadMenuHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using MonoDevelop.Components.Commands; | ||
using MonoDevelop.Ide; | ||
|
||
namespace EssentialsAddin.CommandHandlers | ||
{ | ||
public class AppOutputFilterPadMenuHandler : CommandHandler | ||
{ | ||
protected override void Run() | ||
{ | ||
var pad = IdeApp.Workbench.GetPad<OutputFilterPad>(); | ||
if (pad != null) | ||
{ | ||
pad.Visible = true; | ||
pad.IsOpenedAutomatically = true; | ||
pad.BringToFront(true); | ||
} | ||
} | ||
|
||
protected override void Update(CommandInfo info) | ||
{ | ||
info.Enabled = true;//IdeApp.Workbench.ActiveDocument?.Editor != null; | ||
} | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
EssentialsAddin/CommandHandlers/CurrentVersionMenuHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using MonoDevelop.Components.Commands; | ||
|
||
namespace EssentialsAddin.CommandHandlers | ||
{ | ||
public class CurrentVersionMenuHandler : CommandHandler | ||
{ | ||
//protected override void Run() | ||
//{ | ||
// var pad = IdeApp.Workbench.GetPad<OutputFilterPad>(); | ||
// if (pad != null) | ||
// { | ||
// pad.Visible = true; | ||
// pad.IsOpenedAutomatically = true; | ||
// pad.BringToFront(true); | ||
// } | ||
//} | ||
|
||
protected override void Update(CommandInfo info) | ||
{ | ||
info.Enabled = false;//IdeApp.Workbench.ActiveDocument?.Editor != null; | ||
info.Text = $"Essentials Addin ({Constants.Version})"; | ||
//info.Icon = MonoDevelop.Ide.Gui.Stock.MonoDevelop; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.