static unsafe IntPtr CreateFromSettings(CTParagraphStyleSettings s) { var handle = IntPtr.Zero; var specifiers = s.GetSpecifiers(); var settings = new CTParagraphStyleSetting [specifiers.Count]; var values = new CTParagraphStyleSettingValue [specifiers.Count]; int i = 0; foreach (var e in specifiers) { e.WriteValue(values, i); settings [i].spec = e.Spec; settings [i].valueSize = (uint)e.ValueSize; ++i; } fixed(CTParagraphStyleSettingValue *pv = values) { for (i = 0; i < settings.Length; ++i) { // TODO: is this safe on the ARM? byte *p = &pv[i].int8; settings[i].value = (IntPtr)p; } handle = CTParagraphStyleCreate(settings, settings.Length); } i = 0; foreach (var e in specifiers) { e.Dispose(values, i); } return(handle); }
static unsafe IntPtr CreateFromSettings (CTParagraphStyleSettings s) { var handle = IntPtr.Zero; var specifiers = s.GetSpecifiers (); var settings = new CTParagraphStyleSetting [specifiers.Count]; var values = new CTParagraphStyleSettingValue [specifiers.Count]; int i = 0; foreach (var e in specifiers) { e.WriteValue (values, i); settings [i].spec = e.Spec; settings [i].valueSize = (uint) e.ValueSize; ++i; } fixed (CTParagraphStyleSettingValue* pv = values) { for (i = 0; i < settings.Length; ++i) { // TODO: is this safe on the ARM? byte* p = &pv[i].int8; settings[i].value = (IntPtr) p; } handle = CTParagraphStyleCreate (settings, settings.Length); } i = 0; foreach (var e in specifiers) { e.Dispose (values, i); } return handle; }
public override void Dispose (CTParagraphStyleSettingValue[] values, int index) { values [index].pointer = IntPtr.Zero; value.Dispose (); value = null; }
internal override void WriteValue (CTParagraphStyleSettingValue[] values, int index) { values [index].pointer = value.Handle; }
internal override void WriteValue (CTParagraphStyleSettingValue[] values, int index) { values [index].single = value; }
public virtual void Dispose (CTParagraphStyleSettingValue[] values, int index) { }
internal abstract void WriteValue (CTParagraphStyleSettingValue[] values, int index);