Skip to content

Commit

Permalink
Retargeted project to .NET Standard 1.0
Browse files Browse the repository at this point in the history
- Removed unused code and interfaces.
  • Loading branch information
shravan2x committed Aug 10, 2017
1 parent e3300a6 commit 792bba9
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 232 deletions.
14 changes: 7 additions & 7 deletions Gameloop.Vdf.sln
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
# Visual Studio 15
VisualStudioVersion = 15.0.26430.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gameloop.Vdf", "Gameloop.Vdf\Gameloop.Vdf.csproj", "{1F092A3D-E6A1-4215-9196-F94C3D1F7EC5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gameloop.Vdf", "Gameloop.Vdf\Gameloop.Vdf.csproj", "{4380F0DC-26AD-4075-96EB-57F6B8E1C150}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1F092A3D-E6A1-4215-9196-F94C3D1F7EC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F092A3D-E6A1-4215-9196-F94C3D1F7EC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F092A3D-E6A1-4215-9196-F94C3D1F7EC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F092A3D-E6A1-4215-9196-F94C3D1F7EC5}.Release|Any CPU.Build.0 = Release|Any CPU
{4380F0DC-26AD-4075-96EB-57F6B8E1C150}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4380F0DC-26AD-4075-96EB-57F6B8E1C150}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4380F0DC-26AD-4075-96EB-57F6B8E1C150}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4380F0DC-26AD-4075-96EB-57F6B8E1C150}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
96 changes: 32 additions & 64 deletions Gameloop.Vdf/Gameloop.Vdf.csproj
Original file line number Diff line number Diff line change
@@ -1,71 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1F092A3D-E6A1-4215-9196-F94C3D1F7EC5}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Gameloop.Vdf</RootNamespace>
<AssemblyName>Gameloop.Vdf</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<TargetFramework>netstandard1.0</TargetFramework>
<Description>A high-performance framework for the Valve Data Format, also called KeyValues.</Description>
<Copyright>Copyright © Shravan Rajinikanth 2016</Copyright>
<Company>Gameloop</Company>
<Authors>Shravan Rajinikanth</Authors>
<Version>0.4.0</Version>
<AssemblyVersion>0.4.0.0</AssemblyVersion>
<FileVersion>0.4.0.0</FileVersion>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>Vdf.NET</Title>
<PackageId>Gameloop.Vdf</PackageId>
<PackageLicenseUrl>https://raw.githubusercontent.com/shravan2x/Gameloop.Vdf/master/LICENSE</PackageLicenseUrl>
<PackageTags>vdf keyvalue steam</PackageTags>
<RepositoryUrl>https://github.com/shravan2x/Gameloop.Vdf</RepositoryUrl>
<NeutralLanguage>en-US</NeutralLanguage>
<PackageProjectUrl>https://github.com/shravan2x/Gameloop.Vdf</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>NETSTANDARD1_0</DefineConstants>
<Optimize>True</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Gameloop.Vdf.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
<Prefer32Bit>false</Prefer32Bit>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard1.0\Gameloop.Vdf.xml</DocumentationFile>
<DefineConstants>RELEASE;NETSTANDARD1_0</DefineConstants>
<NoWarn>1591;1701;1702;1705</NoWarn>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
<PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utilities\CollectionUtils.cs" />
<Compile Include="Utilities\DynamicProxy.cs" />
<Compile Include="Utilities\DynamicProxyMetaObject.cs" />
<Compile Include="Utilities\ReflectionUtils.cs" />
<Compile Include="Utilities\TypeExtensions.cs" />
<Compile Include="VContainer.cs" />
<Compile Include="VdfConvert.cs" />
<Compile Include="VdfReader.cs" />
<Compile Include="VdfSerializer.cs" />
<Compile Include="VdfSerializerSettings.cs" />
<Compile Include="VdfStructure.cs" />
<Compile Include="VdfTextReader.cs" />
<Compile Include="VdfTextWriter.cs" />
<Compile Include="VdfWriter.cs" />
<Compile Include="VObject.cs" />
<Compile Include="VProperty.cs" />
<Compile Include="VPropertyDescriptor.cs" />
<Compile Include="VToken.cs" />
<Compile Include="VValue.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->

</Project>
35 changes: 0 additions & 35 deletions Gameloop.Vdf/Properties/AssemblyInfo.cs

This file was deleted.

26 changes: 25 additions & 1 deletion Gameloop.Vdf/Utilities/ReflectionUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,34 @@

using System;
using System.Linq;
using System.Reflection;

namespace Gameloop.Vdf.Utilities
{
[Flags]
internal enum BindingFlags
{
Default = 0,
IgnoreCase = 1,
DeclaredOnly = 2,
Instance = 4,
Static = 8,
Public = 16,
NonPublic = 32,
FlattenHierarchy = 64,
InvokeMethod = 256,
CreateInstance = 512,
GetField = 1024,
SetField = 2048,
GetProperty = 4096,
SetProperty = 8192,
PutDispProperty = 16384,
ExactBinding = 65536,
PutRefDispProperty = 32768,
SuppressChangeType = 131072,
OptionalParamBinding = 262144,
IgnoreReturn = 16777216
}

internal static class ReflectionUtils
{
public static bool IsMethodOverridden(Type currentType, Type methodDeclaringType, string method)
Expand Down
23 changes: 23 additions & 0 deletions Gameloop.Vdf/Utilities/TypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,35 @@
#endregion

using System;
using System.Collections.Generic;
using System.Reflection;

namespace Gameloop.Vdf.Utilities
{
internal static class TypeExtensions
{
private const BindingFlags DefaultFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance;

public static MethodInfo GetBaseDefinition(this MethodInfo method)
{
return method.GetRuntimeBaseDefinition();
}

public static MethodInfo GetMethod(this Type type, string name)
{
return type.GetMethod(name, DefaultFlags);
}

public static MethodInfo GetMethod(this Type type, string name, BindingFlags bindingFlags)
{
return type.GetTypeInfo().GetDeclaredMethod(name);
}

public static IEnumerable<MethodInfo> GetMethods(this Type type, BindingFlags bindingFlags)
{
return type.GetTypeInfo().DeclaredMethods;
}

public static Type BaseType(this Type type)
{
#if HAVE_FULL_REFLECTION
Expand Down
87 changes: 1 addition & 86 deletions Gameloop.Vdf/VObject.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using Gameloop.Vdf.Utilities;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Dynamic;
using System.Linq;
using System.Linq.Expressions;

namespace Gameloop.Vdf
{
public class VObject : VToken, ITypedList, ICustomTypeDescriptor
public class VObject : VToken
{
private readonly List<VProperty> _children;

Expand Down Expand Up @@ -107,90 +106,6 @@ public override void WriteTo(VdfWriter writer)
writer.WriteObjectEnd();
}

#region ICustomTypeDescriptor Methods

public PropertyDescriptorCollection GetProperties()
{
PropertyDescriptorCollection descriptorCollection = new PropertyDescriptorCollection(null);

foreach (VProperty property in _children)
descriptorCollection.Add(new VPropertyDescriptor(property.Key));

return descriptorCollection;
}

public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{
return GetProperties();
}

public AttributeCollection GetAttributes()
{
return AttributeCollection.Empty;
}

public string GetClassName()
{
return null;
}

public string GetComponentName()
{
return null;
}

public TypeConverter GetConverter()
{
return new TypeConverter();
}

public EventDescriptor GetDefaultEvent()
{
return null;
}

public PropertyDescriptor GetDefaultProperty()
{
return null;
}

public object GetEditor(Type editorBaseType)
{
return null;
}

public EventDescriptorCollection GetEvents()
{
return EventDescriptorCollection.Empty;
}

public EventDescriptorCollection GetEvents(Attribute[] attributes)
{
return EventDescriptorCollection.Empty;
}

public object GetPropertyOwner(PropertyDescriptor pd)
{
return null;
}

#endregion

#region ITypedList Methods

public string GetListName(PropertyDescriptor[] listAccessors)
{
return null;
}

public PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors)
{
Console.WriteLine("hi");
return GetProperties();
}

#endregion

protected override DynamicMetaObject GetMetaObject(Expression parameter)
{
return new DynamicProxyMetaObject<VObject>(parameter, this, new VObjectDynamicProxy());
Expand Down
37 changes: 0 additions & 37 deletions Gameloop.Vdf/VPropertyDescriptor.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Gameloop.Vdf/VdfTextReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public override void Close()
{
base.Close();
if (CloseInput)
_reader.Close();
_reader.Dispose();
}
}
}
Loading

0 comments on commit 792bba9

Please sign in to comment.