/// <summary> /// Call this method to obtain the Base64 encoded string that /// represent this instance of CallSite;s trace data /// </summary> /// <returns>Returns the Base64 encoded string that represents the /// trace data of this callsite /// </returns> /// public string GetTraceDataToSave() { //Test to see if there is any actual data in the trace cache if (!this.traceData.Any(srtd => srtd.HasAnyNestedData)) return null; TraceSerialiserHelper helper = new TraceSerialiserHelper(); helper.TraceData = this.traceData; using (MemoryStream memoryStream = new MemoryStream()) { IFormatter formatter = new SoapFormatter(); formatter.Serialize(memoryStream, helper); return Convert.ToBase64String(memoryStream.ToArray()); } }
/* /// <summary> /// This function handles generating a unique callsite ID and serializing the data associated with this callsite /// </summary> /// <param name="data"></param> private Object SimulateGetData() { // Get the data for this callite (Simulate unique data) Object callsiteData = ProtoCore.TLSUtils.GetTLSData(); return callsiteData; } */ /// <summary> /// Call this method to obtain the Base64 encoded string that /// represent this instance of CallSite;s trace data /// </summary> /// <returns>Returns the Base64 encoded string that represents the /// trace data of this callsite /// </returns> /// public string GetTraceDataToSave() { TraceSerialiserHelper helper = new TraceSerialiserHelper(); helper.TraceData = this.traceData; using (MemoryStream memoryStream = new MemoryStream()) { IFormatter formatter = new SoapFormatter(); formatter.Serialize(memoryStream, helper); return Convert.ToBase64String(memoryStream.ToArray()); } }