public int get_type_from_descriptor(PhotoshopTypeLibrary.IActionDescriptor desc, int prop_id)
        {
            // Returns the type for a property stored in a descriptor

            int v;

            System.Diagnostics.Debug.Assert(desc != null);
            System.Diagnostics.Debug.Assert(desc_has_key(desc, prop_id));

            desc.GetType(prop_id, out v);
            return(v);
        }
        public void dump_descriptor(PhotoshopTypeLibrary.IActionDescriptor desc1, int indent)
        {
            string indent_text = "  ";
            int    num_items;

            desc1.GetCount(out num_items);

            log.WriteLine("Descriptor ({0} items)", num_items);
            for (int i = 0; i < num_items; i++)
            {
                int child_key;
                int child_type;

                desc1.GetKey(i, out child_key);
                desc1.GetType(child_key, out child_type);

                string indent_str = " ";///commoncs.libstring.Multiply(indent_text, indent + 1);

                log.Write(indent_str);
                log.Write("[{0}] ", i.ToString());
                log.WriteLine(" ( {0} ) ", IDToStr(child_type));

                log.Write(indent_str + "-");

                if (child_type == (int)PSConstants.phTypeObject)
                {
                    PhotoshopTypeLibrary.IActionDescriptor child_desc;
                    int child_class_id;

                    desc1.GetObject(child_key, out child_class_id, out child_desc);

                    string sss = string.Format(" ( {0} ) ( {1} ) ", IDToStr(child_key), IDToStr(child_class_id));
                    log.WriteLine(sss);

                    dump_descriptor(child_desc, indent + 1);
                }
                else if (child_type == (int)PSConstants.phTypeObjectReference)
                {
                    log.WriteLine("<handled type>");
                }
                else if (child_type == (int)PSConstants.phTypeText)
                {
                    log.WriteLine("<handled type>");
                }
                else if (child_type == (int)PSConstants.phTypeBoolean)
                {
                    log.WriteLine("<handled type>");
                }
                else if (child_type == (int)PSConstants.phTypeEnumerated)
                {
                    log.WriteLine("<handled type>");
                }
                else if (child_type == (int)PSConstants.phTypeType)
                {
                    log.WriteLine("<handled type>");
                }
                else if (child_type == (int)PSConstants.phTypePath)
                {
                    log.WriteLine("<handled type>");
                }
                else
                {
                    log.WriteLine("<unhandled type>");
                }
            }
        }