Skip to content

Commit

Permalink
Merge pull request #148 from Visionaid-International-Ltd/stylecop
Browse files Browse the repository at this point in the history
Apply various StyleCop automated fixes
  • Loading branch information
ironfede authored Sep 4, 2024
2 parents 7bd3a21 + 30a8aee commit f66cdc3
Show file tree
Hide file tree
Showing 51 changed files with 365 additions and 803 deletions.
6 changes: 2 additions & 4 deletions sources/OpenMcdf.Extensions/CFStreamExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ namespace OpenMcdf.Extensions
{
public static class CFStreamExtension
{


/// <summary>
/// Return the current <see cref="T:OpenMcdf.CFStream">CFStream</see> object
/// Return the current <see cref="T:OpenMcdf.CFStream">CFStream</see> object
/// as a <see cref="T:System.IO.Stream">Stream</see> object.
/// </summary>
/// <param name="cfStream">Current <see cref="T:OpenMcdf.CFStream">CFStream</see> object</param>
Expand All @@ -18,7 +16,7 @@ public static Stream AsIOStream(this CFStream cfStream)
}

///// <summary>
///// Return the current <see cref="T:OpenMcdf.CFStream">CFStream</see> object
///// Return the current <see cref="T:OpenMcdf.CFStream">CFStream</see> object
///// as a OLE properties Stream.
///// </summary>
///// <param name="cfStream"></param>
Expand Down
11 changes: 7 additions & 4 deletions sources/OpenMcdf.Extensions/OLEProperties/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ namespace OpenMcdf.Extensions.OLEProperties
{
public enum Behavior
{
CaseSensitive, CaseInsensitive
CaseSensitive,
CaseInsensitive
}

public class PropertyContext
{

public Int32 CodePage { get; set; }
public Behavior Behavior { get; set; }
public UInt32 Locale { get; set; }
Expand All @@ -27,12 +27,15 @@ public static class WellKnownFMTID

public enum PropertyDimensions
{
IsScalar, IsVector, IsArray
IsScalar,
IsVector,
IsArray
}

public enum PropertyType
{
TypedPropertyValue = 0, DictionaryProperty = 1
TypedPropertyValue = 0,
DictionaryProperty = 1
}

internal static class CodePages
Expand Down
6 changes: 1 addition & 5 deletions sources/OpenMcdf.Extensions/OLEProperties/DictionaryEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void Read(BinaryReader br)
{
nameBytes = br.ReadBytes(Length << 1);

int m = (Length * 2) % 4;
int m = Length * 2 % 4;
if (m > 0)
br.ReadBytes(m);
}
Expand All @@ -54,15 +54,11 @@ public void Write(BinaryWriter bw)

private string GetName()
{

var result = Encoding.GetEncoding(this.codePage).GetString(nameBytes);

result = result.Trim('\0');

return result;

}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public DictionaryProperty(int codePage)
{
this.codePage = codePage;
this.entries = new Dictionary<uint, string>();

}

public PropertyType PropertyType
Expand Down Expand Up @@ -55,7 +54,6 @@ public void Read(BinaryReader br)
br.ReadByte();
}
}

}

/// <summary>
Expand Down Expand Up @@ -134,8 +132,10 @@ private void WritePaddingIfNeeded(BinaryWriter bw, int fieldLength)
var m = fieldLength % 4;

if (m > 0)
for (int i = 0; i < 4 - m; i++) // padding
{
for (int i = 0; i < 4 - m; i++) // padding
bw.Write((byte)0);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{
public interface IProperty : IBinarySerializable
{

object Value
{
get;
Expand All @@ -13,6 +12,5 @@ PropertyType PropertyType
{
get;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace OpenMcdf.Extensions.OLEProperties
{
public class OLEPropertiesContainer
{

public Dictionary<uint, string> PropertyNames = null;

public OLEPropertiesContainer UserDefinedProperties { get; private set; }
Expand Down Expand Up @@ -126,7 +125,6 @@ internal OLEPropertiesContainer(CFStream cfStream)
Value = p.Value
};


properties.Add(op);
}

Expand Down Expand Up @@ -179,7 +177,6 @@ public OLEProperty NewProperty(VTPropertyType vtPropertyType, uint propertyIdent
return op;
}


public void AddProperty(OLEProperty property)
{
//throw new NotImplementedException("API Unstable - Work in progress - Milestone 2.3.0.0");
Expand Down
2 changes: 0 additions & 2 deletions sources/OpenMcdf.Extensions/OLEProperties/OLEProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public object Value
break;
default:
return this.value;

}

return this.value;
Expand All @@ -69,6 +68,5 @@ public override int GetHashCode()
{
return (int)this.PropertyIdentifier;
}

}
}
Loading

0 comments on commit f66cdc3

Please sign in to comment.