void GetPreviewAndFireEvent(eNkMAIDCapability previewCapabilty, PreviewReadyDelegate d) { NikonArrayWithData previewArray = Object.GetArrayWithData(previewCapabilty); NikonPreview preview = new NikonPreview(previewArray.buffer); Scheduler.Callback(d, this, preview); }
public object Get(eNkMAIDCapability cap) { switch (GetCapabilityType(cap)) { case eNkMAIDCapType.kNkMAIDCapType_String: return(_scheduler.Invoke(new GetStringDelegate(_object.GetString), cap)); case eNkMAIDCapType.kNkMAIDCapType_Unsigned: return(_scheduler.Invoke(new GetUnsignedDelegate(_object.GetUnsigned), cap)); case eNkMAIDCapType.kNkMAIDCapType_Integer: return(_scheduler.Invoke(new GetIntegerDelegate(_object.GetInteger), cap)); case eNkMAIDCapType.kNkMAIDCapType_Boolean: return(_scheduler.Invoke(new GetBooleanDelegate(_object.GetBoolean), cap)); case eNkMAIDCapType.kNkMAIDCapType_Float: return(_scheduler.Invoke(new GetFloatDelegate(_object.GetFloat), cap)); case eNkMAIDCapType.kNkMAIDCapType_Enum: { NikonEnumWithData result = (NikonEnumWithData)_scheduler.Invoke(new GetEnumWithDataDelegate(_object.GetEnumWithData), cap); return(new NikonEnum(result.nativeEnum, result.buffer)); } case eNkMAIDCapType.kNkMAIDCapType_Array: { NikonArrayWithData result = (NikonArrayWithData)_scheduler.Invoke(new GetArrayWithDataDelegate(_object.GetArrayWithData), cap); return(new NikonArray(result.nativeArray, result.buffer)); } case eNkMAIDCapType.kNkMAIDCapType_Range: { NkMAIDRange result = (NkMAIDRange)_scheduler.Invoke(new GetRangeDelegate(_object.GetRange), cap); return(new NikonRange(result)); } case eNkMAIDCapType.kNkMAIDCapType_DateTime: return(_scheduler.Invoke(new GetDateTimeDelegate(_object.GetDateTime), cap)); case eNkMAIDCapType.kNkMAIDCapType_Point: return(_scheduler.Invoke(new GetPointDelegate(_object.GetPoint), cap)); case eNkMAIDCapType.kNkMAIDCapType_Rect: return(_scheduler.Invoke(new GetRectDelegate(_object.GetRect), cap)); case eNkMAIDCapType.kNkMAIDCapType_Size: return(_scheduler.Invoke(new GetSizeDelegate(_object.GetSize), cap)); default: return(null); } }