/// <summary> /// This function is intended for empira internal use only. /// </summary> public PdfCustomValue this[string key] { get { PdfDictionary dict = Elements.GetDictionary(key); if (dict == null) { return(null); } PdfCustomValue cust = dict as PdfCustomValue; if (cust == null) { cust = new PdfCustomValue(dict); } return(cust); } set { if (value == null) { Elements.Remove(key); } else { Owner.Internals.AddObject(value); Elements.SetReference(key, value); } }
/// <summary> /// This function is intended for empira internal use only. /// </summary> public PdfCustomValue this[string key] { get { PdfDictionary dict = Elements.GetDictionary(key); if (dict == null) { return(null); } PdfCustomValue cust = dict as PdfCustomValue; if (cust == null) { cust = new PdfCustomValue(dict); } return(cust); } set { if (value == null) { Elements.Remove(key); } else { Owner.Internals.AddObject(value); Elements.SetReference(key, value); } } //#if old // get // { // PdfDictionary dict = Elements.GetDictionary(key); // if (dict == null) // return null; // if (!(dict is PdfCustomValue)) // dict = new PdfCustomValue(dict); // return dict.Stream.Value; // } // set // { // PdfCustomValue cust; // PdfDictionary dict = Elements.GetDictionary(key); // if (dict == null) // { // cust = new PdfCustomValue(); // Owner.Internals.AddObject(cust); // Elements.Add(key, cust); // } // else // { // cust = dict as PdfCustomValue; // if (cust == null) // cust = new PdfCustomValue(dict); // } // cust.Value = value; // } //#endif }
/// <summary> /// This function is intended for empira internal use only. /// </summary> public PdfCustomValue this[string key] { get { PdfDictionary dict = Elements.GetDictionary(key); if (dict == null) return null; PdfCustomValue cust = dict as PdfCustomValue; if (cust == null) cust = new PdfCustomValue(dict); return cust; } set { if (value == null) { Elements.Remove(key); } else { Owner.Internals.AddObject(value); Elements.SetReference(key, value); } }