예제 #1
0
 private static IEnumerable <object> GetCTSTypedArguments(ArgsTuple argTuple)
 {
     foreach (var tok in GetArguments(argTuple))
     {
         yield return(GetCTSTypedValue(tok));
     }
 }
예제 #2
0
        private static ArgsTuple MakeArgs(ref TokenReader reader)
        {
            System.Diagnostics.Debug.WriteLine("MakeArgs");
            var ret = new ArgsTuple()
            {
                ArgBody    = MakeArgBody(ref reader),
                ArgConcatr = MakeArgConcatr(ref reader)
            };

            AssertNextAny(ref reader, false, Token.TokenType.CloseBracket,
                          Token.TokenType.ConcatenatorAnd, Token.TokenType.ConcatenatorOr);
            return(ret);
        }
예제 #3
0
        private static IEnumerable <Token> GetArguments(ArgsTuple argTuple)
        {
            if (argTuple == null || argTuple.ArgBody == null)
            {
                yield break;
            }
            yield return(argTuple.ArgBody.Arg);

            var conc = argTuple.ArgConcatr;

            while (conc.ArgBody != null)
            {
                yield return(conc.ArgBody.Arg);

                conc = conc.ArgConcatr;
            }
        }
        // TODO: Put strings into the resources.
        //
        public override IVh <IDependencyHandler2> GetDependencyHandler(object dependencyScopeCtx = null)
        {
            this.EnsurePermanentReadOnly();
            EnsureValidated();
            //
            // TODO: В зависимости от DependencyId необходимо выбирать наиболее подходящего исполнителя на основе XInstance-контракта.
            //
            var dependencyScopeContextAsIXInstance = dependencyScopeCtx as IXInstance;

            try {
                if (dependencyScopeContextAsIXInstance == null)
                {
                    return
                        (GetOrderedXInstanceContractHandlers(description: DependencyTargetDescription)
                         .First());
                }
                else
                {
                    var newInstanceFactoryArgs =
                        ArgsTuple
                        .Create(
                            arg1: dependencyScopeContextAsIXInstance,
                            arg2: DependencyTargetDescription);
                    return
                        (RequireSingleContractHandler(
                             description: DependencyTargetDescription,
                             canShareDependency: !IsDependencyTargetSharingDisabled,
                             newInstanceFactoryArgs: newInstanceFactoryArgs));
                }
            }
            catch (Exception firstException) {
                throw
                    new EonException(
                        message: $"Ошибка получения обработчика функциональной зависимости для указанной цели привязки (байндинга) зависимости.{Environment.NewLine}\tПривязка (байндинг):{this.FmtStr().GNLI2()}{Environment.NewLine}\tЦель привязки:{DependencyTargetDescription.FmtStr().GNLI2()}",
                        innerException: firstException);
            }
        }
예제 #5
0
 private static ArgsTuple MakeArgs(ref TokenReader reader)
 {
     System.Diagnostics.Debug.WriteLine("MakeArgs");
     var ret = new ArgsTuple()
     {
         ArgBody = MakeArgBody(ref reader),
         ArgConcatr = MakeArgConcatr(ref reader)
     };
     AssertNextAny(ref reader, false, Token.TokenType.CloseBracket,
         Token.TokenType.ConcatenatorAnd, Token.TokenType.ConcatenatorOr);
     return ret;
 }
예제 #6
0
 private static IEnumerable<object> GetCTSTypedArguments(ArgsTuple argTuple)
 {
     foreach (var tok in GetArguments(argTuple))
     {
         yield return GetCTSTypedValue(tok);
     }
 }
예제 #7
0
 private static IEnumerable<Token> GetArguments(ArgsTuple argTuple)
 {
     if (argTuple == null || argTuple.ArgBody == null) yield break;
     yield return argTuple.ArgBody.Arg;
     var conc = argTuple.ArgConcatr;
     while (conc.ArgBody != null)
     {
         yield return conc.ArgBody.Arg;
         conc = conc.ArgConcatr;
     }
 }