本文整理汇总了C#中DocumentObject类的典型用法代码示例。如果您正苦于以下问题:C# DocumentObject类的具体用法?C# DocumentObject怎么用?C# DocumentObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DocumentObject类属于命名空间,在下文中一共展示了DocumentObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetValue
/// <summary>
/// Gets the object specified by name from dom.
/// </summary>
public object GetValue(DocumentObject dom, string name, GV flags)
{
int dot = name.IndexOf('.');
if (dot == 0)
throw new ArgumentException(DomSR.InvalidValueName(name));
string trail = null;
if (dot > 0)
{
trail = name.Substring(dot + 1);
name = name.Substring(0, dot);
}
ValueDescriptor vd = this.vds[name];
if (vd == null)
throw new ArgumentException(DomSR.InvalidValueName(name));
object value = vd.GetValue(dom, flags);
if (value == null && flags == GV.GetNull) //??? oder auch GV.ReadOnly?
return null;
//REVIEW DaSt: Sollte beim GV.ReadWrite das Objekt angelegt werden?
if (trail != null)
{
if (value == null || trail == "")
throw new ArgumentException(DomSR.InvalidValueName(name));
DocumentObject doc = value as DocumentObject;
if (doc == null)
throw new ArgumentException(DomSR.InvalidValueName(name));
value = doc.GetValue(trail, flags);
}
return value;
}
示例2: GetValue
/// <summary>
/// Gets the object specified by name from dom.
/// </summary>
public object GetValue(DocumentObject dom, string name, GV flags)
{
int dot = name.IndexOf('.');
if (dot == 0)
throw new ArgumentException(DomSR.InvalidValueName(name));
string trail = null;
if (dot > 0)
{
trail = name.Substring(dot + 1);
name = name.Substring(0, dot);
}
ValueDescriptor vd = _vds[name];
if (vd == null)
throw new ArgumentException(DomSR.InvalidValueName(name));
object value = vd.GetValue(dom, flags);
if (value == null && flags == GV.GetNull) //??? also for GV.ReadOnly?
return null;
//REVIEW DaSt: Create object in case of GV.ReadWrite?
if (trail != null)
{
if (value == null || trail == "")
throw new ArgumentException(DomSR.InvalidValueName(name));
DocumentObject doc = value as DocumentObject;
if (doc == null)
throw new ArgumentException(DomSR.InvalidValueName(name));
value = doc.GetValue(trail, flags);
}
return value;
}
示例3: Cell
/// <summary>
/// Initializes a new instance of the Cell class with the specified parent.
/// </summary>
internal Cell(DocumentObject parent) : base(parent) { }
示例4: IsNull
/// <summary>
/// Determines whether the given DocumentObject is null (not set).
/// </summary>
public override bool IsNull(DocumentObject dom)
{
DocumentObjectCollection val = FieldInfo.GetValue(dom) as DocumentObjectCollection;
if (val == null)
return true;
return val.IsNull();
}
示例5: PageRefField
/// <summary>
/// Initializes a new instance of the PageRefField class with the specified parent.
/// </summary>
internal PageRefField(DocumentObject parent) : base(parent) { }
示例6: NumericFieldBase
/// <summary>
/// Initializes a new instance of the NumericFieldBase class with the specified parent.
/// </summary>
internal NumericFieldBase(DocumentObject parent)
: base(parent)
{
}
示例7: XValues
/// <summary>
/// Initializes a new instance of the XValues class with the specified parent.
/// </summary>
internal XValues(DocumentObject parent)
: base(parent)
{
}
示例8: Row
/// <summary>
/// Initializes a new instance of the Row class with the specified parent.
/// </summary>
internal Row(DocumentObject parent) : base(parent) { }
示例9: SeriesElements
/// <summary>
/// Initializes a new instance of the SeriesElements class with the specified parent.
/// </summary>
internal SeriesElements(DocumentObject parent)
: base(parent)
{
}
示例10: SetNull
/// <summary>
/// Sets the member of dom specified by name to null.
/// If a member with the specified name does not exist an ArgumentException will be thrown.
/// </summary>
public void SetNull(DocumentObject dom, string name)
{
ValueDescriptor vd = vds[name];
if (vd == null)
throw new ArgumentException(DomSR.InvalidValueName(name));
vd.SetNull(dom);
}
示例11: IsNull
/// <summary>
/// Determines whether the member of dom specified by name is null.
/// If a member with the specified name does not exist an ArgumentException will be thrown.
/// </summary>
public virtual bool IsNull(DocumentObject dom, string name)
{
//bool isNull = false;
int dot = name.IndexOf('.');
if (dot == 0)
throw new ArgumentException(DomSR.InvalidValueName(name));
string trail = null;
if (dot > 0)
{
trail = name.Substring(dot + 1);
name = name.Substring(0, dot);
}
ValueDescriptor vd = this.vds[name];
if (vd == null)
throw new ArgumentException(DomSR.InvalidValueName(name));
if (vd is NullableDescriptor || vd is ValueTypeDescriptor)
{
if (trail != null)
throw new ArgumentException(DomSR.InvalidValueName(name));
return vd.IsNull(dom);
}
DocumentObject docObj = (DocumentObject)vd.GetValue(dom, GV.ReadOnly);
if (docObj == null)
return true;
if (trail != null)
return docObj.IsNull(trail);
else
return docObj.IsNull();
// DomValueDescriptor vd = vds[name];
// if (vd == null)
// throw new ArgumentException(DomSR.InvalidValueName(name));
//
// return vd.IsNull(dom);
}
示例12: SetValue
/// <summary>
/// Sets the member of dom specified by name to val.
/// If a member with the specified name does not exist an ArgumentException will be thrown.
/// </summary>
public void SetValue(DocumentObject dom, string name, object val)
{
int dot = name.IndexOf('.');
if (dot == 0)
throw new ArgumentException(DomSR.InvalidValueName(name));
string trail = null;
if (dot > 0)
{
trail = name.Substring(dot + 1);
name = name.Substring(0, dot);
}
ValueDescriptor vd = this.vds[name];
if (vd == null)
throw new ArgumentException(DomSR.InvalidValueName(name));
if (trail != null)
{
//REVIEW DaSt: dom.GetValue(name) und rekursiv SetValue aufrufen,
// oder dom.GetValue(name.BisVorletzteElement) und erst SetValue aufrufen.
DocumentObject doc = dom.GetValue(name) as DocumentObject;
doc.SetValue(trail, val);
}
else
vd.SetValue(dom, val);
}
示例13: SetNull
public abstract void SetNull(DocumentObject dom);
示例14: SetValue
public abstract void SetValue(DocumentObject dom, object val);
示例15: GetValue
public abstract object GetValue(DocumentObject dom, GV flags);