// // GetCapInfo // internal NkMAIDCapInfo[] GetCapInfo() { NkMAIDCapInfo[] capInfo = null; while (true) { // Get capability count uint count = GetCapCount(); // Allocate capabiity info array capInfo = new NkMAIDCapInfo[count]; // GetCapInfo if (GetCapInfo(capInfo)) { // If GetCapInfo succeeds, we break out of the loop break; } else { // Otherwise we keep trying continue; } } // Return result return(capInfo); }
public CapModel(NikonBase obj, NkMAIDCapInfo cap) { _object = obj; _cap = cap; NikonDevice device = _object as NikonDevice; if (device != null) { device.CapabilityValueChanged += new CapabilityChangedDelegate(device_CapabilityValueChanged); } }
public static bool CanGetArray(this NkMAIDCapInfo c) { return((c.ulOperations & eNkMAIDCapOperation.kNkMAIDCapOperation_GetArray) != 0); }
public static bool CanSet(this NkMAIDCapInfo c) { return((c.ulOperations & eNkMAIDCapOperation.kNkMAIDCapOperation_Set) != 0); }
public static unsafe string GetDescription(this NkMAIDCapInfo c) { return(Marshal.PtrToStringAnsi(new IntPtr(c.szDescription))); }
public static bool IsInvalid(this NkMAIDCapInfo c) { return((c.ulVisibility & eNkMAIDCapVisibility.kNkMAIDCapVisibility_Invalid) != 0); }
public static bool IsGroupMember(this NkMAIDCapInfo c) { return((c.ulVisibility & eNkMAIDCapVisibility.kNkMAIDCapVisibility_GroupMember) != 0); }
public static bool IsVendor(this NkMAIDCapInfo c) { return((c.ulVisibility & eNkMAIDCapVisibility.kNkMAIDCapVisibility_Vendor) != 0); }
public static bool IsAdvanced(this NkMAIDCapInfo c) { return((c.ulVisibility & eNkMAIDCapVisibility.kNkMAIDCapVisibility_Advanced) != 0); }
public static bool IsHidden(this NkMAIDCapInfo c) { return((c.ulVisibility & eNkMAIDCapVisibility.kNkMAIDCapVisibility_Hidden) != 0); }
public static bool CanGetDefault(this NkMAIDCapInfo c) { return((c.ulOperations & eNkMAIDCapOperation.kNkMAIDCapOperation_GetDefault) != 0); }
// // GetCapInfo // internal NkMAIDCapInfo[] GetCapInfo() { NkMAIDCapInfo[] capInfo = null; while (true) { // Get capability count uint count = GetCapCount(); // Allocate capabiity info array capInfo = new NkMAIDCapInfo[count]; // GetCapInfo if (GetCapInfo(capInfo)) { // If GetCapInfo succeeds, we break out of the loop break; } else { // Otherwise we keep trying continue; } } // Return result return capInfo; }
// // GetCapInfo // bool GetCapInfo(NkMAIDCapInfo[] capInfo) { fixed (NkMAIDCapInfo* p = capInfo) { try { CallEntryPointAsync( eNkMAIDCommand.kNkMAIDCommand_GetCapInfo, (uint)capInfo.Length, eNkMAIDDataType.kNkMAIDDataType_CapInfoPtr, new IntPtr(p).ToInt32()); } catch (NikonException ex) { if (ex.ErrorCode == eNkMAIDResult.kNkMAIDResult_BufferSize) { return false; } else { throw; } } } return true; }