Skip to content

Commit d7da29e

Browse files
authored
Merge pull request #178 from OfficeDev/vNext
Merge vNext to Master
2 parents 3f36da8 + 22ff166 commit d7da29e

File tree

1,027 files changed

+95851
-63050
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,027 files changed

+95851
-63050
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,9 @@ UpgradeLog*.htm
174174

175175
# Microsoft Fakes
176176
FakesAssemblies/
177+
*.nuget.props
178+
*.nuget.targets
179+
project.lock.json
180+
.vs/
181+
Tests/
182+
TestFiles/

.nuget/nuget.exe

-1.59 MB
Binary file not shown.

.nuget/packages.config

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

.travis.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
8+
<PropertyGroup Label="Globals">
9+
<ProjectGuid>e97a956d-8113-45b6-9002-2ed651a6cd6c</ProjectGuid>
10+
<RootNamespace>BinaryFormatConverter</RootNamespace>
11+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
13+
</PropertyGroup>
14+
15+
<PropertyGroup>
16+
<SchemaVersion>2.0</SchemaVersion>
17+
</PropertyGroup>
18+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
19+
</Project>

BinaryFormatConverter/Program.cs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
using DocumentFormat.OpenXml.Internal.SchemaValidation;
2+
using SourceCodeSerializer;
3+
using SourceCodeSerializer.Generators;
4+
using System;
5+
using System.Collections.Immutable;
6+
using System.IO;
7+
using Microsoft.CodeAnalysis;
8+
using Microsoft.CodeAnalysis.CSharp.Syntax;
9+
10+
namespace Converter
11+
{
12+
class Program
13+
{
14+
static void Main(string[] args)
15+
{
16+
Write("Office2007Schema", SdbSchemaDatas.GetOffice2007SchemaDatas());
17+
Write("Office2010Schema", SdbSchemaDatas.GetOffice2010SchemaDatas());
18+
Write("Office2013Schema", SdbSchemaDatas.GetOffice2013SchemaDatas());
19+
}
20+
21+
private static void Write(string name, SdbSchemaDatas data)
22+
{
23+
Console.WriteLine($"Serializing {name}");
24+
25+
var path = Path.Combine(GetRootDirectory(), "DocumentFormat.OpenXml", "src", "GeneratedCode", $"{name}.cs");
26+
27+
using (var fs = File.Open(path, FileMode.Create, FileAccess.Write))
28+
using (var writer = new StreamWriter(fs))
29+
{
30+
var settings = new SerializerSettings
31+
{
32+
IgnoreDefaultValues = false,
33+
ObjectInitializationNewLine = false,
34+
Usings = ImmutableArray.Create("DocumentFormat.OpenXml.Internal.SchemaValidation", "DocumentFormat.OpenXml.Validation", "System"),
35+
Generator = new ConstructorGenerator("DocumentFormat.OpenXml.Internal.SchemaValidation", name)
36+
};
37+
38+
SourceCodeSerializer.SourceCodeSerializer.Serialize(writer, data, settings);
39+
}
40+
}
41+
42+
private static string GetRootDirectory(string path = null)
43+
{
44+
if (path == null)
45+
{
46+
return GetRootDirectory(Directory.GetCurrentDirectory());
47+
}
48+
49+
if (File.Exists(Path.Combine(path, "global.json")))
50+
{
51+
return Path.GetFullPath(path);
52+
}
53+
54+
return GetRootDirectory(Path.Combine(path, ".."));
55+
}
56+
}
57+
}

BinaryFormatConverter/project.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": "1.0.0-*",
3+
"buildOptions": {
4+
"debugType": "portable",
5+
"emitEntryPoint": true,
6+
"keyFile": "../DocumentFormat.OpenXml/DocumentFormat.OpenXml.snk"
7+
},
8+
"dependencies": {
9+
"DocumentFormat.OpenXml": "0.0.1-*",
10+
"SourceCodeSerializer": "0.1.0"
11+
},
12+
"frameworks": {
13+
"net46": {
14+
}
15+
}
16+
}

DocumentFormat.OpenXml.Tests/BaseFixture.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@
2929
using System.Xml;
3030
using DocumentFormat.OpenXml.Packaging;
3131
using Xunit;
32+
using OxTest;
3233

3334
namespace DocumentFormat.OpenXml.Tests
3435
{
3536
[SuppressMessage("ReSharper", "UnusedMember.Global")]
3637
[SuppressMessage("ReSharper", "VirtualMemberNeverOverriden.Global")]
3738
public class BaseFixture : IDisposable
3839
{
39-
protected const string TestFilesPath = @"..\..\..\TestFiles";
40+
protected static string s_TestFileLocation = null;
41+
42+
public static string TestFilesPath => TestUtil.TestFilesDir;
4043

4144
protected BaseFixture()
4245
{
@@ -64,7 +67,8 @@ protected static string GetTestFilePath(string path)
6467
if (path == null)
6568
throw new ArgumentNullException("path");
6669

67-
return Path.Combine(TestFilesPath, Path.GetFileName(path));
70+
var combinedPath = Path.Combine(TestFilesPath, Path.GetFileName(path));
71+
return combinedPath;
6872
}
6973

7074
/// <summary>

DocumentFormat.OpenXml.Tests/Common/TestContext.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2+
using System;
23
using System.Collections.Generic;
34
using System.Diagnostics;
45
using System.Linq;
@@ -28,13 +29,6 @@ public string FullyQualifiedTestClassName
2829
set;
2930
}
3031

31-
[MethodImpl(MethodImplOptions.NoInlining)]
32-
public static string GetCurrentMethod()
33-
{
34-
StackTrace st = new StackTrace();
35-
StackFrame sf = st.GetFrame(1);
36-
37-
return sf.GetMethod().Name;
38-
}
32+
public static string GetCurrentMethod([CallerMemberName]string name = null) => name;
3933
}
4034
}

0 commit comments

Comments
 (0)