本文整理汇总了C#中PdfObject.IsNull方法的典型用法代码示例。如果您正苦于以下问题:C# PdfObject.IsNull方法的具体用法?C# PdfObject.IsNull怎么用?C# PdfObject.IsNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PdfObject
的用法示例。
在下文中一共展示了PdfObject.IsNull方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddDefaultColor
internal void AddDefaultColor(PdfName name, PdfObject obj)
{
if (obj == null || obj.IsNull())
colorDictionary.Remove(name);
else
colorDictionary.Put(name, obj);
}
示例2: SetDefaultColorspace
/**
* Sets the default colorspace that will be applied to all the document.
* The colorspace is only applied if another colorspace with the same name
* is not present in the content.
* <p>
* The colorspace is applied immediately when creating templates and at the page
* end for the main document content.
* @param key the name of the colorspace. It can be <CODE>PdfName.DEFAULTGRAY</CODE>, <CODE>PdfName.DEFAULTRGB</CODE>
* or <CODE>PdfName.DEFAULTCMYK</CODE>
* @param cs the colorspace. A <CODE>null</CODE> or <CODE>PdfNull</CODE> removes any colorspace with the same name
*/
public void SetDefaultColorspace(PdfName key, PdfObject cs)
{
if (cs == null || cs.IsNull())
defaultColorspace.Remove(key);
defaultColorspace.Put(key, cs);
}
示例3: Put
// methods concerning the Hashtable member value
/**
* Adds a <CODE>PdfObject</CODE> and its key to the <CODE>PdfDictionary</CODE>.
* If the value is <CODE>null</CODE> or <CODE>PdfNull</CODE> the key is deleted.
*
* @param key key of the entry (a <CODE>PdfName</CODE>)
* @param value value of the entry (a <CODE>PdfObject</CODE>)
*/
public void Put(PdfName key, PdfObject value)
{
if (value == null || value.IsNull())
hashMap.Remove(key);
else
hashMap[key] = value;
}