private unsafe int Get(IntPtr key, PIActionDescriptor *descriptor) { if (key == IntPtr.Zero || descriptor == null) { return(PSError.kSPBadParameterError); } try { string registryKey = StringUtil.FromCString(key); if (registryKey == null) { return(PSError.kSPBadParameterError); } PluginSettingsRegistryItem item; if (registry.TryGetValue(registryKey, out item)) { *descriptor = actionDescriptorSuite.CreateDescriptor(item.Values); } else { *descriptor = PIActionDescriptor.Null; } } catch (OutOfMemoryException) { return(PSError.memFullErr); } return(PSError.kSPNoError); }
private unsafe int GetObject(PIActionList list, uint index, uint *retType, PIActionDescriptor *descriptor) { if (actionDescriptorSuite == null) { // The plug-in called this method before acquiring the Action Descriptor suite. return(PSError.kSPLogicError); } if (descriptor == null) { return(PSError.kSPBadParameterError); } ActionListItemCollection items = actionLists[list]; if (index < items.Count) { ActionListDescriptor item = (ActionListDescriptor)items[(int)index].Value; if (retType != null) { *retType = item.Type; } try { *descriptor = actionDescriptorSuite.CreateDescriptor(item.DescriptorValues); } catch (OutOfMemoryException) { return(PSError.kSPOutOfMemoryError); } return(PSError.kSPNoError); } return(PSError.kSPBadParameterError); }
private unsafe int GetGlobalObject(PIActionList list, uint index, uint *retType, PIActionDescriptor *descriptor) { return(GetObject(list, index, retType, descriptor)); }