1 type derived from Delegate
System.Private.CoreLib (1)
1598 references to Delegate
Aspire.Hosting.RemoteHost (8)
Aspire.Hosting.RemoteHost.Tests (6)
Aspire.TypeSystem (2)
CodeStyleConfigFileGenerator (2)
dotnet-svcutil-lib (2)
GenerateDocumentationAndConfigFiles (7)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
108where T : Delegate
ILCompiler.Compiler (3)
illink (2)
ILLink.RoslynAnalyzer (2)
Microsoft.AspNetCore.Components (10)
Microsoft.AspNetCore.Components.Endpoints (8)
Microsoft.AspNetCore.Components.Server (1)
Microsoft.AspNetCore.Hosting (1)
Microsoft.AspNetCore.Http.Abstractions (5)
Microsoft.AspNetCore.Http.Extensions (16)
RequestDelegateFactory.cs (12)
35/// Creates <see cref="RequestDelegate"/> implementations from <see cref="Delegate"/> request handlers.
135/// Returns metadata inferred automatically for the <see cref="RequestDelegate"/> created by <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/>.
138/// <param name="methodInfo">The <see cref="MethodInfo"/> for the route handler to be passed to <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/>.</param>
139/// <param name="options">The options that will be used when calling <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/>.</param>
140/// <returns>The <see cref="RequestDelegateMetadataResult"/> to be passed to <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/>.</returns>
159public static RequestDelegateResult Create(Delegate handler, RequestDelegateFactoryOptions? options)
171/// If <see langword="null"/>, this call to <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/> method will infer the metadata that
172/// <see cref="InferMetadata(MethodInfo, RequestDelegateFactoryOptions?)"/> would have inferred for the same <see cref="Delegate.Method"/> and populate <see cref="RequestDelegateFactoryOptions.EndpointBuilder"/>
177public static RequestDelegateResult Create(Delegate handler, RequestDelegateFactoryOptions? options = null, RequestDelegateMetadataResult? metadataResult = null)
223/// If <see langword="null"/>, this call to <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/> method will infer the metadata that
224/// <see cref="InferMetadata(MethodInfo, RequestDelegateFactoryOptions?)"/> would have inferred for the same <see cref="Delegate.Method"/> and populate <see cref="RequestDelegateFactoryOptions.EndpointBuilder"/>
266private static RequestDelegateFactoryContext CreateFactoryContext(RequestDelegateFactoryOptions? options, RequestDelegateMetadataResult? metadataResult = null, Delegate? handler = null)
Microsoft.AspNetCore.Identity (14)
Microsoft.AspNetCore.Mvc.Core (5)
Microsoft.AspNetCore.Razor.Utilities.Shared (4)
Microsoft.AspNetCore.Routing (30)
RouteEndpointDataSource.cs (5)
37Func<Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult?, RequestDelegateResult> createHandlerRequestDelegateFunc,
61Delegate routeHandler,
65Func<Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult?, RequestDelegateResult> createHandlerRequestDelegateFunc,
342public required Delegate RouteHandler { get; init; }
348public required Func<Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult?, RequestDelegateResult> CreateHandlerRequestDelegateFunc { get; init; }
Microsoft.AspNetCore.Routing.Abstractions (4)
Microsoft.Build (6)
Microsoft.Build.Framework (2)
Microsoft.Build.Tasks.CodeAnalysis (3)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
108where T : Delegate
Microsoft.Build.Tasks.Core (2)
Microsoft.CodeAnalysis (8)
Microsoft.CodeAnalysis.Analyzers (7)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
108where T : Delegate
Microsoft.CodeAnalysis.AnalyzerUtilities (7)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
108where T : Delegate
Microsoft.CodeAnalysis.CodeStyle (7)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
108where T : Delegate
Microsoft.CodeAnalysis.Extensions.Package (6)
Microsoft.CodeAnalysis.Razor.Compiler (7)
Microsoft.CodeAnalysis.ResxSourceGenerator (7)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
108where T : Delegate
Microsoft.CodeAnalysis.Workspaces (7)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
108where T : Delegate
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (2)
Microsoft.CSharp (12)
Microsoft.Data.Analysis (19)
Microsoft.DotNet.HotReload.WebAssembly.Browser (1)
Microsoft.Extensions.AI.Abstractions (4)
Microsoft.Extensions.AI.Abstractions.Tests (6)
Microsoft.Extensions.AI.Tests (1)
Microsoft.Extensions.DotNetDeltaApplier (2)
Microsoft.Maui (14)
Microsoft.Maui.Controls (3)
Microsoft.ML.Core (15)
Utilities\ThreadUtils.cs (8)
35private static readonly Queue<(Delegate, object, TaskCompletionSource<bool>)> _queue = new Queue<(Delegate, object, TaskCompletionSource<bool>)>();
45public static Task QueueAsync(Action threadStart) => QueueAsync((Delegate)threadStart, null);
53public static Task QueueAsync(Action<object> threadStart, object state) => QueueAsync((Delegate)threadStart, state);
55private static Task QueueAsync(Delegate threadStart, object state)
76while (TryDequeue(out (Delegate action, object state, TaskCompletionSource<bool> tcs) item))
99static void Enqueue((Delegate, object, TaskCompletionSource<bool>) item)
123static bool TryDequeue(out (Delegate action, object state, TaskCompletionSource<bool> tcs) item)
Microsoft.ML.Data (409)
Data\Conversion.cs (33)
51private static readonly FuncInstanceMethodInfo1<Conversions, KeyDataViewType, Delegate> _getKeyParseMethodInfo
52= FuncInstanceMethodInfo1<Conversions, KeyDataViewType, Delegate>.Create(target => target.GetKeyParse<int>);
78private readonly Dictionary<(Type src, Type dst), Delegate> _delegatesStd;
82private readonly Dictionary<(Type src, Type dst), Delegate> _delegatesAll;
85private readonly Dictionary<Type, Delegate> _isNADelegates;
88private readonly Dictionary<Type, Delegate> _hasNADelegates;
91private readonly Dictionary<Type, Delegate> _isDefaultDelegates;
95private readonly Dictionary<Type, Delegate> _hasZeroDelegates;
98private readonly Dictionary<Type, Delegate> _getNADelegates;
101private readonly Dictionary<Type, Delegate> _tryParseDelegates;
105_delegatesStd = new Dictionary<(Type src, Type dst), Delegate>();
106_delegatesAll = new Dictionary<(Type src, Type dst), Delegate>();
107_isNADelegates = new Dictionary<Type, Delegate>();
108_hasNADelegates = new Dictionary<Type, Delegate>();
109_isDefaultDelegates = new Dictionary<Type, Delegate>();
110_hasZeroDelegates = new Dictionary<Type, Delegate>();
111_getNADelegates = new Dictionary<Type, Delegate>();
112_tryParseDelegates = new Dictionary<Type, Delegate>();
389Delegate del;
403public Delegate GetStandardConversion(DataViewType typeSrc, DataViewType typeDst)
406Delegate conv;
417out Delegate conv, out bool identity)
503Delegate del;
574private Delegate GetKeyParse(KeyDataViewType key)
606if (!_delegatesStd.TryGetValue(delegatesKey, out Delegate del))
627Delegate del;
647Delegate del;
659public bool TryGetIsNAPredicate(DataViewType type, out Delegate del)
687Delegate del;
710Delegate del;
728Delegate del;
740Delegate isDefPred;
758Delegate del;
Data\RowCursorUtils.cs (10)
19private static readonly FuncStaticMethodInfo1<DataViewRow, int, Delegate> _getGetterAsDelegateCoreMethodInfo
20= new FuncStaticMethodInfo1<DataViewRow, int, Delegate>(GetGetterAsDelegateCore<int>);
33public static Delegate GetGetterAsDelegate(DataViewRow row, int col)
42private static Delegate GetGetterAsDelegateCore<TValue>(DataViewRow row, int col)
53public static Delegate GetGetterAs(DataViewType typeDst, DataViewRow row, int col)
66return (Delegate)methodInfo.Invoke(null, new object[] { typeSrc, typeDst, row, col });
101return (ValueGetter<TDst>)(Delegate)getter;
153public static Delegate GetVecGetterAs(PrimitiveDataViewType typeDst, DataViewRow row, int col)
165return (Delegate)methodInfo.Invoke(null, new object[] { typeSrc, typeDst, GetterFactory.Create(row, col) });
267return (ValueGetter<VBuffer<TDst>>)(Delegate)getter;
DataView\DataViewConstructionUtils.cs (49)
153private static Delegate[] MakePeeks(InternalSchemaDefinition schemaDef)
155var peeks = new Delegate[schemaDef.Columns.Length];
195private static readonly FuncInstanceMethodInfo1<InputRowBase<TRow>, Delegate, Delegate> _createDirectArrayGetterDelegateMethodInfo
196= FuncInstanceMethodInfo1<InputRowBase<TRow>, Delegate, Delegate>.Create(target => target.CreateDirectArrayGetterDelegate<int>);
198private static readonly FuncInstanceMethodInfo1<InputRowBase<TRow>, Delegate, Delegate> _createDirectVBufferGetterDelegateMethodInfo
199= FuncInstanceMethodInfo1<InputRowBase<TRow>, Delegate, Delegate>.Create(target => target.CreateDirectVBufferGetterDelegate<int>);
201private static readonly FuncInstanceMethodInfo1<InputRowBase<TRow>, Delegate, Delegate> _createDirectGetterDelegateMethodInfo
202= FuncInstanceMethodInfo1<InputRowBase<TRow>, Delegate, Delegate>.Create(target => target.CreateDirectGetterDelegate<int>);
204private static readonly FuncInstanceMethodInfo1<InputRowBase<TRow>, Delegate, DataViewType, Delegate> _createKeyGetterDelegateMethodInfo
205= FuncInstanceMethodInfo1<InputRowBase<TRow>, Delegate, DataViewType, Delegate>.Create(target => target.CreateKeyGetterDelegate<int>);
208private readonly Delegate[] _getters;
215public InputRowBase(IHostEnvironment env, DataViewSchema schema, InternalSchemaDefinition schemaDef, Delegate[] peeks, Func<int, bool> predicate)
228_getters = new Delegate[_colCount];
234private Delegate CreateGetter(DataViewType colType, InternalSchemaDefinition.Column column, Delegate peek)
238FuncInstanceMethodInfo1<InputRowBase<TRow>, Delegate, Delegate> del;
308private Delegate CreateConvertingArrayGetterDelegate<TSrc, TDst>(Delegate peekDel, Func<TSrc, TDst> convert)
324private Delegate CreateConvertingGetterDelegate<TSrc, TDst>(Delegate peekDel, Func<TSrc, TDst> convert)
336private Delegate CreateDirectArrayGetterDelegate<TDst>(Delegate peekDel)
352private Delegate CreateDirectVBufferGetterDelegate<TDst>(Delegate peekDel)
367private Delegate CreateDirectGetterDelegate<TDst>(Delegate peekDel)
375private Delegate CreateKeyGetterDelegate<TDst>(Delegate peekDel, DataViewType colType)
433var getter = _getters[column.Index];
456private readonly Delegate[] _peeks;
472_peeks = new Delegate[n];
840internal abstract Delegate GetGetterDelegate();
857private static readonly FuncInstanceMethodInfo1<AnnotationInfo<T>, Delegate> _getArrayGetterMethodInfo
858= FuncInstanceMethodInfo1<AnnotationInfo<T>, Delegate>.Create(target => target.GetArrayGetter<int>);
860private static readonly FuncInstanceMethodInfo1<AnnotationInfo<T>, Delegate> _getGetterCoreMethodInfo
861= FuncInstanceMethodInfo1<AnnotationInfo<T>, Delegate>.Create(target => target.GetGetterCore<int>);
863private static readonly FuncInstanceMethodInfo1<AnnotationInfo<T>, Delegate> _getVBufferGetterMethodInfo
864= FuncInstanceMethodInfo1<AnnotationInfo<T>, Delegate>.Create(target => target.GetVBufferGetter<int>);
969private Delegate GetGetterCore<TDst>()
974internal override Delegate GetGetterDelegate()
DataView\TypedCursor.cs (17)
83private readonly Delegate[] _pokes;
88private readonly Delegate[] _peeks;
126_pokes = new Delegate[n];
127_peeks = new Delegate[n];
356private Action<TRow> GenerateSetter(DataViewRow input, int index, InternalSchemaDefinition.Column column, Delegate poke, Delegate peek)
361Func<DataViewRow, int, Delegate, Delegate, Action<TRow>> del;
424private Action<TRow> CreateConvertingVBufferSetter<TSrc, TDst>(DataViewRow input, int col, Delegate poke, Delegate peek, Func<TSrc, TDst> convert)
446private Action<TRow> CreateDirectVBufferSetter<TDst>(DataViewRow input, int col, Delegate poke, Delegate peek)
484private static Action<TRow> CreateConvertingActionSetter<TSrc, TDst>(DataViewRow input, int col, Delegate poke, Func<TSrc, TDst> convert)
498private static Action<TRow> CreateDirectSetter<TDst>(DataViewRow input, int col, Delegate poke, Delegate peek)
513private Action<TRow> CreateVBufferToVBufferSetter<TDst>(DataViewRow input, int col, Delegate poke, Delegate peek)
Scorers\FeatureContributionCalculation.cs (6)
94private static readonly FuncInstanceMethodInfo1<BindableMapper, DataViewRow, int, Delegate> _getValueGetterMethodInfo
95= FuncInstanceMethodInfo1<BindableMapper, DataViewRow, int, Delegate>.Create(target => target.GetValueGetter<int>);
191public Delegate GetTextContributionGetter(DataViewRow input, int colSrc, VBuffer<ReadOnlyMemory<char>> slotNames)
199return (Delegate)meth.Invoke(this, new object[] { input, colSrc, slotNames });
202public Delegate GetContributionGetter(DataViewRow input, int colSrc)
369var getters = new Delegate[totalColumnsCount];
Scorers\MulticlassClassificationScorer.cs (9)
70private static readonly FuncInstanceMethodInfo1<LabelNameBindableMapper, object, Delegate> _decodeInitMethodInfo
71= FuncInstanceMethodInfo1<LabelNameBindableMapper, object, Delegate>.Create(target => target.DecodeInit<int>);
83private readonly Delegate _getter;
107private LabelNameBindableMapper(IHostEnvironment env, ISchemaBoundMapper mapper, VectorDataViewType type, Delegate getter,
113private LabelNameBindableMapper(IHostEnvironment env, ISchemaBindableMapper bindable, VectorDataViewType type, Delegate getter,
150private Delegate DecodeInit<T>(object value)
238internal static ISchemaBoundMapper CreateBound<T>(IHostEnvironment env, ISchemaBoundRowMapper mapper, VectorDataViewType type, Delegate getter,
562protected override Delegate GetPredictedLabelGetter(DataViewRow output, out Delegate scoreGetter)
Scorers\RowToRowScorerBase.cs (9)
22private static readonly FuncStaticMethodInfo1<DataViewRow, int, Delegate> _getGetterFromRowMethodInfo
23= new FuncStaticMethodInfo1<DataViewRow, int, Delegate>(GetGetterFromRow<int>);
165protected override Delegate[] CreateGetters(DataViewRow input, IEnumerable<DataViewSchema.Column> activeColumns, out Action disp)
188protected abstract Delegate[] GetGetters(DataViewRow output, Func<int, bool> predicate);
190protected static Delegate[] GetGettersFromRow(DataViewRow row, Func<int, bool> predicate)
195var getters = new Delegate[row.Schema.Count];
204protected static Delegate GetGetterFromRow(DataViewRow row, int col)
232private readonly Delegate[] _getters;
299var getter = _getters[index];
Scorers\SchemaBindablePredictorWrapper.cs (7)
37private static readonly FuncInstanceMethodInfo2<SchemaBindablePredictorWrapperBase, DataViewRow, int, Delegate> _getValueGetterMethodInfo
38= FuncInstanceMethodInfo2<SchemaBindablePredictorWrapperBase, DataViewRow, int, Delegate>.Create(target => target.GetValueGetter<int, int>);
157protected virtual Delegate GetPredictionGetter(DataViewRow input, int colSrc)
240var getters = new Delegate[1];
553private Delegate[] CreateGetters(DataViewRow input, bool[] active)
558var getters = new Delegate[2];
698protected override Delegate GetPredictionGetter(DataViewRow input, int colSrc)
Transforms\ColumnConcatenatingTransformer.cs (8)
524private static readonly FuncInstanceMethodInfo1<BoundColumn, DataViewRow, Delegate> _makeIdentityGetterMethodInfo
525= FuncInstanceMethodInfo1<BoundColumn, DataViewRow, Delegate>.Create(target => target.MakeIdentityGetter<int>);
527private static readonly FuncInstanceMethodInfo1<BoundColumn, DataViewRow, Delegate> _makeGetterMethodInfo
528= FuncInstanceMethodInfo1<BoundColumn, DataViewRow, Delegate>.Create(target => target.MakeGetter<int>);
675public Delegate MakeGetter(DataViewRow input)
683private Delegate MakeIdentityGetter<T>(DataViewRow input)
689private Delegate MakeGetter<T>(DataViewRow input)
875protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Transforms\FeatureContributionCalculationTransformer.cs (4)
167private static readonly FuncInstanceMethodInfo1<Mapper, DataViewRow, int, Delegate> _getValueGetterMethodInfo
168= FuncInstanceMethodInfo1<Mapper, DataViewRow, int, Delegate>.Create(target => target.GetValueGetter<int>);
203protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> active, out Action disposer)
213private Delegate GetValueGetter<TSrc>(DataViewRow input, int colSrc)
Transforms\Hashing.cs (8)
237var dstGetter = GetGetterCore(srcCursor, iinfo, out disposer);
261private Delegate GetGetterCore(DataViewRow input, int iinfo, out Action disposer)
1354protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer) => _parent.GetGetterCore(input, iinfo, out disposer);
1508public static InvertHashHelper Create(DataViewRow row, HashingEstimator.ColumnOptions ex, int invertHashMaxCount, Delegate dstGetter)
1519var consTypes = new Type[] { typeof(DataViewRow), typeof(HashingEstimator.ColumnOptions), typeof(int), typeof(Delegate) };
1629public ImplOne(DataViewRow row, HashingEstimator.ColumnOptions ex, int invertHashMaxCount, Delegate dstGetter)
1663public ImplVec(DataViewRow row, HashingEstimator.ColumnOptions ex, int invertHashMaxCount, Delegate dstGetter)
1697public ImplVecOrdered(DataViewRow row, HashingEstimator.ColumnOptions ex, int invertHashMaxCount, Delegate dstGetter)
Transforms\RowShufflingTransformer.cs (12)
372public static ShufflePipe Create(int bufferSize, DataViewType type, Delegate getter)
387Interlocked.CompareExchange(ref _pipeConstructorTypes, new Type[] { typeof(int), typeof(Delegate) }, null);
400public ImplVec(int bufferSize, Delegate getter)
413public ImplOne(int bufferSize, Delegate getter)
430public ShufflePipe(int bufferSize, Delegate getter)
457private static readonly FuncInstanceMethodInfo1<Cursor, int, Delegate> _createGetterDelegateMethodInfo
458= FuncInstanceMethodInfo1<Cursor, int, Delegate>.Create(target => target.CreateGetterDelegate<int>);
475private readonly Delegate[] _getters;
524_getters = new Delegate[numActive];
676private Delegate CreateGetterDelegate(int col)
683private Delegate CreateGetterDelegate<TValue>(int col)
717var originGetter = _getters[_colToActivesIndex[column.Index]];
Transforms\SlotsDroppingTransformer.cs (13)
448private static readonly FuncInstanceMethodInfo1<Mapper, Delegate> _makeOneTrivialGetterMethodInfo
449= FuncInstanceMethodInfo1<Mapper, Delegate>.Create(target => target.MakeOneTrivialGetter<int>);
451private static readonly FuncInstanceMethodInfo1<Mapper, Delegate> _makeVecTrivialGetterMethodInfo
452= FuncInstanceMethodInfo1<Mapper, Delegate>.Create(target => target.MakeVecTrivialGetter<int>);
454private static readonly FuncInstanceMethodInfo1<Mapper, DataViewRow, int, Delegate> _makeVecGetterMethodInfo
455= FuncInstanceMethodInfo1<Mapper, DataViewRow, int, Delegate>.Create(target => target.MakeVecGetter<int>);
457private static readonly FuncInstanceMethodInfo1<Mapper, DataViewRow, int, Delegate> _getSrcGetterMethodInfo
458= FuncInstanceMethodInfo1<Mapper, DataViewRow, int, Delegate>.Create(target => target.GetSrcGetter<int>);
719protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
738private Delegate MakeOneTrivialGetter(DataViewRow input, int iinfo)
759private Delegate MakeVecTrivialGetter(DataViewRow input, int iinfo)
780private Delegate MakeVecGetter(DataViewRow input, int iinfo)
816private Delegate GetSrcGetter(DataViewType typeDst, DataViewRow row, int iinfo)
Transforms\TransformBase.cs (13)
189protected abstract Delegate[] CreateGetters(DataViewRow input, IEnumerable<DataViewSchema.Column> activeColumns, out Action disp);
196private readonly Delegate[] _getters;
203public RowImpl(DataViewRow input, RowToRowMapperTransformBase parent, DataViewSchema schema, Delegate[] getters, Action disposer)
232var originFn = _getters[index];
478private static readonly FuncInstanceMethodInfo1<OneToOneTransformBase, DataViewRow, int, Delegate> _getSrcGetterMethodInfo
479= FuncInstanceMethodInfo1<OneToOneTransformBase, DataViewRow, int, Delegate>.Create(target => target.GetSrcGetter<int>);
692protected abstract Delegate GetGetterCore(IChannel ch, DataViewRow input, int iinfo, out Action disposer);
703protected Delegate GetSrcGetter(DataViewType typeDst, DataViewRow row, int iinfo)
818protected override Delegate[] CreateGetters(DataViewRow input, IEnumerable<DataViewSchema.Column> activeColumns, out Action disposer)
828var getters = new Delegate[_bindings.InfoCount];
849private readonly Delegate[] _getters;
861_getters = new Delegate[parent.Infos.Length];
906var originFn = _getters[index];
Transforms\TypeConverting.cs (3)
424if (!Data.Conversion.Conversions.DefaultInstance.TryGetStandardConversion(srcType.GetItemType(), itemType, out Delegate del, out bool identity))
467protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
632if (!Data.Conversion.Conversions.DefaultInstance.TryGetStandardConversion(col.ItemType, newType, out Delegate del, out bool identity))
Transforms\ValueToKeyMappingTransformer.cs (4)
704private static readonly FuncInstanceMethodInfo1<Mapper, DataViewRow, int, Delegate> _makeGetterMethodInfo
705= FuncInstanceMethodInfo1<Mapper, DataViewRow, int, Delegate>.Create(target => target.MakeGetter<int>);
756protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
765private Delegate MakeGetter<T>(DataViewRow row, int src) => _termMap[src].GetMappingGetter(row);
Utils\ApiUtils.cs (14)
22private static readonly FuncStaticMethodInfo3<FieldInfo, OpCode, Delegate> _generatePeekFieldMethodInfo
23= new FuncStaticMethodInfo3<FieldInfo, OpCode, Delegate>(GeneratePeek<int, int, int>);
25private static readonly FuncStaticMethodInfo3<PropertyInfo, OpCode, Delegate> _generatePeekPropertyMethodInfo
26= new FuncStaticMethodInfo3<PropertyInfo, OpCode, Delegate>(GeneratePeek<int, int, int>);
28private static readonly FuncStaticMethodInfo3<FieldInfo, OpCode, Delegate> _generatePokeFieldMethodInfo
29= new FuncStaticMethodInfo3<FieldInfo, OpCode, Delegate>(GeneratePoke<int, int, int>);
31private static readonly FuncStaticMethodInfo3<PropertyInfo, Delegate> _generatePokePropertyMethodInfo
32= new FuncStaticMethodInfo3<PropertyInfo, Delegate>(GeneratePoke<int, int, int>);
68internal static Delegate GeneratePeek<TOwn, TRow>(InternalSchemaDefinition.Column column)
89private static Delegate GeneratePeek<TOwn, TRow, TValue>(FieldInfo fieldInfo, OpCode assignmentOpCode)
109private static Delegate GeneratePeek<TOwn, TRow, TValue>(PropertyInfo propertyInfo, OpCode assignmentOpCode)
136internal static Delegate GeneratePoke<TOwn, TRow>(InternalSchemaDefinition.Column column)
156private static Delegate GeneratePoke<TOwn, TRow, TValue>(FieldInfo fieldInfo, OpCode assignmentOpCode)
174private static Delegate GeneratePoke<TOwn, TRow, TValue>(PropertyInfo propertyInfo)
Microsoft.ML.DataView (12)
DataViewSchema.cs (10)
178private readonly Delegate[] _getters;
185public static Annotations Empty { get; } = new Annotations(new DataViewSchema(new Column[0]), new Delegate[0]);
193internal Annotations(DataViewSchema schema, Delegate[] getters)
202var getter = getters[i];
211private void CheckGetter<TValue>(Delegate getter)
247internal Delegate GetGetterInternal(int index)
258private readonly List<(string Name, DataViewType Type, Delegate Getter, Annotations Annotations)> _items;
262_items = new List<(string Name, DataViewType Type, Delegate Getter, Annotations Annotations)>();
318public void Add(string name, DataViewType type, Delegate getter, Annotations annotations = null)
361private void AddDelegate<TValue>(string name, DataViewType type, Delegate getter, Annotations annotations)
Microsoft.ML.Ensemble (7)
Microsoft.ML.FastTree (6)
Microsoft.ML.ImageAnalytics (7)
ImageLoader.cs (3)
206protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
216private Delegate MakeGetterImageDataViewType(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
263private Delegate MakeGetterVectorDataViewByteType(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
Microsoft.ML.KMeansClustering (1)
Microsoft.ML.Mkl.Components (1)
Microsoft.ML.OnnxTransformer (7)
Microsoft.ML.Parquet (21)
PartitionedFileLoader.cs (17)
367private static readonly FuncInstanceMethodInfo1<Cursor, int, Delegate> _createSubGetterDelegateCoreMethodInfo
368= FuncInstanceMethodInfo1<Cursor, int, Delegate>.Create(target => target.CreateSubGetterDelegateCore<int>);
370private static readonly FuncInstanceMethodInfo1<Cursor, int, DataViewType, Delegate> _createGetterDelegateCoreMethodInfo
371= FuncInstanceMethodInfo1<Cursor, int, DataViewType, Delegate>.Create(target => target.CreateGetterDelegateCore<int>);
377private readonly Delegate[] _getters;
378private readonly Delegate[] _subGetters; // Cached getters of the sub-cursor.
403_subGetters = new Delegate[SubColumnCount];
424var originGetter = _getters[column.Index];
575private Delegate[] CreateGetters()
577Delegate[] getters = new Delegate[Schema.Count];
602private Delegate CreateSubGetterDelegateCore<TValue>(int col)
604return (Delegate)SubGetterDelegateCore<TValue>(col);
619private Delegate CreateGetterDelegateCore<TValue>(int col, DataViewType type)
621return (Delegate)GetterDelegateCore<TValue>(col, type);
681private Delegate MarshalGetter(Func<DataViewSchema.Column, ValueGetter<DataViewSchema.Column>> func, Type type, DataViewSchema.Column column)
687return (Delegate)typedMeth.Invoke(func.Target, new object[] { column });
Microsoft.ML.PCA (2)
Microsoft.ML.PerformanceTests (2)
Microsoft.ML.Recommender (2)
Microsoft.ML.Samples (2)
Microsoft.ML.StandardTrainers (12)
Microsoft.ML.TensorFlow (5)
TensorflowTransform.cs (5)
641private Delegate CreateGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, OutputCache outputCache)
653public override Delegate[] CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer)
660var result = new Delegate[n];
698protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
701private Delegate MakeGetter<T>(DataViewRow input, int iinfo, ITensorValueGetter[] srcTensorGetters, string[] activeOutputColNames, OutputCache outputCache) where T : unmanaged
Microsoft.ML.Tests (3)
Microsoft.ML.TimeSeries (20)
Microsoft.ML.TorchSharp (49)
AutoFormerV2\ObjectDetectionTrainer.cs (15)
517private static readonly FuncStaticMethodInfo1<object, Delegate> _decodeInitMethodInfo
518= new FuncStaticMethodInfo1<object, Delegate>(DecodeInit<int>);
701var labelGetter = Microsoft.ML.Internal.Utilities.Utils.MarshalInvoke(_decodeInitMethodInfo, vecType.ItemType.RawType, value);
714private static Delegate DecodeInit<T>(object value)
726private static readonly FuncInstanceMethodInfo1<ObjDetMapper, DataViewSchema.DetachedColumn, Delegate> _makeLabelAnnotationGetter
727= FuncInstanceMethodInfo1<ObjDetMapper, DataViewSchema.DetachedColumn, Delegate>.Create(target => target.GetLabelAnnotations<int>);
756var getter = Microsoft.ML.Internal.Utilities.Utils.MarshalInvoke(_makeLabelAnnotationGetter, this, keyType.ItemType.RawType, _parent.LabelColumn);
776private Delegate GetLabelAnnotations<T>(DataViewSchema.DetachedColumn labelCol)
790protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
793private Delegate CreateGetter(DataViewRow input, int iinfo, TensorCacher outputCacher)
804private Delegate MakeScoreGetter(DataViewRow input, IChannel ch, TensorCacher outputCacher)
828private Delegate MakePredictedLabelGetter(DataViewRow input, IChannel ch, TensorCacher outputCacher)
852private Delegate MakeBoundingBoxGetter(DataViewRow input, IChannel ch, TensorCacher outputCacher)
876public override Delegate[] CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer)
886var result = new Delegate[n];
NasBert\NasBertTrainer.cs (6)
495private static readonly FuncInstanceMethodInfo1<NasBertMapper, DataViewSchema.DetachedColumn, Delegate> _makeLabelAnnotationGetter
496= FuncInstanceMethodInfo1<NasBertMapper, DataViewSchema.DetachedColumn, Delegate>.Create(target => target.GetLabelAnnotations<int>);
521var getter = Microsoft.ML.Internal.Utilities.Utils.MarshalInvoke(_makeLabelAnnotationGetter, this, keyType.ItemType.RawType, Parent.LabelColumn);
543var getter = Microsoft.ML.Internal.Utilities.Utils.MarshalInvoke(_makeLabelAnnotationGetter, this, keyType.ItemType.RawType, Parent.LabelColumn);
561private Delegate GetLabelAnnotations<T>(DataViewSchema.DetachedColumn labelCol)
566protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
NasBert\TextClassificationTrainer.cs (7)
180private static readonly FuncStaticMethodInfo1<object, Delegate> _decodeInitMethodInfo
181= new FuncStaticMethodInfo1<object, Delegate>(DecodeInit<int>);
284var labelGetter = Microsoft.ML.Internal.Utilities.Utils.MarshalInvoke(_decodeInitMethodInfo, vecType.ItemType.RawType, value);
294private static Delegate DecodeInit<T>(object value)
307private protected override Delegate CreateGetter(DataViewRow input, int iinfo, TensorCacher outputCacher)
316private Delegate MakeScoreGetter(DataViewRow input, IChannel ch, TensorCacher outputCacher)
347private Delegate MakePredictedLabelGetter(DataViewRow input, IChannel ch, TensorCacher outputCacher)
Roberta\QATrainer.cs (6)
761protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
764private Delegate CreateGetter(DataViewRow input, int iinfo, TensorCacher outputCacher)
773private Delegate MakeScoreGetter(DataViewRow input, IChannel ch, TensorCacher outputCacher)
800private Delegate MakePredictedAnswerGetter(DataViewRow input, IChannel ch, TensorCacher outputCacher)
827public override Delegate[] CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer)
837var result = new Delegate[n];
TorchSharpBaseTrainer.cs (7)
447private static readonly FuncInstanceMethodInfo1<TorchSharpBaseMapper, DataViewSchema.DetachedColumn, Delegate> _makeLabelAnnotationGetter
448= FuncInstanceMethodInfo1<TorchSharpBaseMapper, DataViewSchema.DetachedColumn, Delegate>.Create(target => target.GetLabelAnnotations<int>);
450private Delegate GetLabelAnnotations<T>(DataViewSchema.DetachedColumn labelCol)
485protected override Delegate MakeGetter(DataViewRow input, int iinfo, Func<int, bool> activeOutput, out Action disposer)
488private protected abstract Delegate CreateGetter(DataViewRow input, int iinfo, TensorCacher outputCacher);
490public override Delegate[] CreateGetters(DataViewRow input, Func<int, bool> activeOutput, out Action disposer)
500var result = new Delegate[n];
Microsoft.ML.Transforms (115)
Microsoft.ML.Vision (3)
Microsoft.NET.Sdk.Publish.Tasks (7)
Microsoft.TestPlatform.CoreUtilities (5)
Microsoft.VisualStudio.TestPlatform.Common (1)
Microsoft.Win32.SystemEvents (8)
MSBuild (2)
mscorlib (1)
netstandard (1)
NuGet.CommandLine.XPlat (1)
NuGet.PackageManagement (1)
PresentationBuildTasks (5)
PresentationCore (124)
System\Windows\EventHelper.cs (10)
23public static void AddHandler<T>(ref Tuple<T, Delegate[]> field, T value) where T : Delegate
27Tuple<T, Delegate[]> oldTuple = field;
28T combinedDelegate = (T)Delegate.Combine(oldTuple?.Item1, value);
29Tuple<T, Delegate[]> newTuple = combinedDelegate != null ? Tuple.Create(combinedDelegate, combinedDelegate.GetInvocationList()) : null;
40public static void RemoveHandler<T>(ref Tuple<T, Delegate[]> field, T value) where T : Delegate
44Tuple<T, Delegate[]> oldTuple = field;
45T delegateWithRemoval = (T)Delegate.Remove(oldTuple?.Item1, value);
46Tuple<T, Delegate[]> newTuple = delegateWithRemoval != null ? Tuple.Create(delegateWithRemoval, delegateWithRemoval.GetInvocationList()) : null;
PresentationFramework (90)
Roslyn.Diagnostics.Analyzers (7)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
108where T : Delegate
System.ComponentModel.Composition (8)
System.ComponentModel.Composition.Registration (1)
System.ComponentModel.Primitives (9)
System.ComponentModel.TypeConverter (14)
System.Composition.Convention (1)
System.Configuration.ConfigurationManager (1)
System.Data.Odbc (2)
System.Data.OleDb (2)
System.Linq.Expressions (23)
System.Management (4)
System.Net.HttpListener (1)
System.Private.CoreLib (164)
Internal\Reflection\Augments\ReflectionAugments.cs (7)
239public static Delegate CreateDelegate(Type type, object firstArgument, MethodInfo method, bool throwOnBindFailure)
245public static Delegate CreateDelegate(Type type, MethodInfo method, bool throwOnBindFailure)
257private static Delegate CreateDelegateWorker(Type type, object firstArgument, MethodInfo method, bool throwOnBindFailure, bool allowClosed)
273Delegate result = runtimeMethodInfo.CreateDelegateNoThrowOnBindFailure(runtimeDelegateTypeInfo, firstArgument, allowClosed);
285public static Delegate CreateDelegate(Type type, object target, string method, bool ignoreCase, bool throwOnBindFailure)
310public static Delegate CreateDelegate(Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.AllMethods)] Type target, string method, bool ignoreCase, bool throwOnBindFailure)
489public static MethodInfo GetDelegateMethod(Delegate del)
Internal\Runtime\Augments\RuntimeAugments.cs (3)
182public static Delegate CreateDelegate(RuntimeTypeHandle typeHandleForDelegate, IntPtr ldftnResult, object thisObject, bool isStatic, bool isOpen)
184return Delegate.CreateDelegate(typeHandleForDelegate.ToMethodTable(), ldftnResult, thisObject, isStatic: isStatic, isOpen: isOpen);
190public static IntPtr GetDelegateLdFtnResult(Delegate d, out RuntimeTypeHandle typeOfFirstParameterIfInstanceDelegate, out bool isOpenResolver)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Delegate.cs (30)
18public static Delegate? Combine(Delegate? a, Delegate? b)
26public static Delegate? Combine(params Delegate?[]? delegates) =>
27Combine((ReadOnlySpan<Delegate?>)delegates);
38public static Delegate? Combine(params ReadOnlySpan<Delegate?> delegates)
40Delegate? d = null;
55public static Delegate CreateDelegate(Type type, object? firstArgument, MethodInfo method) => CreateDelegate(type, firstArgument, method, throwOnBindFailure: true)!;
58public static Delegate CreateDelegate(Type type, MethodInfo method) => CreateDelegate(type, method, throwOnBindFailure: true)!;
62public static Delegate CreateDelegate(Type type, object target, string method) => CreateDelegate(type, target, method, ignoreCase: false, throwOnBindFailure: true)!;
64public static Delegate CreateDelegate(Type type, object target, string method, bool ignoreCase) => CreateDelegate(type, target, method, ignoreCase, throwOnBindFailure: true)!;
67public static Delegate CreateDelegate(Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.AllMethods)] Type target, string method) => CreateDelegate(type, target, method, ignoreCase: false, throwOnBindFailure: true)!;
68public static Delegate CreateDelegate(Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.AllMethods)] Type target, string method, bool ignoreCase) => CreateDelegate(type, target, method, ignoreCase, throwOnBindFailure: true)!;
96public static System.Delegate.InvocationListEnumerator<TDelegate> EnumerateInvocationList<TDelegate>(TDelegate? d) where TDelegate : System.Delegate
103public struct InvocationListEnumerator<TDelegate> where TDelegate : System.Delegate
144public System.Delegate.InvocationListEnumerator<TDelegate> GetEnumerator() => this;
158public static Delegate? Remove(Delegate? source, Delegate? value)
172public static Delegate? RemoveAll(Delegate? source, Delegate? value)
174Delegate? newDelegate;
187public static bool operator ==(Delegate? d1, Delegate? d2)
200public static bool operator !=(Delegate? d1, Delegate? d2)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (12)
125internal Delegate? m_action;
646internal Task(Delegate action, object? state, Task? parent, CancellationToken cancellationToken,
679internal void TaskConstructorCore(Delegate? action, object? state, CancellationToken cancellationToken,
1286Task? creatingTask, Delegate action, object? state, CancellationToken cancellationToken, TaskScheduler scheduler,
1826m_action is Delegate action)
7227internal virtual Delegate[]? GetDelegateContinuationsForDebugger()
7236private static Delegate[]? GetDelegatesFromContinuationObject(object? continuationObject)
7252Delegate[]? delegates = continuationTask.GetDelegateContinuationsForDebugger();
7266List<Delegate> result = new List<Delegate>();
7269Delegate[]? innerDelegates = GetDelegatesFromContinuationObject(obj);
7272foreach (Delegate del in innerDelegates)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (7)
15Task antecedent, Delegate action, object? state, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions) :
61Task antecedent, Delegate function, object? state, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions) :
107Task<TAntecedentResult> antecedent, Delegate action, object? state, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions) :
153Task<TAntecedentResult> antecedent, Delegate function, object? state, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions) :
255internal abstract Delegate[]? GetDelegateContinuationsForDebugger();
357internal override Delegate[]? GetDelegateContinuationsForDebugger() =>
824internal override Delegate[] GetDelegateContinuationsForDebugger()
System\Delegate.cs (32)
56public Wrapper(Delegate value) => Value = value;
57public Delegate Value;
362public static Delegate CreateDelegate(Type type, object? firstArgument, MethodInfo method, bool throwOnBindFailure) => ReflectionAugments.CreateDelegate(type, firstArgument, method, throwOnBindFailure);
365public static Delegate CreateDelegate(Type type, MethodInfo method, bool throwOnBindFailure) => ReflectionAugments.CreateDelegate(type, method, throwOnBindFailure);
369public static Delegate CreateDelegate(Type type, object target, string method, bool ignoreCase, bool throwOnBindFailure) => ReflectionAugments.CreateDelegate(type, target, method, ignoreCase, throwOnBindFailure);
372public static Delegate CreateDelegate(Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.AllMethods)] Type target, string method, bool ignoreCase, bool throwOnBindFailure) => ReflectionAugments.CreateDelegate(type, target, method, ignoreCase, throwOnBindFailure);
385internal static unsafe Delegate CreateObjectArrayDelegate(Type t, Func<object?[], object?> handler)
395Delegate del = (Delegate)(RuntimeImports.RhNewObject(delegateEEType));
397IntPtr objArrayThunk = del.GetThunk(Delegate.ObjectArrayThunk);
415internal static unsafe Delegate CreateDelegate(MethodTable* delegateEEType, IntPtr ldftnResult, object thisObject, bool isStatic, bool isOpen)
419Delegate del = (Delegate)RuntimeImports.RhNewObject(delegateEEType);
428IntPtr thunk = del.GetThunk(Delegate.OpenStaticThunk);
433IntPtr thunk = del.GetThunk(Delegate.ClosedStaticThunk);
441IntPtr thunk = del.GetThunk(Delegate.OpenInstanceThunk);
452private unsafe Delegate NewMulticastDelegate(Wrapper[] invocationList, int invocationCount, bool thisIsMultiCastAlready = false)
455Delegate result = Unsafe.As<Delegate>(RuntimeImports.RhNewObject(this.GetMethodTable()));
467private static bool TrySetSlot(Wrapper[] a, int index, Delegate o)
474if (a[index].Value is Delegate dd)
489protected virtual Delegate CombineImpl(Delegate? d)
607protected virtual Delegate? RemoveImpl(Delegate d)
676public virtual Delegate[] GetInvocationList()
684var del = new Delegate[invocationCount];
690return new Delegate[] { this };
703Debug.Assert(obj is Delegate, "Shouldn't have failed here since we already checked the types are the same!");
704var d = Unsafe.As<Delegate>(obj);
780internal Delegate? TryGetAt(int index)
System\Reflection\Runtime\MethodInfos\RuntimeMethodInfo.cs (6)
58public sealed override Delegate CreateDelegate(Type delegateType)
64public sealed override Delegate CreateDelegate(Type delegateType, object target)
69private Delegate CreateDelegateWorker(Type delegateType, object target, bool allowClosed)
81Delegate result = CreateDelegateNoThrowOnBindFailure(runtimeDelegateTypeInfo, target, allowClosed);
308internal Delegate CreateDelegateNoThrowOnBindFailure(RuntimeTypeInfo runtimeDelegateType, object target, bool allowClosed)
398internal Delegate CreateDelegateWithoutSignatureValidation(Type delegateType, object target, bool isStatic, bool isOpen)
System.Private.DataContractSerialization (3)
System.Private.Reflection.Execution (5)
System.Private.Windows.Core.TestUtilities (2)
System.Private.Xml (2)
System.Reflection.Context (6)
System.Reflection.MetadataLoadContext (4)
System.Runtime (1)
System.Runtime.InteropServices (2)
System.Runtime.Serialization.Formatters (2)
System.Security.Cryptography (1)
System.ServiceModel.Primitives (1)
System.ServiceModel.Syndication (2)
System.Speech (4)
System.Text.Json (20)
System.Threading.Tasks.Dataflow (5)
System.Transactions.Local (6)
System.Windows.Controls.Ribbon (6)
System.Windows.Forms (36)
System.Windows.Forms.Design (11)
System.Windows.Forms.Primitives (1)
System.Xaml (13)
System\Xaml\Runtime\DynamicMethodRuntime.cs (6)
40private delegate Delegate DelegateCreator(Type delegateType, object target, string methodName);
181protected override Delegate CreateDelegate(Type delegateType, object target, string methodName)
295typeof(Delegate), typeof(Type), typeof(object), typeof(string));
303Emit_CastTo(ilGenerator, typeof(Delegate));
312typeof(Delegate), typeof(Type), typeof(object), typeof(string));
318MethodInfo method = typeof(Delegate).GetMethod(KnownStrings.CreateDelegate,
UIAutomationClient (16)
MS\Internal\Automation\ClientEventManager.cs (7)
41internal static void AddFocusListener(Delegate eventCallback, EventListener l)
48internal static void RemoveFocusListener(Delegate eventCallback)
55internal static void AddListener(AutomationElement rawEl, Delegate eventCallback, EventListener l)
149internal static void RemoveListener( AutomationEvent eventId, AutomationElement el, Delegate eventCallback )
467private static void AddRootListener(Tracker idx, Delegate eventCallback, EventListener l)
493private static void RemoveRootListener(AutomationEvent eventId, Tracker idx, Delegate eventCallback)
513private static void RemoveWinEventListener(Tracker idx, Delegate eventCallback)