private int SetErrorFromZString(ASZString str) { string value; if (zstringSuite.ConvertToString(str, out value)) { errorMessage = value; return(PSError.kSPNoError); } return(PSError.kSPBadParameterError); }
private int PutZString(PIActionList list, ASZString zstring) { try { ActionDescriptorZString value; if (zstringSuite.ConvertToActionDescriptor(zstring, out value)) { actionLists[list].Add(new ActionListItem(DescriptorTypes.Char, value)); } else { return(PSError.kSPBadParameterError); } } catch (OutOfMemoryException) { return(PSError.kSPOutOfMemoryError); } return(PSError.kSPNoError); }
private unsafe int PickColor(ColorID *colorID, ASZString promptZString) { if (colorID == null) { return(PSError.kSPBadParameterError); } int error; string prompt; if (zstringSuite.ConvertToString(promptZString, out prompt)) { PaintDotNet.ColorBgra?chosenColor = ColorPickerService.ShowColorPickerDialog(prompt); if (chosenColor.HasValue) { error = Make(colorID); if (error == PSError.kSPNoError) { PaintDotNet.ColorBgra color = chosenColor.Value; colors[*colorID] = new Color(ColorSpace.RGBSpace, color.R, color.G, color.B, 0); } } else { error = PSError.kSPUserCanceledError; } } else { error = PSError.kSPBadParameterError; } return(error); }