Exemplo n.º 1
0
 private void BtnDuplicateList_Click(object sender, RoutedEventArgs e)
 {
     if (this.gvProxyLists.SelectedItems.Count > 0)
     {
         foreach (ProxyListObject obj2 in this.gvProxyLists.SelectedItems)
         {
             ProxyListObject item = new ProxyListObject {
                 Id           = Guid.NewGuid().ToString(),
                 Name         = obj2.Name,
                 ProxyTestUrl = obj2.ProxyTestUrl,
                 ProxyTimeout = obj2.ProxyTimeout,
                 Rotation     = obj2.Rotation
             };
             item.Proxies = new ObservableCollection <ProxyObject>();
             foreach (ProxyObject obj4 in obj2.Proxies)
             {
                 ProxyObject obj5 = new ProxyObject {
                     Id       = Guid.NewGuid().ToString(),
                     IP       = obj4.IP,
                     Port     = obj4.Port,
                     Username = obj4.Username,
                     Password = obj4.Password,
                     Enabled  = obj4.Enabled
                 };
                 item.Proxies.Add(obj5);
             }
             Global.SETTINGS.PROXIES.Add(item);
         }
         Helpers.SaveSettings();
     }
 }
Exemplo n.º 2
0
 public ProxyListWindow(Window owner, ProxyListObject proxyList)
 {
     Class7.RIuqtBYzWxthF();
     this.InitializeComponent();
     base.Owner      = owner;
     this._operation = Global.FormOperation.update;
     this._proxyList = proxyList;
 }
Exemplo n.º 3
0
 private void BtnEditList_Click(object sender, RoutedEventArgs e)
 {
     if (this.gvProxyLists.SelectedItems.Count == 1)
     {
         ProxyListObject proxyList = (ProxyListObject)this.gvProxyLists.SelectedItems[0];
         new ProxyListWindow((Window)Global.MAIN_WINDOW, proxyList).ShowDialog();
     }
 }
Exemplo n.º 4
0
        public ProxyListWindow(Window owner)
        {
            Class7.RIuqtBYzWxthF();
            this.InitializeComponent();
            base.Owner      = owner;
            this._operation = Global.FormOperation.insert;
            ProxyListObject obj1 = new ProxyListObject {
                Id = Guid.NewGuid().ToString()
            };

            this._proxyList = obj1;
        }
Exemplo n.º 5
0
 private void BtnDeleteList_Click(object sender, RoutedEventArgs e)
 {
     if (this.gvProxyLists.SelectedItems.Count > 0)
     {
         if (MessageBox.Show("Really delete the selected proxy lists?", "Are you sure?", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
         {
             List <string> list = new List <string>();
             foreach (ProxyListObject obj3 in this.gvProxyLists.SelectedItems)
             {
                 list.Add(obj3.Id);
             }
             foreach (string id in list)
             {
                 ProxyListObject item = Global.SETTINGS.PROXIES.First <ProxyListObject>(x => x.Id == id);
                 Global.SETTINGS.PROXIES.Remove(item);
             }
         }
         Helpers.SaveSettings();
     }
 }