Inheritance: IResourceLoader
コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SimBalanceViewModel" /> class.
        /// </summary>
        /// <param name="simBalance">The sim balance.</param>
        /// <param name="topUpHistory">The top up history.</param>
        /// <param name="usageHistory">The usage history.</param>
        /// <param name="authorizationService">The authorization service.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="resourceLoader">The resource loader.</param>
        /// <exception cref="System.ArgumentNullException"></exception>
        public SimBalanceViewModel(ISimBalance simBalance, ITopUpHistory topUpHistory, IUsageHistory usageHistory, IAuthorizationService authorizationService, INavigationService navigationService, ResourceLoader resourceLoader)
            : base(authorizationService, resourceLoader, navigationService)
        {
            if (simBalance == null)
            {
                throw new ArgumentNullException("simBalance");
            }
            if (topUpHistory == null)
            {
                throw new ArgumentNullException("topUpHistory");
            }
            if (usageHistory == null)
            {
                throw new ArgumentNullException("usageHistory");
            }

            _mobileNumber = (DTO.MobileNumber)NavigationService.Parameter;

            _simBalanceRepository = simBalance;
            _topUpHistory = topUpHistory;
            _usageHistory = usageHistory;

            Groups = new ObservableCollection<Group>();

            HandleNoInternet();
            LoadBalance();

        }
コード例 #2
0
        private async void Grid_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            Grid grid = (Grid)sender;
            Records.Items items = (Records.Items)grid.DataContext;
            String Data = String.Empty;
            ResourceLoader resourceLoader = new ResourceLoader();

            Data += String.Format(resourceLoader.GetString("pageResult_Assignment") + Environment.NewLine, items.Oid);
            Data += String.Format(resourceLoader.GetString("pageResult_Registry") + Environment.NewLine, items.RegistryID);
            Data += String.Format(resourceLoader.GetString("pageResult_OrganizationName") + Environment.NewLine, items.Name);
            Data += String.Format(resourceLoader.GetString("pageResult_OrganizationAddress") + Environment.NewLine, items.Address);

            if ( (items.Protocol != String.Empty) && (items.Protocol != null))
            {
                Data += String.Format(resourceLoader.GetString("pageResult_Protocol") + Environment.NewLine, items.Protocol);
            }

            DataPackage dataPackage = new DataPackage();

            dataPackage.SetText(Data);
            Clipboard.SetContent(dataPackage);

            MessageDialog msgbox = new MessageDialog(Data, resourceLoader.GetString("pageResult_DialogCopied"));

            msgbox.Commands.Clear();
            msgbox.Commands.Add(new UICommand { Label = resourceLoader.GetString("pageResult_DialogClose"), Id = 0 });
 
            var res = await msgbox.ShowAsync();
        }
コード例 #3
0
        public void LoadNavigation()
        {
            Nodes = new ObservableCollection<NavigationNode>();
		    var resourceLoader = new ResourceLoader();
            Nodes.Add(new ItemNavigationNode
            {
                Title = @"Windows 10 News",
                Label = "Home",
                FontIcon = "\ue10f",
                IsSelected = true,
                NavigationInfo = NavigationInfo.FromPage("HomePage")
            });

            Nodes.Add(new ItemNavigationNode
            {
                Label = "What's going on",
                FontIcon = "\ue12a",
                NavigationInfo = NavigationInfo.FromPage("WhatsGoingOnListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Recent news",
                FontIcon = "\ue1d7",
                NavigationInfo = NavigationInfo.FromPage("RecentNewsListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Apps",
                FontIcon = "\ue15a",
                NavigationInfo = NavigationInfo.FromPage("AppsListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Insider program",
                FontIcon = "\ue178",
                NavigationInfo = NavigationInfo.FromPage("InsiderProgramListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "What are people talking about",
                FontIcon = "\ue134",
                NavigationInfo = NavigationInfo.FromPage("WhatArePeopleTalkingAboutListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Do more",
                FontIcon = "\ue12d",
                NavigationInfo = NavigationInfo.FromPage("DoMoreListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = resourceLoader.GetString("NavigationPanePrivacy"),
                FontIcon = "\ue1f7",
                NavigationInfo = new NavigationInfo()
                {
                    NavigationType = NavigationType.DeepLink,
                    TargetUri = new Uri("http://appstudio.windows.com/home/appprivacyterms", UriKind.Absolute)
                }
            });
        }
コード例 #4
0
 public FavoriteTeamsViewModel(INavigationService navigationService)
 {
     _navigationService = navigationService;
     daTeams = new ChampionshipsAPIAccess();
     daUsers = new UsersAPIAccess();
     loader = new ResourceLoader();
 }
コード例 #5
0
        private static void notificationReceived(PushNotificationChannel sender, PushNotificationReceivedEventArgs args)
        {
            string receiver = args.RawNotification.Content;

            if (CommonData.session!=null && receiver == CommonData.session.Username)
            {
                if (CommonData.activeConversationPage != null)
                {
                    CommonData.activeConversationPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                    {
                        CommonData.activeConversationPage.refreshMessages(null, null);
                    });
                }
            }
            else
            {
                foreach (string[] credential in DataStorage.GetNotifierCredentials())
                {
                    if (receiver == credential[0])
                    {
                        ToastTemplateType toastTemplate = ToastTemplateType.ToastText02;
                        XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);
                        var toastTextElements = toastXml.GetElementsByTagName("text");
                        ResourceLoader resourceGetter = new ResourceLoader();
                        string appName = resourceGetter.GetString("ApplicationTitle");
                        string notificationText = resourceGetter.GetString("NotifierNewMessageText") + credential[0];
                        toastTextElements[0].AppendChild(toastXml.CreateTextNode(appName));
                        toastTextElements[1].AppendChild(toastXml.CreateTextNode(notificationText));
                        ToastNotification toast = new ToastNotification(toastXml);
                        ToastNotificationManager.CreateToastNotifier().Show(toast);
                    }
                }
            }
        }
コード例 #6
0
ファイル: ResourceHelper.cs プロジェクト: blinds52/intense
 private static ResourceLoader GetLoader()
 {
     if (loader == null) {
         loader = ResourceLoader.GetForCurrentView("Intense/Resources");
     }
     return loader;
 }
コード例 #7
0
ファイル: MobileHelper.cs プロジェクト: ddumic/WP_8_1_helper
 public static async void MessageBoxDialog(string message)
 {
     ResourceLoader resourceLoader = new ResourceLoader();
     string messageString = resourceLoader.GetString(message);
     MessageDialog msgbox = new MessageDialog(messageString);
     await msgbox.ShowAsync();
 }
コード例 #8
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            var loader = new ResourceLoader();
            var returnValue = string.Format("{0}{1}", loader.GetString("LocalCurrency"),((double)value).ToString(CultureInfo.InvariantCulture));

            return returnValue;
        }
コード例 #9
0
        private void ReportPage_Mobile_Loaded(object sender, RoutedEventArgs e)
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();

            pivotFixKosten.Header      = loader.GetString(CategoryNamenCosts.Fixed.ToString());
            pivotLebensmittel.Header   = loader.GetString(CategoryNamenCosts.Foods.ToString());
            pivotAuto.Header           = loader.GetString(CategoryNamenCosts.Auto.ToString());
            pivotBildung.Header        = loader.GetString(CategoryNamenCosts.Education.ToString());
            pivotApp.Header            = loader.GetString(CategoryNamenCosts.Apps.ToString());
            pivotUrlaub.Header         = loader.GetString(CategoryNamenCosts.Vacation.ToString());
            pivotUnterhaltung.Header   = loader.GetString(CategoryNamenCosts.Entertainment.ToString());
            pivotHaus.Header           = loader.GetString(CategoryNamenCosts.House.ToString());
            pivotVerkehr.Header        = loader.GetString(CategoryNamenCosts.Transport.ToString());
            pivotPersonal.Header       = loader.GetString(CategoryNamenCosts.Private.ToString());
            pivotSonstAusgaben.Header  = loader.GetString(CategoryNamenCosts.OtherCosts.ToString());
            pivotGehalt.Header         = loader.GetString(CategoryNamenIncomen.Salary.ToString());
            pivotSonstEinkommen.Header = loader.GetString(CategoryNamenIncomen.OtherIncomes.ToString());

            //clear back stack
            if (this.Frame.CanGoBack)
            {
                this.Frame.BackStack.Clear();
            }
            VisualStateManager.GoToState(this, BalanceState.Name, true);
        }
コード例 #10
0
ファイル: MembersViewModel.cs プロジェクト: AlyCrunch/samples
        public async Task LoadProcessedData()
        {
            ResourceLoader resourceLoader = new ResourceLoader();
            await ProcessData.LoadSettings();

            MembersHubViewModel OfficeMembers = new MembersHubViewModel();
            OfficeMembers.HubName = resourceLoader.GetString(OFFICE_RESOURCE_KEY);
            List<OfficeMember> OfficeMembersModelsList = ProcessData.GetOfficeMembers();

            foreach (OfficeMember officeMemberModel in OfficeMembersModelsList)
            {
                MemberItemViewModel officeMemberItem = new MemberItemViewModel();
                officeMemberItem.ModelToItem(officeMemberModel);
                OfficeMembers.Add(officeMemberItem);
            }
            this.Hubs.Add(OfficeMembers);

            MembersHubViewModel Members = new MembersHubViewModel();
            Members.HubName = resourceLoader.GetString(MEMBERS_RESOURCE_KEY);
            List<Member> MembersModelsList = ProcessData.GetMembers();

            foreach (Member MemberModel in MembersModelsList)
            {
                MemberItemViewModel MemberItem = new MemberItemViewModel();
                MemberItem.ModelToItem(MemberModel);
                Members.Add(MemberItem);
            }
            this.Hubs.Add(Members);
        }
コード例 #11
0
        public ApplicationViewModel(
              ISettingsService settingsService
            , IToolbarStateService toolbarStateService
            )
        {
            var resources = new ResourceLoader();

            AvailableCharsets = new ObservableCharsetCollection(new[] {
                    new DisplayedItem<Charset> { Key = Charset.UTF8, Label = resources.GetString("/Resources/Encoding_UTF8"), },
                    new DisplayedItem<Charset> { Key = Charset.UnicodeLe, Label = resources.GetString("/Resources/Encoding_UnicodeLe"), },
                    new DisplayedItem<Charset> { Key = Charset.UnicodeBe, Label = resources.GetString("/Resources/Encoding_UnicodeBe"), },
                    new DisplayedItem<Charset> { Key = Charset.CentralEasternEurope, Label = resources.GetString("/Resources/Encoding_CentralEasternEurope_1250"), },
                    new DisplayedItem<Charset> { Key = Charset.WesternEurope, Label = resources.GetString("/Resources/Encoding_WesternEurope_1252"), },
                    new DisplayedItem<Charset> { Key = Charset.Greece, Label = resources.GetString("/Resources/Encoding_Greece_1253"), },
                });

            // register an event for changes to the DefaultCharset Setting property.

            settingsService_ = settingsService;
            settingsService_.DefaultCharsetChanged += SettingsService__DefaultCharsetChanged;

            // register an event for changes to the SaveCommandEnabled state.

            toolbarStateService_ = toolbarStateService;
            toolbarStateService_.SaveCommandEnabledChanged += ToolbarStateService__SaveCommandEnabledChanged;
            toolbarStateService_.IsPaneOpenChanged += ToolbarStateService__IsPaneOpenChanged;
        }
コード例 #12
0
        private async void Purchase_Click(object sender, RoutedEventArgs e)
        {
            var item = (ItemDetails)ProductsListView.SelectedItem;
            StorePurchaseResult result = await storeContext.RequestPurchaseAsync(item.StoreId);

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

            switch (result.Status)
            {
            case StorePurchaseStatus.AlreadyPurchased:
                Result.Text = loader.GetString("PurchaseStatusAlreadyPurchased");
                break;

            case StorePurchaseStatus.Succeeded:
                Result.Text = loader.GetString("PurchaseStatusSucceeded") + " " + item.Title + " !";
                break;

            case StorePurchaseStatus.NotPurchased:
                Result.Text = loader.GetString("PurchaseStatusNotPurchased");
                break;

            case StorePurchaseStatus.NetworkError:
                Result.Text = loader.GetString("PurchaseStatusNetworkError");
                break;

            case StorePurchaseStatus.ServerError:
                Result.Text = loader.GetString("PurchaseStatusServerError");
                break;

            default:
                Result.Text = loader.GetString("PurchaseStatusUnknownError");
                break;
            }
        }
コード例 #13
0
ファイル: ResourceHelper.cs プロジェクト: Valks/Okra
        // *** Methods ***

        public static string GetErrorResource(string resourceName)
        {
            if (errorResourceLoader == null)
                errorResourceLoader = new ResourceLoader("Okra.MEF/Errors");

            return errorResourceLoader.GetString(resourceName);
        }
コード例 #14
0
        ///////////////////////////////////////////////////////////////////////////////////
        // Update with URLs to About, Support and Privacy Policy Web Pages
        ///////////////////////////////////////////////////////////////////////////////////
        void settingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var rl = new ResourceLoader();

            var aboutCmd = new SettingsCommand("About", rl.GetString("SETTINGS_PANEL_CMD_ABOUT"), async (x) =>
            {
                await Launcher.LaunchUriAsync(new Uri(""));
            });

            args.Request.ApplicationCommands.Add(aboutCmd);

            var supportCmd = new SettingsCommand("Support", rl.GetString("SETTINGS_PANEL_CMD_SUPPORT"), async (x) =>
            {
                await Launcher.LaunchUriAsync(new Uri(""));
            });

            args.Request.ApplicationCommands.Add(supportCmd);

            var policyCmd = new SettingsCommand("PrivacyPolicy", rl.GetString("SETTINGS_PANEL_CMD_PRIVACY_POLICY"), async (x) =>
            {
                await Launcher.LaunchUriAsync(new Uri(""));
            });

            args.Request.ApplicationCommands.Add(policyCmd);
        }
コード例 #15
0
        public void LoadNavigation()
        {
            Nodes = new ObservableCollection<NavigationNode>();
		    var resourceLoader = new ResourceLoader();
            Nodes.Add(new ItemNavigationNode
            {
                Title = @"XenoForums App",
                Label = "Home",
                FontIcon = "\ue10f",
                IsSelected = true,
                NavigationInfo = NavigationInfo.FromPage("HomePage")
            });

            Nodes.Add(new ItemNavigationNode
            {
                Label = "Latest News",
                FontIcon = "\ue12a",
                NavigationInfo = NavigationInfo.FromPage("LatestNewsListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Latest Posts",
                FontIcon = "\ue15f",
                NavigationInfo = NavigationInfo.FromPage("LatestPostsListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Our YouTube",
                FontIcon = "\ue173",
                NavigationInfo = NavigationInfo.FromPage("OurYouTubeListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Our Staff Members",
                FontIcon = "\ue13d",
                NavigationInfo = NavigationInfo.FromPage("OurStaffMembersListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Server Status",
                FontIcon = "\ue102",
                NavigationInfo = NavigationInfo.FromPage("ServerStatusListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = resourceLoader.GetString("NavigationPaneAbout"),
                FontIcon = "\ue11b",
                NavigationInfo = NavigationInfo.FromPage("AboutPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = resourceLoader.GetString("NavigationPanePrivacy"),
                FontIcon = "\ue1f7",
                NavigationInfo = new NavigationInfo()
                {
                    NavigationType = NavigationType.DeepLink,
                    TargetUri = new Uri("http://appstudio.windows.com/home/appprivacyterms", UriKind.Absolute)
                }
            });
        }
コード例 #16
0
		public static TestMessageHandler FromResourceResponse(string key)
		{
			if(s_TestResponses == null)
				s_TestResponses = new Windows.ApplicationModel.Resources.ResourceLoader("TestResponses");
			var testResponse = s_TestResponses.GetString(key);
			return new TestMessageHandler(testResponse);
		}
コード例 #17
0
ファイル: MainPage.xaml.cs プロジェクト: tallichet/ShareIt
 public MainPage()
 {
     this.InitializeComponent();
     RegisterForSharing();
     RegisterForSettings();
     resources = new ResourceLoader();
 }
コード例 #18
0
        public AuthEnforcementHandler()
        {
            _resourceLoader = ResourceLoader.GetForCurrentView();

            // We need to be aware of when a sign-in happens.
            AppEnvironment.Instance.CurrentUserChanged += AppEnvironment_CurrentUserChanged;
        }
コード例 #19
0
        private async void CallButton_Click(object sender, RoutedEventArgs e)
        {
            SetEnableState(false);
            ErrorBorder.Visibility = Visibility.Collapsed;

            ResultTextBox.Text = "";

            var function = (string)FunctionComboBox.SelectedItem;
            var arg = ArgumentsTextBox.Text;

            try
            {
                var functionValue = await particleDevice.RunFunctionAsync(function, arg);
                if (functionValue != null)
                    ResultTextBox.Text = Convert.ToString(functionValue.ReturnValue);
            }
            catch
            {
                ResourceLoader resourceLoader = new ResourceLoader();
                ErrorText.Text = resourceLoader.GetString("Error");
                ErrorBorder.Visibility = Visibility.Visible;
            }

            SetEnableState(true);
        }
コード例 #20
0
        // *** Methods ***

        public static string GetErrorResource(string resourceName)
        {
            if (s_errorResourceLoader == null)
                s_errorResourceLoader = ResourceLoader.GetForViewIndependentUse(ERROR_RESOURCEMAP);

            return s_errorResourceLoader.GetString(resourceName);
        }
コード例 #21
0
        public VMRanking(INavigationService navigationService)
        {
            _navigationService = navigationService;

            scDa = new ScoringCardsDataAccess();

            loader = new ResourceLoader();
        }
コード例 #22
0
 // loads a resource string and runs string.Format on it...
 public static string Format(string name, params object[] args)
 {
     var buf = new ResourceLoader(ResourceMapName).GetString("Resources/" + name);
     if (args.Any())
         return string.Format(buf, args);
     else
         return buf;
 }
コード例 #23
0
 public MusicLibraryViewModel()
 {
     var resourceLoader = new ResourceLoader();
     _goBackCommand = new StopVideoCommand();
     Panels.Add(new Panel(resourceLoader.GetString("Artist").ToUpper(), 0, 1));
     Panels.Add(new Panel(resourceLoader.GetString("Tracks").ToUpper(), 1, 0.4));
     Panels.Add(new Panel(resourceLoader.GetString("FavoriteAlbums").ToUpper(), 2, 0.4));
 }
コード例 #24
0
ファイル: Resources.cs プロジェクト: tempestrock/Kalaha
        // --- Methods of the class ---
        /// <summary>The constructor of the class. This is declared private because only
        /// the Instance property method may call it.</summary>
        private KalahaResources()
        {
            _resLoader = new ResourceLoader("Resources");
            _msgLoader = new ResourceLoader("Messages");

            // Define the standard theme to be the initial theme:
            ChangeLayoutResources(GetRes("Theme_HighContrast"));
        }
コード例 #25
0
 private static void GetLibraryName(string resourceName, out string resourceValue)
 {
     if (resourceLoader == null)
     {
         resourceLoader = ResourceLoader.GetForCurrentView("AppResourceClassLibrary/Resources");
     }
     resourceValue = resourceLoader.GetString(resourceName);
 }
コード例 #26
0
        private void settingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var ConfigHandler = new UICommandInvokedHandler(onConfigCommand);

            var loader = new ResourceLoader();
            var configurationCommand = new SettingsCommand(loader.GetString("Settings"), loader.GetString("Settings"), ConfigHandler);
            args.Request.ApplicationCommands.Add(configurationCommand);
        }
コード例 #27
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public MainViewModel()
 {
     SensorItems = new ObservableCollection<BoolItemModel>();
     CameraItems = new ObservableCollection<BoolItemModel>();
     SensorCoreItems = new ObservableCollection<BoolItemModel>();
     _resourceLoader = new ResourceLoader();
     CreateItems();
 }
コード例 #28
0
        private async void infoIcon_Click(object sender, RoutedEventArgs e)
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
            var info   = loader.GetString("Info");

            var dialog = new Windows.UI.Popups.MessageDialog(info);
            await dialog.ShowAsync();
        }
コード例 #29
0
ファイル: DateHelper.cs プロジェクト: cbhl/LndrMeWin8App
 public static string _(string key)
 {
     var rl = new ResourceLoader();
     return rl.GetString(key);
     //var context = new ResourceContext();
     //var resourceMap = ResourceManager.Current.MainResourceMap;
     //return resourceMap.GetValue(key, context).ToString();
 }
コード例 #30
0
ファイル: Game.xaml.cs プロジェクト: Julia-Bobko/Bottle
 public Game()
 {
     InitializeComponent();
     CurrentGamer = 1;
     random = new Random();
     resourceLoader = new ResourceLoader();
     backgroundRepository = new BackgroundRepository();
     bottleRepository = new BottleRepository();
 }
コード例 #31
0
ファイル: M4MStrings.cs プロジェクト: smartnsoft/ModernApp4Me
 static M4MStrings()
 {
     try
       {
     ResourcesName = "Strings";
     resourceLoader = ResourceLoader.GetForViewIndependentUse(ResourcesName);
       }
       catch { }
 }
コード例 #32
0
ファイル: InscriptionViewModel.cs プロジェクト: Haz3/Soonzik
 public InscriptionViewModel()
 {
     loader = new ResourceLoader();
     ValidateCommand = new RelayCommand(ValidateExecute);
     PasswordBoxCommand = new RelayCommand(PasswordBoxCommandExecute);
     NewUser = new User();
     NewAddress = new Address();
     Navigation = new NavigationService();
 }
コード例 #33
0
        public BasePage()
            : base()
        {
            _navigationHelper = new NavigationHelper(this);
            _navigationHelper.LoadState += this.NavigationHelper_LoadState;
            _navigationHelper.SaveState += this.NavigationHelper_SaveState;

            _resourceLoader = ResourceLoader.GetForCurrentView("Resources");
        }
コード例 #34
0
        private async void ErrorInternet(errormeth m)
        {
            ResourceLoader loader = new Windows.ApplicationModel.Resources.ResourceLoader();
            //message tonen
            MessageDialog d = new MessageDialog(loader.GetString("ErrorInternet"));

            d.Commands.Add(new UICommand(loader.GetString("Opnieuw"), new UICommandInvokedHandler(m)));
            d.Commands.Add(new UICommand(loader.GetString("Annuleer"), new UICommandInvokedHandler(this.MessageCancel)));
            await d.ShowAsync();
        }
コード例 #35
0
        /// <summary>
        /// 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().
        /// </summary>
        public App()
        {
            ResourceLoader appCenterData     = new Windows.ApplicationModel.Resources.ResourceLoader("AppCenterData");
            string         appCenterSecret   = appCenterData.GetString("appCenterSecret");
            string         syncfusionLicense = appCenterData.GetString("syncfusionLicense");

            AppCenter.Start(appCenterSecret, typeof(Analytics), typeof(Crashes));
            Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense(syncfusionLicense);
            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }
コード例 #36
0
        private void HamburgerButton_OnClick(object sender, RoutedEventArgs e)
        {
            HamburgerSplitview.IsPaneOpen = !HamburgerSplitview.IsPaneOpen;
            //MapText.Text = ResourceLoader.GetForCurrentView("Strings").GetString("NAVIGATION_MAP_TEXT");
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();

            MapText.Text      = loader.GetString("NAVIGATION_MAP_TEXT");
            RouteText.Text    = loader.GetString("ROUTEPAGE_SELECTROUTE_TEXT");
            SightsText.Text   = loader.GetString("NAVIGATIONPAGE_SIGHTS_TEXT");
            LanguageText.Text = loader.GetString("LANGUAGEPAGE_LANGUAGE_TEXT");
        }
コード例 #37
0
        /// <summary>
        /// Write No daten found
        /// </summary>
        /// <returns></returns>
        private ListViewItem GetNotDaten()
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();

            var listItem = new ListViewItem
            {
                Content             = loader.GetString("NoData"),
                HorizontalAlignment = HorizontalAlignment.Center,
                Margin     = new Thickness(5, 15, 5, 15),
                Foreground = new SolidColorBrush(Colors.White),
                IsEnabled  = false
            };

            return(listItem);
        }
コード例 #38
0
        void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            ResourceLoader LanguageLoader = new Windows.ApplicationModel.Resources.ResourceLoader();

            args.Request.ApplicationCommands.Add(
                new SettingsCommand("UID1", LanguageLoader.GetString("About"), new UICommandInvokedHandler(async(cmd) =>
            {
                await Windows.System.Launcher.LaunchUriAsync(new Uri("http://www.epicapps.com.br/"));
            }))
                );
            args.Request.ApplicationCommands.Add(
                new SettingsCommand("UID2", LanguageLoader.GetString("Privacy"), new UICommandInvokedHandler(async(cmd) =>
            {
                await Windows.System.Launcher.LaunchUriAsync(new Uri("http://www.epicapps.com.br/privacy/"));
            }))
                );
        }
コード例 #39
0
        // ********** Méthodes **********

        private void UpdateListModel()
        {
            if (PourcentageAverageVariation > 0)
            {
                if (_isCategory)
                {
                    GetCategoriesByAverageVariationPourcentage();
                }
                else
                {
                    GetPlacesByAverageVariationPourcentage();
                }
            }
            else
            {
                var loader    = new Windows.ApplicationModel.Resources.ResourceLoader();
                var msgDialog = new MessageDialog(loader.GetString("expensesGestionPourcentageError"));
                msgDialog.ShowAsync();
            }
        }
コード例 #40
0
        private static void SendToast(string message)
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
            ToastTemplateType toastTemplate     = ToastTemplateType.ToastText01;
            XmlDocument       toastXml          = ToastNotificationManager.GetTemplateContent(toastTemplate);
            XmlNodeList       toastTextElements = toastXml.GetElementsByTagName("text");

            if (message.Contains("fileSent"))
            {
                message = message.Replace("fileSent", "");
                toastTextElements[0].AppendChild(toastXml.CreateTextNode(message));
            }
            else
            {
                toastTextElements[0].AppendChild(toastXml.CreateTextNode(loader.GetString(message)));
            }
            ToastNotification toast = new ToastNotification(toastXml);

            ToastNotificationManager.CreateToastNotifier().Show(toast);
        }
コード例 #41
0
        private void UpdateComposingMessage()
        {
            if (chatRoom == null)
            {
                return;
            }

            bool isRemoteComposing = chatRoom.IsRemoteComposing;

            RemoteComposing.Visibility = isRemoteComposing ? Visibility.Visible : Visibility.Collapsed;

            string remoteName = chatRoom.PeerAddress.DisplayName;

            if (remoteName == null || remoteName.Length <= 0)
            {
                remoteName = chatRoom.PeerAddress.Username;
            }
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();

            RemoteComposing.Text = remoteName + loader.GetString("RemoteComposing");
        }
コード例 #42
0
        public SignParameters(string uri)
        {

            // Restor de recursos
            ResourceLoader labels = new Windows.ApplicationModel.Resources.ResourceLoader();

            // Analizador de parametros en URL
            WwwFormUrlDecoder decoder;
            try
            {
                decoder = new WwwFormUrlDecoder(uri.Substring(uri.IndexOf("?"), uri.Length - uri.IndexOf("?")));
            }
            catch (Exception)
            {
                throw new ParameterException(labels.GetString("Error_parametros") + " (ERR:W00)");
            }

            // Comprobamos los parámetros obligatorios uno a uno

            // Direccion del servlet de almacenamiento, comprobamos que exista y que sea una URI
            // valida con http o https
            string servlet;
            try
            {
                servlet = decoder.GetFirstValueByName(SERVLET_STORAGE);
            }
            catch (Exception)
            {
                throw new ParameterException(labels.GetString("Error_parametros") + " (ERR:W01)");
            }
            try
            {
                this.servletUri = new Uri(servlet);
            }
            catch (Exception)
            {
                throw new ParameterException(labels.GetString("Error_parametros") + " (ERR:W02)");
            }
            if (servletUri.Scheme != "http" && servletUri.Scheme != "https")
            {
                throw new ParameterException(labels.GetString("Error_parametros") + " (ERR:W03)");
            }

            // Id del fichero a firmar.
            try
            {
                this.id = decoder.GetFirstValueByName(ID);
            }
            catch (Exception)
            {
                throw new ParameterException(labels.GetString("Error_parametros") + " (ERR:W04)");
            }

            // Formato de firma (CAdES, XAdES, PAdES...)
            try
            {
                this.format = decoder.GetFirstValueByName(FORMAT);
            }
            catch (Exception)
            {
                throw new ParameterException(labels.GetString("Error_parametros") + " (ERR:W05)");
            }
            if (!supportedSignatureFormats.Contains(this.format.ToLower()))
            {
                throw new UnsupportedSignatureFormat(this.format);
            }

            // Algoritmo de firma (SHA1withRSA, SHA512withRSA, etc.)
            try
            {
                this.algorithm = decoder.GetFirstValueByName(ALGORITHM);
            }
            catch (Exception)
            {
                throw new ParameterException(labels.GetString("Error_parametros") + " (ERR:W06)");
            }
            if (!supportedSignatureAlgorithms.Contains(this.algorithm))
            {
                throw new UnsupportedSignatureAlgorithm(this.algorithm);
            }

            // Propiedades adicionales
            string base64Properties = null;
            try
            {
                base64Properties = decoder.GetFirstValueByName(PROPERTIES);
            }
            catch(Exception)
            {
                this.properties = new Dictionary<string,string>();
            }
            if (base64Properties != null)
            {
                // Deshacemos la codificacion URL si existiese
                base64Properties = base64Properties.Replace('_', '/').Replace('-', '+');
                // Deshacemos el Base64
                try
                {
                    byte[] binaryProperties = Convert.FromBase64String(base64Properties);
                    this.properties = Properties2Dictionary(System.Text.Encoding.UTF8.GetString(binaryProperties, 0, binaryProperties.Length));
                }
                catch (Exception)
                {
                    throw new ParameterException(labels.GetString("Error_parametros") + " (ERR:W07)");
                }
            }

            // Entorno GUI de origen (opcional, en caso de error o ausencia se toma el escritorio clásico como origen)
            try
            {
                Boolean.TryParse(decoder.GetFirstValueByName(FROM), out this.metro);
            }
            catch (Exception)
            {
                metro = false;
            }

            // Clave DES de cifrado
            string key;
            try
            {
                key = decoder.GetFirstValueByName(KEY);
            }
            catch (Exception)
            {
                throw new ParameterException(labels.GetString("Error_parametros") + " (ERR:W08)");
            }
            this.desKey = key;
            if (this.desKey.Length != 8)
            {
                throw new ParameterException(labels.GetString("Error_parametros") + " (ERR:W09)");
            }

            // Datos a firmar
            string dataBase64;
            try
            {
                dataBase64 = decoder.GetFirstValueByName(DATA);
            }
            catch (Exception)
            {
                dataBase64 = null;
            }
            // Nos pasan los datos en la URL
            if (dataBase64 != null)
            {
                // Deshacemos la codificación URL si existiese
                dataBase64 = dataBase64.Replace('_', '/').Replace('-', '+');
                try
                {
                    // Guardamos los datos descodificados
                    this.data = Convert.FromBase64String(dataBase64);
                }
                catch (Exception)
                {
                    throw new ParameterException(labels.GetString("Error_parametros") + " (ERR:W10)");
                }
            }
            //no tiene sentido esto aqui.
            //this.data = null;


        }
コード例 #43
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            searchClicked = false;
            //progressBar.IsEnabled = true;
            searchBox.Text            = "";
            searchBox.PlaceholderText = searchBox.PlaceholderText;

            string rated    = string.Empty;
            string facebook = string.Empty;

            if (!ApplicationData.Current.LocalSettings.Values.ContainsKey("Rated") || ApplicationData.Current.LocalSettings.Values["Rated"].ToString() != "1")
            {
                ApplicationData.Current.LocalSettings.Values["Rated"] = "0";
            }
            if (!ApplicationData.Current.LocalSettings.Values.ContainsKey("Facebook") || ApplicationData.Current.LocalSettings.Values["Facebook"].ToString() != "1")
            {
                ApplicationData.Current.LocalSettings.Values["Facebook"] = "0";
            }

            //string rated = !ApplicationData.Current.LocalSettings.Values.ContainsKey("Rated") ? "0" : string.Empty;
            //ApplicationData.Current.LocalSettings.Values["Rated"] = rated;

            if (App.timeOfUse % 10 == 0 && ApplicationData.Current.LocalSettings.Values["Rated"].ToString() != "1" && !App.asked)
            {
                App.asked = true;
                var    loader       = new Windows.ApplicationModel.Resources.ResourceLoader();
                string promptString = loader.GetString("PromptToRate");
                string promptTitle  = loader.GetString("RateReviewTitle");

                MessageDialog msg = new MessageDialog(promptString, promptTitle);
                msg.Commands.Add(new UICommand("Later", new UICommandInvokedHandler(CommandHandlersRate)));
                msg.Commands.Add(new UICommand("Ok", new UICommandInvokedHandler(CommandHandlersRate)));

                await msg.ShowAsync();
            }

            if (App.timeOfUse % 10 == 5 && ApplicationData.Current.LocalSettings.Values["Facebook"].ToString() != "1" && !App.asked)
            {
                App.asked = true;
                var    loader       = new Windows.ApplicationModel.Resources.ResourceLoader();
                string promptString = loader.GetString("Facebook");

                MessageDialog msg = new MessageDialog(promptString, "Facebook");
                msg.Commands.Add(new UICommand("Later", new UICommandInvokedHandler(CommandHandlersFacebook)));
                msg.Commands.Add(new UICommand("Ok", new UICommandInvokedHandler(CommandHandlersFacebook)));

                await msg.ShowAsync();
            }

            #region obsolete
            //something = "";
            //something += CultureInfo.CurrentCulture + ", ";
            //something += CultureInfo.CurrentUICulture;

            //ResourceContext ctx = new Windows.ApplicationModel.Resources.Core.ResourceContext();
            //ctx.Languages = new string[] { "fr" };
            //ResourceMap rmap = ResourceManager.Current.MainResourceMap.GetSubtree("Resources");
            //titleTextBlock.Text = rmap.GetValue("mainTextBlock", ctx).ValueAsString;

            //titleTextBlock.Text = App.LanguageChanges(0);
            //trainCB.Label = App.LanguageChanges(2);
            //favoriteIcon.Label = App.LanguageChanges(3);
            //searchBox.Text = something;
            //something += CultureInfo.CurrentCulture.EnglishName + ", ";
            //something += CultureInfo.InvariantCulture.EnglishName;


            //Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "el-GR";
            // TODO: Prepare page for display here.

            // TODO: If your application contains multiple pages, ensure that you are
            // handling the hardware Back button by registering for the
            // Windows.Phone.UI.Input.HardwareButtons.BackPressed event.
            // If you are using the NavigationHelper provided by some templates,
            // this event is handled for you.
            #endregion
        }
コード例 #44
0
        private async Task DeleteItemsBtns(ListView listView)
        {
            if (listView.SelectedIndex != -1)
            {
                List <ListBalance> selectedItems = new List <ListBalance>();
                //Um die Deleten vom ListView moglich machen

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

                foreach (ListBalance balance in listView.SelectedItems)
                {
                    selectedItems.Add(balance);
                }
                var dialogContent = new ContentDialog()
                {
                    FontFamily          = new FontFamily("Segoe Print"),
                    Background          = new SolidColorBrush(Color.FromArgb(255, 69, 184, 234)),
                    Foreground          = new SolidColorBrush(Colors.White),
                    Title               = loader.GetString("TtlDelete"),
                    Content             = loader.GetString("DialogContent"),
                    PrimaryButtonText   = loader.GetString("Yes"),
                    SecondaryButtonText = loader.GetString("No")
                };
                ContentDialogResult result = await dialogContent.ShowAsync();;

                foreach (ListBalance balance in selectedItems)
                {
                    switch (balance.CostsOrIncomes)
                    {
                        #region Costs Case

                    case "Cost":
                        if (result == ContentDialogResult.Primary)
                        {
                            using (var db = new Store.DataBase.DataBaseEF.DataBaseFile())
                            {
                                var name =
                                    (from nameCosts in db.Costs
                                     where nameCosts.CostId == balance.ID
                                     select nameCosts).FirstOrDefault();
                                db.Costs.Remove(name);
                                db.SaveChanges();
                            }
                        }
                        break;

                        #endregion

                        #region Incomes  Case

                    case "Income":
                        if (result == ContentDialogResult.Primary)
                        {
                            using (var db = new Store.DataBase.DataBaseEF.DataBaseFile())
                            {
                                var name =
                                    (from nameIncomes in db.Incomes
                                     where nameIncomes.IncomeId == balance.ID
                                     select nameIncomes).FirstOrDefault();
                                db.Incomes.Remove(name);
                                db.SaveChanges();
                            }
                        }
                        break;

                        #endregion

                    default:
                        break;
                    }
                }

                if (result == ContentDialogResult.Primary)
                {
                    var uNFI = new UserNumberFormat();

                    await datenViewModel.BalanceForYearAsync();

                    await datenViewModel.CostIncomeSummeAsync();
                }
            }
        }
コード例 #45
0
        //private void searchBox_GotFocus(object sender, RoutedEventArgs e)
        //{
        //    if (searchBox.Text.Equals(searchBox.PlaceholderText, StringComparison.OrdinalIgnoreCase))
        //    {
        //        searchBox.Text = string.Empty;
        //    }
        //}

        //private void searchBox_LostFocus(object sender, RoutedEventArgs e)
        //{
        //    if (string.IsNullOrEmpty(searchBox.Text))
        //    {
        //        searchBox.PlaceholderText = searchBox.PlaceholderText;
        //    }
        //}

        private async void searchBus_Click(object sender, RoutedEventArgs e)
        {
            //progressBar.Visibility = Windows.UI.Xaml.Visibility.Visible;

            //IEnumerable<System.Xml.Linq.XElement> bus = Bus(searchBox.Text);

            //if (bus == null && searchClicked == false)
            //{
            //    searchClicked = true;

            //    var dialog = new Windows.UI.Popups.MessageDialog(App.LanguageChanges(1));
            //    await dialog.ShowAsync();
            //    searchBox.Text = "";

            //    searchClicked = false;

            //    return;
            //}

            //////progressBar.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            ////progressBar.IsEnabled = true;
            ////var xd = XDocument.Load("all.xml");
            if (!searchBox.Text.Equals("") && searchBox.Text.Count() <= 4 && searchClicked == false)
            {
                App.LoadBus(searchBox.Text);

                if ((App.activeBus.Elements().Count() == 0) && (searchClicked == false))
                {
                    searchClicked = true;
                    previousPushedButton.Style = Resources["RoundNumberButtonTemplate"] as Style;

                    var loader      = new Windows.ApplicationModel.Resources.ResourceLoader();
                    var errorString = loader.GetString("Error");

                    var dialog = new Windows.UI.Popups.MessageDialog(errorString);
                    await dialog.ShowAsync();

                    searchBox.Text = "";

                    searchClicked = false;

                    return;
                }

                searchClicked = true;
                previousPushedButton.Style = Resources["RoundNumberButtonTemplate"] as Style;
                //if (searchBox.Text.Contains("Α"))
                //{
                //    Frame.Navigate(typeof(TimeSchedule), searchBox.Text.Replace("Α", "a"));
                //}
                //else if (searchBox.Text.Contains("Β"))
                //{
                //    Frame.Navigate(typeof(TimeSchedule), searchBox.Text.Replace("Β", "b"));
                //}
                //else if (searchBox.Text.Contains("Γ"))
                //{
                //    Frame.Navigate(typeof(TimeSchedule), searchBox.Text.Replace("Γ", "c"));
                //}
                //else if (searchBox.Text.Contains("Ε"))
                //{
                //    Frame.Navigate(typeof(TimeSchedule), searchBox.Text.Replace("Ε", "e"));
                //}
                //else if (searchBox.Text.Contains("Χ"))
                //{
                //    Frame.Navigate(typeof(TimeSchedule), searchBox.Text.Replace("Χ", "x"));
                //}
                //else
                //{
                //IEnumerable<System.Xml.Linq.XElement> bus = from el in xd.Descendants("Bus")
                //                                            where el.Attribute("lineNumber").Value == searchBox.Text
                //                                            select el;
                //progressRing.IsActive = false;
                //App.progressRing.IsEnabled = true;
                //App.progressRing.IsActive = true;
                Frame.Navigate(typeof(TimeSchedule));
                //}
            }
        }
コード例 #46
0
 public AppResourceProvider()
 {
     m_stringResLoader        = ResourceLoader.GetForViewIndependentUse();
     m_cEnginestringResLoader = ResourceLoader.GetForViewIndependentUse("CEnginestrings");
 }
コード例 #47
0
        public SaveParameters(string uri)
        {

            // Restor de recursos
            ResourceLoader labels = new Windows.ApplicationModel.Resources.ResourceLoader();

            // Analizador de parametros en URL
            WwwFormUrlDecoder decoder;
            try
            {
                decoder = new WwwFormUrlDecoder(uri.Substring(uri.IndexOf("?"), uri.Length - uri.IndexOf("?")));
            }
            catch (Exception)
            {
                throw new ParameterException(labels.GetString("Error_parametros") + " (ERR:W00)");
            }

            // Comprobamos los parámetros obligatorios uno a uno

            // Nombre del fichero (opcional)
            try
            {
                this.fileName = decoder.GetFirstValueByName(FILENAME);
            }
            catch (Exception)
            {
                fileName = null;
            }

            // Extensión del fichero (opcional)
            try
            {
                this.extension = decoder.GetFirstValueByName(EXTENSION);
                if (!this.extension.StartsWith("."))
                {
                    this.extension = "." + this.extension;
                }
            }
            catch (Exception)
            {
                this.extension = EXTENSION_DEFAULT;
            }

            // Descripción del fichero (opcional)
            try
            {
                this.description = decoder.GetFirstValueByName(DESCRIPTION);
            }
            catch (Exception)
            {
                this.description = null;
            }

            // Entorno GUI de origen (opcional, en caso de error o ausencia se toma el escritorio clásico como origen)
            try
            {
                Boolean.TryParse(decoder.GetFirstValueByName(FROM), out this.metro);
            }
            catch (Exception)
            {
                metro = false;
            }

            // ***********************
            // *** Datos a guardar ***
            // ***********************
            string dataBase64 = null;
            try
            {
                dataBase64 = decoder.GetFirstValueByName(DATA);
            }
            catch (Exception)
            {
                throw new ParameterException(labels.GetString("Error_parametros") + " (ERR:W02)");
            }

            // Deshacemos la codificación URL si existiese
            dataBase64 = dataBase64.Replace('_', '/').Replace('-', '+');
            try
            {
                // Guardamos los datos descodificados
                this.data = Convert.FromBase64String(dataBase64);
            }
            catch (Exception)
            {
                throw new ParameterException(labels.GetString("Error_parametros") + " (ERR:W10)");
            }
        }