Beispiel #1
0
        /// <nodoc />
        public void Serialize(BuildXLWriter writer)
        {
            var kind = Kind;

            Contract.Assert(kind != ResolvedEntryKind.ResolverCallback, "Resolver Callbacks are not serializable and therefore this module should not have been marked as cacheable.");

            writer.Write((byte)kind);
            writer.Write(m_thunkContextNameOrSymbolName);

            if (Thunk != null)
            {
                Thunk.Expression.Serialize(writer);
                Node.Serialize(Thunk.CapturedTemplateReference, writer);

                writer.Write(QualifierSpaceId);
                writer.Write(IsVariableDeclaration);
            }
            else
            {
                if (Function != null)
                {
                    Function.Serialize(writer);
                }
                else if (ConstantExpression != null)
                {
                    ConstExpressionSerializer.Write(writer, ConstantExpression);
                }
                else if (Expression != null)
                {
                    Expression.Serialize(writer);
                }
            }
        }
Beispiel #2
0
 /// <nodoc />
 public void Serialize(BuildXLWriter writer)
 {
     ConstExpressionSerializer.Write(writer, this);
 }