MigraDoc.DocumentObjectModel.Internals.ValueDescriptor.SetValue C# (CSharp) 메소드

SetValue() 공개 추상적인 메소드

public abstract SetValue ( DocumentObject dom, object val ) : void
dom DocumentObject
val object
리턴 void
    public abstract void SetValue(DocumentObject dom, object val);
    public abstract void SetNull(DocumentObject dom);

Usage Example

예제 #1
0
        /// <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);
            }
        }
All Usage Examples Of MigraDoc.DocumentObjectModel.Internals.ValueDescriptor::SetValue