Remove() public method

public Remove ( string key ) : void
key string
return void
Esempio n. 1
0
 protected void SetPropertyString(string name, string value)
 {
     if (value == null)
     {
         m_Properties.Remove(name);
     }
     else
     {
         m_Properties.SetString(name, value);
     }
 }
Esempio n. 2
0
        public override void UpdateProps()
        {
            base.SetPropertyString("fileRef", this.fileRef);
            PBXElementDict dict = null;

            if (base.m_Properties.Contains("settings"))
            {
                dict = base.m_Properties["settings"].AsDict();
            }
            if ((this.compileFlags != null) && (this.compileFlags != ""))
            {
                if (dict == null)
                {
                    dict = base.m_Properties.CreateDict("settings");
                }
                dict.SetString("COMPILER_FLAGS", this.compileFlags);
            }
            else if (dict != null)
            {
                dict.Remove("COMPILER_FLAGS");
            }
            if (this.weak)
            {
                if (dict == null)
                {
                    dict = base.m_Properties.CreateDict("settings");
                }
                PBXElementArray array = null;
                if (dict.Contains("ATTRIBUTES"))
                {
                    array = dict["ATTRIBUTES"].AsArray();
                }
                else
                {
                    array = dict.CreateArray("ATTRIBUTES");
                }
                bool flag = false;
                foreach (PBXElement element in array.values)
                {
                    if ((element is PBXElementString) && (element.AsString() == "Weak"))
                    {
                        flag = true;
                    }
                }
                if (!flag)
                {
                    array.AddString("Weak");
                }
            }
            else if ((dict != null) && dict.Contains("ATTRIBUTES"))
            {
                PBXElementArray array2 = dict["ATTRIBUTES"].AsArray();
                if (< > f__am$cache0 == null)
                {
Esempio n. 3
0
        public override void UpdateProps()
        {
            this.SetPropertyString("fileRef", this.fileRef);
            PBXElementDict settings = (PBXElementDict)null;

            if (this.m_Properties.Contains("settings"))
            {
                settings = this.m_Properties["settings"].AsDict();
            }
            if (this.compileFlags != null && this.compileFlags != "")
            {
                if (settings == null)
                {
                    settings = this.m_Properties.CreateDict("settings");
                }
                settings.SetString("COMPILER_FLAGS", this.compileFlags);
            }
            else if (settings != null)
            {
                settings.Remove("COMPILER_FLAGS");
            }
            PBXElementDict pbxElementDict = this.UpdatePropsAttribute(this.UpdatePropsAttribute(this.UpdatePropsAttribute(settings, this.weak, "Weak"), this.codeSignOnCopy, "CodeSignOnCopy"), this.removeHeadersOnCopy, "RemoveHeadersOnCopy");

            if (this.assetTags.Count > 0)
            {
                if (pbxElementDict == null)
                {
                    pbxElementDict = this.m_Properties.CreateDict("settings");
                }
                PBXElementArray array = pbxElementDict.CreateArray("ASSET_TAGS");
                foreach (string val in this.assetTags)
                {
                    array.AddString(val);
                }
            }
            else if (pbxElementDict != null)
            {
                pbxElementDict.Remove("ASSET_TAGS");
            }
            if (pbxElementDict == null || pbxElementDict.values.Count != 0)
            {
                return;
            }
            this.m_Properties.Remove("settings");
        }
Esempio n. 4
0
        private PBXElementDict UpdatePropsAttribute(PBXElementDict settings, bool value, string attributeName)
        {
            PBXElementArray pbxElementArray = (PBXElementArray)null;

            if (value && settings == null)
            {
                settings = this.m_Properties.CreateDict("settings");
            }
            if (settings != null && settings.Contains("ATTRIBUTES"))
            {
                pbxElementArray = settings["ATTRIBUTES"].AsArray();
            }
            if (value)
            {
                if (pbxElementArray == null)
                {
                    pbxElementArray = settings.CreateArray("ATTRIBUTES");
                }
                if (!Enumerable.Any <PBXElement>((IEnumerable <PBXElement>)pbxElementArray.values, (Func <PBXElement, bool>)(attr => attr is PBXElementString && attr.AsString() == attributeName)))
                {
                    pbxElementArray.AddString(attributeName);
                }
            }
            else if (pbxElementArray != null)
            {
                pbxElementArray.values.RemoveAll((Predicate <PBXElement>)(el =>
                {
                    if (el is PBXElementString)
                    {
                        return(el.AsString() == attributeName);
                    }
                    return(false);
                }));
                if (pbxElementArray.values.Count == 0)
                {
                    settings.Remove("ATTRIBUTES");
                }
            }
            return(settings);
        }
Esempio n. 5
0
        public override void UpdateProps()
        {
            SetPropertyString("fileRef", fileRef);

            PBXElementDict settings = null;

            if (m_Properties.Contains("settings"))
            {
                settings = m_Properties["settings"].AsDict();
            }

            if (compileFlags != null && compileFlags != "")
            {
                if (settings == null)
                {
                    settings = m_Properties.CreateDict("settings");
                }
                settings.SetString("COMPILER_FLAGS", compileFlags);
            }
            else
            {
                if (settings != null)
                {
                    settings.Remove("COMPILER_FLAGS");
                }
            }

            if (weak)
            {
                if (settings == null)
                {
                    settings = m_Properties.CreateDict("settings");
                }
                PBXElementArray attrs = null;
                if (settings.Contains("ATTRIBUTES"))
                {
                    attrs = settings["ATTRIBUTES"].AsArray();
                }
                else
                {
                    attrs = settings.CreateArray("ATTRIBUTES");
                }

                bool exists = false;
                foreach (var value in attrs.values)
                {
                    if (value is PBXElementString && value.AsString() == "Weak")
                    {
                        exists = true;
                    }
                }
                if (!exists)
                {
                    attrs.AddString("Weak");
                }
            }
            else
            {
                if (settings != null && settings.Contains("ATTRIBUTES"))
                {
                    var attrs = settings["ATTRIBUTES"].AsArray();
                    attrs.values.RemoveAll(el => (el is PBXElementString && el.AsString() == "Weak"));
                    if (attrs.values.Count == 0)
                    {
                        settings.Remove("ATTRIBUTES");
                    }
                }
            }

            if (assetTags.Count > 0)
            {
                if (settings == null)
                {
                    settings = m_Properties.CreateDict("settings");
                }
                var tagsArray = settings.CreateArray("ASSET_TAGS");
                foreach (string tag in assetTags)
                {
                    tagsArray.AddString(tag);
                }
            }
            else
            {
                if (settings != null)
                {
                    settings.Remove("ASSET_TAGS");
                }
            }

            if (settings != null && settings.values.Count == 0)
            {
                m_Properties.Remove("settings");
            }
        }