public ConversionPopUp(CgApiFeature.Feature feature)
 {
     this.InitializeComponent();
     base.DataContext = this;
     this.< CurrentFeature > k__BackingField = feature;
     this.InitializePopUp();
 }
 private void SetConversionPopUp(CgApiFeature.Feature currentFeature)
 {
     if (!ObjectHolder.CurrentUser.HasUserAccessToFeature(currentFeature))
     {
         this.FeatureBoxButton.IsChecked = new bool?(false);
         ConversionPopUpHelpers.ShowConversionPopUp(currentFeature);
     }
 }
        public static void ShowConversionPopUp(CgApiFeature.Feature aFeature)
        {
            string conversionInfo;
            string conversionTitle;

            switch (aFeature)
            {
            case 1:
                conversionInfo  = Conversion.ConversionAdblockMessage;
                conversionTitle = Profiles.ads_head;
                goto IL_13F;

            case 2:
                conversionInfo  = Conversion.ConversionMalwareMessage;
                conversionTitle = Profiles.malware_head;
                goto IL_13F;

            case 3:
                conversionInfo  = Conversion.ConversionZipMessage;
                conversionTitle = Profiles.compression_head;
                goto IL_13F;

            case 4:
                conversionInfo  = Conversion.ConversionTrackingMessage;
                conversionTitle = Profiles.tracking_head;
                goto IL_13F;

            case 8:
                conversionInfo  = Conversion.ConversionHttpsEverywhereMessage;
                conversionTitle = Profiles.https_everywhere;
                goto IL_13F;

            case 9:
                conversionInfo  = Conversion.ConversionExtraSpeedMessage;
                conversionTitle = Profiles.speed_head;
                goto IL_13F;

            case 11:
                conversionInfo  = Conversion.ConversionConnectNetworkMessage;
                conversionTitle = Conversion.ConversionConnectWifiTitle;
                goto IL_13F;

            case 12:
                conversionInfo  = Conversion.ConversionConnectUnblockMessage;
                conversionTitle = Conversion.ConversionConnectUnblockTitle;
                goto IL_13F;

            case 13:
                conversionInfo  = Conversion.ConversionConnectSurfMessage;
                conversionTitle = Conversion.ConversionConnectSurfTitle;
                goto IL_13F;

            case 14:
                conversionInfo  = Conversion.ConversionConnectUnblockMessage;
                conversionTitle = Conversion.ConversionConnectUnblockTitle;
                goto IL_13F;

            case 16:
                conversionInfo  = Conversion.ConversionConnectCustomMessage;
                conversionTitle = Conversion.ConversionConnectCustomTitle;
                goto IL_13F;

            case 17:
                conversionInfo  = Conversion.ConversionConnectNetworkMessage;
                conversionTitle = Conversion.ConversionConnectNetworkTitle;
                goto IL_13F;

            case 18:
                conversionInfo  = Conversion.ConversionConnectDownloadMessage;
                conversionTitle = Conversion.ConversionConnectDownloadTitle;
                goto IL_13F;

            case 19:
                conversionInfo  = Conversion.ConversionCountrySelectionMessage;
                conversionTitle = Conversion.ConversionCountrySelectionTitle;
                goto IL_13F;
            }
            throw new ArgumentOutOfRangeException("aFeature", aFeature, null);
IL_13F:
            Frame frame = (Frame)ObjectHolder.MainForm.Template.FindName("ConversionFrame", ObjectHolder.MainForm);

            frame.Visibility = Visibility.Visible;
            ObjectHolder.MainForm.ContentBlockerVisibility = Visibility.Visible;
            ConversionPopUp conversionPopUp = new ConversionPopUp(aFeature)
            {
                ConversionTitle = conversionTitle,
                ConversionInfo  = conversionInfo,
                ContentFrame    = frame
            };

            conversionPopUp.ContentFrame.Navigate(conversionPopUp);
            ObjectHolder.MainForm.ShowMe();
        }
 public void FeatureBoxButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (this.FeatureBoxButton.IsChecked.HasValue)
         {
             this.Checked = this.FeatureBoxButton.IsChecked.Value;
         }
         if (this.DataContext is CgProfileAnonymousBrowsing)
         {
             CgProfileAnonymousBrowsing profileAnonymousBrowsing = SettingsHolder.get_Settings().get_ProfileAnonymousBrowsing();
             this.SetFeaturesInSetting(profileAnonymousBrowsing);
         }
         if (this.DataContext is CgProfileAnonymousDownloading)
         {
             CgProfileAnonymousDownloading profileAnonymousDownloading = SettingsHolder.get_Settings().get_ProfileAnonymousDownloading();
             this.SetFeaturesInSetting(profileAnonymousDownloading);
         }
         if (this.DataContext is CgProfileCustom)
         {
             CgProfileCustom profileCustom = SettingsHolder.get_Settings().get_ProfileCustom();
             this.SetFeaturesInSetting(profileCustom);
         }
         if (this.DataContext is CgProfileNetwork)
         {
             CgProfileNetwork profileNetwork = SettingsHolder.get_Settings().get_ProfileNetwork();
             this.SetFeaturesInSetting(profileNetwork);
         }
         if (this.DataContext is CgProfileUnblock)
         {
             CgProfileUnblock profileUnblock = SettingsHolder.get_Settings().get_ProfileUnblock();
             this.SetFeaturesInSetting(profileUnblock);
         }
         if (this.DataContext is CgProfileUncensoring)
         {
             CgProfileUncensoring profileUncensoring = SettingsHolder.get_Settings().get_ProfileUncensoring();
             this.SetFeaturesInSetting(profileUncensoring);
         }
         if (this.DataContext is CgProfileWifi)
         {
             CgProfileWifi profileWifi = SettingsHolder.get_Settings().get_ProfileWifi();
             this.SetFeaturesInSetting(profileWifi);
         }
         if (this.Ident.Equals("FeatureSpeed"))
         {
             this.CurrentFeature = 9;
         }
         else if (this.Ident.Equals("FeatureMalware"))
         {
             this.CurrentFeature = 2;
         }
         else if (this.Ident.Equals("FeatureAdBlock"))
         {
             this.CurrentFeature = 1;
         }
         else if (this.Ident.Equals("FeatureTracking"))
         {
             this.CurrentFeature = 4;
         }
         else if (this.Ident.Equals("FeatureZip"))
         {
             this.CurrentFeature = 3;
         }
         else if (this.Ident.Equals("FeatureHttps"))
         {
             this.CurrentFeature = 8;
         }
         this.SetConversionPopUp(this.CurrentFeature);
         if (this.CurrentFeature == 9)
         {
             this.FeatureBoxButton.IsChecked = new bool?(!ObjectHolder.CurrentUser.IsFreeUser());
             this.FeatureBoxButton.IsEnabled = ObjectHolder.CurrentUser.IsFreeUser();
         }
     }
     catch (Exception arg_1FD_0)
     {
         HelperFunctions.DebugLine(arg_1FD_0.Message);
     }
 }