Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
        //
        // Get Children
        //
        internal NikonObject[] GetChildren()
        {
            List <NikonObject> children = new List <NikonObject>();

            NikonEnumWithData e = GetEnumWithData(eNkMAIDCapability.kNkMAIDCapability_Children);

            for (int i = 0; i < e.nativeEnum.ulElements; i++)
            {
                uint childId = BitConverter.ToUInt32(e.buffer, i * 4);

                NikonObject child = new NikonObject(_md3, this, childId);

                children.Add(child);
            }

            return(children.ToArray());
        }