Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Egomotion.EgoXproject.Internal.PBXBaseObject"/> class.
        /// </summary>
        /// <param name="isa">Isa.</param> The type of object it is
        /// <param name="uid">Uid.</param> The UID in the project objects dictionary for this object
        /// <param name="dict">Dict.</param> The dictionary entry in the project objects dictionary for this object
        protected PBXBaseObject(PBXTypes isa, string uid, PBXProjDictionary dict)
        {
            if (string.IsNullOrEmpty(uid))
            {
                throw new System.ArgumentNullException((uid).ToString(), "Dictionary cannot be null");
            }

            if (dict == null)
            {
                throw new System.ArgumentNullException((dict).ToString(), "Dictionary cannot be null");
            }

            var isaValue = dict.Element <PBXProjString>(isaKey);

            if (isaValue == null)
            {
                throw new System.ArgumentException("Dictionary must contain an isa key with a string value", (dict).ToString());
            }

            if (isa.ToString() != isaValue.Value)
            {
                throw new System.ArgumentException("Dictionary must be a " + isa + " dictionary and not a " + isaValue.Value + " dictionary", (dict).ToString());
            }

            Dict = dict;
            UID  = uid;
            Isa  = isa;
        }
        public string StringForKey(string key)
        {
            //INFOPLIST_FILE
            var str = BuildSettings.Element <PBXProjString>(key);

            if (str != null)
            {
                return(str.Value);
            }

            return("");
        }