Skip to content

Commit

Permalink
Fixed Save file + Bumped Beta v0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wRadion committed Apr 2, 2020
1 parent 95044dd commit c558ae5
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 21 deletions.
48 changes: 45 additions & 3 deletions LoopstationEditor/LoopstationEditor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>C:\Users\wRadion\Dropbox\Public\LoopstationEditor\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<TargetCulture>en</TargetCulture>
<ProductName>RC-505 Loopstation Settings Editor</ProductName>
<PublisherName>wRadion</PublisherName>
<AutorunEnabled>true</AutorunEnabled>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>0.2.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -39,10 +59,19 @@
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>B80B6587D5D2C78DBB411709BCB1DA82EBF9A948</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>LoopstationEditor_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="LcdLabel">
<HintPath>..\..\..\..\..\Downloads\LCDLabelWpf\LcdLabel.dll</HintPath>
</Reference>
<Reference Include="PropertyChanged, Version=3.2.6.0, Culture=neutral, PublicKeyToken=ee3ee20bcf148ddd, processorArchitecture=MSIL">
<HintPath>..\packages\PropertyChanged.Fody.3.2.6\lib\net40\PropertyChanged.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -822,6 +851,7 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="LoopstationEditor_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand All @@ -838,6 +868,18 @@
<ItemGroup>
<Resource Include="Views\Resources\Images\icon.png" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.6.1.0\build\Fody.targets" Condition="Exists('..\packages\Fody.6.1.0\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
4 changes: 2 additions & 2 deletions LoopstationEditor/Models/PropertyEngine/ValueBool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public override object ToType(Type conversionType, IFormatProvider provider)

public override string ToString() => ((bool)this).ToString();

public static explicit operator int(ValueBool value) => value._value;
public static explicit operator ValueBool(int value) => new ValueBool(value);
public static implicit operator int(ValueBool value) => value._value;
public static implicit operator ValueBool(int value) => new ValueBool(value);

public static explicit operator bool(ValueBool value) => Convert.ToBoolean(value._value);
public static explicit operator ValueBool(bool value) => new ValueBool(value);
Expand Down
4 changes: 2 additions & 2 deletions LoopstationEditor/Models/PropertyEngine/ValueChar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public override object ToType(Type conversionType, IFormatProvider provider)

public override string ToString() => ((char)this).ToString();

public static explicit operator int(ValueChar value) => value._value;
public static explicit operator ValueChar(int value) => new ValueChar(value);
public static implicit operator int(ValueChar value) => value._value;
public static implicit operator ValueChar(int value) => new ValueChar(value);

public static explicit operator char(ValueChar value) => (char)value._value;
public static explicit operator ValueChar(char value) => new ValueChar(value);
Expand Down
4 changes: 2 additions & 2 deletions LoopstationEditor/Models/PropertyEngine/ValueEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public override object ToType(Type conversionType, IFormatProvider provider)

public override string ToString() => ((TEnum)this).ToString();

public static explicit operator int(ValueEnum<TEnum> value) => value._value;
public static explicit operator ValueEnum<TEnum>(int value) => new ValueEnum<TEnum>(value);
public static implicit operator int(ValueEnum<TEnum> value) => value._value;
public static implicit operator ValueEnum<TEnum>(int value) => new ValueEnum<TEnum>(value);

public static explicit operator TEnum(ValueEnum<TEnum> value) => (TEnum)Enum.ToObject(typeof(TEnum), value._value);
public static explicit operator ValueEnum<TEnum>(TEnum value) => new ValueEnum<TEnum>(value);
Expand Down
4 changes: 2 additions & 2 deletions LoopstationEditor/Models/PropertyEngine/ValueInt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public virtual object ToType(Type conversionType, IFormatProvider provider)

public override string ToString() => _value.ToString();

public static explicit operator int(ValueInt value) => value._value;
public static explicit operator ValueInt(int value) => new ValueInt(value);
public static implicit operator int(ValueInt value) => value._value;
public static implicit operator ValueInt(int value) => new ValueInt(value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ public SettingsMemoryNameModel() : base() { }

public override string ToString()
{
return new StringBuilder(12).Append(Character01).Append(Character02).Append(Character03).Append(Character04).
Append(Character05).Append(Character06).Append(Character07).Append(Character08).Append(Character09).
Append(Character10).Append(Character11).Append(Character12).ToString();
return new StringBuilder(12).Append((char)Character01).Append((char)Character02).Append((char)Character03).Append((char)Character04).
Append((char)Character05).Append((char)Character06).Append((char)Character07).Append((char)Character08).Append((char)Character09).
Append((char)Character10).Append((char)Character11).Append((char)Character12).ToString();
}
}
}
26 changes: 25 additions & 1 deletion LoopstationEditor/Models/Settings/SettingsModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Xml.Serialization;

using LoopstationEditor.Models.PropertyEngine;

Expand All @@ -10,6 +11,7 @@ public abstract class SettingsModel : SettingsContainerModel
{
public const BindingFlags PropertyFlags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty | BindingFlags.SetProperty;

[XmlIgnore]
public PropertySet PropertySet { get; private set; }

public SettingsModel() : base()
Expand Down Expand Up @@ -77,7 +79,29 @@ public override void ApplyPropertyValues()
foreach (PropertyInfo prop in instanceProperties)
{
if (prop.GetCustomAttribute<PropertyAttribute>() == null) continue;
prop.SetValue(this, PropertySet.GetValue<ValueInt>(prop.Name));

PropertyMixedAttribute mixedAttr = prop.GetCustomAttribute<PropertyMixedAttribute>();

if (prop.PropertyType == typeof(ValueInt))
{
if (mixedAttr == null)
prop.SetValue(this, PropertySet.GetValue<ValueInt>(prop.Name));
else
{
ValueBool mixed = PropertySet.GetValue<ValueBool>(prop.Name + "_mixed");
prop.SetValue(this, PropertySet.GetValue<ValueInt>(prop.Name + ((bool)mixed ? "_enum" : "_int")));
}
}
else if (prop.PropertyType == typeof(ValueBool))
prop.SetValue(this, PropertySet.GetValue<ValueBool>(prop.Name));
else if (prop.PropertyType == typeof(ValueChar))
prop.SetValue(this, PropertySet.GetValue<ValueChar>(prop.Name));
else if (prop.PropertyType.IsGenericType)
{
Type type = typeof(ValueEnum<>).MakeGenericType(prop.PropertyType.GetGenericArguments()[0]);
prop.SetValue(this, Convert.ChangeType(PropertySet.GetValue<ValueInt>(prop.Name), type));
}

}
}
}
Expand Down
4 changes: 2 additions & 2 deletions LoopstationEditor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("0.2.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public class SettingsMemoryNameViewModel : SettingsViewModel
public SettingsMemoryNameViewModel(SettingsMemoryNameModel model)
: base(model, false)
{
Name = new StringBuilder().Append(model.Character01).Append(model.Character02).Append(model.Character03).Append(model.Character04).
Append(model.Character05).Append(model.Character06).Append(model.Character07).Append(model.Character08).
Append(model.Character09).Append(model.Character10).Append(model.Character11).Append(model.Character12).
Name = new StringBuilder().Append((char)model.Character01).Append((char)model.Character02).Append((char)model.Character03).Append((char)model.Character04).
Append((char)model.Character05).Append((char)model.Character06).Append((char)model.Character07).Append((char)model.Character08).
Append((char)model.Character09).Append((char)model.Character10).Append((char)model.Character11).Append((char)model.Character12).
ToString().TrimEnd(' ');
TempName = Name;
}
Expand Down
2 changes: 1 addition & 1 deletion LoopstationEditor/Views/MainWindow/MainWindowView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
xmlns:cmd="clr-namespace:LoopstationEditor.Commands"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
Title="RC-505 Loopstation Settings Editor - Beta v0.1"
Title="RC-505 Loopstation Settings Editor - Beta v0.2"
Icon="/Views/Resources/Images/icon.png"
MinWidth="1600px"
MinHeight="750px"
Expand Down

0 comments on commit c558ae5

Please sign in to comment.