Пример #1
0
        /// <summary>
        ///     Filters the update.
        /// </summary>
        private void FilterUpdate( )
        {
            List <AppLibraryApp> filteredApps = new List <AppLibraryApp>( );

            foreach (var app in AppLibraryApps)
            {
                FilterObject applicationFilterObject  = ApplicationFilters.FirstOrDefault(f => f.Value.ToString( ) == app.Application);
                FilterObject versionFilterObject      = VersionFilters.FirstOrDefault(f => f.Value.ToString( ) == app.Version);
                FilterObject publisherFilterObject    = PublisherFilters.FirstOrDefault(f => f.Value.ToString( ) == app.Publisher);
                FilterObject publisherUrlFilterObject = PublisherUrlFilters.FirstOrDefault(f => f.Value.ToString( ) == app.PublisherUrl);

                if ((applicationFilterObject == null || applicationFilterObject.IsFiltered) && (versionFilterObject == null || versionFilterObject.IsFiltered) && (publisherFilterObject == null || publisherFilterObject.IsFiltered) && (publisherUrlFilterObject == null || publisherUrlFilterObject.IsFiltered))
                {
                    filteredApps.Add(app);
                }
            }

            FilteredAppLibraryApps = filteredApps;
        }
Пример #2
0
        /// <summary>
        ///     Filters the update.
        /// </summary>
        private void FilterUpdate( )
        {
            List <TenantApp> filteredApps = new List <TenantApp>( );

            foreach (var app in TenantApps)
            {
                FilterObject tenantFilterObject       = TenantFilters.FirstOrDefault(f => f.Value.ToString( ) == app.TenantName);
                FilterObject solutionFilterObject     = SolutionFilters.FirstOrDefault(f => f.Value.ToString( ) == app.Solution);
                FilterObject versionFilterObject      = VersionFilters.FirstOrDefault(f => f.Value.ToString( ) == app.SolutionVersion);
                FilterObject publisherFilterObject    = PublisherFilters.FirstOrDefault(f => f.Value.ToString( ) == app.Publisher);
                FilterObject publisherUrlFilterObject = PublisherUrlFilters.FirstOrDefault(f => f.Value.ToString( ) == app.PublisherUrl);
                FilterObject protectedFilterObject    = ProtectedFilters.FirstOrDefault(f => ( bool )f.Value == app.IsProtected);

                if ((tenantFilterObject == null || tenantFilterObject.IsFiltered) && (solutionFilterObject == null || solutionFilterObject.IsFiltered) && (versionFilterObject == null || versionFilterObject.IsFiltered) && (publisherFilterObject == null || publisherFilterObject.IsFiltered) && (publisherUrlFilterObject == null || publisherUrlFilterObject.IsFiltered) && (protectedFilterObject == null || protectedFilterObject.IsFiltered))
                {
                    filteredApps.Add(app);
                }
            }

            FilteredTenantApps = filteredApps;
        }