static int Position(object item, object sequence, object [] arguments) { KeywordArgument <bool> fromEnd = new KeywordArgument <bool> (KW.FromEnd); KeywordArgument <object> test = new KeywordArgument <object> (KW.Test); KeywordArgument <int> start = new KeywordArgument <int> (KW.Start); KeywordArgument <int> end = new KeywordArgument <int> (KW.End); KeywordArgument <object> key = new KeywordArgument <object> (KW.Key); KeywordArgumentBase.ProcessKeywordArguments( new KeywordArgumentBase [] { fromEnd, test, start, end, key }, arguments, false); return(Position(item, sequence, fromEnd.Supplied ? fromEnd.Value : false, test.Supplied ? ResolveFunctionSpecifier <EqualityTest> (test.Value) : new EqualityTest(CL.Eql), start.Supplied ? start.Value : 0, end.Supplied ? end.Value : CL.Length(sequence), key.Supplied ? ResolveFunctionSpecifier <Function1> (key.Value) : new Function1(CL.Identity))); }
static TItem Find <TItem, Tkey> (Tkey item, System.Collections.Generic.ICollection <TItem> sequence, object [] arguments) { KeywordArgument <bool> fromEnd = new KeywordArgument <bool> (KW.FromEnd); KeywordArgument <object> test = new KeywordArgument <object> (KW.Test); KeywordArgument <int> start = new KeywordArgument <int> (KW.Start); KeywordArgument <int> end = new KeywordArgument <int> (KW.End); KeywordArgument <object> key = new KeywordArgument <object> (KW.Key); KeywordArgumentBase.ProcessKeywordArguments( new KeywordArgumentBase [] { fromEnd, test, start, end, key }, arguments, false); if (!key.Supplied) { throw new NotImplementedException(); } return(Find <TItem, Tkey> (item, sequence, fromEnd.Supplied ? fromEnd.Value : false, test.Supplied ? ResolveFunctionSpecifier <EqualityTest <Tkey> > (test.Value) : new EqualityTest <Tkey> (CL.Eql <Tkey>), start.Supplied ? start.Value : 0, end.Supplied ? end.Value : CL.Length(sequence), ResolveFunctionSpecifier <Function1 <Tkey, TItem> > (key.Value))); }