当前位置: 首页>>代码示例>>C#>>正文


C# DocumentObject类代码示例

本文整理汇总了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;
    }
开发者ID:GorelH,项目名称:PdfSharp,代码行数:34,代码来源:Meta.cs

示例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;
        }
开发者ID:Sl0vi,项目名称:MigraDoc,代码行数:34,代码来源:Meta.cs

示例3: Cell

 /// <summary>
 /// Initializes a new instance of the Cell class with the specified parent.
 /// </summary>
 internal Cell(DocumentObject parent) : base(parent) { }
开发者ID:vronikp,项目名称:EventRegistration,代码行数:4,代码来源:Cell.cs

示例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();
 }
开发者ID:GorelH,项目名称:PdfSharp,代码行数:10,代码来源:ValueDescriptor.cs

示例5: PageRefField

 /// <summary>
 /// Initializes a new instance of the PageRefField class with the specified parent.
 /// </summary>
 internal PageRefField(DocumentObject parent) : base(parent) { }
开发者ID:GorelH,项目名称:PdfSharp,代码行数:4,代码来源:PageRefField.cs

示例6: NumericFieldBase

 /// <summary>
 /// Initializes a new instance of the NumericFieldBase class with the specified parent.
 /// </summary>
 internal NumericFieldBase(DocumentObject parent)
     : base(parent)
 {
 }
开发者ID:dankennedy,项目名称:MigraDoc,代码行数:7,代码来源:NumericFieldBase.cs

示例7: XValues

 /// <summary>
 /// Initializes a new instance of the XValues class with the specified parent.
 /// </summary>
 internal XValues(DocumentObject parent)
     : base(parent)
 {
 }
开发者ID:dankennedy,项目名称:MigraDoc,代码行数:7,代码来源:XValues.cs

示例8: Row

 /// <summary>
 /// Initializes a new instance of the Row class with the specified parent.
 /// </summary>
 internal Row(DocumentObject parent) : base(parent) { }
开发者ID:DavidS,项目名称:MigraDoc,代码行数:4,代码来源:Row.cs

示例9: SeriesElements

 /// <summary>
 /// Initializes a new instance of the SeriesElements class with the specified parent.
 /// </summary>
 internal SeriesElements(DocumentObject parent)
     : base(parent)
 {
 }
开发者ID:dankennedy,项目名称:MigraDoc,代码行数:7,代码来源:SeriesElements.cs

示例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);
    }
开发者ID:GorelH,项目名称:PdfSharp,代码行数:12,代码来源:Meta.cs

示例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);
    }
开发者ID:GorelH,项目名称:PdfSharp,代码行数:40,代码来源:Meta.cs

示例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);
    }
开发者ID:GorelH,项目名称:PdfSharp,代码行数:29,代码来源:Meta.cs

示例13: SetNull

 public abstract void SetNull(DocumentObject dom);
开发者ID:GorelH,项目名称:PdfSharp,代码行数:1,代码来源:ValueDescriptor.cs

示例14: SetValue

 public abstract void SetValue(DocumentObject dom, object val);
开发者ID:GorelH,项目名称:PdfSharp,代码行数:1,代码来源:ValueDescriptor.cs

示例15: GetValue

 public abstract object GetValue(DocumentObject dom, GV flags);
开发者ID:GorelH,项目名称:PdfSharp,代码行数:1,代码来源:ValueDescriptor.cs


注:本文中的DocumentObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。