protected override void Write(CiBinaryResourceExpr expr) { Write("getBinaryResource("); WriteConst(expr.Resource.Name); Write(", "); Write(expr.Resource.Content.Length); Write(')'); }
protected override void Write(CiBinaryResourceExpr expr) { Write("new "); WriteName(expr.Resource); }
protected virtual void Write(CiBinaryResourceExpr expr) { WriteName(expr.Resource); }
CiExpr ICiExprVisitor.Visit(CiBinaryResourceExpr expr) { string name = (string) ResolveConstExpr(expr.NameExpr, CiStringPtrType.Value); CiBinaryResource resource; if (!this.BinaryResources.TryGetValue(name, out resource)) { resource = new CiBinaryResource(); resource.Name = name; resource.Content = File.ReadAllBytes(FindFile(name)); resource.Type = new CiArrayStorageType { ElementType = CiByteType.Value, Length = resource.Content.Length }; this.BinaryResources.Add(name, resource); } expr.Resource = resource; return expr; }