Skip to content

Commit 792bba9

Browse files
committed
Retargeted project to .NET Standard 1.0
- Removed unused code and interfaces.
1 parent e3300a6 commit 792bba9

File tree

9 files changed

+90
-232
lines changed

9 files changed

+90
-232
lines changed

Gameloop.Vdf.sln

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.24720.0
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26430.16
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gameloop.Vdf", "Gameloop.Vdf\Gameloop.Vdf.csproj", "{1F092A3D-E6A1-4215-9196-F94C3D1F7EC5}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gameloop.Vdf", "Gameloop.Vdf\Gameloop.Vdf.csproj", "{4380F0DC-26AD-4075-96EB-57F6B8E1C150}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{1F092A3D-E6A1-4215-9196-F94C3D1F7EC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{1F092A3D-E6A1-4215-9196-F94C3D1F7EC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{1F092A3D-E6A1-4215-9196-F94C3D1F7EC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{1F092A3D-E6A1-4215-9196-F94C3D1F7EC5}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{4380F0DC-26AD-4075-96EB-57F6B8E1C150}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{4380F0DC-26AD-4075-96EB-57F6B8E1C150}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{4380F0DC-26AD-4075-96EB-57F6B8E1C150}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{4380F0DC-26AD-4075-96EB-57F6B8E1C150}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE

Gameloop.Vdf/Gameloop.Vdf.csproj

Lines changed: 32 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,39 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
43
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{1F092A3D-E6A1-4215-9196-F94C3D1F7EC5}</ProjectGuid>
8-
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>Gameloop.Vdf</RootNamespace>
11-
<AssemblyName>Gameloop.Vdf</AssemblyName>
12-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
<TargetFrameworkProfile />
4+
<TargetFramework>netstandard1.0</TargetFramework>
5+
<Description>A high-performance framework for the Valve Data Format, also called KeyValues.</Description>
6+
<Copyright>Copyright © Shravan Rajinikanth 2016</Copyright>
7+
<Company>Gameloop</Company>
8+
<Authors>Shravan Rajinikanth</Authors>
9+
<Version>0.4.0</Version>
10+
<AssemblyVersion>0.4.0.0</AssemblyVersion>
11+
<FileVersion>0.4.0.0</FileVersion>
12+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
13+
<Title>Vdf.NET</Title>
14+
<PackageId>Gameloop.Vdf</PackageId>
15+
<PackageLicenseUrl>https://raw.githubusercontent.com/shravan2x/Gameloop.Vdf/master/LICENSE</PackageLicenseUrl>
16+
<PackageTags>vdf keyvalue steam</PackageTags>
17+
<RepositoryUrl>https://github.com/shravan2x/Gameloop.Vdf</RepositoryUrl>
18+
<NeutralLanguage>en-US</NeutralLanguage>
19+
<PackageProjectUrl>https://github.com/shravan2x/Gameloop.Vdf</PackageProjectUrl>
20+
<RepositoryType>git</RepositoryType>
1521
</PropertyGroup>
16-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17-
<DebugSymbols>true</DebugSymbols>
18-
<DebugType>full</DebugType>
19-
<Optimize>false</Optimize>
20-
<OutputPath>bin\Debug\</OutputPath>
21-
<DefineConstants>DEBUG;TRACE</DefineConstants>
22-
<ErrorReport>prompt</ErrorReport>
23-
<WarningLevel>4</WarningLevel>
24-
<Prefer32Bit>false</Prefer32Bit>
22+
23+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
24+
<DefineConstants>NETSTANDARD1_0</DefineConstants>
25+
<Optimize>True</Optimize>
2526
</PropertyGroup>
26-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27-
<DebugType>pdbonly</DebugType>
28-
<Optimize>true</Optimize>
29-
<OutputPath>bin\Release\</OutputPath>
30-
<DefineConstants>TRACE</DefineConstants>
31-
<ErrorReport>prompt</ErrorReport>
32-
<WarningLevel>4</WarningLevel>
33-
<DocumentationFile>bin\Release\Gameloop.Vdf.xml</DocumentationFile>
34-
<NoWarn>1591</NoWarn>
35-
<Prefer32Bit>false</Prefer32Bit>
27+
28+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
29+
<DocumentationFile>bin\Release\netstandard1.0\Gameloop.Vdf.xml</DocumentationFile>
30+
<DefineConstants>RELEASE;NETSTANDARD1_0</DefineConstants>
31+
<NoWarn>1591;1701;1702;1705</NoWarn>
3632
</PropertyGroup>
33+
3734
<ItemGroup>
38-
<Reference Include="System" />
39-
<Reference Include="System.Core" />
35+
<PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
36+
<PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" />
4037
</ItemGroup>
41-
<ItemGroup>
42-
<Compile Include="Properties\AssemblyInfo.cs" />
43-
<Compile Include="Utilities\CollectionUtils.cs" />
44-
<Compile Include="Utilities\DynamicProxy.cs" />
45-
<Compile Include="Utilities\DynamicProxyMetaObject.cs" />
46-
<Compile Include="Utilities\ReflectionUtils.cs" />
47-
<Compile Include="Utilities\TypeExtensions.cs" />
48-
<Compile Include="VContainer.cs" />
49-
<Compile Include="VdfConvert.cs" />
50-
<Compile Include="VdfReader.cs" />
51-
<Compile Include="VdfSerializer.cs" />
52-
<Compile Include="VdfSerializerSettings.cs" />
53-
<Compile Include="VdfStructure.cs" />
54-
<Compile Include="VdfTextReader.cs" />
55-
<Compile Include="VdfTextWriter.cs" />
56-
<Compile Include="VdfWriter.cs" />
57-
<Compile Include="VObject.cs" />
58-
<Compile Include="VProperty.cs" />
59-
<Compile Include="VPropertyDescriptor.cs" />
60-
<Compile Include="VToken.cs" />
61-
<Compile Include="VValue.cs" />
62-
</ItemGroup>
63-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
64-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
65-
Other similar extension points exist, see Microsoft.Common.targets.
66-
<Target Name="BeforeBuild">
67-
</Target>
68-
<Target Name="AfterBuild">
69-
</Target>
70-
-->
38+
7139
</Project>

Gameloop.Vdf/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

Gameloop.Vdf/Utilities/ReflectionUtils.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,34 @@
2525

2626
using System;
2727
using System.Linq;
28-
using System.Reflection;
2928

3029
namespace Gameloop.Vdf.Utilities
3130
{
31+
[Flags]
32+
internal enum BindingFlags
33+
{
34+
Default = 0,
35+
IgnoreCase = 1,
36+
DeclaredOnly = 2,
37+
Instance = 4,
38+
Static = 8,
39+
Public = 16,
40+
NonPublic = 32,
41+
FlattenHierarchy = 64,
42+
InvokeMethod = 256,
43+
CreateInstance = 512,
44+
GetField = 1024,
45+
SetField = 2048,
46+
GetProperty = 4096,
47+
SetProperty = 8192,
48+
PutDispProperty = 16384,
49+
ExactBinding = 65536,
50+
PutRefDispProperty = 32768,
51+
SuppressChangeType = 131072,
52+
OptionalParamBinding = 262144,
53+
IgnoreReturn = 16777216
54+
}
55+
3256
internal static class ReflectionUtils
3357
{
3458
public static bool IsMethodOverridden(Type currentType, Type methodDeclaringType, string method)

Gameloop.Vdf/Utilities/TypeExtensions.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,35 @@
2424
#endregion
2525

2626
using System;
27+
using System.Collections.Generic;
2728
using System.Reflection;
2829

2930
namespace Gameloop.Vdf.Utilities
3031
{
3132
internal static class TypeExtensions
3233
{
34+
private const BindingFlags DefaultFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance;
35+
36+
public static MethodInfo GetBaseDefinition(this MethodInfo method)
37+
{
38+
return method.GetRuntimeBaseDefinition();
39+
}
40+
41+
public static MethodInfo GetMethod(this Type type, string name)
42+
{
43+
return type.GetMethod(name, DefaultFlags);
44+
}
45+
46+
public static MethodInfo GetMethod(this Type type, string name, BindingFlags bindingFlags)
47+
{
48+
return type.GetTypeInfo().GetDeclaredMethod(name);
49+
}
50+
51+
public static IEnumerable<MethodInfo> GetMethods(this Type type, BindingFlags bindingFlags)
52+
{
53+
return type.GetTypeInfo().DeclaredMethods;
54+
}
55+
3356
public static Type BaseType(this Type type)
3457
{
3558
#if HAVE_FULL_REFLECTION

Gameloop.Vdf/VObject.cs

Lines changed: 1 addition & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
using Gameloop.Vdf.Utilities;
22
using System;
33
using System.Collections.Generic;
4-
using System.ComponentModel;
54
using System.Dynamic;
65
using System.Linq;
76
using System.Linq.Expressions;
87

98
namespace Gameloop.Vdf
109
{
11-
public class VObject : VToken, ITypedList, ICustomTypeDescriptor
10+
public class VObject : VToken
1211
{
1312
private readonly List<VProperty> _children;
1413

@@ -107,90 +106,6 @@ public override void WriteTo(VdfWriter writer)
107106
writer.WriteObjectEnd();
108107
}
109108

110-
#region ICustomTypeDescriptor Methods
111-
112-
public PropertyDescriptorCollection GetProperties()
113-
{
114-
PropertyDescriptorCollection descriptorCollection = new PropertyDescriptorCollection(null);
115-
116-
foreach (VProperty property in _children)
117-
descriptorCollection.Add(new VPropertyDescriptor(property.Key));
118-
119-
return descriptorCollection;
120-
}
121-
122-
public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
123-
{
124-
return GetProperties();
125-
}
126-
127-
public AttributeCollection GetAttributes()
128-
{
129-
return AttributeCollection.Empty;
130-
}
131-
132-
public string GetClassName()
133-
{
134-
return null;
135-
}
136-
137-
public string GetComponentName()
138-
{
139-
return null;
140-
}
141-
142-
public TypeConverter GetConverter()
143-
{
144-
return new TypeConverter();
145-
}
146-
147-
public EventDescriptor GetDefaultEvent()
148-
{
149-
return null;
150-
}
151-
152-
public PropertyDescriptor GetDefaultProperty()
153-
{
154-
return null;
155-
}
156-
157-
public object GetEditor(Type editorBaseType)
158-
{
159-
return null;
160-
}
161-
162-
public EventDescriptorCollection GetEvents()
163-
{
164-
return EventDescriptorCollection.Empty;
165-
}
166-
167-
public EventDescriptorCollection GetEvents(Attribute[] attributes)
168-
{
169-
return EventDescriptorCollection.Empty;
170-
}
171-
172-
public object GetPropertyOwner(PropertyDescriptor pd)
173-
{
174-
return null;
175-
}
176-
177-
#endregion
178-
179-
#region ITypedList Methods
180-
181-
public string GetListName(PropertyDescriptor[] listAccessors)
182-
{
183-
return null;
184-
}
185-
186-
public PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors)
187-
{
188-
Console.WriteLine("hi");
189-
return GetProperties();
190-
}
191-
192-
#endregion
193-
194109
protected override DynamicMetaObject GetMetaObject(Expression parameter)
195110
{
196111
return new DynamicProxyMetaObject<VObject>(parameter, this, new VObjectDynamicProxy());

Gameloop.Vdf/VPropertyDescriptor.cs

Lines changed: 0 additions & 37 deletions
This file was deleted.

Gameloop.Vdf/VdfTextReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public override void Close()
199199
{
200200
base.Close();
201201
if (CloseInput)
202-
_reader.Close();
202+
_reader.Dispose();
203203
}
204204
}
205205
}

0 commit comments

Comments
 (0)