private void InitIcons()
 {
     this.ImageUpLeft.Source    = new BitmapImage(new Uri(Theming.GetThemedImage("Icons\\Connected\\virus.png")));
     this.ImageUpRight.Source   = new BitmapImage(new Uri(Theming.GetThemedImage("Icons\\Connected\\tracking-2.png")));
     this.ImageDownLeft.Source  = new BitmapImage(new Uri(Theming.GetThemedImage("Icons\\Connected\\adblock.png")));
     this.ImageDownRight.Source = new BitmapImage(new Uri(Theming.GetThemedImage("Icons\\Connected\\time.png")));
 }
        public ConnectedWifi()
        {
            this.InitializeComponent();
            BitmapImage bitmapImage = new BitmapImage();

            bitmapImage.BeginInit();
            bitmapImage.UriSource = new Uri(Theming.GetThemedImage("Background\\stats-wifi-ghostie.gif"));
            bitmapImage.EndInit();
            ImageBehavior.SetAnimatedSource(this.SurfingAnimated, bitmapImage);
            this._wiFiDetector.add_OnNewWiFiDetected(new WiFiDetector.NewWiFiDetected(this._wiFiDetector_OnNewWiFiDetected));
            this._wiFiDetector.add_OnSignalStrengthChanged(new WiFiDetector.SignalStrengthChanged(this._wiFiDetector_OnSignalStrengthChanged));
            this._wiFiDetector.add_OnWifiDisconnected(new WiFiDetector.NewWiFiDetected(this._wiFiDetector_OnWifiDisconnected));
            this._wiFiDetector.set_Enabled(true);
            this.< IconPathString > k__BackingField = Theming.GetThemedImage("Icons\\ProfileTabs\\ico-wifi-color.png");
            try
            {
                this.Surfing.Source = new BitmapImage(new Uri(Theming.GetThemedImage("Background\\stats-surfen-ghostie.png")));
            }
            catch (FileNotFoundException ex)
            {
                DebugLogHelper.Instance.Info(string.Format("{0}.{1} {2}", base.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message));
            }
            catch (ArgumentNullException ex2)
            {
                DebugLogHelper.Instance.Info(string.Format("{0}.{1} {2}", base.GetType().Name, MethodBase.GetCurrentMethod().Name, ex2.Message));
            }
        }
 private void InitIcons()
 {
     this._iosLogoUri     = new Uri(Theming.GetThemedImage("Icons\\DeviceTabs\\ios.png"));
     this._macosLogoUri   = new Uri(Theming.GetThemedImage("Icons\\DeviceTabs\\macos.png"));
     this._windowsLogoUri = new Uri(Theming.GetThemedImage("Icons\\DeviceTabs\\windows.png"));
     this._androidLogoUri = new Uri(Theming.GetThemedImage("Icons\\DeviceTabs\\android.png"));
     this._otherLogoUri   = new Uri(Theming.GetThemedImage("Icons\\DeviceTabs\\custom.png"));
 }
 public void OnNavigatedTo()
 {
     if (ObjectHolder.CurrentProfile.Equals(SettingsHolder.get_Settings().get_ProfileAnonymousBrowsing()))
     {
         if (File.Exists(Theming.GetThemedImage("Background\\anonSurfBack.png")))
         {
             this.BackgroundImage.ImageSource = new BitmapImage(new Uri(Theming.GetThemedImage("Background\\anonSurfBack.png")));
         }
         this.LblUpLeftFirstLine.Foreground    = (base.FindResource("BrushColorYellow") as SolidColorBrush);
         this.LblUpRightFirstLine.Foreground   = (base.FindResource("BrushColorYellow") as SolidColorBrush);
         this.LblDownLeftFirstLine.Foreground  = (base.FindResource("BrushColorYellow") as SolidColorBrush);
         this.LblDownRightFirstLine.Foreground = (base.FindResource("BrushColorYellow") as SolidColorBrush);
     }
     if (ObjectHolder.CurrentProfile.Equals(SettingsHolder.get_Settings().get_ProfileAnonymousDownloading()))
     {
         if (File.Exists(Theming.GetThemedImage("Background\\anonDownloadBack.png")))
         {
             this.BackgroundImage.ImageSource = new BitmapImage(new Uri(Theming.GetThemedImage("Background\\anonDownloadBack.png")));
         }
         this.LblUpLeftFirstLine.Foreground    = (base.FindResource("ProfileAnonDownloadColorBrush") as SolidColorBrush);
         this.LblUpRightFirstLine.Foreground   = (base.FindResource("ProfileAnonDownloadColorBrush") as SolidColorBrush);
         this.LblDownLeftFirstLine.Foreground  = (base.FindResource("ProfileAnonDownloadColorBrush") as SolidColorBrush);
         this.LblDownRightFirstLine.Foreground = (base.FindResource("ProfileAnonDownloadColorBrush") as SolidColorBrush);
     }
     if (ObjectHolder.CurrentProfile.Equals(SettingsHolder.get_Settings().get_ProfileCustom()))
     {
         if (File.Exists(Theming.GetThemedImage("Background\\stats-settingsBack.png")))
         {
             this.BackgroundImage.ImageSource = new BitmapImage(new Uri(Theming.GetThemedImage("Background\\stats-settingsBack.png")));
         }
         this.LblUpLeftFirstLine.Foreground    = (base.FindResource("MangentaBaseBrush") as SolidColorBrush);
         this.LblUpRightFirstLine.Foreground   = (base.FindResource("MangentaBaseBrush") as SolidColorBrush);
         this.LblDownLeftFirstLine.Foreground  = (base.FindResource("MangentaBaseBrush") as SolidColorBrush);
         this.LblDownRightFirstLine.Foreground = (base.FindResource("MangentaBaseBrush") as SolidColorBrush);
     }
     if (ObjectHolder.CurrentProfile.Equals(SettingsHolder.get_Settings().get_ProfileNetwork()) || ObjectHolder.CurrentProfile.Equals(SettingsHolder.get_Settings().get_ProfileWifi()))
     {
         if (File.Exists(Theming.GetThemedImage("Background\\stats-wifi.png")))
         {
             this.BackgroundImage.ImageSource = new BitmapImage(new Uri(Theming.GetThemedImage("Background\\stats-wifi.png")));
         }
         this.LblUpLeftFirstLine.Foreground    = (base.FindResource("ProfileWifiColorBrush") as SolidColorBrush);
         this.LblUpRightFirstLine.Foreground   = (base.FindResource("ProfileWifiColorBrush") as SolidColorBrush);
         this.LblDownLeftFirstLine.Foreground  = (base.FindResource("ProfileWifiColorBrush") as SolidColorBrush);
         this.LblDownRightFirstLine.Foreground = (base.FindResource("ProfileWifiColorBrush") as SolidColorBrush);
     }
     this.TrafficData                      = GuiHelper.ResetTrafficData();
     this.SwitchLeft.Visibility            = Visibility.Hidden;
     this.SwitchRight.Visibility           = Visibility.Hidden;
     ObjectHolder.ConnectedDispatcherTimer = this._generalDispatcherTimer;
     if (!this._stopWatch.IsRunning)
     {
         this._stopWatch.Stop();
         this._stopWatch.Reset();
         this._timerForStopWatch.Start();
     }
 }
Exemplo n.º 5
0
        private void InitIcons()
        {
            this.StatsSurfenGhostieBackground = new Uri(Theming.GetThemedImage("Background\\stats-surfen-ghostie.gif"));
            BitmapImage bitmapImage = new BitmapImage();

            bitmapImage.BeginInit();
            bitmapImage.UriSource = this.StatsSurfenGhostieBackground;
            bitmapImage.EndInit();
            ImageBehavior.SetAnimatedSource(this.SurfingAnimated, bitmapImage);
            this.Surfing.Source = new BitmapImage(new Uri(Theming.GetThemedImage("Background\\stats-surfen-ghostie.png")));
        }
Exemplo n.º 6
0
        private void InitIcons()
        {
            this.StatsUnblockGhostieBackground = new Uri(Theming.GetThemedImage("Background\\stats-unlock-ghostie.gif"));
            this.IconPlayPath = new Uri(Theming.GetThemedImage("Icons\\Functions\\icon_play.png"));
            BitmapImage bitmapImage = new BitmapImage();

            bitmapImage.BeginInit();
            bitmapImage.UriSource = this.StatsUnblockGhostieBackground;
            bitmapImage.EndInit();
            ImageBehavior.SetAnimatedSource(this.UnblockingAnimated, bitmapImage);
            this.GridBackground.ImageSource = new BitmapImage(new Uri(Theming.GetThemedImage("Background\\unblockBack.png")));
            this.Unblocking.Source          = new BitmapImage(new Uri(Theming.GetThemedImage("Background\\stats-unlock-ghostie.png")));
        }
Exemplo n.º 7
0
 private void SetCountryLabel()
 {
     try
     {
         if (!string.IsNullOrEmpty(SettingsHolder.get_Settings().get_ProfileUnblock().get_SelectedItemCountryCode()))
         {
             this.LblImageCountry.Source = new BitmapImage(new Uri(Theming.GetThemedImage(Path.Combine("Icons\\Flags\\24", string.Format("{0}.png", SettingsHolder.get_Settings().get_ProfileUnblock().get_SelectedItemCountryCode())))));
         }
     }
     catch (Exception)
     {
     }
 }
Exemplo n.º 8
0
 private void InitIcons()
 {
     this._freeImageAnonDownload    = new Uri(Theming.GetThemedImage("Icons\\ProfileTabs\\ico-download.png"));
     this._freeImageAnonSurf        = new Uri(Theming.GetThemedImage("Icons\\ProfileTabs\\ico-browse.png"));
     this._freeImageAntiCensor      = new Uri(Theming.GetThemedImage("Icons\\ProfileTabs\\ico-anti.png"));
     this._freeImageCustom          = new Uri(Theming.GetThemedImage("Icons\\ProfileTabs\\ico-setting.png"));
     this._freeImageNetwork         = new Uri(Theming.GetThemedImage("Icons\\ProfileTabs\\ico-lan.png"));
     this._freeImageUnblock         = new Uri(Theming.GetThemedImage("Icons\\ProfileTabs\\ico-unblock.png"));
     this._freeImageWifi            = new Uri(Theming.GetThemedImage("Icons\\ProfileTabs\\ico-wifi.png"));
     this._premiumImageAnonDownload = new Uri(Theming.GetThemedImage(string.Format("Icons\\ProfileTabs\\HomePremium_{0}\\ico-download.png", SettingsHolder.get_Settings().get_Language())));
     this._premiumImageAnonSurf     = new Uri(Theming.GetThemedImage(string.Format("Icons\\ProfileTabs\\HomePremium_{0}\\ico-browse.png", SettingsHolder.get_Settings().get_Language())));
     this._premiumImageAntiCensor   = new Uri(Theming.GetThemedImage(string.Format("Icons\\ProfileTabs\\HomePremium_{0}\\ico-anti.png", SettingsHolder.get_Settings().get_Language())));
     this._premiumImageCustom       = new Uri(Theming.GetThemedImage(string.Format("Icons\\ProfileTabs\\HomePremium_{0}\\ico-setting.png", SettingsHolder.get_Settings().get_Language())));
     this._premiumImageNetwork      = new Uri(Theming.GetThemedImage(string.Format("Icons\\ProfileTabs\\HomePremium_{0}\\ico-lan.png", SettingsHolder.get_Settings().get_Language())));
     this._premiumImageUnblock      = new Uri(Theming.GetThemedImage(string.Format("Icons\\ProfileTabs\\HomePremium_{0}\\ico-unblock.png", SettingsHolder.get_Settings().get_Language())));
     this._premiumImageWifi         = new Uri(Theming.GetThemedImage(string.Format("Icons\\ProfileTabs\\HomePremium_{0}\\ico-wifi.png", SettingsHolder.get_Settings().get_Language())));
 }
Exemplo n.º 9
0
        public ProgramData(string fileName, bool visible = false)
        {
            string text = this.IconFromFilePath(fileName);

            if (!string.IsNullOrEmpty(text) && File.Exists(text))
            {
                this.ExeImage = new Uri(text);
            }
            else
            {
                this.ExeImage = new Uri(Theming.GetThemedImage("Icons\\Functions\\blank_tile.png"));
            }
            this.ExeName        = Path.GetFileName(fileName);
            this.Tag            = "";
            this.ToolTip        = fileName;
            this.ApplicationExe = fileName;
            this.Visible        = visible;
        }
Exemplo n.º 10
0
 private void UpdateConnectedPanel()
 {
     if (ObjectHolder.ConnectionStatus != -1 && ObjectHolder.CurrentConnectionInfos != null)
     {
         this.connected_Profile.Text    = SettingsHolder.get_Settings().get_ConnectedProfileNamePretty();
         this.connected_ServerName.Text = string.Format("{0} ({1})", ObjectHolder.CurrentConnectionInfos.ServerName, ObjectHolder.CurrentConnectionInfos.ServerIp);
         string themedImage = Theming.GetThemedImage(Path.Combine("Icons\\Flags\\24", string.Format("{0}.png", ObjectHolder.CurrentConnectionInfos.ServerCountry.ToLower())));
         if (File.Exists(themedImage))
         {
             BitmapImage bitmapImage = new BitmapImage();
             bitmapImage.BeginInit();
             bitmapImage.UriSource = new Uri(themedImage);
             bitmapImage.EndInit();
             this.connected_CountryImage.Source = bitmapImage;
         }
         this.connected_Info.Visibility = Visibility.Visible;
         return;
     }
     this.connected_Info.Visibility = Visibility.Collapsed;
 }
Exemplo n.º 11
0
        public void OnNavigatedTo(NavigationEventArgs e)
        {
            this.UpgradeBtn.CurrentProfile = SettingsHolder.get_Settings().get_ProfileCustom();
            this.UpgradeBtn.SetVisibility(this.ConnectBtn, 16);
            this.InfoFooter.Profile       = SettingsHolder.get_Settings().get_ProfileCustom();
            this.ConnectBtn.IsEnabled     = false;
            this.SelectedLabel.Visibility = Visibility.Hidden;
            if (SettingsHolder.get_Settings().get_ProfileCustom().get_SelectedServerId() > 0 || !string.IsNullOrEmpty(SettingsHolder.get_Settings().get_ProfileCustom().get_SelectedCountry()) || !string.IsNullOrEmpty(SettingsHolder.get_Settings().get_ProfileCustom().get_SelectedCountryDisplay()))
            {
                this.SelectedLabel.Visibility = Visibility.Visible;
                this.ConnectBtn.IsEnabled     = true;
            }
            ObjectHolder.MainForm.set_IsNavigationVisible(true);
            this.ServerOption.Content = SettingsHolder.get_Settings().get_ProfileCustom().get_SelectedServerName();
            if (string.IsNullOrEmpty(SettingsHolder.get_Settings().get_ProfileCustom().get_SelectedServerName()))
            {
                this.ServerOption.Content = SettingsHolder.get_Settings().get_ProfileCustom().get_SelectedServerDisplayName();
            }
            string themedImage = Theming.GetThemedImage(Path.Combine("Icons\\Flags\\24", string.Format("{0}.png", SettingsHolder.get_Settings().get_ProfileCustom().get_SelectedCountry())));

            if (string.IsNullOrEmpty(SettingsHolder.get_Settings().get_ProfileCustom().get_SelectedCountry()))
            {
                themedImage = Theming.GetThemedImage(Path.Combine("Icons\\Flags\\24", string.Format("{0}.png", SettingsHolder.get_Settings().get_ProfileCustom().get_SelectedCountryDisplay())));
            }
            if (!string.IsNullOrEmpty(themedImage) && File.Exists(themedImage))
            {
                this.ServerImage.Visibility = Visibility.Visible;
                this.ServerImage.Source     = new BitmapImage(new Uri(string.Format(themedImage, new object[0])));
            }
            else
            {
                this.ServerImage.Visibility = Visibility.Hidden;
            }
            this.FeatureGroup.CurrentProfile = SettingsHolder.get_Settings().get_ProfileCustom();
            this.FeatureGroup.BindFeatures();
            ObjectHolder.CurrentProfileTab = "extra features";
            GuiHelper.SetUpgradeBarVisiblity(this.FeatureGroup);
        }
Exemplo n.º 12
0
 private void SetCountryImage()
 {
     try
     {
         if (ObjectHolder.ConnectionStatus != null)
         {
             this.LblCountry.Text = Profiles.COUNTRY;
             if (File.Exists(this.IcoBlankFlag.ToString()))
             {
                 this.LblImageCountry.Source = new BitmapImage(this.IcoBlankFlag);
             }
         }
         else if (!string.IsNullOrEmpty(SettingsHolder.get_Settings().get_ProfileUncensoring().get_SelectedItemCountryCode()))
         {
             string selectedItemCountryCode = SettingsHolder.get_Settings().get_ProfileUncensoring().get_SelectedItemCountryCode();
             this.LblCountry.Text        = GuiHelper.FindTranslationForCountry(selectedItemCountryCode);
             this.LblImageCountry.Source = new BitmapImage(new Uri(Theming.GetThemedImage(Path.Combine("Icons\\Flags\\24", string.Format("{0}.png", SettingsHolder.get_Settings().get_ProfileUncensoring().get_SelectedItemCountryCode())))));
         }
     }
     catch (Exception)
     {
     }
 }
 private void InitIcons()
 {
     this.GhostyImage.Source = new BitmapImage(new Uri(Theming.GetThemedImage("Background\\friends.png")));
 }
Exemplo n.º 14
0
 private void InitIcons()
 {
     this.WifiIco.Source = new BitmapImage(new Uri(Theming.GetThemedImage("Icons\\ProfileTabs\\ico-wifi.png")));
 }
 private void InitIcons()
 {
     this.Flag = Theming.GetThemedImage("Icons\\Flags\\24\\Blank.png");
 }
 private void InitIcons()
 {
     this.ImageText.Source = new BitmapImage(new Uri(Theming.GetThemedImage("ConversionImages\\surfen-4.png")));
 }
Exemplo n.º 17
0
 private void InitIcons()
 {
     this.IcoBlankFlag = new Uri(Theming.GetThemedImage("Icons\\Flags\\24\\blank.png"));
     this.GridBackground.ImageSource = new BitmapImage(new Uri(Theming.GetThemedImage("Background\\anticensorBack.png")));
     this.Unblocking.Source          = new BitmapImage(new Uri(Theming.GetThemedImage("Background\\anticensor.png")));
 }
        private void FillProgramList()
        {
            this.ProgramDataList.Clear();
            string themedImage = Theming.GetThemedImage("Icons\\Functions\\blank_tile.png");

            try
            {
                this.ProgramDataList.Add(new ProgramData
                {
                    ExeImage = new Uri(themedImage, UriKind.RelativeOrAbsolute),
                    ExeName  = General.AnonymousDownloading_FillUnblockListWithContent_Dont_start_additional_program,
                    Tag      = "empty",
                    ToolTip  = "empty",
                    Visible  = false
                });
            }
            catch (Exception ex)
            {
                HelperFunctions.DebugLine(string.Format("{0}::{1} COULD NOT ADD STATIC APP TO LIST {2}", base.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message));
            }
            try
            {
                this.ProgramDataList.Add(new ProgramData
                {
                    ExeImage = new Uri(themedImage, UriKind.RelativeOrAbsolute),
                    ExeName  = Profiles.startDefaultBrowserIgnoMode,
                    Tag      = "browser",
                    ToolTip  = "browser",
                    Visible  = false
                });
            }
            catch (Exception ex2)
            {
                HelperFunctions.DebugLine(string.Format("{0}::{1} COULD NOT ADD STATIC APP TO LIST {2}", base.GetType().Name, MethodBase.GetCurrentMethod().Name, ex2.Message));
            }
            foreach (CgApiProgram current in ObjectHolder.ProgramList.get_Items())
            {
                if (current.IsInstalled())
                {
                    try
                    {
                        this.ProgramDataList.Add(new ProgramData(current, false));
                    }
                    catch (Exception ex3)
                    {
                        HelperFunctions.DebugLine(string.Format("{0}::{1} COULD NOT ADD PROGRAMDATA TO LIST {2}", base.GetType().Name, MethodBase.GetCurrentMethod().Name, ex3.Message));
                    }
                }
            }
            using (List <string> .Enumerator enumerator2 = SettingsHolder.get_Settings().get_ProfileAnonymousDownloading().get_CustomApps().GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    ProgramData item = new ProgramData(enumerator2.Current, true);
                    this.ProgramDataList.Add(item);
                }
            }
            this.ProgramDataList.Add(new ProgramData
            {
                ExeImage = new Uri(themedImage, UriKind.RelativeOrAbsolute),
                ExeName  = Profiles.AnonDownload_Fill_ProgramList_Add_custom_program,
                Tag      = "customProgram",
                ToolTip  = "custom",
                Visible  = false
            });
        }