Skip to content

Commit

Permalink
Added appcenter.
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed May 14, 2021
1 parent 44c4a10 commit e4be42b
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 29 deletions.
46 changes: 46 additions & 0 deletions Gum/Gum.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<BaseIntermediateOutputPath>objNetFramework\</BaseIntermediateOutputPath>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
Expand Down Expand Up @@ -60,6 +62,15 @@
<StartupObject>Gum.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.AppCenter, Version=0.0.0.0, Culture=neutral, PublicKeyToken=8a600e2fee7ba272, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AppCenter.4.2.0\lib\net461\Microsoft.AppCenter.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AppCenter.Analytics, Version=0.0.0.0, Culture=neutral, PublicKeyToken=8a600e2fee7ba272, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AppCenter.Analytics.4.2.0\lib\net461\Microsoft.AppCenter.Analytics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AppCenter.Crashes, Version=0.0.0.0, Culture=neutral, PublicKeyToken=8a600e2fee7ba272, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AppCenter.Crashes.4.2.0\lib\net461\Microsoft.AppCenter.Crashes.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>Libraries\Xna\Microsoft.Xna.Framework.dll</HintPath>
Expand All @@ -73,10 +84,38 @@
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="SQLitePCLRaw.batteries_v2, Version=2.0.2.669, Culture=neutral, PublicKeyToken=8226ea5df37bcae9, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.bundle_green.2.0.2\lib\net461\SQLitePCLRaw.batteries_v2.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.core, Version=2.0.2.669, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.core.2.0.2\lib\netstandard2.0\SQLitePCLRaw.core.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.nativelibrary, Version=2.0.2.669, Culture=neutral, PublicKeyToken=502ed628492ab262, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.bundle_green.2.0.2\lib\net461\SQLitePCLRaw.nativelibrary.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.provider.dynamic_cdecl, Version=2.0.2.669, Culture=neutral, PublicKeyToken=b68184102cba0b3b, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.provider.dynamic_cdecl.2.0.2\lib\netstandard2.0\SQLitePCLRaw.provider.dynamic_cdecl.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Design" />
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
Expand Down Expand Up @@ -695,6 +734,13 @@
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\SQLitePCLRaw.lib.e_sqlite3.2.0.2\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets" Condition="Exists('..\packages\SQLitePCLRaw.lib.e_sqlite3.2.0.2\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\SQLitePCLRaw.lib.e_sqlite3.2.0.2\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SQLitePCLRaw.lib.e_sqlite3.2.0.2\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
59 changes: 31 additions & 28 deletions Gum/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
using Gum.Controls;
using Gum.Logic.FileWatch;
using Gum.Commands;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Crashes;

namespace Gum
{
Expand Down Expand Up @@ -68,34 +70,6 @@ public MainWindow()
// Create the wireframe control, but don't add it...
CreateWireframeControl();

gumEditorPanel = new Panel();

// place the scrollbars first so they are in front of everything
scrollBarControlLogic = new ScrollBarControlLogic(gumEditorPanel, wireframeControl1);
scrollBarControlLogic.SetDisplayedArea(800, 600);
wireframeControl1.CameraChanged += () =>
{
if(ProjectManager.Self.GumProjectSave != null)
{
scrollBarControlLogic.SetDisplayedArea(
ProjectManager.Self.GumProjectSave.DefaultCanvasWidth,
ProjectManager.Self.GumProjectSave.DefaultCanvasHeight);
}
else
{
scrollBarControlLogic.SetDisplayedArea(800, 600);
}
scrollBarControlLogic.UpdateScrollBars();
scrollBarControlLogic.UpdateScrollBarsToCameraPosition();
};


//... add it here, so it can be done after scroll bars and other controls
gumEditorPanel.Controls.Add(this.wireframeControl1);

CreateWireframeEditControl();
CreateEditorToolbarPanel();

Expand Down Expand Up @@ -211,6 +185,9 @@ private void CreateWireframeControl()
};


wireframeControl1.ErrorOccurred += (exception) => Crashes.TrackError(exception);

this.wireframeControl1.QueryContinueDrag += (sender, args) =>
{
args.Action = DragAction.Continue;
Expand All @@ -226,7 +203,33 @@ private void CreateWireframeControl()
}
};

gumEditorPanel = new Panel();

// place the scrollbars first so they are in front of everything
scrollBarControlLogic = new ScrollBarControlLogic(gumEditorPanel, wireframeControl1);
scrollBarControlLogic.SetDisplayedArea(800, 600);
wireframeControl1.CameraChanged += () =>
{
if (ProjectManager.Self.GumProjectSave != null)
{
scrollBarControlLogic.SetDisplayedArea(
ProjectManager.Self.GumProjectSave.DefaultCanvasWidth,
ProjectManager.Self.GumProjectSave.DefaultCanvasHeight);
}
else
{
scrollBarControlLogic.SetDisplayedArea(800, 600);
}
scrollBarControlLogic.UpdateScrollBars();
scrollBarControlLogic.UpdateScrollBarsToCameraPosition();
};


//... add it here, so it can be done after scroll bars and other controls
gumEditorPanel.Controls.Add(this.wireframeControl1);
}

private void CreateWireframeEditControl()
Expand Down
14 changes: 13 additions & 1 deletion Gum/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
Expand All @@ -16,6 +19,15 @@ static void Main()
System.Windows.Media.RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

Application.ThreadException += (sender, args) =>
{
Crashes.TrackError(args.Exception);
};

AppCenter.Start("ba71b882-7cee-4dff-90a0-3cbbb179bec0",
typeof(Analytics), typeof(Crashes));

Application.Run(new MainWindow());
}
}
Expand Down
11 changes: 11 additions & 0 deletions Gum/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.AppCenter" version="4.2.0" targetFramework="net472" />
<package id="Microsoft.AppCenter.Analytics" version="4.2.0" targetFramework="net472" />
<package id="Microsoft.AppCenter.Crashes" version="4.2.0" targetFramework="net472" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net46" />
<package id="SQLitePCLRaw.bundle_green" version="2.0.2" targetFramework="net472" />
<package id="SQLitePCLRaw.core" version="2.0.2" targetFramework="net472" />
<package id="SQLitePCLRaw.lib.e_sqlite3" version="2.0.2" targetFramework="net472" />
<package id="SQLitePCLRaw.provider.dynamic_cdecl" version="2.0.2" targetFramework="net472" />
<package id="System.Buffers" version="4.4.0" targetFramework="net472" />
<package id="System.Memory" version="4.5.3" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" />
</packages>
2 changes: 2 additions & 0 deletions XnaAndWinforms/GraphicsDeviceControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ protected override void Dispose(bool disposing)

public event Action XnaDraw;
public event Action XnaUpdate;
public event Action<Exception> ErrorOccurred;

#endregion

Expand Down Expand Up @@ -206,6 +207,7 @@ protected override void OnPaint(PaintEventArgs e)
}
catch (Exception exception)
{
ErrorOccurred?.Invoke(exception);
mRenderError.Message = exception.ToString();
}
}
Expand Down

0 comments on commit e4be42b

Please sign in to comment.