public override void GenerateXaml(VexObject v, out string xamlFileName) { this.v = v; this.Log = new StringBuilder(); xamlFileName = Directory.GetCurrentDirectory() + "/" + v.Name + ".xaml"; xw = new XamlWriter(xamlFileName, Encoding.UTF8); xw.WriteComment(headerComment); #if(IS_TRIAL) // turn off watermarking for small files isWatermarking = true; xw.WriteComment(trialComment); if (v.Definitions.Count < 15) { isWatermarking = false; } #else isWatermarking = false; #endif xw.OpenHeaderTag(v.ViewPort.Size.Width, v.ViewPort.Size.Height, v.BackgroundColor); WriteDefinitions(v.Definitions, true, false); WriteTimelineDefiniton(v.Root, true); xw.CloseHeaderTag(); xw.Close(); }
public override void GenerateXamlPart(VexObject v, IDefinition def, out string resultFileName) { this.v = v; this.Log = new StringBuilder(); string baseFileName = Directory.GetCurrentDirectory() + "/" + v.Name + SILVERLIGHT_SUFFIX + "_" + def.Id; resultFileName = baseFileName + ".html"; string xamlFileName = baseFileName + ".xaml"; xw = new XamlWriter(xamlFileName, Encoding.UTF8); xw.WriteComment(headerComment); #if(IS_TRIAL) // turn off watermarking for small files isWatermarking = true; xw.WriteComment(trialComment); if (v.Definitions.Count < 15) { isWatermarking = false; } #else isWatermarking = false; #endif xw.OpenHeaderTag(def.StrokeBounds.Size.Width, def.StrokeBounds.Size.Height, v.BackgroundColor); Dictionary<uint, IDefinition> defList = new Dictionary<uint, IDefinition>(); defList.Add(1, def); AddImagesPart(defList, true); //WriteTimelineDefiniton(v.Root, true); // Write a rectangle to hold this shape Instance inst = new Instance(); inst.Name = instancePrefix + def.Id; inst.InstanceId = 1; inst.DefinitionId = def.Id; inst.Transformations.Add(new Transform(0, 1000, Matrix.Identitiy, 1, ColorTransform.Identity)); WriteInstance(def, inst, true); xw.CloseHeaderTag(); xw.Close(); WriteSilverlightHtml(v, resultFileName); }