LinkSource

DocumentProperty.LinkSource property

يحصل على مصدر خاصية مستند مخصص مرتبط.

public string LinkSource { get; }

أمثلة

يوضح كيفية ربط خاصية مستند مخصصة بإشارة مرجعية.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.StartBookmark("MyBookmark");
builder.Write("Hello world!");
builder.EndBookmark("MyBookmark");

// اربط خاصية مخصصة جديدة بإشارة مرجعية. قيمة هذه الخاصية
//سيكون محتوى الإشارة المرجعية التي تشير إليها في عضو "LinkSource".
CustomDocumentProperties customProperties = doc.CustomDocumentProperties;
DocumentProperty customProperty = customProperties.AddLinkToContent("Bookmark", "MyBookmark");

Assert.AreEqual(true, customProperty.IsLinkToContent);
Assert.AreEqual("MyBookmark", customProperty.LinkSource);
Assert.AreEqual("Hello world!", customProperty.Value);

doc.Save(ArtifactsDir + "DocumentProperties.LinkCustomDocumentPropertiesToBookmark.docx");

أنظر أيضا