Esempio n. 1
0
        /// <summary>
        /// Gets the type of the smart object.
        /// </summary>
        /// <param name="__appRef">Application Reference</param>
        /// <returns></returns>
        private string getSmartObjectType(Photoshop.Application __appRef)
        {
            string __value;
            Photoshop.ActionReference __aRef = new Photoshop.ActionReference();
            __aRef.PutEnumerated(__appRef.CharIDToTypeID("Lyr "), __appRef.CharIDToTypeID("Ordn"), __appRef.CharIDToTypeID("Trgt"));

            Photoshop.ActionDescriptor __desc;
            __desc = __appRef.ExecuteActionGet(__aRef);

            if (__desc.HasKey(__appRef.StringIDToTypeID("smartObject")))
            {
                int __desc2 = __appRef.ExecuteActionGet(__aRef).GetObjectValue(__appRef.StringIDToTypeID("smartObject")).GetEnumerationValue(__appRef.StringIDToTypeID("placed"));

                if ((string)(__appRef.TypeIDToStringID(__desc2)) == "vectorData")
                {
                    __value = ".ai";
                }
                else if ((string)(__appRef.TypeIDToStringID(__desc2)) == "rasterizeContent")
                {
                    __value = ".psd";
                }
                else
                {
                    __value = "";
                }
            }
            else
            {
                __value = "";
            }
            return __value;
        }