About.xaml.cs 2.26 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
/*
About.xaml.cs
Copyright (C) 2015  Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
14
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
15 16
*/

Margaux Clerc's avatar
Margaux Clerc committed
17
using Linphone.Model;
18 19 20
using System.Reflection;
using Windows.UI.Xaml.Controls;

Erwan Croze's avatar
Erwan Croze committed
21
namespace Linphone.Views {
Margaux Clerc's avatar
Margaux Clerc committed
22

Erwan Croze's avatar
Erwan Croze committed
23 24
    public partial class About : Page {
        public About() {
25 26
            this.InitializeComponent();

Margaux Clerc's avatar
Margaux Clerc committed
27 28 29
            var packageId = Windows.ApplicationModel.Package.Current.Id;
            AppVersion.Text = string.Format("{0}.{1}.{2}", packageId.Version.Major, packageId.Version.Minor, packageId.Version.Build);
            CoreVersion.Text = LinphoneManager.Instance.getCoreVersion();
30 31 32

            // Parse the text to insert clickable links when a line start with http://
            // And replace #version# tag by actual version name
Margaux Clerc's avatar
Margaux Clerc committed
33 34 35 36 37 38 39
            /* foreach (var line in text.Split('\n'))
             {
                 String textLine = line;
                 if (line.Contains("#version#"))
                 {
                     textLine = line.Replace("#version#", versionName);
                 }
40

Margaux Clerc's avatar
Margaux Clerc committed
41 42 43 44 45 46
                 if (line.StartsWith("http://"))
                 {
                     Hyperlink link = new Hyperlink();
                     link.NavigateUri = new Uri(textLine);
                     link.Inlines.Add(textLine);
                     link.TargetName = "_blank";
47

Margaux Clerc's avatar
Margaux Clerc committed
48 49 50 51 52 53 54 55 56 57
                     paragraph.Inlines.Add(link);
                     i++;
                 }
                 else
                 {
                     paragraph.Inlines.Add(textLine);
                     paragraph.Inlines.Add(new LineBreak());
                 }
             }
             AboutText.Blocks.Add(paragraph);*/
58 59 60
        }
    }
}