Example #1
0
        private void BtnAddScan_Click(object sender, RoutedEventArgs e)
        {
            //AppType appType = AppScanType.SelectedItem as AppType;
            if (AppScanList.Items.Count <= 0)
            {
                return;
            }

            var ss = new SimpleSelector(
                _AppTypes,
                AppTypes.SelectedItem,
                "AppTypeName",
                Strings.SELECT_APP_GROUP,
                true);

            ss.Owner = this;

            if (ss.ShowDialog() ?? false)
            {
                var selectedApps = GetSelected();

                if (ss.AutoGroup)
                {
                    _Controller.AddScned(_AppGroup, selectedApps);
                }
                else
                {
                    _Controller.AddScned(
                        _AppGroup,
                        ss.SelectedItem as AppType,
                        ss.NewName,
                        selectedApps);
                }
            }
        }
Example #2
0
        private void BtnResore_Click(object sender, RoutedEventArgs e)
        {
            var delApp = DeletedAppList.SelectedItems;

            AppType appType   = null;
            bool    hasNoType = false;

            foreach (DeletedApp da in delApp)
            {
                if (da.DeletedFrom == null)
                {
                    hasNoType = true;
                    break;
                }
            }

            if (hasNoType)
            {
                var ss = new SimpleSelector(
                    _AppTypes,
                    AppTypes.SelectedItem,
                    "AppTypeName",
                    Strings.SELECT_APP_GROUP,
                    false);

                ss.Owner = this;
                if (ss.ShowDialog() ?? false)
                {
                    _Controller.RestoreApp(
                        _AppGroup,
                        new DeletedAppCollection(delApp),
                        _DeletedApps,
                        appType,
                        ss.NewName
                        );
                }

                return;
            }

            _Controller.RestoreApp(
                _AppGroup,
                new DeletedAppCollection(delApp),
                _DeletedApps,
                null,
                null
                );
        }