Example #1
0
        private void tbVersionNumber_Click(object sender, RoutedEventArgs e)
        {
            if (ApplicationData.Current.LocalSettings.Values.ContainsKey("NoOfDevClick"))
            {
                string strNoOfClick = ApplicationData.Current.LocalSettings.Values["NoOfDevClick"].ToString();

                int noOfClick = Convert.ToInt32(strNoOfClick);

                if (noOfClick < 5)
                {
                    ApplicationData.Current.LocalSettings.Values["NoOfDevClick"] = noOfClick + 1;

                    if (noOfClick + 1 == 5)
                    {
                        UtilityClass.MessageDialog("Congratulation! You have unlocked a new hidden feature, Find it in Services Settings Pane", "Congratulations! You've done it!");
                    }
                }
                else
                {
                    UtilityClass.MessageDialog("You have already unlocked a new hidden feature, Find it in Services Settings Pane", "You did it already!");
                }
            }
            else
            {
                ApplicationData.Current.LocalSettings.Values["NoOfDevClick"] = 1;
            }
        }
Example #2
0
        private async void btset_Click(object sender, RoutedEventArgs e)
        {
            if (!isPassword)
            {
                if (tbset1.Password == tbset2.Password)
                {
                    if (string.IsNullOrEmpty(tbset1.Password) || string.IsNullOrWhiteSpace(tbset1.Password))
                    {
                        UtilityClass.MessageDialog("Password cannot be empty or white space, Try again!", "Failed to Set Password");
                    }
                    else
                    {
                        ApplicationData.Current.LocalSettings.Values["Password"] = tbset1.Password;
                        await FileIO.WriteTextAsync(nameFile, tbname1.Text);

                        if (tempImage != null)
                        {
                            StorageFolder folder  = ApplicationData.Current.LocalFolder;
                            StorageFile   newFile = await tempImage.CopyAsync(folder, "Image", NameCollisionOption.ReplaceExisting);

                            ApplicationData.Current.LocalSettings.Values["isPassImage"] = true;
                        }
                        else
                        {
                            ApplicationData.Current.LocalSettings.Values["isPassImage"] = false;
                        }
                        if (tempCoverImage != null)
                        {
                            StorageFolder folder  = ApplicationData.Current.LocalFolder;
                            StorageFile   newFile = await tempCoverImage.CopyAsync(folder, "CoverImage", NameCollisionOption.ReplaceExisting);

                            ApplicationData.Current.LocalSettings.Values["isPassCoverImage"] = true;
                        }
                        else
                        {
                            ApplicationData.Current.LocalSettings.Values["isPassCoverImage"] = false;
                        }

                        UtilityClass.MessageDialog("Password has been Set Successfully!", "Password Set Successfully.");
                        Frame.GoBack();
                        spSetPassword.Visibility   = Visibility.Collapsed;
                        spResetPassword.Visibility = Visibility.Visible;
                    }
                }
                else
                {
                    UtilityClass.MessageDialog("Password Didn't Match, Try Again!", "Wrong Password");
                }
            }
            else
            {
                RemoveorResetPass(null);
            }
        }
Example #3
0
        private async void btClearCache_Click(object sender, RoutedEventArgs e)
        {
            prClearCache.Visibility = Visibility.Visible;
            btClearCache.IsEnabled  = false;
            await WebView.ClearTemporaryWebDataAsync();

            await Task.Delay(TimeSpan.FromSeconds(1));

            prClearCache.Visibility = Visibility.Collapsed;
            btClearCache.IsEnabled  = true;
            UtilityClass.MessageDialog("Cache and Temporary Files have been Cleaned, May require restart.", "Cache and Temporary Files Cleaned");
        }
Example #4
0
        private async void saveImage(StorageFile storageFile, bool isCoverPhoto)
        {
            try
            {
                if (storageFile != null)
                {
                    var contentType = storageFile.ContentType;

                    if (!isCoverPhoto)
                    {
                        if (contentType.Contains("image/"))
                        {
                            tempImage = storageFile;
                            var bitmapImage = new BitmapImage();
                            using (IRandomAccessStream stream = await storageFile.OpenAsync(FileAccessMode.Read))
                            {
                                bitmapImage.SetSource(stream);
                            }
                            imgProfile.Source = bitmapImage;
                        }
                        else
                        {
                            tempImage = null;
                            UtilityClass.MessageDialog("Sorry, Only Image is supported. Try Again!", "File not supported");
                        }
                    }
                    else
                    {
                        if (contentType.Contains("image/"))
                        {
                            tempCoverImage = storageFile;
                            var bitmapImage = new BitmapImage();
                            using (IRandomAccessStream stream = await storageFile.OpenAsync(FileAccessMode.Read))
                            {
                                bitmapImage.SetSource(stream);
                            }
                            CoverImageBrush.ImageSource = bitmapImage;
                        }
                        else
                        {
                            tempCoverImage = null;
                            UtilityClass.MessageDialog("Sorry, Only Image is supported. Try Again!", "File not supported");
                        }
                    }
                }
            }
            catch (Exception)
            {
            }
        }
Example #5
0
        private async void RemoveorResetPass(string Pass)
        {
            string pinString = ApplicationData.Current.LocalSettings.Values["Password"].ToString();

            if (Pass == null)
            {
                if (string.IsNullOrEmpty(tbreset2.Password) || string.IsNullOrWhiteSpace(tbreset3.Password))
                {
                    UtilityClass.MessageDialog("Password cannot be empty or white space, Try again!", "Failed to Set Password");
                }
                else if (tbreset1.Password == pinString && tbreset2.Password == tbreset3.Password)
                {
                    ApplicationData.Current.LocalSettings.Values["Password"] = tbreset3.Password;
                    if (tempImage != null)
                    {
                        StorageFolder folder  = ApplicationData.Current.LocalFolder;
                        StorageFile   newFile = await tempImage.CopyAsync(folder, "Image", NameCollisionOption.ReplaceExisting);

                        ApplicationData.Current.LocalSettings.Values["isPassImage"] = true;
                    }
                    if (tempCoverImage != null)
                    {
                        StorageFolder folder  = ApplicationData.Current.LocalFolder;
                        StorageFile   newFile = await tempCoverImage.CopyAsync(folder, "CoverImage", NameCollisionOption.ReplaceExisting);

                        ApplicationData.Current.LocalSettings.Values["isPassCoverImage"] = true;
                    }
                    Frame.GoBack();
                    UtilityClass.MessageDialog("Password has been Changed Successfully!", "Password Changed");
                }
                else
                {
                    UtilityClass.MessageDialog("Password Didn't Match, Try Again!", "Wrong Password");
                }
            }
            else if (Pass == pinString)
            {
                ApplicationData.Current.LocalSettings.Values["Password"]         = "";
                ApplicationData.Current.LocalSettings.Values["isPassImage"]      = false;
                ApplicationData.Current.LocalSettings.Values["isPassCoverImage"] = false;
                Frame.GoBack();
                UtilityClass.MessageDialog("Password has been removed!", "Password removed successfully");
            }
            else
            {
                UtilityClass.MessageDialog("You have entered Wrong Password, Please Try Again", "Wrong Password");
            }
        }
Example #6
0
 private void bt1_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (tb1.Password == pinString)
         {
             this.Frame.Navigate(typeof(MainPage), parameter);
         }
         else
         {
             UtilityClass.MessageDialog("Password is Incorrect, Please Try Again! ", "Wrong Password");
         }
     }
     catch
     {
     }
 }
Example #7
0
 private void bthelp_Click(object sender, RoutedEventArgs e)
 {
     UtilityClass.MessageDialog("You can Unlock the Password and Windows Hello Setting to secure your app by setting your own Password or Windows Hello so that no one can use your app Without your Permission/Password.", "Unlock Custom Password and Windows Hello");
 }
Example #8
0
        private async void btpinIAP_Click(object sender, RoutedEventArgs e)
        {
            this.FindName("gdPurchasingAddon");
            gdPurchasingAddon.Visibility = Visibility.Visible;

            try
            {
                if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 3))
                {
                    string[] filterList = new string[] { "Durable" };

                    if (UtilityData.addOnCollection == null || UtilityData.addOnCollection.ExtendedError != null)
                    {
                        UtilityData.addOnCollection = await storeContext.GetUserCollectionAsync(filterList);
                    }

                    var isPurchasedList = UtilityData.addOnCollection.Products.Values.Where(p => p.InAppOfferToken.Equals(UtilityData.PinIAP)).ToList();
                    if (isPurchasedList.Count == 0)
                    {
                        if (UtilityData.addOnsAssociatedStoreProducts == null)
                        {
                            UtilityData.addOnsAssociatedStoreProducts = await storeContext.GetAssociatedStoreProductsAsync(filterList);
                        }

                        var AddOnList = UtilityData.addOnsAssociatedStoreProducts.Products.Values.Where(p => p.InAppOfferToken.Equals(UtilityData.PinIAP)).ToList();

                        StorePurchaseResult result = await storeContext.RequestPurchaseAsync(AddOnList[0].StoreId);

                        if (result != null)
                        {
                            switch (result.Status)
                            {
                            case StorePurchaseStatus.AlreadyPurchased:
                                PinLicense();
                                break;

                            case StorePurchaseStatus.Succeeded:
                                ApplicationData.Current.RoamingSettings.Values[UtilityData.UpPin] = true;
                                PinLicense();
                                UtilityClass.MessageDialog("Thank You very much for Purchasing. We really appreciate your kind support!", "Thank You very much! :)");
                                break;

                            case StorePurchaseStatus.NetworkError:
                            case StorePurchaseStatus.ServerError:
                                UtilityClass.MessageDialog("An Error Occured , Please Try Again!", "Error occured while purchasing.");
                                break;
                            }
                        }
                    }
                }
                else
                {
                    if (UtilityData.AppLicenseInformation == null)
                    {
                        UtilityData.AppLicenseInformation = CurrentApp.LicenseInformation;
                    }
                    if (!UtilityData.AppLicenseInformation.ProductLicenses["PinIAP"].IsActive)
                    {
                        try
                        {
                            PurchaseResults results = await CurrentApp.RequestProductPurchaseAsync("PinIAP");

                            if (results.Status == ProductPurchaseStatus.Succeeded)
                            {
                                ApplicationData.Current.RoamingSettings.Values["UpPin"] = UtilityData.AppLicenseInformation.ProductLicenses["PinIAP"].IsActive;
                                PinLicense();
                                UtilityClass.MessageDialog("Thank You very much for Purchasing. We really appreciate your kind support!", "Thank You very much! :)");
                            }
                        }
                        catch
                        {
                            UtilityClass.MessageDialog("Please Check your Internet Connection and then try again", "No Internet Connection.");
                        }
                    }
                    else
                    {
                    }
                }
            }
            catch (Exception)
            {
                UtilityClass.MessageDialog("Please Check your Internet Connection and then try again", "No Internet Connection.");
            }
            finally
            {
                if (gdPurchasingAddon != null)
                {
                    gdPurchasingAddon.Visibility = Visibility.Collapsed;
                }
            }
        }
Example #9
0
        private async void btRemoveDesktopAds_Click(object sender, RoutedEventArgs e)
        {
            this.FindName("gdPurchasingAddon");
            gdPurchasingAddon.Visibility = Visibility.Visible;

            try
            {
                if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 3))
                {
                    StorePurchaseResult result = await PurchaseAddOn(UtilityData.RemoveAds);

                    if (result != null)
                    {
                        switch (result.Status)
                        {
                        case StorePurchaseStatus.AlreadyPurchased:
                            RemoveAdsLicense();
                            break;

                        case StorePurchaseStatus.Succeeded:
                            ApplicationData.Current.RoamingSettings.Values[UtilityData.UpRemoveAds] = true;
                            RemoveAdsLicense();
                            UtilityClass.MessageDialog("Thank You very much for Purchasing. We really appreciate your kind support!", "Thank You very much! :)");
                            break;

                        case StorePurchaseStatus.NetworkError:
                        case StorePurchaseStatus.ServerError:
                            UtilityClass.MessageDialog("An Error Occured , Please Try Again!", "Error occured while purchasing.");
                            break;
                        }
                    }
                }
                else
                {
                    if (UtilityData.AppLicenseInformation == null)
                    {
                        UtilityData.AppLicenseInformation = CurrentApp.LicenseInformation;
                    }

                    if (!UtilityData.AppLicenseInformation.ProductLicenses["RemoveAds"].IsActive)
                    {
                        try
                        {
                            PurchaseResults results = await CurrentApp.RequestProductPurchaseAsync("RemoveAds");

                            if (results.Status == ProductPurchaseStatus.Succeeded)
                            {
                                ApplicationData.Current.RoamingSettings.Values["UpRemoveAds"] = UtilityData.AppLicenseInformation.ProductLicenses["RemoveAds"].IsActive;
                                RemoveAdsLicense();
                                UtilityClass.MessageDialog("Thank You very much for Purchasing. We really appreciate your kind support!", "Thank You very much! :)");
                            }
                        }
                        catch (Exception)
                        {
                            UtilityClass.MessageDialog("Please Check your Internet Connection and then try again", "No Internet Connection.");
                        }
                    }
                    else
                    {
                        // The customer already owns this feature.
                    }
                }
            }
            catch (Exception)
            {
                UtilityClass.MessageDialog("Please Check your Internet Connection and then try again", "No Internet Connection.");
            }
            finally
            {
                if (gdPurchasingAddon != null)
                {
                    gdPurchasingAddon.Visibility = Visibility.Collapsed;
                }
            }
        }
Example #10
0
        private async void btTelegramIAP_Tapped()
        {
            this.FindName("gdPurchasingAddon");
            gdPurchasingAddon.Visibility = Visibility.Visible;

            try
            {
                if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 3))
                {
                    StorePurchaseResult result = await PurchaseAddOn(UtilityData.UnlockTelegram);

                    if (result != null)
                    {
                        switch (result.Status)
                        {
                        case StorePurchaseStatus.AlreadyPurchased:
                            TelegramLicense();
                            //listboxassets("telegram", typeof(Telegram), "Telegram", UtilityData.TelegramColor, UtilityData.isTelegramDark);
                            break;

                        case StorePurchaseStatus.Succeeded:
                            ApplicationData.Current.RoamingSettings.Values[UtilityData.UpTelegram] = true;
                            TelegramLicense();
                            //lvMain.SelectedIndex = 0;
                            UtilityClass.MessageDialog("Thank You very much for Purchasing. We really appreciate your kind support!", "Thank You very much! :)");
                            break;

                        case StorePurchaseStatus.NetworkError:
                        case StorePurchaseStatus.ServerError:
                            UtilityClass.MessageDialog("An Error Occured , Please Try Again!", "Error occured while purchasing.");
                            break;
                        }
                    }
                }
                else
                {
                    if (UtilityData.AppLicenseInformation == null)
                    {
                        UtilityData.AppLicenseInformation = CurrentApp.LicenseInformation;
                    }

                    if (!UtilityData.AppLicenseInformation.ProductLicenses["UnlockTelegram"].IsActive)
                    {
                        try
                        {
                            PurchaseResults results = await CurrentApp.RequestProductPurchaseAsync("UnlockTelegram");

                            if (results.Status == ProductPurchaseStatus.Succeeded)
                            {
                                ApplicationData.Current.RoamingSettings.Values["UpTelegram"] = UtilityData.AppLicenseInformation.ProductLicenses["UnlockTelegram"].IsActive;
                                TelegramLicense();
                                mylistbox.SelectedIndex = 0;

                                UtilityClass.MessageDialog("Thank You very much for Purchasing. We really appreciate your kind support!", "Thank You very much! :)");
                            }
                        }
                        catch (Exception)
                        {
                            UtilityClass.MessageDialog("Please Check your Internet Connection and then try again", "No Internet Connection.");
                        }
                    }
                    else
                    {
                        TelegramLicense();
                    }
                }
            }
            catch (Exception)
            {
                UtilityClass.MessageDialog("Please Check your Internet Connection and then try again", "No Internet Connection.");
            }
            finally
            {
                if (gdPurchasingAddon != null)
                {
                    gdPurchasingAddon.Visibility = Visibility.Collapsed;
                }
            }
        }