public SourceScope(SourceFile source, string[] content, IResourceFilter filter, Dictionary <string, object> configuration) { File = source; SourceContentCache = content; Filter = filter; Configuration = configuration; }
public bool IsApplicable(IResourceFilter filter) { if(filter is HostingEnvironmentFilter envFilter) { return ((envFilter.PlatformType & this.PlatformType) > 0) && ((envFilter.HostingEnvironmentType & this.HostingEnvironmentType) > 0); } return false; }
/// <summary> /// Determines whether the app resource is applicable after filtering. /// </summary> /// <param name="filter">App Resource Filter</param> /// <returns>True, if app resource passes the filter. False otherwise</returns> public bool IsApplicable(IResourceFilter filter) { if (filter is AppFilter appFilter) { return(((appFilter.AppType & this.AppType) > 0) && ((appFilter.PlatformType & this.PlatformType) > 0) && ((this.StackType == StackType.None) || (appFilter.StackType & this.StackType) > 0) && ((appFilter.StampType & this.StampType) > 0)); } return(false); }
/// <summary> /// Determines whether the current arm resource is applicable after filtering. /// </summary> /// <param name="filter">App Resource Filter</param> /// <returns>True, if app resource passes the filter. False otherwise</returns> public bool IsApplicable(IResourceFilter filter) { if (filter is ArmResourceFilter) { ArmResourceFilter armFilter = filter as ArmResourceFilter; return((string.Compare(armFilter.Provider, this.Provider, true) == 0) && (string.Compare(armFilter.ResourceTypeName, this.ResourceTypeName, true) == 0)); } else { return(false); } }
public static void AfterOnResourceExecuted( this DiagnosticListener diagnosticListener, ResourceExecutedContext resourceExecutedContext, IResourceFilter filter) { Debug.Assert(diagnosticListener != null); Debug.Assert(resourceExecutedContext != null); Debug.Assert(filter != null); // Inlinable fast-path check if diagnostic listener is enabled if (diagnosticListener.IsEnabled()) { AfterOnResourceExecutedImpl(diagnosticListener, resourceExecutedContext, filter); } }
private void InitializeAttributes() { if (_entryPointMethodInfo == null) { return; } _entryPointDefinitionAttribute = _entryPointMethodInfo.GetCustomAttribute <Definition>(); if (_entryPointDefinitionAttribute != null) { _entryPointDefinitionAttribute.SupportTopicList = _entryPointMethodInfo.GetCustomAttributes <SupportTopic>(); } _resourceFilter = _entryPointMethodInfo.GetCustomAttribute <ResourceFilterBase>(); }
public static void BeforeOnResourceExecuting( this DiagnosticListener diagnosticListener, ResourceExecutingContext resourceExecutingContext, IResourceFilter filter) { Debug.Assert(diagnosticListener != null); Debug.Assert(resourceExecutingContext != null); Debug.Assert(filter != null); // Inlinable fast-path check if Diagnositcs is enabled if (diagnosticListener.IsEnabled()) { BeforeOnResourceExecutingImpl(diagnosticListener, resourceExecutingContext, filter); } }
public static void AfterOnResourceExecuting( this DiagnosticSource diagnosticSource, ResourceExecutingContext resourceExecutingContext, IResourceFilter filter) { if (diagnosticSource.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnResourceExecuting")) { diagnosticSource.Write( "Microsoft.AspNetCore.Mvc.AfterOnResourceExecuting", new { actionDescriptor = resourceExecutingContext.ActionDescriptor, resourceExecutingContext = resourceExecutingContext, filter = filter }); } }
public ClientResourcesManager(IPresentationSource presenter, IResourceFilter resourceFilter, IResourceComparator resourceComparator) { _presenter = presenter; _resourceFilter = resourceFilter; _resourceComparator = resourceComparator; _trigger = new object[] { resourceFilter, resourceComparator }.OfType<IObservableResource>().Aggregate(Observable.Return(Unit.Default), (agg, next) => agg.Merge(next.Trigger)); ActiveResources.Add(_nullResource); PopulateResources(); Update(); }
public static void BeforeOnResourceExecuted( this DiagnosticSource diagnosticSource, ActionDescriptor actionDescriptor, ResourceExecutedContext resourceExecutedContext, IResourceFilter filter) { if (diagnosticSource.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnResourceExecuted")) { diagnosticSource.Write( "Microsoft.AspNetCore.Mvc.BeforeOnResourceExecuted", new { actionDescriptor = actionDescriptor, resourceExecutedContext = resourceExecutedContext, filter = filter }); } }
public static void AfterOnResourceExecuted( this DiagnosticSource diagnosticSource, ResourceExecutedContext resourceExecutedContext, IResourceFilter filter) { Debug.Assert(diagnosticSource != null); Debug.Assert(resourceExecutedContext != null); Debug.Assert(filter != null); if (diagnosticSource.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnResourceExecuted")) { diagnosticSource.Write( "Microsoft.AspNetCore.Mvc.AfterOnResourceExecuted", new { actionDescriptor = resourceExecutedContext.ActionDescriptor, resourceExecutedContext = resourceExecutedContext, filter = filter }); } }
public Dictionary <string, string> GetResourceParams(IResourceFilter gResourceFilter) { try { var resourceParams = new Dictionary <string, string>(); resourceParams.Add("ResourceType", gResourceFilter.ResourceType.ToString()); if (gResourceFilter.ResourceType.ToString() == "App") { var appFilter = JsonConvert.DeserializeObject <AppFilter>(JsonConvert.SerializeObject(gResourceFilter)); AppType appType = appFilter.AppType; var appTypesList = Enum.GetValues(typeof(AppType)).Cast <AppType>().Where(p => appType.HasFlag(p)).Select(x => Enum.GetName(typeof(AppType), x)); resourceParams.Add("AppType", String.Join(",", appTypesList)); PlatformType platformType = appFilter.PlatformType; var platformTypesList = Enum.GetValues(typeof(PlatformType)).Cast <PlatformType>().Where(p => platformType.HasFlag(p)).Select(x => Enum.GetName(typeof(PlatformType), x)); resourceParams.Add("PlatformType", String.Join(",", platformTypesList)); } return(resourceParams); } catch { return(new Dictionary <string, string>()); } }
public NotResourceFilter(IResourceFilter filter) { _filter = filter; }
public static GroupTemplateContext WithContext(this IResourceGroupTemplate groupTemplate, IResourceFilter excludeFilter) { return(new GroupTemplateContext(groupTemplate, excludeFilter)); }
internal GroupTemplateContext(IResourceGroupTemplate groupTemplate, IResourceFilter excludeFilter) { GroupTemplate = groupTemplate; _excludeFilter = excludeFilter; }
private static void AfterOnResourceExecutedImpl(DiagnosticListener diagnosticListener, ResourceExecutedContext resourceExecutedContext, IResourceFilter filter) { if (diagnosticListener.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnResourceExecuted")) { diagnosticListener.Write( "Microsoft.AspNetCore.Mvc.AfterOnResourceExecuted", new { actionDescriptor = resourceExecutedContext.ActionDescriptor, resourceExecutedContext = resourceExecutedContext, filter = filter }); } }
/// <summary> /// Determines whether the Azure Kubernetes Service resource is applicable after filtering. /// </summary> /// <param name="filter">Resource Filter</param> /// <returns>True, if resource passes the filter. False otherwise</returns> public bool IsApplicable(IResourceFilter filter) { return(filter is AzureKubernetesServiceFilter); }
public static IResourceFilter Not(IResourceFilter filter) { return new NotResourceFilter(filter); }
/// <summary> /// Determines whether the APIM resource is applicable after filtering. /// </summary> /// <param name="filter">Resource Filter</param> /// <returns>True, if resource passes the filter. False otherwise</returns> public bool IsApplicable(IResourceFilter filter) { return(filter is ApiManagementServiceFilter); }
public static GroupTemplateContext WithContext(this IResourceGroupTemplate groupTemplate, IResourceFilter excludeFilter) { return new GroupTemplateContext(groupTemplate, excludeFilter); }
public static IEnumerable <IResource> Where(this IEnumerable <IResource> resources, IResourceFilter filter) { return(resources.Where(filter.IsMatch)); }
public static IEnumerable <IResource> Exclude(this IEnumerable <IResource> resources, IResourceFilter excludeFilter) { return(resources.Where(ResourceFilters.Not(excludeFilter))); }
internal static bool Match(this IResourceFilter filter, Baseline resource) { return(filter.Match(resource.Name, null)); }
public static void BeforeOnResourceExecuted( this DiagnosticSource diagnosticSource, ResourceExecutedContext resourceExecutedContext, IResourceFilter filter) { Debug.Assert(diagnosticSource != null); Debug.Assert(resourceExecutedContext != null); Debug.Assert(filter != null); if (diagnosticSource.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnResourceExecuted")) { diagnosticSource.Write( "Microsoft.AspNetCore.Mvc.BeforeOnResourceExecuted", new { actionDescriptor = resourceExecutedContext.ActionDescriptor, resourceExecutedContext = resourceExecutedContext, filter = filter }); } }
public static void BeforeOnResourceExecuting( this DiagnosticSource diagnosticSource, ResourceExecutingContext resourceExecutingContext, IResourceFilter filter) { if (diagnosticSource.IsEnabled("Microsoft.AspNetCore.Mvc.BeforeOnResourceExecuting")) { diagnosticSource.Write( "Microsoft.AspNetCore.Mvc.BeforeOnResourceExecuting", new { actionDescriptor = resourceExecutingContext.ActionDescriptor, resourceExecutingContext = resourceExecutingContext, filter = filter }); } }
public static void AfterOnResourceExecuted( this DiagnosticSource diagnosticSource, ActionDescriptor actionDescriptor, ResourceExecutedContext resourceExecutedContext, IResourceFilter filter) { if (diagnosticSource.IsEnabled("Microsoft.AspNetCore.Mvc.AfterOnResourceExecuted")) { diagnosticSource.Write( "Microsoft.AspNetCore.Mvc.AfterOnResourceExecuted", new { actionDescriptor = actionDescriptor, resourceExecutedContext = resourceExecutedContext, filter = filter }); } }
public static IResourceFilter Not(IResourceFilter filter) { return(new NotResourceFilter(filter)); }
public void AddFilter(IResourceFilter filter) { _filters.Add(filter); }
/// <summary> /// Determines whether the App Service certificate resource is applicable after filtering. /// </summary> /// <param name="filter">Resource Filter</param> /// <returns>True, if resource passes the filter. False otherwise</returns> public bool IsApplicable(IResourceFilter filter) { return(filter is AppServiceCertificateFilter); }
private static void BeforeOnResourceExecutingImpl(DiagnosticListener diagnosticListener, ResourceExecutingContext resourceExecutingContext, IResourceFilter filter) { if (diagnosticListener.IsEnabled(Diagnostics.BeforeResourceFilterOnResourceExecutingEventData.EventName)) { diagnosticListener.Write( Diagnostics.BeforeResourceFilterOnResourceExecutingEventData.EventName, new BeforeResourceFilterOnResourceExecutingEventData( resourceExecutingContext.ActionDescriptor, resourceExecutingContext, filter )); } }
/// <summary> /// Determines whether the logic app resource is applicable after filtering. /// </summary> /// <param name="filter">Resource Filter</param> /// <returns>True, if resource passes the filter. False otherwise</returns> public bool IsApplicable(IResourceFilter filter) { return(filter is LogicAppFilter); }
private static void AfterOnResourceExecutedImpl(DiagnosticListener diagnosticListener, ResourceExecutedContext resourceExecutedContext, IResourceFilter filter) { if (diagnosticListener.IsEnabled(Diagnostics.AfterResourceFilterOnResourceExecutedEventData.EventName)) { diagnosticListener.Write( Diagnostics.AfterResourceFilterOnResourceExecutedEventData.EventName, new AfterResourceFilterOnResourceExecutedEventData( resourceExecutedContext.ActionDescriptor, resourceExecutedContext, filter )); } }
public static IEnumerable<IResource> Where(this IEnumerable<IResource> resources, IResourceFilter filter) { return resources.Where(filter.IsMatch); }
internal GetBaselinePipeline(PipelineContext pipeline, Source[] source, PipelineReader reader, PipelineWriter writer, IResourceFilter filter) : base(pipeline, source, reader, writer) { _Filter = filter; }
public static IEnumerable<IResource> Exclude(this IEnumerable<IResource> resources, IResourceFilter excludeFilter) { return resources.Where(ResourceFilters.Not(excludeFilter)); }
/// <summary> /// Determines whether the App Service domain resource is applicable after filtering. /// </summary> /// <param name="filter">Resource Filter</param> /// <returns>True, if resource passes the filter. False otherwise</returns> public bool IsApplicable(IResourceFilter filter) { return(filter is AppServiceDomainFilter); }