Beispiel #1
0
        private void CompressionType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch (CompressionType.SelectedIndex)
            {
            case 0:
            {
                FName.Text = $"{(string.IsNullOrEmpty(SuggestName) ? Globalization.GetString("Compression_Admin_Name_Text") : SuggestName)}.zip";
                FName.Select(0, FName.Text.Length - 4);
                Type = Class.CompressionType.Zip;
                CompressLevel.Visibility = Windows.UI.Xaml.Visibility.Visible;

                break;
            }

            case 1:
            {
                FName.Text = $"{(string.IsNullOrEmpty(SuggestName) ? Globalization.GetString("Compression_Admin_Name_Text") : SuggestName)}.tar";
                FName.Select(0, FName.Text.Length - 4);
                Type = Class.CompressionType.Tar;
                CompressLevel.Visibility = Windows.UI.Xaml.Visibility.Collapsed;

                break;
            }

            case 2:
            {
                FName.Text = $"{(string.IsNullOrEmpty(SuggestName) ? Globalization.GetString("Compression_Admin_Name_Text") : SuggestName)}.gz";
                FName.Select(0, FName.Text.Length - 7);
                Type = Class.CompressionType.Gzip;
                CompressLevel.Visibility = Windows.UI.Xaml.Visibility.Visible;

                break;
            }
            }
        }
        public ZipDialog()
        {
            InitializeComponent();

            FName.Text = $"{Globalization.GetString("Zip_Admin_Name_Text")}.zip";
            FName.Select(0, FName.Text.Length - 4);

            ZipMethod.Items.Add(Globalization.GetString("Zip_Dialog_Level_1"));
            ZipMethod.Items.Add(Globalization.GetString("Zip_Dialog_Level_2"));
            ZipMethod.Items.Add(Globalization.GetString("Zip_Dialog_Level_3"));

            ZipMethod.SelectedIndex = 1;
        }
Beispiel #3
0
        private void FName_GotFocus(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            switch (CType.SelectedIndex)
            {
            case 0:
            case 3:
            {
                FName.Select(0, FName.Text.Length - 4);
                break;
            }

            case 1:
            {
                switch (CAlgorithm.SelectedIndex)
                {
                case 0:
                {
                    FName.Select(0, FName.Text.Length - 7);
                    break;
                }

                case 1:
                {
                    FName.Select(0, FName.Text.Length - 8);
                    break;
                }

                case 2:
                {
                    FName.Select(0, FName.Text.Length - 4);
                    break;
                }
                }
                break;
            }

            case 2:
            {
                FName.Select(0, FName.Text.Length - 3);
                break;
            }
            }
        }
        public ZipDialog(FileSystemStorageItemBase StorageItem)
        {
            InitializeComponent();

            if (StorageItem.StorageType == Windows.Storage.StorageItemTypes.File)
            {
                FName.Text = $"{Path.GetFileNameWithoutExtension(StorageItem.Name)}.zip";
            }
            else
            {
                FName.Text = $"{StorageItem.Name}.zip";
            }

            if (FName.Text != Path.GetExtension(FName.Text))
            {
                FName.Select(0, FName.Text.Length - 4);
            }

            ZipMethod.Items.Add(Globalization.GetString("Zip_Dialog_Level_1"));
            ZipMethod.Items.Add(Globalization.GetString("Zip_Dialog_Level_2"));
            ZipMethod.Items.Add(Globalization.GetString("Zip_Dialog_Level_3"));

            ZipMethod.SelectedIndex = 1;
        }