コード例 #1
0
        /// <summary>
        /// Applies the CollectionFilterview to a specific Datagrid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnApplyFilter_Click(object sender, RoutedEventArgs e)
        {
            var s = (System.Windows.Controls.Button)sender; //The Button (sender) determines which Filter will be Applied

            switch (s.Name)
            {
            case "BtnApplyCollectionFilter":
                CollectionViewHelper <CMCollection> .ApplyFilter(TxtCollectionFilter, GrdCollection, "Collections", "Name", _logger);

                break;

            case "BtnApplyApplicationFilter":
                CollectionViewHelper <CMApplication> .ApplyFilter(TxtApplicationFilter, GrdApplication, "Applications", "LocalizedDisplayname", _logger);

                break;

            case "BtnApplySoftwareupdateFilter":
                CollectionViewHelper <CMSoftwareupdate> .ApplyFilter(TxtSoftwareupdateFilter, GrdSoftwareupdate, "Software Updates", "LocalizedDisplayname", _logger);

                break;

            case "BtnApplySoftwareupdateGroupFilter":
                CollectionViewHelper <CMSoftwareupdateGroup> .ApplyFilter(TxtSoftwareupdateGroupFilter, GrdSoftwareupdateGroup, "Software Update Groups", "LocalizedDisplayname", _logger);

                break;

            case "BtnApplyDevicesFilter":
                CollectionViewHelper <CMDevice> .ApplyFilter(TxtDevicesFilter, GrdDevices, "Devices", "Name", _logger);

                break;

            case "BtnApplyUserFilter":
                CollectionViewHelper <CMUser> .ApplyFilter(TxtUserFilter, GrdUser, "User", "Name", _logger);

                break;

            case "BtnApplyTasksequenceFilter":
                CollectionViewHelper <CMTasksequence> .ApplyFilter(TxtTasksequenceFilter, GrdTasksequence, "Tasksequences", "Name", _logger);

                break;

            case "BtnApplyPackageFilter":
                CollectionViewHelper <CMPackage> .ApplyFilter(TxtPackagesFilter, GrdPackage, "Packages", "Name", _logger);

                break;

            case "BtnApplyDeploymenttypeFilter":
                CollectionViewHelper <CMDeploymenttype> .ApplyFilter(TxtDeploymenttypeFilter, GrdDeploymenttype, "Deploymenttypes", "LocalizedDisplayname", _logger);

                break;

            case "BtnApplyBootimageFilter":
                CollectionViewHelper <CMBootimage> .ApplyFilter(TxtBootimageFilter, GrdBootimage, "Bootimages", "Name", _logger);

                break;

            case "BtnApplyOSImageFilter":
                CollectionViewHelper <CMOSImage> .ApplyFilter(TxtOSImageFilter, GrdOSImage, "OS-Images", "Name", _logger);

                break;
            }
        }