Skip to content

Commit

Permalink
Merge pull request #24 from IvoKrugers/develop
Browse files Browse the repository at this point in the history
Output filter pad
Ignore .png and .ttf in one click
Local Repository. See [readme](https://github.com/IvoKrugers/EssentialsAddin)
  • Loading branch information
IvoKrugers committed Sep 8, 2020
2 parents 243c71b + 0a3706d commit 9f0e66c
Show file tree
Hide file tree
Showing 33 changed files with 982 additions and 97 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ EssentialsAddin/obj
packages
.vs
.mfractor
*.mpack
EssentialsAddin.Lib/bin
EssentialsAddin.Lib/obj
EssentialsAddin.Unitttests/bin
EssentialsAddin.Unitttests/obj
Binary file added Art/ExtensionManager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions EssentialsAddin.Lib/EssentialsAddin.Lib.csproj
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 EssentialsAddin.Unitttests/EssentialsAddin.Unitttests.csproj
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 EssentialsAddin.Unitttests/TextBufferExtensionsTests.cs
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);
}
}
}
}
4 changes: 4 additions & 0 deletions EssentialsAddin.Unitttests/packages.config
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>
12 changes: 12 additions & 0 deletions EssentialsAddin.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EssentialsAddin", "EssentialsAddin\EssentialsAddin.csproj", "{06AAEAAA-1031-4096-BA41-394CACC5CC92}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EssentialsAddin.Unitttests", "EssentialsAddin.Unitttests\EssentialsAddin.Unitttests.csproj", "{F5B2B011-8011-464E-A81B-332A58EC7449}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EssentialsAddin.Lib", "EssentialsAddin.Lib\EssentialsAddin.Lib.csproj", "{8BECCA94-FBC6-4F83-AFBC-1FBBB3A8A914}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -13,6 +17,14 @@ Global
{06AAEAAA-1031-4096-BA41-394CACC5CC92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06AAEAAA-1031-4096-BA41-394CACC5CC92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06AAEAAA-1031-4096-BA41-394CACC5CC92}.Release|Any CPU.Build.0 = Release|Any CPU
{F5B2B011-8011-464E-A81B-332A58EC7449}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5B2B011-8011-464E-A81B-332A58EC7449}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5B2B011-8011-464E-A81B-332A58EC7449}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5B2B011-8011-464E-A81B-332A58EC7449}.Release|Any CPU.Build.0 = Release|Any CPU
{8BECCA94-FBC6-4F83-AFBC-1FBBB3A8A914}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8BECCA94-FBC6-4F83-AFBC-1FBBB3A8A914}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8BECCA94-FBC6-4F83-AFBC-1FBBB3A8A914}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8BECCA94-FBC6-4F83-AFBC-1FBBB3A8A914}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
version = 1.2
Expand Down
1 change: 1 addition & 0 deletions EssentialsAddin/AddinCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ public enum AddinCommands
ShowProperties,
NewInstanceVS,
ShowSolutionFilterPad,
ShowAppOutputFilterPad
}
}
25 changes: 25 additions & 0 deletions EssentialsAddin/CommandHandlers/AppOutputFilterPadMenuHandler.cs
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 EssentialsAddin/CommandHandlers/CurrentVersionMenuHandler.cs
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;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;

namespace EssentialsAddin.SolutionFilter
namespace EssentialsAddin.CommandHandlers
{
public class SolutionFilterPadMenuHandler : CommandHandler
{
Expand Down
7 changes: 4 additions & 3 deletions EssentialsAddin/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
{
public static class Constants
{
public const string Version = "1.6.5";
public const string SolutionPadId = "EssentialsAddin.SolutionFilterPad";
public const string Version = "1.7.6";
public const string SolutionFilterPadId = "EssentialsAddin.SolutionFilterPad";
public const string OutputFilterPadId = "EssentialsAddin.OutputFilterPad";
}
}
}
15 changes: 12 additions & 3 deletions EssentialsAddin/EssentialsAddin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,18 @@
<Compile Include="Other\InsertDateHandler.cs" />
<Compile Include="Other\ViewFileHandler.cs" />
<Compile Include="Other\SolutionFilterPad.cs" />
<Compile Include="SolutionFilter\SolutionFilterPadMenuHandler.cs" />
<Compile Include="SolutionFilter\SpecialNodeBuilderExtension.cs" />
<Compile Include="SolutionFilter\SolutionTreeExtensions.cs" />
<Compile Include="Constants.cs" />
<Compile Include="Services\Release.cs" />
<Compile Include="Services\ReleaseService.cs" />
<Compile Include="OutputFilterWidget.cs" />
<Compile Include="gtk-gui\EssentialsAddin.OutputFilterWidget.cs" />
<Compile Include="OutputFilterPad.cs" />
<Compile Include="CommandHandlers\SolutionFilterPadMenuHandler.cs" />
<Compile Include="CommandHandlers\AppOutputFilterPadMenuHandler.cs" />
<Compile Include="CommandHandlers\CurrentVersionMenuHandler.cs" />
<Compile Include="Models\Release.cs" />
<Compile Include="Helpers\TextBufferExtensions.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Manifest.addin.xml" />
Expand All @@ -62,14 +68,15 @@
<Folder Include="Helpers\" />
<Folder Include="Other\" />
<Folder Include="Services\" />
<Folder Include="CommandHandlers\" />
<Folder Include="Models\" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="Mono.Posix" />
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="System.Net.Http.Extensions">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
</Reference>
Expand All @@ -78,7 +85,9 @@
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\MonoDevelop.Addins.0.4.7\build\MonoDevelop.Addins.targets" Condition="Exists('..\packages\MonoDevelop.Addins.0.4.7\build\MonoDevelop.Addins.targets')" />
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
</Project>
Loading

0 comments on commit 9f0e66c

Please sign in to comment.