本文整理汇总了C#中IDocumentAccessor类的典型用法代码示例。如果您正苦于以下问题:C# IDocumentAccessor类的具体用法?C# IDocumentAccessor怎么用?C# IDocumentAccessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDocumentAccessor类属于命名空间,在下文中一共展示了IDocumentAccessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialise
public void Initialise(XElement xElement, IDocumentAccessor accessor)
{
xElement = Persistence.ThisOrSingleChild(XName, xElement);
var identity = Persistence.Identity.Parse(xElement, accessor);
SetIdentity(identity);
var xComponentType = xElement
.Elements("ComponentType")
.SingleOrDefault();
ComponentType.Initialise(xComponentType, accessor);
var xEngineType = xElement
.Elements("EngineType")
.SingleOrDefault();
EngineType.Initialise(xEngineType, accessor);
UseNativeEngine = Utilities.Xml.GetAttribute(xElement, "useNativeEngine", false);
Arguments = Persistence.Arguments
.Parse(xElement, accessor)
.ToList();
Inputs = Persistence.Inputs
.Parse(xElement, accessor)
.ToList();
Outputs = Persistence.Outputs
.Parse(xElement, accessor)
.ToList();
}
示例2: Initialise
public void Initialise(XElement xElement, IDocumentAccessor accessor)
{
xElement = Persistence.ThisOrSingleChild(XName, xElement);
ISpatialDefinition spatial;
bool hasZ, hasM;
ElementType = Persistence.ElementSet.Parse(xElement, accessor, out spatial, out hasZ, out hasM);
SetSpatial(spatial);
HasZ = hasZ;
HasM = hasM;
string relative = xElement.Value;
var uri = new Uri(accessor.Uri, relative);
var selafin = new FileInfo(uri.LocalPath);
Selafin = new Selafin(selafin);
var argIdSelafin = Utilities.Xml.GetAttribute(xElement, "argIdSelafin");
Arguments = new IArgument[] {
new ArgumentFile(new Identity(argIdSelafin, "Selafin file"), selafin),
}.ToList();
Initialise();
}
示例3: Persist
public XElement Persist(IDocumentAccessor accessor)
{
return new XElement(Component.NamespaceOpenMIv2 + "Argument",
new XAttribute("Key", Key),
new XAttribute("Value", Value),
new XAttribute("ReadOnly", ReadOnly));
}
示例4: Indent
public void Indent(IDocumentAccessor document, bool keepEmptyLines)
{
if (document == null)
{
throw new ArgumentNullException("document");
}
}
示例5: Reformat
public void Reformat(IDocumentAccessor doc, IndentationSettings settings)
{
Init();
while (doc.MoveNext())
Step(doc, settings);
}
示例6: Persist
public override XElement Persist(IDocumentAccessor accessor)
{
return new XElement("Category",
new XAttribute("type", _value.GetType().ToString()),
new XAttribute("value", _value.ToString()),
base.Persist(accessor));
}
示例7: Category
public Category(XElement xElement, IDocumentAccessor accessor)
: base(xElement.Elements("Describes").Single(), accessor)
{
Utilities.Xml.ValidElement(xElement, "Category");
Type type = Type.GetType(Utilities.Xml.GetAttribute(xElement, "type"));
_value = Convert.ChangeType(Utilities.Xml.GetAttribute(xElement, "value"), type);
}
示例8: Initialise
public void Initialise(XElement xElement, IDocumentAccessor accessor)
{
Contract.Requires(xElement != null, "xElement != null");
Key = Utilities.Xml.GetAttribute(xElement, "Key");
Value = Utilities.Xml.GetAttribute(xElement, "Value");
ReadOnly = Utilities.Xml.GetAttribute(xElement, "ReadOnly", false);
}
示例9: Initialise
public override void Initialise(string initialisingXml, IDocumentAccessor accessor)
{
base.Initialise(initialisingXml, accessor);
_caption = ArgumentCaption;
_timeDelta = (double)Argument(SimpleComponent.GetArgumentIdentity(
SimpleComponent.ConsumerArgs.TimeDelta)).Value;
}
示例10: Initialise
/// <summary>
/// Simple implementation of interface FluidEarth2.Sdk.Interfaces.IEngine::Initialise()
///
/// Overide if specific additional functionality required.
/// </summary>
/// <param name="initialisingXml">See FluidEarth2.Sdk.BaseEngine</param>
/// <param name="accessor">See FluidEarth2.Sdk.BaseEngine</param>
public override void Initialise(string initialisingXml, IDocumentAccessor accessor)
{
base.Initialise(initialisingXml, accessor);
_horizon = new Time(ArgumentTimeHorizon);
_timeCurrent = _horizon.StampAsModifiedJulianDay;
if (double.IsNegativeInfinity(_timeCurrent))
throw new Exception("Time horizon start is unbounded");
}
示例11: Indent
/// <summary>
/// Performs indentation using the specified document accessor.
/// </summary>
/// <param name="document">Object used for accessing the document line-by-line</param>
/// <param name="keepEmptyLines">Specifies whether empty lines should be kept</param>
public void Indent(IDocumentAccessor document, bool keepEmptyLines)
{
if (document == null)
throw new ArgumentNullException("document");
IndentationSettings settings = new IndentationSettings();
settings.IndentString = this.IndentationString;
settings.LeaveEmptyLines = keepEmptyLines;
IndentationReformatter r = new IndentationReformatter();
r.Reformat(document, settings);
}
示例12: Initialise
public virtual void Initialise(XElement xElement, IDocumentAccessor accessor)
{
xElement = Persistence.ThisOrSingleChild(XName, xElement);
ISpatialDefinition spatial;
bool hasZ, hasM;
ElementType = Persistence.ElementSet.Parse(xElement, accessor, out spatial, out hasZ, out hasM);
SetSpatial(spatial);
HasZ = hasZ;
HasM = hasM;
}
示例13: Initialise
public override void Initialise(XElement xElement, IDocumentAccessor accessor)
{
xElement = Persistence.ThisOrSingleChild(XName, xElement);
base.Initialise(xElement, accessor);
IndexMap = xElement
.Elements("Indexes")
.Select(x => Persistence.Values<int>.Parse(x, accessor))
.ToArray();
}
示例14: Initialise
public void Initialise(XElement xElement, IDocumentAccessor accessor)
{
xElement = Persistence.ThisOrSingleChild(XName, xElement);
Identity = Persistence.Identity.Parse(xElement, accessor);
ValueDefinition = Persistence.ValueDefinition.Parse(xElement, accessor);
SpatialDefinition = Persistence.SpatialDefinition.Parse(xElement, accessor);
TimeSet = Persistence.TimeSet.Parse(xElement, accessor);
Component = null;
Provider = null;
}
示例15: Indent
/// <summary>
/// Performs indentation using the specified document accessor.
/// </summary>
/// <param name="document">Object used for accessing the document line-by-line</param>
/// <param name="indentationString">The string used for indentation.</param>
/// <param name="keepEmptyLines">Specifies whether empty lines should be kept</param>
private void Indent(IDocumentAccessor document, string indentationString, bool keepEmptyLines)
{
if (document == null)
throw new ArgumentNullException(nameof(document));
IndentationSettings settings = new IndentationSettings();
settings.IndentString = indentationString;
settings.LeaveEmptyLines = keepEmptyLines;
CSharpIndentationReformatter r = new CSharpIndentationReformatter();
r.Reformat(document, settings);
}