mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-15 19:54:52 +08:00
update editorconfig to override other project defaults
This commit is contained in:
@@ -1,4 +1,94 @@
|
||||
root = true
|
||||
[*.cs]
|
||||
|
||||
#### Core EditorConfig Options ####
|
||||
|
||||
# Indentation and spacing
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
indent_size = 4
|
||||
tab_width = 4
|
||||
|
||||
# New line preferences
|
||||
end_of_line = crlf
|
||||
insert_final_newline = false
|
||||
|
||||
#### .NET Coding Conventions ####
|
||||
|
||||
# Organize usings
|
||||
dotnet_separate_import_directive_groups = false
|
||||
dotnet_sort_system_directives_first = false
|
||||
|
||||
# Parameter preferences
|
||||
dotnet_code_quality_unused_parameters = all:suggestion
|
||||
|
||||
# Modifier preferences
|
||||
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
|
||||
|
||||
# Code-block preferences
|
||||
csharp_prefer_braces = true:warning
|
||||
|
||||
# 'using' directive preferences
|
||||
csharp_using_directive_placement = inside_namespace:silent
|
||||
|
||||
#### Naming styles ####
|
||||
|
||||
# Naming rules
|
||||
|
||||
dotnet_naming_rule.private_or_internal_static_field_should_be_pascal_case.severity = warning
|
||||
dotnet_naming_rule.private_or_internal_static_field_should_be_pascal_case.symbols = private_or_internal_static_field
|
||||
dotnet_naming_rule.private_or_internal_static_field_should_be_pascal_case.style = pascal_case
|
||||
|
||||
dotnet_naming_rule.private_or_internal_field_should_be_not_underscored.severity = warning
|
||||
dotnet_naming_rule.private_or_internal_field_should_be_not_underscored.symbols = private_or_internal_field
|
||||
dotnet_naming_rule.private_or_internal_field_should_be_not_underscored.style = not_underscored
|
||||
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
|
||||
|
||||
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
|
||||
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
|
||||
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
|
||||
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
|
||||
|
||||
# Symbol specifications
|
||||
|
||||
dotnet_naming_symbols.interface.applicable_kinds = interface
|
||||
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||
dotnet_naming_symbols.interface.required_modifiers =
|
||||
|
||||
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
|
||||
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
|
||||
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
|
||||
|
||||
dotnet_naming_symbols.private_or_internal_static_field.applicable_kinds = field
|
||||
dotnet_naming_symbols.private_or_internal_static_field.applicable_accessibilities = internal, private, private_protected
|
||||
dotnet_naming_symbols.private_or_internal_static_field.required_modifiers = static
|
||||
|
||||
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
||||
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||
dotnet_naming_symbols.types.required_modifiers =
|
||||
|
||||
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
|
||||
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||
dotnet_naming_symbols.non_field_members.required_modifiers =
|
||||
|
||||
# Naming styles
|
||||
|
||||
dotnet_naming_style.pascal_case.required_prefix =
|
||||
dotnet_naming_style.pascal_case.required_suffix =
|
||||
dotnet_naming_style.pascal_case.word_separator =
|
||||
dotnet_naming_style.pascal_case.capitalization = pascal_case
|
||||
|
||||
dotnet_naming_style.begins_with_i.required_prefix = I
|
||||
dotnet_naming_style.begins_with_i.required_suffix =
|
||||
dotnet_naming_style.begins_with_i.word_separator =
|
||||
dotnet_naming_style.begins_with_i.capitalization = pascal_case
|
||||
|
||||
dotnet_naming_style.not_underscored.required_prefix =
|
||||
dotnet_naming_style.not_underscored.required_suffix =
|
||||
dotnet_naming_style.not_underscored.word_separator =
|
||||
dotnet_naming_style.not_underscored.capitalization = camel_case
|
||||
|
@@ -7,7 +7,7 @@
|
||||
using Core;
|
||||
using Graphics.Operations;
|
||||
using Tokens;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This class would lazily flush all token. Allowing us to make changes to references without need to rewrite the whole stream
|
||||
/// </summary>
|
||||
@@ -30,12 +30,14 @@
|
||||
Stream = baseStream ?? throw new ArgumentNullException(nameof(baseStream));
|
||||
DisposeStream = disposeStream;
|
||||
}
|
||||
|
||||
|
||||
public void Flush(decimal version, IndirectReferenceToken catalogReference)
|
||||
{
|
||||
if (catalogReference == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(catalogReference));
|
||||
|
||||
}
|
||||
|
||||
WriteString($"%PDF-{version.ToString("0.0", CultureInfo.InvariantCulture)}", Stream);
|
||||
|
||||
Stream.WriteText("%");
|
||||
@@ -47,7 +49,7 @@
|
||||
|
||||
var offsets = new Dictionary<IndirectReference, long>();
|
||||
ObjectToken catalogToken = null;
|
||||
foreach(var pair in tokenReferences)
|
||||
foreach (var pair in tokenReferences)
|
||||
{
|
||||
var referenceToken = pair.Key;
|
||||
var token = pair.Value;
|
||||
@@ -98,7 +100,7 @@
|
||||
|
||||
return reference;
|
||||
}
|
||||
|
||||
|
||||
public int ReserveNumber()
|
||||
{
|
||||
var reserved = CurrentNumber;
|
||||
@@ -108,10 +110,10 @@
|
||||
}
|
||||
|
||||
public IndirectReferenceToken ReserveNumberToken()
|
||||
{
|
||||
{
|
||||
return new IndirectReferenceToken(new IndirectReference(ReserveNumber(), 0));
|
||||
}
|
||||
|
||||
|
||||
public byte[] ToArray()
|
||||
{
|
||||
var currentPosition = Stream.Position;
|
||||
@@ -120,7 +122,9 @@
|
||||
var bytes = new byte[Stream.Length];
|
||||
|
||||
if (Stream.Read(bytes, 0, bytes.Length) != bytes.Length)
|
||||
{
|
||||
throw new Exception("Unable to read all the bytes from stream");
|
||||
}
|
||||
|
||||
Stream.Seek(currentPosition, SeekOrigin.Begin);
|
||||
|
||||
@@ -138,7 +142,7 @@
|
||||
Stream?.Dispose();
|
||||
Stream = null;
|
||||
}
|
||||
|
||||
|
||||
private IndirectReferenceToken AddToken(IToken token, int reservedNumber)
|
||||
{
|
||||
var reference = new IndirectReference(reservedNumber, 0);
|
||||
@@ -149,7 +153,7 @@
|
||||
|
||||
private IndirectReferenceToken FindToken(IToken token)
|
||||
{
|
||||
foreach(var pair in tokenReferences)
|
||||
foreach (var pair in tokenReferences)
|
||||
{
|
||||
var reference = pair.Key;
|
||||
var storedToken = pair.Value;
|
||||
@@ -161,7 +165,7 @@
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private static void WriteString(string text, Stream stream)
|
||||
{
|
||||
var bytes = OtherEncodings.StringAsLatin1Bytes(text);
|
||||
|
Reference in New Issue
Block a user