Permalink
Browse files

Merge pull request #375 from Gravecorp/master

drilus
  • Loading branch information...
2 parents a1f251f + c0c2e28 commit d4261faa0e1f8add24e6c26e216b05822f31fe86 @Gravecorp Gravecorp committed Apr 20, 2012
Showing with 10 additions and 5 deletions.
  1. +10 −5 octgnFX/Octgn/Play/PlayWindow.xaml.cs
@@ -111,7 +111,7 @@ private void ExtractFont(string Schema)
{
foreach (PackageRelationship relationship in package.GetRelationshipsByType(Schema))
{
- if (!package.PartExists(relationship.TargetUri)) return;
+ if (!package.PartExists(relationship.TargetUri)) continue;
PackagePart definition = package.GetPart(relationship.TargetUri);
ExtractPart(definition, Directory.GetCurrentDirectory() + "\\temp.ttf");
}
@@ -171,12 +171,17 @@ private static void ExtractPart(PackagePart packagePart, string targetDirectory)
fontName.Add(partUri.OriginalString);
// Create the necessary directories based on the full part path
- Directory.CreateDirectory(Path.GetDirectoryName(uriFullFilePath.LocalPath));
-
+ if (!Directory.Exists(Path.GetDirectoryName(uriFullFilePath.LocalPath)))
+ {
+ Directory.CreateDirectory(Path.GetDirectoryName(uriFullFilePath.LocalPath));
+ }
// Write the file from the part’s content stream.
- using (FileStream fileStream = File.Create(uriFullFilePath.LocalPath))
+ if (!File.Exists(uriFullFilePath.LocalPath))
{
- packagePart.GetStream().CopyTo(fileStream);
+ using (FileStream fileStream = File.Create(uriFullFilePath.LocalPath))
+ {
+ packagePart.GetStream().CopyTo(fileStream);
+ }
}
}

0 comments on commit d4261fa

Please sign in to comment.