本文整理汇总了C#中MARC类的典型用法代码示例。如果您正苦于以下问题:C# MARC类的具体用法?C# MARC怎么用?C# MARC使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MARC类属于命名空间,在下文中一共展示了MARC类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: flc_MessageAvailable
static void flc_MessageAvailable(object sender, MARC.Everest.Connectors.UnsolicitedDataEventArgs e)
{
// Get a local copy of the connector that raised the event
var listenConnector = sender as FileListenConnector;
// Receive the message from the listen connector's stack
var receiveResult = listenConnector.Receive();
// If the result was processed successfully, then show it
if (receiveResult.Structure != null)
{
// Received structure should be cast as a clinical document for convenience
var cda = receiveResult.Structure as ClinicalDocument;
// Output the title of the CDA
Console.WriteLine("Got a CDA titled : {0}", cda.Title);
// If the CDA has a structured body then show the sub-sections
if (cda.Component != null && cda.Component.BodyChoice is StructuredBody)
foreach (var comp in (cda.Component.BodyChoice as StructuredBody).Component)
Console.WriteLine("\tSubSection {0}", comp.Section.Title);
}
Console.WriteLine("The following issues were detected:");
foreach (var dtl in receiveResult.Details)
Console.WriteLine("{0} @ {1}", dtl.Type, dtl.Message);
}
示例2: Graph
public virtual MARC.Everest.Connectors.ResultCode Graph(System.Xml.XmlWriter s, object o, MARC.Everest.Interfaces.IGraphable context, MARC.Everest.Formatters.XML.ITS1.XmlIts1FormatterGraphResult resultContext) {
MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Agent instance = o as MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Agent;;
MARC.Everest.Connectors.ResultCode retVal = MARC.Everest.Connectors.ResultCode.Accepted;
if(o == null) throw new System.ArgumentNullException("o");
if(instance == null) throw new System.ArgumentException(System.String.Format("Could not cast type '{0}' to 'MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Agent'!", o.GetType().FullName));
bool isInstanceNull = instance.NullFlavor != null;
if(instance.NullFlavor != null) this.Host.WriteNullFlavorUtil(s, instance.NullFlavor);
if(instance.ClassCode != null && !isInstanceNull) {
s.WriteAttributeString("classCode", MARC.Everest.Connectors.Util.ToWireFormat(instance.ClassCode));
}
if(instance.RealmCode != null && !isInstanceNull) {
if(!instance.RealmCode.IsEmpty)
retVal = Host.WriteElementUtil(s, "realmCode", (MARC.Everest.Interfaces.IGraphable)instance.RealmCode, typeof(MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>>), context, resultContext);
if(resultContext.Code != MARC.Everest.Connectors.ResultCode.Accepted) retVal = resultContext.Code;
}
if(instance.TypeId != null && !isInstanceNull) {
retVal = Host.WriteElementUtil(s, "typeId", (MARC.Everest.Interfaces.IGraphable)instance.TypeId, typeof(MARC.Everest.DataTypes.II), context, resultContext);
if(resultContext.Code != MARC.Everest.Connectors.ResultCode.Accepted) retVal = resultContext.Code;
}
if(instance.TemplateId != null && !isInstanceNull) {
if(!instance.TemplateId.IsEmpty)
retVal = Host.WriteElementUtil(s, "templateId", (MARC.Everest.Interfaces.IGraphable)instance.TemplateId, typeof(MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II>), context, resultContext);
if(resultContext.Code != MARC.Everest.Connectors.ResultCode.Accepted) retVal = resultContext.Code;
}
if(instance.RepresentedOrganization != null && !isInstanceNull) {
retVal = Host.WriteElementUtil(s, "representedOrganization", (MARC.Everest.Interfaces.IGraphable)instance.RepresentedOrganization, typeof(MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Organization), context, resultContext);
if(resultContext.Code != MARC.Everest.Connectors.ResultCode.Accepted) retVal = resultContext.Code;
}
return retVal;
}
示例3: Parse
public virtual object Parse(System.Xml.XmlReader s, System.Type useType, System.Type currentInteractionType, MARC.Everest.Formatters.XML.ITS1.XmlIts1FormatterParseResult resultContext) {
System.String nil = s.GetAttribute("nil", MARC.Everest.Formatters.XML.ITS1.XmlIts1Formatter.NS_XSI);
if(!System.String.IsNullOrEmpty(nil) && System.Convert.ToBoolean(nil)) return null;;
MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Agent instance = new MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Agent();;
if(s.NodeType != System.Xml.XmlNodeType.Element) throw new System.InvalidOperationException(System.String.Format("Expected node type of Element, actual node type is '{0}'", s.NodeType));
if(s.GetAttribute("classCode") != null){ if(!"AGNT".Equals(s.GetAttribute("classCode"))) resultContext.AddResultDetail(new MARC.Everest.Connectors.FixedValueMisMatchedResultDetail(s.GetAttribute("classCode"), "AGNT", false, s.ToString())); instance.ClassCode = (MARC.Everest.DataTypes.CS<System.String>)MARC.Everest.Connectors.Util.FromWireFormat(s.GetAttribute("classCode"), typeof(MARC.Everest.DataTypes.CS<System.String>)); }
if(s.GetAttribute("nullFlavor") != null) instance.NullFlavor = (MARC.Everest.DataTypes.CS<MARC.Everest.DataTypes.NullFlavor>)MARC.Everest.Connectors.Util.FromWireFormat(s.GetAttribute("nullFlavor"), typeof(MARC.Everest.DataTypes.CS<MARC.Everest.DataTypes.NullFlavor>));
if(s.IsEmptyElement) return instance;
string sName = s.Name;
int sDepth = s.Depth;
s.Read();
while(!(s.NodeType == System.Xml.XmlNodeType.EndElement && s.Name == sName && s.Depth == sDepth)) {
string oldName = s.LocalName;
try { if(s.NodeType == System.Xml.XmlNodeType.Element) {
if(s.LocalName == "representedOrganization" ) {
object db1b9febfa2ff4d9c8a44c75c7799f8e1 = Host.ParseObject(s, typeof(MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Organization), currentInteractionType, resultContext); instance.RepresentedOrganization = db1b9febfa2ff4d9c8a44c75c7799f8e1 is MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Organization ? db1b9febfa2ff4d9c8a44c75c7799f8e1 as MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Organization : (MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Organization)MARC.Everest.Connectors.Util.FromWireFormat(db1b9febfa2ff4d9c8a44c75c7799f8e1, typeof(MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.Organization));
}
else if(s.LocalName == "realmCode" ) {
object d8a6a02dee5514777bfbbd1f6d49916f3 = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>>), currentInteractionType, resultContext); instance.RealmCode = d8a6a02dee5514777bfbbd1f6d49916f3 is MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>> ? d8a6a02dee5514777bfbbd1f6d49916f3 as MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>> : (MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>>)MARC.Everest.Connectors.Util.FromWireFormat(d8a6a02dee5514777bfbbd1f6d49916f3, typeof(MARC.Everest.DataTypes.SET<MARC.Everest.DataTypes.CS<System.String>>));
}
else if(s.LocalName == "typeId" ) {
object d1e93adf2ef0647dea657168fb827351e = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.II), currentInteractionType, resultContext); instance.TypeId = d1e93adf2ef0647dea657168fb827351e is MARC.Everest.DataTypes.II ? d1e93adf2ef0647dea657168fb827351e as MARC.Everest.DataTypes.II : (MARC.Everest.DataTypes.II)MARC.Everest.Connectors.Util.FromWireFormat(d1e93adf2ef0647dea657168fb827351e, typeof(MARC.Everest.DataTypes.II));
}
else if(s.LocalName == "templateId" ) {
object d6fcedf8ad81741bfb6425f42cbe2daf7 = Host.ParseObject(s, typeof(MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II>), currentInteractionType, resultContext); instance.TemplateId = d6fcedf8ad81741bfb6425f42cbe2daf7 is MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II> ? d6fcedf8ad81741bfb6425f42cbe2daf7 as MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II> : (MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II>)MARC.Everest.Connectors.Util.FromWireFormat(d6fcedf8ad81741bfb6425f42cbe2daf7, typeof(MARC.Everest.DataTypes.LIST<MARC.Everest.DataTypes.II>));
}
else { resultContext.AddResultDetail(new MARC.Everest.Connectors.NotImplementedElementResultDetail(MARC.Everest.Connectors.ResultDetailType.Warning, s.LocalName, s.NamespaceURI, s.ToString(), null)); }
}
}
catch (System.Exception e) { resultContext.AddResultDetail(new MARC.Everest.Connectors.ResultDetail(MARC.Everest.Connectors.ResultDetailType.Error, e.Message, s.ToString(), e)); }
finally { if(oldName.Equals(s.LocalName)) s.Read(); } }
return instance;
}
示例4: BeginSend
public IAsyncResult BeginSend(MARC.Everest.Interfaces.IGraphable data, IReceiveResult correlate, AsyncCallback callback, object state)
{
// Formatter check
if (!IsOpen())
throw new ConnectorException(ConnectorException.MSG_INVALID_STATE, ConnectorException.ReasonType.NotOpen);
// Setup wroker
Worker w = new Worker();
// Create a new instance of the formatter
w.Formatter = (IXmlStructureFormatter)Formatter;
var cresult = correlate as WcfReceiveResult;
w.MessageId = (correlate as WcfReceiveResult).MessageIdentifier;
w.MessageVersion = (correlate as WcfReceiveResult).MessageVersion;
w.InvalidResponse = InvalidResponse;
w.ResponseHeaders = cresult.ResponseHeaders;
// Set async result
IAsyncResult Result = new SendResultAsyncResult(state, new AutoResetEvent(false));
// Completed delegate
w.Completed += delegate(object Sender)
{
Worker sWorker = Sender as Worker; // Strong type sender
// Lookup the result in the dictionary
if (!asyncResults.ContainsKey(Result))
lock (asyncResults) { asyncResults.Add(Result, sWorker.SendResult); }
(Result as SendResultAsyncResult).SetComplete(); // Set completed
(Result.AsyncWaitHandle as AutoResetEvent).Set(); // send signal
if (callback != null) callback(Result); // callback
};
// Add to thread pool
ThreadPool.QueueUserWorkItem(new WaitCallback(w.WorkSend), data);
return Result;
}
示例5: Send
/// <summary>
/// Synchronous send operation
/// </summary>
/// <param name="data">The data to send</param>
/// <returns>The result of the send operation</returns>
public ISendResult Send(MARC.Everest.Interfaces.IGraphable data)
{
// Good practice to check if the connector is open
if (!IsOpen())
throw new ConnectorException(ConnectorException.MSG_INVALID_STATE, ConnectorException.ReasonType.NotOpen, null);
// Create a new worker
Worker w = new Worker();
// Always clone the current formatter
w.Formatter = (IStructureFormatter)Formatter.Clone();
// Perform the work
w.Work(data);
return w.Result;
}
示例6: Validate
public virtual bool Validate(MARC.Everest.Interfaces.IGraphable o, string location, out MARC.Everest.Connectors.IResultDetail[] outDetails) {
MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.AttentionLine instance = o as MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.AttentionLine;;
outDetails = new MARC.Everest.Connectors.IResultDetail[0]; System.Collections.Generic.List<MARC.Everest.Connectors.IResultDetail> details = new System.Collections.Generic.List<MARC.Everest.Connectors.IResultDetail>(10);;
bool isValid = true;;
if(instance == null && o != null) throw new System.NullReferenceException(System.String.Format("Could not cast type '{0}' to 'MARC.Everest.RMIM.UV.NE2008.MCCI_MT100200UV01.AttentionLine'!", o.GetType().FullName));if(instance == null || instance.NullFlavor != null) return true;;
outDetails = details.ToArray();;
return isValid;;
}
示例7: BeginSend
/// <summary>
/// Asynchronous send operation
/// </summary>
/// <param name="data">The data being sent</param>
/// <param name="callback">A callback to execute when the method is complete</param>
/// <param name="state">A user state</param>
/// <returns>An IAsyncResult representing the asynchronous operation</returns>
public IAsyncResult BeginSend(MARC.Everest.Interfaces.IGraphable data, AsyncCallback callback, object state)
{
// Good practice to check if the connector is open
if (!IsOpen())
throw new ConnectorException(ConnectorException.MSG_INVALID_STATE, ConnectorException.ReasonType.NotOpen, null);
// Create a new worker
Worker w = new Worker();
// Always clone the current formatter
w.Formatter = (IStructureFormatter)Formatter.Clone();
// Create the async result
IAsyncResult result = new SendResultAsyncResult(state, new AutoResetEvent(false));
// Set the callback
w.Completed += new WaitCallback(delegate(object sender)
{
Worker sWorker = sender as Worker;
// Set the result in the dictionary
lock (this.results)
this.results.Add(result, sWorker.Result);
// Notify any listeners
(result.AsyncWaitHandle as AutoResetEvent).Set();
if (callback != null) callback(result);
});
// Execute
ThreadPool.QueueUserWorkItem(w.Work, data);
return result;
}
示例8: Send
/// <summary>
/// Send a response back to the remote endpoint.
/// </summary>
/// <param name="data">The data to send back.</param>
/// <param name="correlate">The result to correlate this response with.</param>
/// <returns>A send result structure that details the result of the send operation.</returns>
public ISendResult Send(MARC.Everest.Interfaces.IGraphable data, IReceiveResult correlate)
{
if (!IsOpen())
throw new ConnectorException(ConnectorException.MSG_INVALID_STATE, ConnectorException.ReasonType.NotOpen);
Worker w = new Worker();
var cresult = correlate as WcfReceiveResult;
w.MessageId = cresult.MessageIdentifier;
w.MessageVersion = cresult.MessageVersion; // Prepare
w.Formatter = (IXmlStructureFormatter)Formatter;
w.ResponseHeaders = cresult.ResponseHeaders;
w.InvalidResponse = InvalidResponse;
w.WorkSend(data); // Work
// Publish so WCF connector can send a result
lock (results)
results.Add(w.MessageId, w.SendResult);
// Notify
PublishResult(w.MessageId);
// Return result
return w.SendResult;
}