Beispiel #1
0
 private async void SearchBook()
 {
     BookAccess bookAccess = new BookAccess();
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     try
     {
         if (CanExecute() == true)
         {
             var codeCategorie = SelectedCategory.CodeCategorie;
             codeCategorie = codeCategorie.Replace(" ", "_");
             BooksSearch = await bookAccess.GetBookSearch(WordSearch, codeCategorie);
             if(BooksSearch.Count == 0)
             {
                 string str = loader.GetString("NoResult");
                 ShowToast(str);
             }
         }
         else
         {                    
             string str = loader.GetString("Search_Missing");
             throw new EmptyFieldsException(str);
         }
     }
     catch (EmptyFieldsException e)
     {
         ShowToast(e.ErrorMessage);
     }
     catch (NoNetworkException e)
     {
         ShowToast(e.ErrorMessage);
     }
 }
Beispiel #2
0
        private async void BookReseravation_Click(Book book)
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
            string strVR = loader.GetString("ValideReservation");
            string yes = loader.GetString("Yes");
            string no = loader.GetString("No");
            var dialog = new Windows.UI.Popups.MessageDialog(book.Title+"\n" + strVR);      
            dialog.Commands.Add(new Windows.UI.Popups.UICommand(yes) { Id = 1 });
            dialog.Commands.Add(new Windows.UI.Popups.UICommand(no) { Id = 0 });

            var result = await dialog.ShowAsync();

            if ((int)result.Id == 1)
            {
                var duplicate = false;
                foreach (var b in bookReservation)
                {
                    if (b.NumBook == book.NumBook)
                        duplicate = true;
                }
                if(duplicate == false)
                    bookReservation.Add(book);
                else
                {
                    var str = loader.GetString("Duplicate");
                    dialog = new Windows.UI.Popups.MessageDialog(str);
                    await dialog.ShowAsync();
                }
            }
        }
 public object Convert(object value, Type targetType, object parameter, string culture)
 {
     Windows.ApplicationModel.Resources.ResourceLoader loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     DateTime dateTimeToConvert = (DateTime)value;
     string commentTimeString = "";
     TimeSpan commentTimeLag = System.DateTime.Now - dateTimeToConvert;
     if (dateTimeToConvert.Date == System.DateTime.Now.Date)
     {
         if (TimeSpan.FromHours(1) > commentTimeLag)
         {
             if (commentTimeLag.Minutes <= 1)
                 commentTimeString = string.Format("{0}" + loader.GetString("TimeConverter_Recent_1"), commentTimeLag.Minutes);
             else
                 commentTimeString = string.Format("{0}" + loader.GetString("TimeConverter_Recent"), commentTimeLag.Minutes);
         }
         else
         {
             commentTimeString = string.Format(loader.GetString("TimeConverter_Today") + "{0}:{1:d2}", dateTimeToConvert.Hour, dateTimeToConvert.Minute);
         }
     }
     else if (dateTimeToConvert.AddDays(1).Date == System.DateTime.Now.Date)
     {
         commentTimeString = string.Format(loader.GetString("TimeConverter_Yesterday") + "{0}:{1:d2}", dateTimeToConvert.Hour, dateTimeToConvert.Minute);
     }
     //else if (dateTimeToConvert.AddDays(2).Date == System.DateTime.Now.Date)
     //{
     //    commentTimeString = string.Format(loader.GetString("TimeConverter_DayBeforeYesterday") + "{0}:{1:d2}", dateTimeToConvert.Hour, dateTimeToConvert.Minute);
     //}
     else
     {
         commentTimeString = dateTimeToConvert.ToString("yyyy-MM-dd");
     }
     return commentTimeString;
 }
 private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
 {
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     args.Request.Data.SetText(
         $"{loader.GetString("SendMeFriendRequest/Text")} {_link} {Environment.NewLine} {loader.GetString("SentFromPlayStationApp/Text")}");
     args.Request.Data.Properties.Title = loader.GetString("InviteFriendsToPsn/Text");
 }
 public async static Task SendMessageDialogAsync(string message, bool isSuccess)
 {
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     var title = isSuccess ? loader.GetString("SuccessText/Text") : loader.GetString("ErrorText/Text");
     var dialog = new MessageDialog((string.Concat(title, Environment.NewLine, Environment.NewLine, message)));
     await dialog.ShowAsync();
 }
        public OssHttpRequestMessage(Uri endpoint, string bucketName, string key, IDictionary<string, string> _parameters = null)
        {
            if (bucketName != NONEEDBUKETNAME)
            {
                var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                if (string.IsNullOrEmpty(bucketName))
                {
                    var text = loader.GetString("ExceptionIfArgumentStringIsNullOrEmpty");
                    throw new ArgumentException(text, "bucketName");
                }

                if (!string.IsNullOrEmpty(bucketName) && !OssUtils.IsBucketNameValid(bucketName))
                {
                    var text = loader.GetString("BucketNameInvalid");
                    throw new ArgumentException(text, "bucketName");
                }
            }
            else
            {
                bucketName = "";
            }
            Endpoint = endpoint;
            ResourcePath = "/" + ((bucketName != null) ? bucketName : "") + ((key != null) ? ("/" + key) : "");
            ResourcePathUrl = OssUtils.MakeResourcePath(bucketName, key);
             parameters = _parameters;
             RequestUri = new Uri(BuildRequestUri());
        }
Beispiel #7
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            CoreWindow.GetForCurrentThread().PointerCursor = new CoreCursor(CoreCursorType.Arrow, 1);
            if (e.NavigationMode == NavigationMode.New)
            {
                frame.Navigate(typeof(Setting));
                List<MenuItem> mylist1 = new List<MenuItem>();
                var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                //str = loader.GetString("back");
                //mylist1.Add(new MenuItem() { Icon = "Back", Title = str });
                var str = loader.GetString("setting");
                mylist1.Add(new MenuItem() { Icon = "Setting", Title = str });
                str = loader.GetString("histroy");
                mylist1.Add(new MenuItem() { Icon = "Favorite", Title = str });
                str = loader.GetString("help");
                mylist1.Add(new MenuItem() { Icon = "Help", Title = str });
                list1.ItemsSource = mylist1;

                mylist1 = new List<MenuItem>();
                str = loader.GetString("about");
                mylist1.Add(new MenuItem() { Icon = "Contact", Title = str });
                str = loader.GetString("like");
                mylist1.Add(new MenuItem() { Icon = "Like", Title = str });
                //str = loader.GetString("back");
                //mylist1.Add(new MenuItem() { Icon = "Back", Title = str });
                list2.ItemsSource = mylist1;
            }
            base.OnNavigatedTo(e);
            CoreWindow.GetForCurrentThread().PointerReleased += (sender, args) =>
            {
                args.Handled = true;
                if (args.CurrentPoint.Properties.PointerUpdateKind == Windows.UI.Input.PointerUpdateKind.XButton1Released) if (Frame.CanGoBack) Frame.GoBack();
            };
        }
 public SearchRecipeViewModel(INavigationService navigationService)
 {
     _navigationService = navigationService;
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     var tradSearchDesc = loader.GetString("searchDesc");
     var tradSearch = loader.GetString("searchInput");
     var tradSearchTitle = loader.GetString("searchTitle");
 }
 private void CalculatePercentage(Windows.Devices.Power.BatteryReport details)
 {
     var getPercentage = (details.RemainingCapacityInMilliwattHours.Value / (double)details.FullChargeCapacityInMilliwattHours.Value);
     var status = details.Status;
     string per = getPercentage.ToString("##%");
     ProgressInPer.Value = getPercentage * 100;
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     BatteryStatus.Text = loader.GetString("status") + loader.GetString(status.ToString()) + " - " + loader.GetString("percentage") + per;
 }
 public void PopulateMenu()
 {
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     MenuItems = new List<MenuItem>()
     {
         new MenuItem()
         {
             Icon = "/Assets/Icons/Home.png",
             Name = loader.GetString("Home/Text"),
             Command = new NavigateToWhatsNewPage()
         },
         //new MenuItem()
         //{
         //    Icon = "/Assets/Icons/Event.png",
         //    Name = loader.GetString("Events/Text"),
         //    Command = new NavigateToEventsPageCommand()
         //},
         new MenuItem()
         {
             Icon = "/Assets/Icons/Friends.png",
             Name = loader.GetString("Friends/Text"),
             Command = new NavigateToFriendsPage()
         },
         new MenuItem()
         {
             Icon = "/Assets/Icons/Trophy.png",
             Name = loader.GetString("Trophy/Text"),
             Command = new NavigateToTrophiesPage()
         },
         new MenuItem()
         {
             Icon = "/Assets/Icons/Messenger.png",
             Name = loader.GetString("Messenger/Text"),
             Command = new NavigateToMessagesViewCommand()
         },
         new MenuItem()
         {
             Icon = "/Assets/Icons/Live.png",
             Name = loader.GetString("LiveFromPlayStation/Text"),
             Command = new NavigateToLiveFromPlaystationPage()
         },
         new MenuItem()
         {
             Icon = "/Assets/Icons/AddFriendLink.png",
             Name = loader.GetString("InviteFriendsToPsn/Text"),
             Command = new NavigateToFriendLinkPageCommand()
         },
         new MenuItem()
         {
             Icon = "/Assets/Icons/SignOut.png",
             Name = loader.GetString("Signout/Text"),
             Command = new NavigateToSelectAccountCommand()
         }
     };
     SwipeableSplitView?.UpdateLayout();
     SwipeableSplitView?.UpdateMenuList();
 }
 public SecondPageViewModel(INavigationService navigationService)
 {
     _navigationService = navigationService;
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     var tradSearch = loader.GetString("searchTitle");
     var tradHome = loader.GetString("homeTitle");
     var tradFavoris = loader.GetString("favoritesTitle");
     var tradTitle = loader.GetString("loginTitle");
 }
        public MainPage()
        {
            this.InitializeComponent();

            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
            url = loader.GetString("url");
            authtoken = loader.GetString("authtoken");

            text.Text = "";
        }
        public static string GetBoardName()
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
#if MBM
            return loader.GetString("MBMName");
#elif RPI
            return loader.GetString("Rpi2Name");
#else
            return loader.GetString("GenericBoardName");
#endif
        }
        public static string GetBoardName()
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();

            switch (DeviceTypeInformation.Type)
            {
                case DeviceTypes.RPI2:
                    return loader.GetString("Rpi2Name");
                default:
                    return loader.GetString("GenericBoardName");
            }
        }
Beispiel #15
0
        public async Task InitializeAsync()
        {
            var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
            connectionString = loader.GetString("DataBasePath");

            if (!await DoesFileExistAsync(loader.GetString("DataBasePath")))
            {
                SQLite.SQLiteAsyncConnection context = new SQLite.SQLiteAsyncConnection(connectionString);
                await context.CreateTableAsync<Sugges.UI.Logic.DataModel.Item>();
            }
        }
 public string ComputeSignature(string key, string data)
 {
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     if (string.IsNullOrEmpty(key))
     {
         throw new ArgumentException(loader.GetString("ExceptionIfArgumentStringIsNullOrEmpty"), "key");
     }
     if (string.IsNullOrEmpty(data))
     {
         throw new ArgumentException(loader.GetString("ExceptionIfArgumentStringIsNullOrEmpty"), "data");
     }
     return this.ComputeSignatureCore(key, data);
 }
 private void License_LicenseChanged()
 {
     PurchaseButton.Visibility = Visibility.Visible;
     PurchaseRing.Visibility = Visibility.Collapsed;
     PurchaseRing.IsActive = false;
     PurchaseButton.IsEnabled = !license.IsPurchased;
     PurchaseSlider.IsEnabled = !license.IsPurchased;
     if (license.IsPurchased)
     {
         var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
         ConfirmText.Text = loader.GetString("Thankyou");
         DollarText.Text = loader.GetString("ThankyouTitle");
     }
 }
Beispiel #18
0
 public async Task<String> authenticate()
 {
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader("breakpoint_secret");
     try
     {
         accessToken = await HttpUtil.GetAccessCode("https://github.com/login/oauth/", loader.GetString("ClientID"), loader.GetString("ClientSecret"), loader.GetString("Scope"));
     }
     catch (AccessTokenNotFoundException args)
     {
         NotifyUser("Uh oh, something went terribly wrong. Sorry about that! Breakpoint will now close. Verify network connectivity and try again. (" + args.Message + ")");
         App.Current.Exit();
     }
     return accessToken;
 }
        public SettingsNarrow(PrayerViewModel context)
        {
            this.InitializeComponent();
            DataContext = prayerViewModel = context;

            Windows.ApplicationModel.Resources.ResourceLoader loader = new Windows.ApplicationModel.Resources.ResourceLoader();

            if (prayerViewModel == null)
                prayerViewModel = new PrayerViewModel();

            CalculationMethodSettingsString.Text = loader.GetString("CalculationMethodSettingsString");
            AsrMethodSettingsString.Text = loader.GetString("AsrMethodSettingsString");
            MidnightMethodSettingsString.Text = loader.GetString("MidnightMethodSettingsString");
            MaghribAdjustementSettingsString.Text = loader.GetString("MaghribAdjustementSettingsString");
        }
        public void onCommandsRequested(SettingsPane settingsPane, SettingsPaneCommandsRequestedEventArgs eventArgs)
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
            var logoutLabel = loader.GetString("LogOut");
            var privacyLabel = loader.GetString("PrivacyPolicy");

            UICommandInvokedHandler logoutHandler = new UICommandInvokedHandler(onLogoutCommand);
            UICommandInvokedHandler privacyHandler = new UICommandInvokedHandler(onPrivacyCommand);

            SettingsCommand logoutCommand = new SettingsCommand("LogoutId", logoutLabel, logoutHandler);
            SettingsCommand privacyCommand = new SettingsCommand("PrivacyId", privacyLabel, privacyHandler);

            eventArgs.Request.ApplicationCommands.Add(logoutCommand);
            eventArgs.Request.ApplicationCommands.Add(privacyCommand);
        }
Beispiel #21
0
        public override async Task Update()
        {
            var client = new GZipHttpClient();
            client.MaxResponseContentBufferSize = 1024 * 1024;
            string url = "https://api.stackexchange.com/2.0/users/" + Source + "?site=" + Site;
            var response = await client.GetAsync(new Uri(url));
            if (response.StatusCode == System.Net.HttpStatusCode.BadRequest)
            {
                Counter = 0;
                return;
                //throw new NullReferenceException("The selected site was not found. Please check spelling.");
            }

            var result = await response.Content.ReadAsStringAsync();
            var recipes = JsonObject.Parse(result);

            if (recipes["items"].GetArray().Count == 0)
            {
                throw new NullReferenceException("The user id was not found.");
            }

            this.Title = recipes["items"].GetArray()[0].GetObject()["display_name"].GetString() + " reputation";
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
            this.Title = String.Format(loader.GetString("StackOverflowWidgetReputation"), recipes["items"].GetArray()[0].GetObject()["display_name"].GetString());
            Counter = (int)recipes["items"].GetArray()[0].GetObject()["reputation"].GetNumber();
        }
Beispiel #22
0
        async public Task SignUp()
        {
            try
            {
                var loader = new Windows.ApplicationModel.Resources.ResourceLoader();

                this.StatusMessage = string.Empty;
                this.Status = Enumerations.TravelerStatus.Working;

                if (this.CheckData())
                {
                    this.Identifier = await model.SignUpAsync(this);
                    
                    if (this.Identifier == new Guid(loader.GetString("GuidNull")))
                    {
                        this.StatusMessage = "The username already exists";
                        this.Status = Enumerations.TravelerStatus.Stopped;
                    }
                    else
                    {
                        this.StatusMessage = "Your account has been created";
                        this.Status = Enumerations.TravelerStatus.AccountCreated;
                    }
                }
            }
            catch (Exception)
            {
                this.StatusMessage = "Sorry, something is wrong, please try later";
                this.Status = Enumerations.TravelerStatus.Stopped;
            }
        }
 public void CreatePopUp(string value)
 {
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     var str = loader.GetString(value);
     var messageDialog = new MessageDialog(str);
     messageDialog.ShowAsync();
 }
        public async Task<bool> VerifiyLoginAsync(string email, string password)
        {
            if (System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
            {
                HttpClient client = new HttpClient();
                HttpResponseMessage response = await client.GetAsync("http://keyregisterweb.azurewebsites.net/api/people/searchPersonByEmail/?email=" + email);

                string json = await response.Content.ReadAsStringAsync();
                var userFromDB = Newtonsoft.Json.JsonConvert.DeserializeObject<Person>(json);

                string cryptedPassword = MyCrypt(password);

                if (cryptedPassword.Equals(userFromDB.Password))
                {
                    return true;
                }

                return false;
            }
            else
            {
                var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                string str = loader.GetString("noNetwork");
                throw new NoNetworkException(str);
            }
        }
Beispiel #25
0
        public UserViewModel()
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
            model = new DatabaseModel();

            this.Identifier = new Guid(loader.GetString("GuidNull"));
        }
        private void RecuperaDados(object sender, RoutedEventArgs e)
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
            var str = loader.GetString("MeuDado");

            lblResultado.Text = str;
        }
Beispiel #27
0
        internal ObjectListing(string bucketName)
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();

            if (string.IsNullOrEmpty(bucketName))
            {
                var text = loader.GetString("ExceptionIfArgumentStringIsNullOrEmpty");
                throw new ArgumentException(text, "bucketName");
            }
            if (!OssUtils.IsBucketNameValid(bucketName))
            {
                var text = loader.GetString("BucketNameInvalid");
                throw new ArgumentException(text, "bucketName");
            }
            this.BucketName = bucketName;
        }
Beispiel #28
0
        /// <summary>
        /// Initializes the widget, specifying the page name and extracting it from the source.
        /// </summary>
        private void init()
        {
            if (this.Source.Contains("http://"))
            {
                this.Source = this.Source.Substring(Source.IndexOf("//") + 2);
            }
            if (this.Source.Contains("facebook.com"))
            {
                this.Source = this.Source.Substring(Source.IndexOf("/") + 1);
            }

            if (this.sel == Selection.Likes)
            {
                var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                this.Title = String.Format(loader.GetString("FBWidgetLikes"), Source);
            }
            else if (this.sel == Selection.TalkingAbout)
            {
                var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                this.Title = String.Format(loader.GetString("FBWidgetPeopleTalkingAbout"), Source);
            }
            this.Background = "#385998";
            this.Foreground = "white";
            this.WidgetForeground = "#33ffffff";
            this.WidgetName = "facebook";
        }
Beispiel #29
0
 public EmptyWidget()
 {
     this.WidgetName = "EmptyWidget";
     this.Foreground = "white";
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     this.Title = loader.GetString("EmptyWidgetTitle");
 }
Beispiel #30
0
    private static string GetResourceString([CallerMemberName] string resourceName = null)
    {
#pragma warning disable
      var loader = new Windows.ApplicationModel.Resources.ResourceLoader("Csla/Resources");
#pragma warning enable
      return loader.GetString(resourceName);
    }
Beispiel #31
0
 public static string GetLocalizedStrings(string resourceName)
 {
     Windows.ApplicationModel.Resources.ResourceLoader resourceLoader = null;
     if (Windows.UI.Core.CoreWindow.GetForCurrentThread() != null)
     {
         resourceLoader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
     }
     return(resourceLoader?.GetString(resourceName).ToString());
 }
Beispiel #32
0
        private async void Cancel_Click(object sender, RoutedEventArgs e)
        {
            var loader             = new Windows.ApplicationModel.Resources.ResourceLoader();
            var yesTag             = loader.GetString("yesTag");
            var noTag              = loader.GetString("noTag");
            var cancelNotification = loader.GetString("cancelNotification");

            var dialog = new MessageDialog(cancelNotification);

            dialog.Commands.Add(new UICommand {
                Label = yesTag, Id = 0
            });
            dialog.Commands.Add(new UICommand {
                Label = noTag, Id = 1
            });
            var result = await dialog.ShowAsync();

            if ((int)result.Id == 0)
            {
                this.Frame.GoBack();
            }
        }
Beispiel #33
0
        public override string ToString()
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();

            if (this.ToInt32() == 0x000606)
            {
                return(loader.GetString("ColorBlue"));
            }
            if (this.ToInt32() == 0x040500)
            {
                return(loader.GetString("ColorGreen"));
            }
            if (this.ToInt32() == 0x060102)
            {
                return(loader.GetString("ColorRed"));
            }
            if (this.ToInt32() == 0x060200)
            {
                return(loader.GetString("ColorOrange"));
            }
            return("R:" + red + "G:" + green + "B:" + blue);
        }
Beispiel #34
0
        private async void Solve(object sender, RoutedEventArgs e)
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();

            if (nis.Text == "")
            {
                MessageDialog messageDialog = new MessageDialog(loader.GetString("NoneInErr"));
                await messageDialog.ShowAsync();

                return;
            }
            if (nis.Text == "0")
            {
                MessageDialog messageDialog = new MessageDialog(loader.GetString("ZeroErr"));
                await messageDialog.ShowAsync();

                return;
            }
            if (Answer.Visibility == Visibility.Visible)
            {
                Answer.Visibility = Visibility.Collapsed;
                coe.Visibility    = Visibility.Visible;
                surd1.Visibility  = Visibility.Visible;
                surd2.Visibility  = Visibility.Visible;
            }
            int x;

            int[] p = new int[2];
            x = Convert.ToInt32(nis.Text);
            p = AppCore.NDS.SimpSurd(x);
            if (p[1] == 1)
            {
                surd1.Visibility = Visibility.Collapsed;
                surd2.Visibility = Visibility.Collapsed;
            }
            coe.Text          = p[0].ToString();
            numinsurd.Text    = p[1].ToString();
            Answer.Visibility = Visibility.Visible;
        }
Beispiel #35
0
        /// <summary>
        /// 控件初始化
        ///
        /// </summary>
        private void Init()
        {
            _time         = 0;
            timer         = new DispatcherTimer();
            TimeInitLevel = new TimeSpan(0, 0, 0, 0, 480); // 500ms
            Layout();                                      // 布局函数
            /// <summary>
            /// 时间
            /// </summary>
            timer.Tick    += Timer_Tick;
            timer.Interval = TimeInitLevel;
            timer.Start();

            Display.IsPause = false;

            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();

            Btn_Sound.Label   = loader.GetString("Button_Music");
            Btn_Control.Label = loader.GetString("Button_Pause");

            SystemNavigationManager.GetForCurrentView().BackRequested += App_BackRequested;
            //    (sender, e) =>
            //{
            //    Game_Stop();
            //    this.Frame.Navigate(typeof(MainPage));
            //};

            if (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Mobile")
            {
                xaml_Control.Visibility = Visibility.Visible;
            }
            else
            {
                xaml_Control.Visibility = Visibility.Collapsed;
            }

            //UpdateMainGrid(Data_RP.ActualHeight);
        }
Beispiel #36
0
        public MainPage()
        {
            this.InitializeComponent();

            _localSettings = ApplicationData.Current.LocalSettings;

            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();

            this.Loaded += MainPage_Loaded;

            InitializeUi();


            List <Feature> fList = new List <Feature>();

            fList.Add(new Feature {
                Icon = "", Name = loader.GetString("UL"), PageType = typeof(URILauncher)
            });
            fList.Add(new Feature {
                Icon = "", Name = loader.GetString("SMI"), PageType = typeof(IconBrowser)
            });
            fList.Add(new Feature {
                Icon = "", Name = loader.GetString("AG"), PageType = typeof(AssetsGen)
            });
            //fList.Add(new Feature { Icon = "", Name = "Device Portal(i)", PageType = typeof(DevicePortal) });
            //fList.Add(new Feature { Icon = "", Name = "Json2Class Converter(i)", PageType = typeof(Json2CS) });
            //fList.Add(new Feature { Icon = "", Name = "Color Converter(i)", PageType = typeof(ColorC) });
            //fList.Add(new Feature { Icon = "", Name = "Notification Editor(i)", PageType = typeof(NotificationEd) });
            fList.Add(new Feature {
                Icon = "", Name = loader.GetString("Settings"), PageType = typeof(SettingsPage)
            });
            //vm.BottomItems.Add(new NavigationItem { Icon = "", DisplayName = loader.GetString("Settings"), PageType = typeof(SettingsPage) });

            gridView.ItemsSource = fList;


            UpdateBuildInfo();
        }
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value is string)
            {
                var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                var str    = loader.GetString("SubmitToTextChannel");

                return(str.Replace("{0}", value as string));
            }
            else
            {
                return(value);
            }
        }
Beispiel #38
0
        private string DownloadedLink(string NameOfButtonClicked, object sender)
        {
            var resources = new Windows.ApplicationModel.Resources.ResourceLoader("setting");
            var ShareApi  = resources.GetString("MainAPI");

            Button     btnClicked  = (Button)sender;
            StackPanel satckPanel  = (StackPanel)btnClicked.Content;
            string     postId      = (satckPanel.FindName(NameOfButtonClicked) as TextBox).Text; //to get post id of clicked post
            string     Requestlink = ShareApi + "posts/" + postId + "/files/" + postId + "/url";
            string     jsonResult  = Requests.getResultJson(Requestlink);
            var        result      = JsonConvert.DeserializeObject <DataResult>(jsonResult);

            return(result.url);
        }
Beispiel #39
0
 public async Task RemoveFavoriteAsync(string email, string emailFavorite)
 {
     if (isUserConnected())
     {
         HttpClient          client   = new HttpClient();
         HttpResponseMessage response = await client.DeleteAsync("http://keyregisterweb.azurewebsites.net/api/people/deleteFavorite/?email=" + email + "&emailFavorite=" + emailFavorite);
     }
     else
     {
         var    loader = new Windows.ApplicationModel.Resources.ResourceLoader();
         string str    = loader.GetString("noNetwork");
         throw new NoNetworkException(str);
     }
 }
Beispiel #40
0
        public static List <MainMenu> GetMainMenus()
        {
            var menus  = new List <MainMenu>();
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();

            menus.Add(new MainMenu {
                ID = 1, Image = "Assets/select-method-icon.png", MenuName = loader.GetString("MainMenuSelectMethod")
            });
            menus.Add(new MainMenu {
                ID = 2, Image = "Assets/custom-method-icon.png", MenuName = loader.GetString("MainMenuCustomMethod")
            });

            menus.Add(new MainMenu {
                ID = 3, Image = "Assets/method-history-icon.png", MenuName = loader.GetString("MainMenuMethodHistory")
            });
            menus.Add(new MainMenu {
                ID = 4, Image = "Assets/calibrate-icon.png", MenuName = loader.GetString("MainMenuCalibrate")
            });
            menus.Add(new MainMenu {
                ID = 5, Image = "Assets/voc-library-icon.png", MenuName = loader.GetString("MainMenuVOCLibrary")
            });
            return(menus);
        }
Beispiel #41
0
        public static FlowDirection GetObjectFlowDirection(string Title)
        {
            Windows.ApplicationModel.Resources.ResourceLoader loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
            var expected = loader.GetString(Title + "/FlowDirection");

            if (expected.StartsWith("R") || expected.StartsWith("r"))
            {
                return(FlowDirection.RightToLeft);
            }
            else
            {
                return(FlowDirection.LeftToRight);
            }
        }
Beispiel #42
0
        //Renvoie différentes données de test selon l'endpoint spécifié.
        private String GetTestData(String url)
        {
            //Les strings sont obtenus de TestData.resw
            Windows.ApplicationModel.Resources.ResourceLoader loader = new Windows.ApplicationModel.Resources.ResourceLoader("TestData");

            string returnData = "<NoTestDataAvailable/>";

            if (url.StartsWith("/api/planning/slots?start="))
            {
                returnData = loader.GetString("planningTestXml");
            }

            if (url.StartsWith("/api/planning/slots/"))
            {
                returnData = loader.GetString("absenceSlotTestXml");
            }

            if (url.StartsWith("/api/rels/"))
            {
                returnData = loader.GetString("relTestXml");
            }

            switch (url)
            {
            case "/api/me":
                returnData = loader.GetString("userTestXml");
                break;

            case "/api/me/absences":
                returnData = loader.GetString("absencesTestXml");
                break;

            case "/api/campus/sites":
                returnData = loader.GetString("campusTestXml");
                break;

            case "/api/campus/rooms?siteId=1991":     //test data dispo pour cergy seulement parce que flemme
                returnData = loader.GetString("sallesTestXml");
                break;

            case "/api/me/marks":
                returnData = loader.GetString("notesTestXml");
                break;
            }

            return(returnData);
        }