public CodeStatement[] GenerateForPropertyGet()
        {
            var exceptionCopyStatement = new CodeVariableDeclarationStatement(
                typeof(Exception), VariableNames.ExceptionCopy,
                new CodeVariableReferenceExpression(VariableNames.Exception));

            var aspectInvocationExpression = this.GenerateAspectInvocationForProperty(true);

            var throwCopyStatement = new CodeThrowExceptionStatement(
                new CodeVariableReferenceExpression(VariableNames.ExceptionCopy));
            var throwOriginalStatement = new CodeThrowExceptionStatement();

            var compareCopyExpression = new CodeBinaryOperatorExpression(
                new CodeVariableReferenceExpression(VariableNames.Exception),
                CodeBinaryOperatorType.IdentityEquality,
                new CodeVariableReferenceExpression(VariableNames.ExceptionCopy));

            var compareAndThrowStatement = new CodeConditionStatement(
                compareCopyExpression, new CodeStatement[] { throwOriginalStatement },
                new CodeStatement[] { throwCopyStatement });

            var aspectInvokeAndThrowStatement = new CodeConditionStatement(
                aspectInvocationExpression, compareAndThrowStatement);

            return(new CodeStatement[] { exceptionCopyStatement, aspectInvokeAndThrowStatement });
        }
Esempio n. 2
0
        public CodeThrowExceptionStatement throwEx(CodeExpression expression)
        {
            CodeThrowExceptionStatement stat = new CodeThrowExceptionStatement(expression);

            _enter(stat);
            return(stat);
        }
        public CodeThrowExceptionStatement Throw(CodeExpression expr)
        {
            CodeThrowExceptionStatement st = new CodeThrowExceptionStatement(expr);

            csc.Add(st);
            return(st);
        }
        public override void apply(CodeTypeDeclaration mock, Type target)
        {
            CodeTypeMemberCollection mockMethods = mock.Members;

            foreach (CodeTypeMember member in mockMethods)
            {
                if (member is CodeMemberMethod)
                {
                    CodeMemberMethod        method     = (CodeMemberMethod)member;
                    CodeStatementCollection statements = method.Statements;
                    if (statements.Count > 0)
                    {
                        CodeStatement lastStatement = statements[statements.Count - 1];
                        if (lastStatement is CodeMethodReturnStatement)
                        {
                            statements.Remove(lastStatement);
                        }
                    }
                    CodeTypeReference           typeToThrow      = new CodeTypeReference(typeof(System.NotSupportedException));
                    CodeObjectCreateExpression  createExpression = new CodeObjectCreateExpression(typeToThrow, new CodeExpression[] {});
                    CodeThrowExceptionStatement throwStatement   = new CodeThrowExceptionStatement(createExpression);
                    statements.Add(throwStatement);
                }
            }
        }
Esempio n. 5
0
 private void ValidateThrowExceptionStatement(CodeThrowExceptionStatement e)
 {
     if (e.ToThrow != null)
     {
         this.ValidateExpression(e.ToThrow);
     }
 }
        public CodeStatement[] GenerateForMethod()
        {
            var methodInfo = this.memberInfo as MethodInfo;

            if (methodInfo == null)
            {
                throw new InvalidOperationException();
            }

            var returnsValue = methodInfo.ReturnType != typeof(void);

            var exceptionCopyStatement = new CodeVariableDeclarationStatement(
                typeof(Exception), VariableNames.ExceptionCopy,
                new CodeVariableReferenceExpression(VariableNames.Exception));
            var aspectInvocationExpression = this.GenerateAspectInvocationForMethod(returnsValue);

            var throwCopyStatement = new CodeThrowExceptionStatement(
                new CodeVariableReferenceExpression(VariableNames.ExceptionCopy));
            var throwOriginalStatement = new CodeThrowExceptionStatement();

            var compareCopyExpression = new CodeBinaryOperatorExpression(
                new CodeVariableReferenceExpression(VariableNames.Exception),
                CodeBinaryOperatorType.IdentityEquality,
                new CodeVariableReferenceExpression(VariableNames.ExceptionCopy));

            var compareAndThrowStatement = new CodeConditionStatement(
                compareCopyExpression, new CodeStatement[] { throwOriginalStatement },
                new CodeStatement[] { throwCopyStatement });

            var aspectInvokeAndThrowStatement = new CodeConditionStatement(
                aspectInvocationExpression, compareAndThrowStatement);

            return(new CodeStatement[] { exceptionCopyStatement, aspectInvokeAndThrowStatement });
        }
        private static CodeThrowExceptionStatement GenerateThrowNotImplementedExceptionStatement()
        {
            CodeThrowExceptionStatement exceptionStatement = new CodeThrowExceptionStatement();

            exceptionStatement.ToThrow = new CodeObjectCreateExpression(typeof(NotImplementedException));
            return(exceptionStatement);
        }
        private CodeThrowExceptionStatement GenerateExceptionStatement(GenerateErrorActivity activity)
        {
            var parameters =
                AbstractActivityBuilder.GenerateParameters(
                    new List <string> {
                @"""Message : {0}\nMessage code : {1} """
            },
                    activity);

            var stringFormatCall = new CodeMethodInvokeExpression();

            stringFormatCall.Parameters.AddRange(parameters);

            var formatMethod = new CodeMethodReferenceExpression {
                MethodName = "Format"
            };
            var stringObject = new CodeVariableReferenceExpression {
                VariableName = "String"
            };

            formatMethod.TargetObject = stringObject;
            stringFormatCall.Method   = formatMethod;

            var throwException =
                new CodeThrowExceptionStatement(
                    new CodeObjectCreateExpression(new CodeTypeReference(typeof(System.Exception)), stringFormatCall));

            return(throwException);
        }
Esempio n. 9
0
        public void Constructor0_Deny_Unrestricted()
        {
            CodeThrowExceptionStatement ctes = new CodeThrowExceptionStatement();

            Assert.IsNull(ctes.ToThrow, "ToThrow");
            ctes.ToThrow = new CodeExpression();
        }
        CodeMemberMethod ImplementEnsureView()
        {
            CodeMemberMethod method = CreateMethod("__EnsureView", MethodAccessibility.Private, MethodScope.Final);

            // T __EnsureView <T> (Func<T> creator, ref T field) where T: class
            var typeParam = new CodeTypeParameter("T");

            typeParam.Constraints.Add(" class");              // Hack: CodeDOM doesn't support the "class" constraint
                                                              // and not passing the leading whitespace would result
                                                              // in @class being output in generated code
            method.TypeParameters.Add(typeParam);

            var tRef    = new CodeTypeReference(typeParam);
            var funcRef = new CodeTypeReference(typeof(Func <>), CodeTypeReferenceOptions.GlobalReference);

            funcRef.TypeArguments.Add(tRef);
            method.Parameters.Add(new CodeParameterDeclarationExpression(funcRef, "creator"));

            method.Parameters.Add(
                new CodeParameterDeclarationExpression(tRef, "field")
            {
                Direction = FieldDirection.Ref
            }
                );
            method.ReturnType = tRef;

            // if (field != null)
            //    return field;
            var fieldVarRef    = new CodeVariableReferenceExpression("field");
            var ifFieldNotNull = new CodeConditionStatement(
                new CodeBinaryOperatorExpression(fieldVarRef, CodeBinaryOperatorType.IdentityInequality, new CodePrimitiveExpression(null)),
                new [] { new CodeMethodReturnStatement(fieldVarRef) }
                );

            method.Statements.Add(ifFieldNotNull);

            // if (creator == null)
            //    throw new ArgumentNullException (nameof (creator));
            var creatorVarRef = new CodeVariableReferenceExpression("creator");
            var argNullEx     = new CodeThrowExceptionStatement(
                new CodeObjectCreateExpression(
                    new CodeTypeReference(typeof(ArgumentNullException), CodeTypeReferenceOptions.GlobalReference),
                    new [] { new CodeSnippetExpression("nameof (creator)") }
                    )
                );
            var ifCreatorNull = new CodeConditionStatement(
                new CodeBinaryOperatorExpression(creatorVarRef, CodeBinaryOperatorType.IdentityEquality, new CodePrimitiveExpression(null)),
                new [] { argNullEx }
                );

            method.Statements.Add(ifCreatorNull);

            // field = creator ();
            method.Statements.Add(new CodeAssignStatement(fieldVarRef, new CodeDelegateInvokeExpression(creatorVarRef)));

            // return field;
            method.Statements.Add(new CodeMethodReturnStatement(fieldVarRef));
            return(method);
        }
Esempio n. 11
0
 private static void PrintThrowExceptionStatement(TextWriter output, CodeThrowExceptionStatement statement)
 {
     output.Write("throw ");
     if (statement.ToThrow != null)
     {
         PrintExpression(output, statement.ToThrow);
     }
 }
Esempio n. 12
0
 public static void ReplaceType(this CodeThrowExceptionStatement statement, string oldType, string newType)
 {
     if (statement == null)
     {
         return;
     }
     statement.ToThrow.ReplaceType(oldType, newType);
 }
Esempio n. 13
0
        /// <summary>
        /// Inspects the specified code unit.
        /// </summary>
        /// <param name="unit">The code unit.</param>
        /// <param name="ns">The code namespace declaration.</param>
        /// <param name="type">The code type declaration.</param>
        /// <param name="executeMethod">The code method declaration for the Execute method.</param>
        public void Inspect(CodeCompileUnit unit, CodeNamespace ns, CodeTypeDeclaration type, CodeMemberMethod executeMethod)
        {
            var statement = new CodeThrowExceptionStatement(
                new CodeObjectCreateExpression(
                    new CodeTypeReference(typeof(System.InvalidOperationException)), new CodeExpression[] {}));

            executeMethod.Statements.Insert(0, statement);
        }
 private bool HandleDynamic(CodeThrowExceptionStatement obj, Context ctx)
 {
     return(HandleIfTrue(() =>
     {
         ctx.Writer.Write($"{ThrowKeyword} ");
         ctx.HandlerProvider.ExpressionHandler.Handle(obj.ToThrow, ctx);
     }, obj, ctx, !string.IsNullOrEmpty(ThrowKeyword)));
 }
Esempio n. 15
0
        // Generate a codedom throw statement
        public static CodeStatement Emit(Throw th)
        {
            var codeThrow = new CodeThrowExceptionStatement();

            codeThrow.ToThrow = CodeDomEmitter.EmitCodeExpression(th.ChildExpressions[0]);

            return(codeThrow);
        }
Esempio n. 16
0
        public void Constructor1_Deny_Unrestricted()
        {
            CodeExpression to_throw          = new CodeExpression();
            CodeThrowExceptionStatement ctes = new CodeThrowExceptionStatement(to_throw);

            Assert.AreSame(to_throw, ctes.ToThrow, "ToThrow");
            ctes.ToThrow = new CodeExpression();
        }
Esempio n. 17
0
        private static void GenerateConstructors(Type t, CodeTypeDeclaration codeType)
        {
            CodeFieldReferenceExpression omObjectFieldReference = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), OmObject);

            ConstructorInfo[]      constructors        = t.GetConstructors();
            ConstructorInfo        publicParameterless = null;
            ConstructorInfo        publicSystemParams  = null;
            ConstructorInfo        publicEnumParams    = null;
            List <ConstructorInfo> publicGeneralParams = new List <ConstructorInfo>();

            foreach (ConstructorInfo con in constructors.Where(c => c.IsPublic || c.IsStatic))
            {
                ParameterInfo[] parameters = con.GetParameters();
                if (parameters == null || parameters.Length == 0)
                {
                    publicParameterless = con;
                }
                else if (con.IsStatic)
                {
                }
                else
                {
                    publicGeneralParams.Add(con);
                }
            }

            if (publicParameterless != null)
            {
                CodeConstructor constructor = new CodeConstructor();
                constructor.Attributes = MemberAttributes.Public;
                CodeObjectCreateExpression createExpression = new CodeObjectCreateExpression(t);
                constructor.Statements.Add(new CodeAssignStatement(omObjectFieldReference, createExpression));
                codeType.Members.Add(constructor);
            }

            foreach (ConstructorInfo c in publicGeneralParams)
            {
                AddConstructorWithCopiedParameters(codeType, t, omObjectFieldReference, c);
            }

            // Default internal constructor that accepts the OM object to wrap
            CodeConstructor defaultConstructor = new CodeConstructor();

            defaultConstructor.Attributes = MemberAttributes.Assembly;
            CodeParameterDeclarationExpression omObjectParameter = new CodeParameterDeclarationExpression(t, OmObject);

            defaultConstructor.Parameters.Add(omObjectParameter);
            CodeArgumentReferenceExpression omObjectArgumentReference = new CodeArgumentReferenceExpression(OmObject);
            CodeObjectCreateExpression      createException           = new CodeObjectCreateExpression(typeof(ArgumentNullException), new CodePrimitiveExpression(OmObject));
            CodeThrowExceptionStatement     throwException            = new CodeThrowExceptionStatement(createException);
            CodeBinaryOperatorExpression    nullCheck = new CodeBinaryOperatorExpression(omObjectArgumentReference, CodeBinaryOperatorType.IdentityEquality, new CodePrimitiveExpression(null));

            // if the parameter is null, throw an exception
            defaultConstructor.Statements.Add(new CodeConditionStatement(nullCheck, throwException));

            defaultConstructor.Statements.Add(new CodeAssignStatement(omObjectFieldReference, omObjectArgumentReference));
            codeType.Members.Add(defaultConstructor);
        }
        public override object Visit(ThrowStatement throwStatement, object data)
        {
            CodeThrowExceptionStatement throwStmt = new CodeThrowExceptionStatement((CodeExpression)throwStatement.Expression.AcceptVisitor(this, data));

            // Add Statement to Current Statement Collection
            AddStmt(throwStmt);

            return(throwStmt);
        }
        public static CodeThrowExceptionStatement ThrowExceptionStatement(CodeExpression toThrow, CodeDirective[] startDirectives, CodeDirective[] endDirectives, CodeLinePragma linePragma)
        {
            var result = new CodeThrowExceptionStatement(toThrow);

            result.StartDirectives.AddRange(startDirectives);
            result.EndDirectives.AddRange(endDirectives);
            result.LinePragma = linePragma;
            return(result);
        }
Esempio n. 20
0
 public TypescriptThrowExceptionStatement(
     IExpressionFactory expressionFactory,
     CodeThrowExceptionStatement statement,
     CodeGeneratorOptions options)
 {
     _expressionFactory = expressionFactory;
     _statement         = statement;
     _options           = options;
 }
Esempio n. 21
0
 private void GenerateThrowExceptionStatement(CodeThrowExceptionStatement e)
 {
     output.Write("throw");
     if (e.ToThrow != null)
     {
         output.Write(" ");
         GenerateExpression(e.ToThrow);
     }
     output.WriteLine(";");
 }
Esempio n. 22
0
        private CodeThrowExceptionStatement CreateNotImplementedStatement()
        {
            CodeThrowExceptionStatement result =
                new CodeThrowExceptionStatement(
                    new CodeObjectCreateExpression(
                        new CodeTypeReference(typeof(System.NotImplementedException)),
                        new CodeExpression[] {}));

            return(result);
        }
Esempio n. 23
0
 protected override void GenerateThrowExceptionStatement(CodeThrowExceptionStatement statement)
 {
     Output.Write("raise");
     if (statement.ToThrow != null)
     {
         Output.Write(' ');
         GenerateExpression(statement.ToThrow);
     }
     Output.WriteLine();
 }
Esempio n. 24
0
        private static void ReplaceControlCreateStatement(Type ctrlType, CodeAssignStatement objAssignStatement, CodeStatementCollection statements)
        {
            /* Generate code like below
             *
             * IServiceProvider __activator = HttpRuntime.WebObjectActivator;
             *
             * if (activator != null) {
             *  _ctrl = (ctrlType)activator.GetService(ctrlType);
             * }
             *
             * // if default c-tor exists
             * else {
             *  _ctrl = new ....
             * }
             * // if no default c-tor
             * else {
             *  throw new InvalidOperationException(SR.GetString(SR.Could_not_create_type_instance, ctrlType))
             * }
             *
             */
            var webObjectActivatorExpr = new CodePropertyReferenceExpression(new CodeTypeReferenceExpression("System.Web.HttpRuntime"), "WebObjectActivator");
            var activatorRefExpr       = new CodeVariableReferenceExpression("__activator");

            var getServiceExpr        = new CodeMethodInvokeExpression(webObjectActivatorExpr, "GetService", new CodeTypeOfExpression(ctrlType));
            var castExpr              = new CodeCastExpression(new CodeTypeReference(ctrlType), getServiceExpr);
            var createObjectStatement = new CodeConditionStatement()
            {
                Condition = new CodeBinaryOperatorExpression(activatorRefExpr,
                                                             CodeBinaryOperatorType.IdentityInequality,
                                                             new CodePrimitiveExpression(null))
            };

            createObjectStatement.TrueStatements.Add(new CodeAssignStatement(objAssignStatement.Left, castExpr));

            // If default c-tor exists
            if (DoesTypeHaveDefaultCtor(ctrlType))
            {
                createObjectStatement.FalseStatements.Add(objAssignStatement);
            }
            else
            {
                var throwExceptionStatement = new CodeThrowExceptionStatement(new CodeObjectCreateExpression(
                                                                                  new CodeTypeReference(typeof(System.InvalidOperationException)),
                                                                                  new CodeExpression[] { new CodePrimitiveExpression(SR.GetString(SR.Could_not_create_type_instance, ctrlType)) }));
                createObjectStatement.FalseStatements.Add(throwExceptionStatement);
            }

            // replace the old assign statement
            var indexOfStatement = statements.IndexOf(objAssignStatement);

            statements.Insert(indexOfStatement, createObjectStatement);
            statements.Insert(indexOfStatement, new CodeAssignStatement(activatorRefExpr, webObjectActivatorExpr));
            statements.Insert(indexOfStatement, new CodeVariableDeclarationStatement(typeof(IServiceProvider), "__activator"));
            statements.Remove(objAssignStatement);
        }
Esempio n. 25
0
        private void Generate(CodeThrowExceptionStatement statement)
        {
            this.Write("throw ");

            if (statement.ToThrow != null)
            {
                this.Generate(statement.ToThrow);
            }

            this.WriteLine(";");
        }
        static bool WriteCodeThrowExceptionStatement(CodeThrowExceptionStatement throwExceptionStatement, TextWriter w, CodeGeneratorOptions o)
        {
            if (throwExceptionStatement == null)
            {
                return(false);
            }

            w.Write(o.IndentString + "throw ");
            GenerateCodeFromExpression(throwExceptionStatement.ToThrow, w, o);
            return(true);
        }
Esempio n. 27
0
        public void CodeThrowExceptionStatementTest()
        {
            CodeThrowExceptionStatement ctet = new CodeThrowExceptionStatement();

            statement = ctet;
            Assert.AreEqual(string.Format(CultureInfo.InvariantCulture,
                                          "Throw{0}", NewLine), Generate(), "#1");

            ctet.ToThrow = new CodeSnippetExpression("whatever");
            Assert.AreEqual(string.Format(CultureInfo.InvariantCulture,
                                          "Throw whatever{0}", NewLine), Generate(), "#2");
        }
Esempio n. 28
0
        /// <summary>
        /// body of public PropertyBufferPtr GetProperty(string bufferName, string varNameInShader)
        /// </summary>
        /// <param name="method"></param>
        private void GetPropertyBody(CodeMemberMethod method, DataStructure dataStructure)
        {
            foreach (var item in dataStructure.PropertyList)
            {
                // if (bufferName == position)
                var ifStatement = new CodeConditionStatement(
                    new CodeBinaryOperatorExpression(
                        new CodeVariableReferenceExpression(bufferName),
                        CodeBinaryOperatorType.IdentityEquality,
                        new CodeVariableReferenceExpression(item.NameInModel)));
                method.Statements.Add(ifStatement);
                // if (positionBufferPtr != null)
                var ifStatement2 = new CodeConditionStatement(
                    new CodeBinaryOperatorExpression(
                        new CodeVariableReferenceExpression(item.BufferPtrName),
                        CodeBinaryOperatorType.IdentityEquality,
                        new CodePrimitiveExpression(null)));
                ifStatement.TrueStatements.Add(ifStatement2);
                // using (var buffer = new PropertyBuffer<vec3>(varNameInShader))
                var usingBegin = new CodeSnippetStatement(string.Format("                    using(var buffer = new PropertyBuffer<{0}>({1}))", item.PropertyType, varNameInShader));
                ifStatement2.TrueStatements.Add(usingBegin);
                ifStatement2.TrueStatements.Add(new CodeSnippetStatement("                    {// begin of using"));
                var create = new CodeSnippetStatement("                        buffer.Create();");
                ifStatement2.TrueStatements.Add(create);
                // unsafe {
                ifStatement2.TrueStatements.Add(new CodeSnippetStatement("                        unsafe"));
                ifStatement2.TrueStatements.Add(new CodeSnippetStatement("                        {// begin of unsafe"));
                // var array = (vec3*)buffer.Header.ToPointer();
                ifStatement2.TrueStatements.Add(new CodeSnippetStatement(string.Format("                            var array = ({0}*)buffer.Header.ToPointer();", item.PropertyType)));
                // array[0] =  ...;;
                ifStatement2.TrueStatements.Add(new CodeSnippetStatement(string.Format("                            // TODO: set array's values: array[0] = ...;")));
                // }
                ifStatement2.TrueStatements.Add(new CodeSnippetStatement("                        }// end of unsafe"));
                ifStatement2.TrueStatements.Add(new CodeSnippetStatement(string.Format("                        {0} = buffer.GetBufferPtr() as PropertyBufferPtr;", item.BufferPtrName)));
                ifStatement2.TrueStatements.Add(new CodeSnippetStatement("                    }// end of using"));
                ifStatement.TrueStatements.Add(new CodeMethodReturnStatement(
                                                   new CodeVariableReferenceExpression(item.BufferPtrName)));
            }

            // throw new NotImplementedException();
            {
                // This CodeThrowExceptionStatement throws a new System.Exception.
                var throwException = new CodeThrowExceptionStatement(
                    // codeExpression parameter indicates the exception to throw.
                    // You must use an object create expression to new an exception here.
                    new CodeObjectCreateExpression(
                        // createType parameter inidicates the type of object to create.
                        new CodeTypeReference(typeof(System.ArgumentException)),
                        // parameters parameter indicates the constructor parameters.
                        new CodeExpression[] { new CodePrimitiveExpression(bufferName) }));
                method.Statements.Add(throwException);
            }
        }
Esempio n. 29
0
 protected override void GenerateThrowExceptionStatement
     (CodeThrowExceptionStatement e)
 {
     if (e.ToThrow != null)
     {
         Output.Write("throw ");
         GenerateExpression(e.ToThrow);
         Output.WriteLine(";");
     }
     else
     {
         Output.WriteLine("throw;");
     }
 }
Esempio n. 30
0
        public static CodeThrowExceptionStatement Clone(this CodeThrowExceptionStatement statement)
        {
            if (statement == null)
            {
                return(null);
            }
            CodeThrowExceptionStatement s = new CodeThrowExceptionStatement();

            s.EndDirectives.AddRange(statement.EndDirectives);
            s.LinePragma = statement.LinePragma;
            s.StartDirectives.AddRange(statement.StartDirectives);
            s.ToThrow = statement.ToThrow.Clone();
            s.UserData.AddRange(statement.UserData);
            return(s);
        }
Esempio n. 31
0
 private void GenerateThrowExceptionStatement(CodeThrowExceptionStatement e)
 {
     Output.Write("throw");
     if (e.ToThrow != null)
     {
         Output.Write(" ");
         GenerateExpression(e.ToThrow);
     }
     Output.WriteLine(";");
 }
Esempio n. 32
0
			public void Visit(CodeThrowExceptionStatement o)
			{
				g.GenerateThrowExceptionStatement(o);
			}
	protected override void GenerateThrowExceptionStatement
				(CodeThrowExceptionStatement e)
			{
				if(e.ToThrow != null)
				{
					Output.Write("throw ");
					GenerateExpression(e.ToThrow);
					Output.WriteLine(";");
				}
				else
				{
					Output.WriteLine("throw;");
				}
			}
	protected override void GenerateThrowExceptionStatement
				(CodeThrowExceptionStatement e)
			{
				CodeExpression expr = e.ToThrow;
				if(expr == null)
				{
					Output.WriteLine("Throw");
				}
				else
				{
					Output.Write("Throw ");
					GenerateExpression(expr);
					Output.WriteLine();
				}
			}
Esempio n. 35
0
 internal CodeThrowExceptionStatement Throw(CodeExpression codeExpression)
 {
     var t = new CodeThrowExceptionStatement(codeExpression);
     Scope.Add(t);
     return t;
 }
Esempio n. 36
0
 private void ValidateThrowExceptionStatement(CodeThrowExceptionStatement e)
 {
     if (e.ToThrow != null)
     {
         ValidateExpression(e.ToThrow);
     }
 }
Esempio n. 37
0
 protected abstract void GenerateThrowExceptionStatement(CodeThrowExceptionStatement e);
Esempio n. 38
0
 internal CodeThrowExceptionStatement Throw()
 {
     var t = new CodeThrowExceptionStatement();
     Scope.Add(t);
     return t;
 }