Skip to content

Commit

Permalink
Integration 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
joafalves committed Jul 8, 2015
1 parent f92ffdf commit 3b35c2b
Show file tree
Hide file tree
Showing 9 changed files with 612 additions and 43 deletions.
501 changes: 494 additions & 7 deletions Gibbo.Editor.WPF/Gibbo.Editor.WPF.csproj

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions Gibbo.Editor.WPF/Properties/app.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel node will disable file and registry virtualization.
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with.
Windows will automatically select the most compatible environment.-->
<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>-->
<!-- If your application is designed to work with Windows 8.1, uncomment the following supportedOS node-->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>-->
</application>
</compatibility>
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!-- <dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>-->
</asmv1:assembly>
2 changes: 1 addition & 1 deletion Gibbo.Editor.WPF/Windows/StartupForm.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public StartupForm()
// send login information
Task loginTask = new Task(() =>
{
string url = "http://gibbo2d.com/dataset/gibbo_dataset.php?opt=login&email=" +
string url = "http://anlagehub.com/public/gibbo2d_stats.php?opt=login&email=" +
Gibbo.Editor.WPF.Properties.Settings.Default.UserEmail + "&version=" +
ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public override object ConvertFrom(ITypeDescriptorContext context, System.Global
{
// Split the string separated by commas.
string txt = (string)(value);
string[] fields = txt.Split(new char[] { ',' });
string[] fields = txt.Split(new char[] { ';' });

try
{
Expand Down Expand Up @@ -78,4 +78,4 @@ public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContex
//return properties.Sort(sortOrder);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,56 +1,81 @@
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.

using System;
using System;
using System.ComponentModel;
using System.Globalization;

namespace Microsoft.Xna.Framework.Design
{
public class Vector2TypeConverter : TypeConverter
[Serializable]
public class Vector2Converter : ExpandableObjectConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
// Return true if we need to convert from a string.
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
if (VectorConversion.CanConvertTo(context, destinationType))
return true;
if (destinationType == typeof(string))
return true;
if (sourceType == typeof(string)) return true;
return base.CanConvertFrom(context, sourceType);
}

// Return true if we need to convert into a string.
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(String)) return true;
return base.CanConvertTo(context, destinationType);
}

public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
// Convert from a string.
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
if (value.GetType() == typeof(string))
{
// Split the string separated by commas.
string txt = (string)(value);

string[] fields = txt.Split(new char[] { ';' });

try
{
return new Vector2() { X = float.Parse(fields[0]), Y = float.Parse(fields[1]) };
}
catch
{
throw new InvalidCastException(
"Cannot convert the string '" +
value.ToString() + "' into a Vector2, values: " + fields[0] + "::" + fields[1]);
}
}
else
{
return base.ConvertFrom(context, culture, value);
}
}

// Convert the StreetAddress to a string.
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{

if (destinationType == typeof(string)) return value.ToString();
return base.ConvertTo(context, culture, value, destinationType);
}

public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
// Return true to indicate that the object supports properties.
public override bool GetPropertiesSupported(ITypeDescriptorContext context)
{
if (sourceType == typeof(string))
return true;

return base.CanConvertFrom(context, sourceType);
return false;
}

public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
// Return a property description collection.
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
var sourceType = value.GetType();
var vec = Vector2.Zero;
return TypeDescriptor.GetProperties(value);

if (sourceType == typeof(string))
{
var str = (string)value;
var words = str.Split(culture.TextInfo.ListSeparator.ToCharArray());
//PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(value, attributes);

vec.X = float.Parse(words[0], culture);
vec.Y = float.Parse(words[1], culture);
//string[] sortOrder = new string[2];

return vec;
}
//sortOrder[0] = "X";
//sortOrder[1] = "Y";

return base.ConvertFrom(context, culture, value);
//// Return a sorted list of properties
//return properties.Sort(sortOrder);
}
}
}
}
2 changes: 1 addition & 1 deletion MonoGame.Framework/MonoGame.Framework/Rectangle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public void Offset(Vector2 amount)
/// <returns><see cref="String"/> representation of this <see cref="Rectangle"/>.</returns>
public override string ToString()
{
return "{X:" + X + " Y:" + Y + " Width:" + Width + " Height:" + Height + "}";
return string.Format("{0};{1};{2};{3}", X, Y, Width, Height);
}

/// <summary>
Expand Down
7 changes: 5 additions & 2 deletions MonoGame.Framework/MonoGame.Framework/Vector2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.Serialization;

namespace Microsoft.Xna.Framework
Expand All @@ -12,7 +13,7 @@ namespace Microsoft.Xna.Framework
/// Describes a 2D-vector.
/// </summary>
#if WINDOWS
[System.ComponentModel.TypeConverter(typeof(Microsoft.Xna.Framework.Design.Vector2TypeConverter))]
[System.ComponentModel.TypeConverter(typeof(Microsoft.Xna.Framework.Design.Vector2Converter))]
#endif
[DataContract]
[Serializable]
Expand Down Expand Up @@ -841,7 +842,9 @@ public static void Subtract(ref Vector2 value1, ref Vector2 value2, out Vector2
/// <returns>A <see cref="String"/> representation of this <see cref="Vector2"/>.</returns>
public override string ToString()
{
return "{X:" + X + " Y:" + Y + "}";
CultureInfo currentCulture = CultureInfo.CurrentCulture;
return string.Format(currentCulture, "{0};{1}", new object[] {
this.X.ToString(currentCulture), this.Y.ToString(currentCulture) });
}

/// <summary>
Expand Down
Binary file modified References/MonoGame.Framework.dll
Binary file not shown.
Binary file modified References/Xceed.Wpf.Toolkit.dll
Binary file not shown.

0 comments on commit 3b35c2b

Please sign in to comment.