Skip to content

Commit

Permalink
Merge pull request #94 from Sparkiy/edge
Browse files Browse the repository at this point in the history
Now builds in VS2013
  • Loading branch information
AleksandarDev committed Feb 14, 2015
2 parents 409d1af + 0f6aec5 commit 77e7a3a
Show file tree
Hide file tree
Showing 46 changed files with 409 additions and 145 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Ignore Windows image thumbnails
Thumbs.db

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

Expand Down
2 changes: 1 addition & 1 deletion SparkiyClient/SharpDX.Toolkit.Game.Direct2D
9 changes: 6 additions & 3 deletions SparkiyClient/SparkiyClient.Common/ExtendedViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ public ExtendedObservableObject()
base.RaisePropertyChanged(propertyName);
}

public bool IsDirty => this.propertyManager.IsDirty;
public bool IsDirty
{
get { return this.propertyManager.IsDirty; }
}

public void MarkAsClean()
{
Expand Down Expand Up @@ -174,8 +177,8 @@ public PropertyManager(INotifyPropertyChangedTrigger trigger)
this.propertyValues[propertyName] = defaultValue;
return (T)this.propertyValues[propertyName];
}
public bool IsDirty => this.isDirty;

public bool IsDirty { get { return this.isDirty; } }

public void MarkAsClean()
{
Expand Down
37 changes: 36 additions & 1 deletion SparkiyClient/SparkiyClient.Common/SparkiyClient.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -52,6 +53,40 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<TargetPlatform Include="WindowsPhoneApp, Version=8.1" />
<TargetPlatform Include="Windows, Version=8.1" />
Expand Down Expand Up @@ -101,4 +136,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public Project Project
set { this.SetProperty(value); }
}

public RelayCommand CreateProjectCommand { get; }
public RelayCommand CreateProjectCommand { get; private set; }
}

public sealed class CreateProjectPageViewModelDesignTime : CreateProjectPageViewModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public DebugPageViewModel(IProjectService projectService, INavigationService nav

this.NavigateToHomeCommand = new RelayCommand(this.NavigateToHomeCommandExecute);
this.NavigateToEditorCommand = new RelayCommand(this.NavigateToEditorCommandExecute);

this.OutputMessages = new ObservableCollection<EngineMessage>();
}

public async override void OnNavigatedTo(NavigationEventArgs e)
Expand Down Expand Up @@ -85,7 +87,7 @@ private void NavigateToHomeCommandExecute()

private void MessagesCheckTimerOnTick(object sender, object o)
{
if (this.projectPlayEngineManager?.Engine == null)
if (this.projectPlayEngineManager == null || this.projectPlayEngineManager.Engine == null)
return;

foreach (var engineMessage in this.projectPlayEngineManager.Engine.GetMessages())
Expand Down Expand Up @@ -115,14 +117,14 @@ public async Task AssignProjectAsync(Project project)
}


public RelayCommand NavigateToEditorCommand { get; }
public RelayCommand NavigateToEditorCommand { get; private set; }

public RelayCommand NavigateToHomeCommand { get; }
public RelayCommand NavigateToHomeCommand { get; private set; }


public Project Project => this.project;
public Project Project { get { return this.project; } }

public ObservableCollection<EngineMessage> OutputMessages { get; } = new ObservableCollection<EngineMessage>();
public ObservableCollection<EngineMessage> OutputMessages { get; private set; }
}

public sealed class DebugPageViewModelDesignTime : DebugPageViewModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public CodeFile SelectedFile
if (this.SelectedFile == value)
return;

if (this.SelectedFile != null && this.editor?.Code != null)
if (this.SelectedFile != null && this.editor != null && this.editor.Code != null)
{
Log.Debug("Assigning code from editor to file \"{0}\"", this.SelectedFile.Name);
this.SelectedFile.Code = this.editor.Code ?? String.Empty;
Expand All @@ -210,28 +210,28 @@ public CodeFile SelectedFile
if (this.SelectedFile != null && editor != null)
{
Log.Debug("Assigning code from file \"{0}\" to editor", this.SelectedFile.Name);
this.editor.Code = this.SelectedFile.Code?.TrimEnd('\r', '\n') + "\r" ?? String.Empty;
this.editor.Code = this.SelectedFile.Code != null ? this.SelectedFile.Code.TrimEnd('\r', '\n') + "\r" : String.Empty;
}
}
}

public RelayCommand AddNewFileCommand { get; }
public RelayCommand AddNewFileCommand { get; private set; }

public INewFileViewModel NewFileViewModel
{
get { return this.GetProperty<INewFileViewModel>(); }
protected set { this.SetProperty(value); }
}

public RelayCommand AddNewAssetCommand { get; }
public RelayCommand AddNewAssetCommand { get; private set; }

public RelayCommand NavigateToHomeCommand { get; }
public RelayCommand NavigateToHomeCommand { get; private set; }

public RelayCommand NavigateToProjectCommand { get; }
public RelayCommand NavigateToProjectCommand { get; private set; }

public RelayCommand DebugProjectCommand { get; }
public RelayCommand DebugProjectCommand { get; private set; }

public RelayCommand PlayProjectCommand { get; }
public RelayCommand PlayProjectCommand { get; private set; }
}

public sealed class EditPageViewModelDesignTime : EditPageViewModel
Expand Down
27 changes: 16 additions & 11 deletions SparkiyClient/SparkiyClient.UILogic/Services/ProjectService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public async Task ImportAsset(Project project, StorageFile file)
if (asset != null)
project.Assets.Add(asset);

Log.Debug("Asset \"{0}\" imported.", asset?.Name ?? "<INVALID TYPE>");
Log.Debug("Asset \"{0}\" imported.", asset != null ? asset.Name : "<INVALID TYPE>");
}

private Asset ResolveAsset(StorageFile file)
Expand Down Expand Up @@ -105,7 +105,7 @@ public async Task SaveAsync()
Log.Debug("Saving projects...");

// Retrieve all dirty projects
var dirtyProjects = this.projects.Where(p => p.IsDirty || (p.Files?.Any(s => s.IsDirty) ?? false));
var dirtyProjects = this.projects.Where(p => p.IsDirty || (p.Files != null ? p.Files.Any(s => s.IsDirty) : false));
foreach (var dirtyProject in dirtyProjects)
{
// Create project folder if it doesnt exist or retrieve one from project files path
Expand All @@ -122,17 +122,22 @@ public async Task SaveAsync()

// Save all dirty files
var scriptsFolder = await projectFolder.GetFolderAsync(ProjectFilesPath);
var dirtyFiles = dirtyProject.Files?.Where(s => s.IsDirty);
if (dirtyFiles != null)
foreach (var script in dirtyFiles)
if (dirtyProject.Files != null)
{
var dirtyFiles = dirtyProject.Files.Where(s => s.IsDirty);
if (dirtyFiles != null)
{
await SaveFileSafeAsync(
scriptsFolder,
script.Name,
script is Script ? ProjectFilesScriptExtension : ProjectFilesClassExtension,
script.Code ?? String.Empty);
script.MarkAsClean();
foreach (var script in dirtyFiles)
{
await SaveFileSafeAsync(
scriptsFolder,
script.Name,
script is Script ? ProjectFilesScriptExtension : ProjectFilesClassExtension,
script.Code ?? String.Empty);
script.MarkAsClean();
}
}
}

dirtyProject.MarkAsClean();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ public async Task SaveFileSafeAsync(
/// <summary>
/// The workspace folder
/// </summary>
public StorageFolder WorkspaceFolder => this.workspaceFolder;
public StorageFolder WorkspaceFolder { get { return this.workspaceFolder; } }
}
}
36 changes: 35 additions & 1 deletion SparkiyClient/SparkiyClient.UILogic/SparkiyClient.UILogic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,40 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<TargetPlatform Include="WindowsPhoneApp, Version=8.1" />
<TargetPlatform Include="Windows, Version=8.1" />
Expand Down Expand Up @@ -145,4 +179,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public MainPageViewModel(INavigationService navigationService, IAlertMessageServ
this.nextReleaseCountdownTimer.Tick += NextReleaseCountdownTimerOnTick;
this.nextReleaseCountdownTimer.Start();
this.NextReleaseCountdownTimerOnTick(null, null);

this.Projects = new ObservableCollection<Project>();
}

private bool NewProjectCommandCanExecute()
Expand Down Expand Up @@ -127,7 +129,9 @@ protected async void InitializeWorkspaceCommandExecuteAsync()
this.RequiresWorkspaceInitialization = this.storageService.RequiresHardStorageInitialization();
await this.samplesService.GetSamplesAsync();
await this.LoadProjectsAsync();
this.NewProjectCommand?.RaiseCanExecuteChanged();

if (this.NewProjectCommand != null)
this.NewProjectCommand.RaiseCanExecuteChanged();
}

public bool LoadingData
Expand All @@ -154,15 +158,15 @@ public bool IsNextReleaseReady
protected set { this.SetProperty(value); }
}

public string CurrentVersion => Application.Current.GetVersion();
public string CurrentVersion { get { return Application.Current.GetVersion(); } }

public RelayCommand InitializeWorkspaceCommand { get; }
public RelayCommand InitializeWorkspaceCommand { get; private set; }

public RelayCommand<Project> ProjectSelectedCommand { get; }
public RelayCommand<Project> ProjectSelectedCommand { get; private set; }

public ObservableCollection<Project> Projects { get; } = new ObservableCollection<Project>();
public ObservableCollection<Project> Projects { get; private set; }

public RelayCommand NewProjectCommand { get; }
public RelayCommand NewProjectCommand { get; private set; }
}

[ComVisible(false)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private async Task AssignProjectAsync(Project project)
this.projectPlayStateManager.PlayProject();
}

public RelayCommand StopCommand { get; }
public RelayCommand StopCommand { get; private set; }
}

public sealed class PlayPageViewModelDesignTime : PlayPageViewModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ public bool IsEditMode
}
}

public RelayCommand EditCommand { get; }
public RelayCommand EditCommand { get; private set; }

public RelayCommand PlayCommand { get; }
public RelayCommand PlayCommand { get; private set; }

public RelayCommand GoBackCommand { get; }
public RelayCommand GoBackCommand { get; private set; }

public bool LoadingData
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<AdSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CultureDescriptors CultureName="">
<AdDuplex AppId="135231" Probability="0" />
<Smaato AppId="101002420" SecondaryId="1001001131" Probability="100" />
</CultureDescriptors>
</AdSettings>
13 changes: 10 additions & 3 deletions SparkiyClient/SparkiyClient/SparkiyClient.Shared/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,18 @@ private void OnUnhandledRegistrationException(Exception ex)
/// Get an reference to the current Application instance
/// as an MvvmAppBase object.
/// </summary>
public static new App Current => (App)Application.Current;
public static new App Current
{
get { return (App)Application.Current; }
}

/// <summary>
/// Get the IoC Unity Container
/// </summary>
public IUnityContainer Container => this.container;
public IUnityContainer Container
{
get { return this.container; }
}

#region IDisposable Support
private bool disposedValue = false; // To detect redundant calls
Expand All @@ -271,7 +277,8 @@ void Dispose(bool disposing)
{
if (disposing)
{
this.container?.Dispose();
if (this.container != null)
this.container.Dispose();
}

// TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
Expand Down
Binary file not shown.
Loading

0 comments on commit 77e7a3a

Please sign in to comment.