From e1ec72eab6d00b3ba38e5932bc88920f103b6e4a Mon Sep 17 00:00:00 2001 From: aunsane Date: Fri, 27 Apr 2018 21:33:17 +0300 Subject: Telegram: initial commit - tdlib moved to telegram dir --- .../Telegram/tdlib/td/example/uwp/app/.gitignore | 5 + .../Telegram/tdlib/td/example/uwp/app/App.xaml | 7 + .../Telegram/tdlib/td/example/uwp/app/App.xaml.cs | 104 +++++++++++++ .../td/example/uwp/app/ApplicationInsights.config | 3 + .../uwp/app/Assets/LockScreenLogo.scale-200.png | Bin 0 -> 1430 bytes .../uwp/app/Assets/SplashScreen.scale-200.png | Bin 0 -> 7700 bytes .../uwp/app/Assets/Square150x150Logo.scale-200.png | Bin 0 -> 2937 bytes .../uwp/app/Assets/Square44x44Logo.scale-200.png | Bin 0 -> 1647 bytes ...are44x44Logo.targetsize-24_altform-unplated.png | Bin 0 -> 1255 bytes .../tdlib/td/example/uwp/app/Assets/StoreLogo.png | Bin 0 -> 1451 bytes .../uwp/app/Assets/Wide310x150Logo.scale-200.png | Bin 0 -> 3204 bytes .../tdlib/td/example/uwp/app/MainPage.xaml | 29 ++++ .../tdlib/td/example/uwp/app/MainPage.xaml.cs | 171 +++++++++++++++++++++ .../tdlib/td/example/uwp/app/Package.appxmanifest | 28 ++++ .../td/example/uwp/app/Properties/AssemblyInfo.cs | 29 ++++ .../td/example/uwp/app/Properties/Default.rd.xml | 31 ++++ .../Telegram/tdlib/td/example/uwp/app/TdApp.csproj | 151 ++++++++++++++++++ .../td/example/uwp/app/TdApp_TemporaryKey.pfx | Bin 0 -> 2456 bytes .../Telegram/tdlib/td/example/uwp/app/project.json | 19 +++ 19 files changed, 577 insertions(+) create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/.gitignore create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/App.xaml create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/App.xaml.cs create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/ApplicationInsights.config create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/Assets/LockScreenLogo.scale-200.png create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/Assets/SplashScreen.scale-200.png create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/Assets/Square150x150Logo.scale-200.png create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/Assets/Square44x44Logo.scale-200.png create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/Assets/Square44x44Logo.targetsize-24_altform-unplated.png create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/Assets/StoreLogo.png create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/Assets/Wide310x150Logo.scale-200.png create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/MainPage.xaml create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/MainPage.xaml.cs create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/Package.appxmanifest create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/Properties/AssemblyInfo.cs create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/Properties/Default.rd.xml create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/TdApp.csproj create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/TdApp_TemporaryKey.pfx create mode 100644 protocols/Telegram/tdlib/td/example/uwp/app/project.json (limited to 'protocols/Telegram/tdlib/td/example/uwp/app') diff --git a/protocols/Telegram/tdlib/td/example/uwp/app/.gitignore b/protocols/Telegram/tdlib/td/example/uwp/app/.gitignore new file mode 100644 index 0000000000..37ab08165b --- /dev/null +++ b/protocols/Telegram/tdlib/td/example/uwp/app/.gitignore @@ -0,0 +1,5 @@ +.vs/ +bin/ +obj/ +project.lock.json +TdApp.csproj.user diff --git a/protocols/Telegram/tdlib/td/example/uwp/app/App.xaml b/protocols/Telegram/tdlib/td/example/uwp/app/App.xaml new file mode 100644 index 0000000000..b4256fd441 --- /dev/null +++ b/protocols/Telegram/tdlib/td/example/uwp/app/App.xaml @@ -0,0 +1,7 @@ + + diff --git a/protocols/Telegram/tdlib/td/example/uwp/app/App.xaml.cs b/protocols/Telegram/tdlib/td/example/uwp/app/App.xaml.cs new file mode 100644 index 0000000000..0ed0f96812 --- /dev/null +++ b/protocols/Telegram/tdlib/td/example/uwp/app/App.xaml.cs @@ -0,0 +1,104 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2018 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +using System; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Navigation; + +namespace TdApp +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + sealed partial class App : Application + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync( + Microsoft.ApplicationInsights.WindowsCollectors.Metadata | + Microsoft.ApplicationInsights.WindowsCollectors.Session); + this.InitializeComponent(); + this.Suspending += OnSuspending; + } + + /// + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used such as when the application is launched to open a specific file. + /// + /// Details about the launch request and process. + protected override void OnLaunched(LaunchActivatedEventArgs e) + { + +#if DEBUG + if (System.Diagnostics.Debugger.IsAttached) + { + this.DebugSettings.EnableFrameRateCounter = true; + } +#endif + + Frame rootFrame = Window.Current.Content as Frame; + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (rootFrame == null) + { + // Create a Frame to act as the navigation context and navigate to the first page + rootFrame = new Frame(); + + rootFrame.NavigationFailed += OnNavigationFailed; + + if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) + { + //TODO: Load state from previously suspended application + } + + // Place the frame in the current Window + Window.Current.Content = rootFrame; + } + + if (rootFrame.Content == null) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame.Navigate(typeof(MainPage), e.Arguments); + } + // Ensure the current window is active + Window.Current.Activate(); + } + + /// + /// Invoked when Navigation to a certain page fails + /// + /// The Frame which failed navigation + /// Details about the navigation failure + void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new Exception("Failed to load Page " + e.SourcePageType.FullName); + } + + /// + /// Invoked when application execution is being suspended. Application state is saved + /// without knowing whether the application will be terminated or resumed with the contents + /// of memory still intact. + /// + /// The source of the suspend request. + /// Details about the suspend request. + private void OnSuspending(object sender, SuspendingEventArgs e) + { + var deferral = e.SuspendingOperation.GetDeferral(); + //TODO: Save application state and stop any background activity + deferral.Complete(); + } + } +} diff --git a/protocols/Telegram/tdlib/td/example/uwp/app/ApplicationInsights.config b/protocols/Telegram/tdlib/td/example/uwp/app/ApplicationInsights.config new file mode 100644 index 0000000000..cb2a232da3 --- /dev/null +++ b/protocols/Telegram/tdlib/td/example/uwp/app/ApplicationInsights.config @@ -0,0 +1,3 @@ + + + diff --git a/protocols/Telegram/tdlib/td/example/uwp/app/Assets/LockScreenLogo.scale-200.png b/protocols/Telegram/tdlib/td/example/uwp/app/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000..735f57adb5 Binary files /dev/null and b/protocols/Telegram/tdlib/td/example/uwp/app/Assets/LockScreenLogo.scale-200.png differ diff --git a/protocols/Telegram/tdlib/td/example/uwp/app/Assets/SplashScreen.scale-200.png b/protocols/Telegram/tdlib/td/example/uwp/app/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000000..023e7f1fed Binary files /dev/null and b/protocols/Telegram/tdlib/td/example/uwp/app/Assets/SplashScreen.scale-200.png differ diff --git a/protocols/Telegram/tdlib/td/example/uwp/app/Assets/Square150x150Logo.scale-200.png b/protocols/Telegram/tdlib/td/example/uwp/app/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000000..af49fec1a5 Binary files /dev/null and b/protocols/Telegram/tdlib/td/example/uwp/app/Assets/Square150x150Logo.scale-200.png differ diff --git a/protocols/Telegram/tdlib/td/example/uwp/app/Assets/Square44x44Logo.scale-200.png b/protocols/Telegram/tdlib/td/example/uwp/app/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000..ce342a2ec8 Binary files /dev/null and b/protocols/Telegram/tdlib/td/example/uwp/app/Assets/Square44x44Logo.scale-200.png differ diff --git a/protocols/Telegram/tdlib/td/example/uwp/app/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/protocols/Telegram/tdlib/td/example/uwp/app/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000000..f6c02ce97e Binary files /dev/null and b/protocols/Telegram/tdlib/td/example/uwp/app/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/protocols/Telegram/tdlib/td/example/uwp/app/Assets/StoreLogo.png b/protocols/Telegram/tdlib/td/example/uwp/app/Assets/StoreLogo.png new file mode 100644 index 0000000000..7385b56c0e Binary files /dev/null and b/protocols/Telegram/tdlib/td/example/uwp/app/Assets/StoreLogo.png differ diff --git a/protocols/Telegram/tdlib/td/example/uwp/app/Assets/Wide310x150Logo.scale-200.png b/protocols/Telegram/tdlib/td/example/uwp/app/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000000..288995b397 Binary files /dev/null and b/protocols/Telegram/tdlib/td/example/uwp/app/Assets/Wide310x150Logo.scale-200.png differ diff --git a/protocols/Telegram/tdlib/td/example/uwp/app/MainPage.xaml b/protocols/Telegram/tdlib/td/example/uwp/app/MainPage.xaml new file mode 100644 index 0000000000..cdff97d9f3 --- /dev/null +++ b/protocols/Telegram/tdlib/td/example/uwp/app/MainPage.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + +