Skip to content

Commit

Permalink
add CommonFileCollection.
Browse files Browse the repository at this point in the history
  • Loading branch information
rocketRobin committed Feb 5, 2018
1 parent 2b107b0 commit 3e58f72
Show file tree
Hide file tree
Showing 10 changed files with 994 additions and 5 deletions.
36 changes: 36 additions & 0 deletions Myrmec.CommonFileFormat/CommonFileCollection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// <copyright file="CommonFileCollection.cs" company="Rocket Robin">
// Copyright (c) Rocket Robin. All rights reserved.
// Licensed under the Apache v2 license. See LICENSE file in the project root for full license information.
// </copyright>

using System.Collections.Generic;

namespace Myrmec.CommonFileFormat
{
public class CommonFileCollection : List<Record>
{
private static CommonFileCollection _collection;

private CommonFileCollection()
: base(128)
{
Init();
}

public static CommonFileCollection Instance()
{
if (_collection == null)
{
_collection = new CommonFileCollection();
}

return _collection;
}

private void Init()
{
Add(new Record("jpg,jpeg", "ff,d8,ff,db"));
Add(new Record("png", "89,50,4e,47,0d,0a,1a,0a"));
}
}
}
7 changes: 7 additions & 0 deletions Myrmec.CommonFileFormat/Myrmec.CommonFileFormat.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

</Project>
75 changes: 75 additions & 0 deletions Myrmec.CommonFileFormat/Myrmec.CommonFileFormat.ruleset
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Microsoft Managed Recommended Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects." ToolsVersion="10.0">
<Localization ResourceAssembly="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.dll" ResourceBaseName="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.Localized">
<Name Resource="MinimumRecommendedRules_Name" />
<Description Resource="MinimumRecommendedRules_Description" />
</Localization>
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA1001" Action="Warning" />
<Rule Id="CA1009" Action="Warning" />
<Rule Id="CA1016" Action="Warning" />
<Rule Id="CA1033" Action="Warning" />
<Rule Id="CA1049" Action="Warning" />
<Rule Id="CA1060" Action="Warning" />
<Rule Id="CA1061" Action="Warning" />
<Rule Id="CA1063" Action="Warning" />
<Rule Id="CA1065" Action="Warning" />
<Rule Id="CA1301" Action="Warning" />
<Rule Id="CA1400" Action="Warning" />
<Rule Id="CA1401" Action="Warning" />
<Rule Id="CA1403" Action="Warning" />
<Rule Id="CA1404" Action="Warning" />
<Rule Id="CA1405" Action="Warning" />
<Rule Id="CA1410" Action="Warning" />
<Rule Id="CA1415" Action="Warning" />
<Rule Id="CA1821" Action="Warning" />
<Rule Id="CA1900" Action="Warning" />
<Rule Id="CA1901" Action="Warning" />
<Rule Id="CA2002" Action="Warning" />
<Rule Id="CA2100" Action="Warning" />
<Rule Id="CA2101" Action="Warning" />
<Rule Id="CA2108" Action="Warning" />
<Rule Id="CA2111" Action="Warning" />
<Rule Id="CA2112" Action="Warning" />
<Rule Id="CA2114" Action="Warning" />
<Rule Id="CA2116" Action="Warning" />
<Rule Id="CA2117" Action="Warning" />
<Rule Id="CA2122" Action="Warning" />
<Rule Id="CA2123" Action="Warning" />
<Rule Id="CA2124" Action="Warning" />
<Rule Id="CA2126" Action="Warning" />
<Rule Id="CA2131" Action="Warning" />
<Rule Id="CA2132" Action="Warning" />
<Rule Id="CA2133" Action="Warning" />
<Rule Id="CA2134" Action="Warning" />
<Rule Id="CA2137" Action="Warning" />
<Rule Id="CA2138" Action="Warning" />
<Rule Id="CA2140" Action="Warning" />
<Rule Id="CA2141" Action="Warning" />
<Rule Id="CA2146" Action="Warning" />
<Rule Id="CA2147" Action="Warning" />
<Rule Id="CA2149" Action="Warning" />
<Rule Id="CA2200" Action="Warning" />
<Rule Id="CA2202" Action="Warning" />
<Rule Id="CA2207" Action="Warning" />
<Rule Id="CA2212" Action="Warning" />
<Rule Id="CA2213" Action="Warning" />
<Rule Id="CA2214" Action="Warning" />
<Rule Id="CA2216" Action="Warning" />
<Rule Id="CA2220" Action="Warning" />
<Rule Id="CA2229" Action="Warning" />
<Rule Id="CA2231" Action="Warning" />
<Rule Id="CA2232" Action="Warning" />
<Rule Id="CA2235" Action="Warning" />
<Rule Id="CA2236" Action="Warning" />
<Rule Id="CA2237" Action="Warning" />
<Rule Id="CA2238" Action="Warning" />
<Rule Id="CA2240" Action="Warning" />
<Rule Id="CA2241" Action="Warning" />
<Rule Id="CA2242" Action="Warning" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1101" Action="None" />
<Rule Id="SA1309" Action="None" />
</Rules>
</RuleSet>
22 changes: 22 additions & 0 deletions Myrmec.CommonFileFormat/stylecop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// ACTION REQUIRED: This file was automatically added to your project, but it
// will not take effect until additional steps are taken to enable it. See the
// following page for additional information:
//
// https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/EnableConfiguration.md

"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings": {
"documentationRules": {
"companyName": "Rocket Robin",
"copyrightText": "Copyright (c) {companyName}. All rights reserved.\nLicensed under the {licenseName} license. See {licenseFile} file in the project root for full license information.",
"variables": {
"licenseName": "Apache v2",
"licenseFile": "LICENSE"
}
},
"orderingRules": {
"usingDirectivesPlacement": "preserve"
}
}
}
8 changes: 7 additions & 1 deletion Myrmec.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2026
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Myrmec", "Myrmec\Myrmec.csproj", "{911D7EF6-364D-4B0A-A964-150A05B104F3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Myrmec", "Myrmec\Myrmec.csproj", "{911D7EF6-364D-4B0A-A964-150A05B104F3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Myrmec.CommonFileFormat", "Myrmec.CommonFileFormat\Myrmec.CommonFileFormat.csproj", "{DF35A534-2B13-4A53-A7D6-5D1C627D92E9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -15,6 +17,10 @@ Global
{911D7EF6-364D-4B0A-A964-150A05B104F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{911D7EF6-364D-4B0A-A964-150A05B104F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{911D7EF6-364D-4B0A-A964-150A05B104F3}.Release|Any CPU.Build.0 = Release|Any CPU
{DF35A534-2B13-4A53-A7D6-5D1C627D92E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF35A534-2B13-4A53-A7D6-5D1C627D92E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF35A534-2B13-4A53-A7D6-5D1C627D92E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF35A534-2B13-4A53-A7D6-5D1C627D92E9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading

0 comments on commit 3e58f72

Please sign in to comment.