// Token: 0x06002641 RID: 9793 RVA: 0x0008825C File Offset: 0x0008645C
        private void method_7(out Dictionary <string, HashSet <string> > installingFiles, out Dictionary <string, HashSet <string> > uninstallingFiles)
        {
            installingFiles   = new Dictionary <string, HashSet <string> >(StringComparer.OrdinalIgnoreCase);
            uninstallingFiles = new Dictionary <string, HashSet <string> >(StringComparer.OrdinalIgnoreCase);
            if (this.InstallState != Enum76.const_0)
            {
                lock (((ICollection)this.dictionary_0).SyncRoot)
                {
                    foreach (KeyValuePair <string, Class102.Class403> keyValuePair in this.dictionary_0)
                    {
                        string key;
                        if (keyValuePair.Value.enum76_0 != Enum76.const_0 && Class136.smethod_5(keyValuePair.Key, out key))
                        {
                            Enum76 installState = this.InstallState;
                            if (installState == Enum76.const_2)
                            {
                                switch (keyValuePair.Value.enum76_0)
                                {
                                case Enum76.const_1:
                                case Enum76.const_2:
                                case Enum76.const_4:
                                    if (!uninstallingFiles.ContainsKey(key))
                                    {
                                        uninstallingFiles.Add(key, new HashSet <string>(StringComparer.OrdinalIgnoreCase));
                                    }
                                    uninstallingFiles[key].Add(keyValuePair.Key);
                                    break;
                                }
                            }
                            else
                            {
                                switch (keyValuePair.Value.enum76_0)
                                {
                                case Enum76.const_2:
                                case Enum76.const_4:
                                    if (!uninstallingFiles.ContainsKey(key))
                                    {
                                        uninstallingFiles.Add(key, new HashSet <string>(StringComparer.OrdinalIgnoreCase));
                                    }
                                    uninstallingFiles[key].Add(keyValuePair.Key);
                                    break;

                                case Enum76.const_3:
                                    if (!installingFiles.ContainsKey(key))
                                    {
                                        installingFiles.Add(key, new HashSet <string>(StringComparer.OrdinalIgnoreCase));
                                    }
                                    installingFiles[key].Add(keyValuePair.Key);
                                    break;
                                }
                            }
                        }
                    }
                }
            }
        }
            // Token: 0x0600264C RID: 9804 RVA: 0x000885B0 File Offset: 0x000867B0
            public void method_0(string item)
            {
                Enum76 enum76_ = this.class102_0.dictionary_0[item].enum76_0;

                if (enum76_ != Enum76.const_4)
                {
                    return;
                }
                this.hashSet_0.Add(item);
            }
                // Token: 0x06002648 RID: 9800 RVA: 0x00088508 File Offset: 0x00086708
                public void method_0(KeyValuePair <Class102, HashSet <string> > removeFile)
                {
                    IEnumerable <string> enumerable = removeFile.Value.Where(new Func <string, bool>(this.method_1));

                    foreach (string key in enumerable)
                    {
                        Enum76 enum76_ = removeFile.Key.dictionary_0[key].enum76_0;
                        if (enum76_ != Enum76.const_4)
                        {
                            removeFile.Key.dictionary_0[key].enum76_0 = Enum76.const_0;
                        }
                    }
                    removeFile.Value.RemoveWhere(new Predicate <string>(this.method_2));
                }
            // Token: 0x06001CC4 RID: 7364 RVA: 0x0005D598 File Offset: 0x0005B798
            public void method_1()
            {
                foreach (ListViewItemState <string> listViewItemState in this.listViewItemState_0)
                {
                    Class102.Class403 @class = this.customizeContentPack_0.class102_0.dictionary_0[listViewItemState.Text];
                    switch (listViewItemState.Checked)
                    {
                    case false:
                        switch (@class.enum76_0)
                        {
                        case Enum76.const_1:
                            @class.enum76_0 = Enum76.const_2;
                            break;

                        case Enum76.const_3:
                            @class.enum76_0 = Enum76.const_0;
                            break;
                        }
                        break;

                    case true:
                        foreach (Class102 class2 in Class110.Instance.ConnectSettings.ContentPacks)
                        {
                            if (class2 != this.customizeContentPack_0.class102_0 && class2.dictionary_0.ContainsKey(listViewItemState.Text))
                            {
                                Enum76 installState = class2.InstallState;
                                if (installState == Enum76.const_0)
                                {
                                    Enum76 enum76_ = class2.dictionary_0[listViewItemState.Text].enum76_0;
                                    if (enum76_ == Enum76.const_3)
                                    {
                                        class2.dictionary_0[listViewItemState.Text].enum76_0 = Enum76.const_0;
                                    }
                                }
                                else
                                {
                                    switch (class2.dictionary_0[listViewItemState.Text].enum76_0)
                                    {
                                    case Enum76.const_1:
                                        class2.dictionary_0[listViewItemState.Text].enum76_0 = Enum76.const_2;
                                        break;

                                    case Enum76.const_3:
                                        class2.dictionary_0[listViewItemState.Text].enum76_0 = Enum76.const_0;
                                        break;
                                    }
                                }
                            }
                        }
                        switch (@class.enum76_0)
                        {
                        case Enum76.const_0:
                            @class.enum76_0 = Enum76.const_3;
                            break;

                        case Enum76.const_2:
                            @class.enum76_0 = Enum76.const_1;
                            break;
                        }
                        break;
                    }
                }
                this.customizeContentPack_0.DialogResult = DialogResult.OK;
                this.customizeContentPack_0.Close();
            }
 // Token: 0x06002643 RID: 9795 RVA: 0x00010F3E File Offset: 0x0000F13E
 public Class403(Struct43 hash, Enum76 state)
 {
     this.struct43_0 = hash;
     this.enum76_0   = state;
 }
        // Token: 0x0600263F RID: 9791 RVA: 0x000874F8 File Offset: 0x000856F8
        public static void smethod_2(string installDirectory, out HashSet <string> changedMultiFiles)
        {
            changedMultiFiles = new HashSet <string>(StringComparer.OrdinalIgnoreCase);
            if (Class110.Instance.ConnectSettings.SpoofedToonTownEnabled)
            {
                Class102.Class404 @class = new Class102.Class404();
                Dictionary <Class102, Dictionary <string, HashSet <string> > > dictionary  = new Dictionary <Class102, Dictionary <string, HashSet <string> > >();
                Dictionary <string, Dictionary <Class102, HashSet <string> > > dictionary2 = new Dictionary <string, Dictionary <Class102, HashSet <string> > >(StringComparer.OrdinalIgnoreCase);
                @class.dictionary_0 = new Dictionary <string, HashSet <string> >(StringComparer.OrdinalIgnoreCase);
                lock (((ICollection)Class110.Instance.ConnectSettings.ContentPacks).SyncRoot)
                {
                    foreach (Class102 class2 in Class110.Instance.ConnectSettings.ContentPacks)
                    {
                        if (!class2.LoaderPack)
                        {
                            Dictionary <string, HashSet <string> > dictionary3;
                            Dictionary <string, HashSet <string> > dictionary4;
                            class2.method_7(out dictionary3, out dictionary4);
                            if (dictionary3.Count > 0)
                            {
                                dictionary.Add(class2, dictionary3);
                            }
                            foreach (KeyValuePair <string, HashSet <string> > keyValuePair in dictionary3)
                            {
                                if ([email protected]_0.ContainsKey(keyValuePair.Key))
                                {
                                    @class.dictionary_0.Add(keyValuePair.Key, new HashSet <string>(StringComparer.OrdinalIgnoreCase));
                                }
                                foreach (string item in keyValuePair.Value)
                                {
                                    if ([email protected]_0[keyValuePair.Key].Contains(item))
                                    {
                                        @class.dictionary_0[keyValuePair.Key].Add(item);
                                    }
                                }
                            }
                            foreach (KeyValuePair <string, HashSet <string> > keyValuePair2 in dictionary4)
                            {
                                Dictionary <Class102, HashSet <string> > dictionary5;
                                if (dictionary2.ContainsKey(keyValuePair2.Key))
                                {
                                    dictionary5 = dictionary2[keyValuePair2.Key];
                                }
                                else
                                {
                                    dictionary2.Add(keyValuePair2.Key, dictionary5 = new Dictionary <Class102, HashSet <string> >());
                                }
                                HashSet <string> hashSet;
                                if (dictionary5.ContainsKey(class2))
                                {
                                    hashSet = dictionary5[class2];
                                }
                                else
                                {
                                    dictionary5.Add(class2, hashSet = new HashSet <string>(StringComparer.OrdinalIgnoreCase));
                                }
                                foreach (string item2 in keyValuePair2.Value)
                                {
                                    if (!hashSet.Contains(item2))
                                    {
                                        hashSet.Add(item2);
                                    }
                                }
                            }
                        }
                    }
                }
                dictionary2.smethod_7(new Action <KeyValuePair <string, Dictionary <Class102, HashSet <string> > > >(@class.method_0));
                IEnumerable <KeyValuePair <string, Dictionary <Class102, HashSet <string> > > > source = dictionary2;
                if (Class102.func_0 == null)
                {
                    Class102.func_0 = new Func <KeyValuePair <string, Dictionary <Class102, HashSet <string> > >, bool>(Class102.smethod_3);
                }
                KeyValuePair <string, Dictionary <Class102, HashSet <string> > >[] array = source.Where(Class102.func_0).ToArray <KeyValuePair <string, Dictionary <Class102, HashSet <string> > > >();
                foreach (KeyValuePair <string, Dictionary <Class102, HashSet <string> > > keyValuePair3 in array)
                {
                    dictionary2.Remove(keyValuePair3.Key);
                }
                Dictionary <Class102, Class132> dictionary6 = new Dictionary <Class102, Class132>();
                try
                {
                    foreach (string text in @class.dictionary_0.Keys.Union(dictionary2.Keys, StringComparer.OrdinalIgnoreCase))
                    {
                        string path = Path.Combine(installDirectory, text + ".mf");
                        if (File.Exists(path))
                        {
                            using (Stream stream = File.Open(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None))
                            {
                                using (Class136 class3 = new Class136(stream))
                                {
                                    if (!changedMultiFiles.Contains(text))
                                    {
                                        changedMultiFiles.Add(text);
                                    }
                                    class3.method_12();
                                    if (dictionary2.ContainsKey(text))
                                    {
                                        string path2 = Path.Combine(installDirectory, text + ".mf.orig");
                                        if (File.Exists(path2))
                                        {
                                            using (Stream stream2 = File.Open(path2, FileMode.Open, FileAccess.Read, FileShare.None))
                                            {
                                                using (Class136 class4 = new Class136(stream2))
                                                {
                                                    HashSet <string> hashSet2 = new HashSet <string>(StringComparer.OrdinalIgnoreCase);
                                                    foreach (KeyValuePair <Class102, HashSet <string> > keyValuePair4 in dictionary2[text])
                                                    {
                                                        foreach (string item3 in keyValuePair4.Value)
                                                        {
                                                            if (!hashSet2.Contains(item3))
                                                            {
                                                                hashSet2.Add(item3);
                                                            }
                                                        }
                                                    }
                                                    class4.method_14(hashSet2);
                                                    foreach (KeyValuePair <Class102, HashSet <string> > keyValuePair5 in dictionary2[text])
                                                    {
                                                        foreach (string name in keyValuePair5.Value)
                                                        {
                                                            if (class4.method_6(name) && class3.method_6(name))
                                                            {
                                                                class4[name].method_0(class3[name]);
                                                            }
                                                        }
                                                        Enum76 installState = keyValuePair5.Key.InstallState;
                                                        if (installState == Enum76.const_2)
                                                        {
                                                            using (HashSet <string> .Enumerator enumerator11 = keyValuePair5.Value.GetEnumerator())
                                                            {
                                                                while (enumerator11.MoveNext())
                                                                {
                                                                    string key = enumerator11.Current;
                                                                    switch (keyValuePair5.Key.dictionary_0[key].enum76_0)
                                                                    {
                                                                    case Enum76.const_2:
                                                                        keyValuePair5.Key.dictionary_0[key].enum76_0 = Enum76.const_0;
                                                                        continue;

                                                                    case Enum76.const_4:
                                                                        continue;
                                                                    }
                                                                    keyValuePair5.Key.dictionary_0[key].enum76_0 = Enum76.const_3;
                                                                }
                                                                continue;
                                                            }
                                                        }
                                                        foreach (string key2 in keyValuePair5.Value)
                                                        {
                                                            Enum76 @enum = keyValuePair5.Key.dictionary_0[key2].enum76_0;
                                                            if (@enum != Enum76.const_4)
                                                            {
                                                                keyValuePair5.Key.dictionary_0[key2].enum76_0 = Enum76.const_0;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    foreach (KeyValuePair <Class102, Dictionary <string, HashSet <string> > > keyValuePair6 in dictionary)
                                    {
                                        if (keyValuePair6.Value.ContainsKey(text))
                                        {
                                            Class102 key3 = keyValuePair6.Key;
                                            if (!dictionary6.ContainsKey(keyValuePair6.Key))
                                            {
                                                dictionary6.Add(keyValuePair6.Key, new Class132(keyValuePair6.Key.FileName, false, true));
                                            }
                                            Class136 data = dictionary6[keyValuePair6.Key].Data;
                                            foreach (string text2 in keyValuePair6.Value[text])
                                            {
                                                if (data.method_6(text2) && class3.method_6(text2))
                                                {
                                                    Class338 class5 = data[text2];
                                                    class5.method_0(class3[text2]);
                                                    class5.Data = null;
                                                    key3.dictionary_0[text2].enum76_0 = Enum76.const_1;
                                                }
                                                else
                                                {
                                                    key3.dictionary_0[text2].enum76_0 = Enum76.const_0;
                                                }
                                            }
                                        }
                                    }
                                    class3.method_18();
                                }
                                continue;
                            }
                        }
                        if (dictionary2.ContainsKey(text))
                        {
                            foreach (KeyValuePair <Class102, HashSet <string> > keyValuePair7 in dictionary2[text])
                            {
                                Enum76 installState = keyValuePair7.Key.InstallState;
                                if (installState == Enum76.const_2)
                                {
                                    using (HashSet <string> .Enumerator enumerator3 = keyValuePair7.Value.GetEnumerator())
                                    {
                                        while (enumerator3.MoveNext())
                                        {
                                            string key4 = enumerator3.Current;
                                            switch (keyValuePair7.Key.dictionary_0[key4].enum76_0)
                                            {
                                            case Enum76.const_2:
                                                keyValuePair7.Key.dictionary_0[key4].enum76_0 = Enum76.const_0;
                                                continue;

                                            case Enum76.const_4:
                                                continue;
                                            }
                                            keyValuePair7.Key.dictionary_0[key4].enum76_0 = Enum76.const_3;
                                        }
                                        continue;
                                    }
                                }
                                foreach (string key5 in keyValuePair7.Value)
                                {
                                    installState = keyValuePair7.Key.dictionary_0[key5].enum76_0;
                                    if (installState != Enum76.const_4)
                                    {
                                        keyValuePair7.Key.dictionary_0[key5].enum76_0 = Enum76.const_0;
                                    }
                                }
                            }
                        }
                    }
                }
                finally
                {
                    foreach (KeyValuePair <Class102, Class132> keyValuePair8 in dictionary6)
                    {
                        keyValuePair8.Value.Dispose();
                    }
                }
                foreach (Class102 class6 in Class110.Instance.ConnectSettings.ContentPacks)
                {
                    class6.method_6();
                }
            }
        }
        // Token: 0x0600263D RID: 9789 RVA: 0x00087018 File Offset: 0x00085218
        public void method_5()
        {
            this.DateInstalled = DateTime.Now;
            HashSet <string> hashSet = new HashSet <string>(StringComparer.OrdinalIgnoreCase);

            lock (((ICollection)this.dictionary_0).SyncRoot)
            {
                using (Class132 @class = new Class132(this.FileName, false, false))
                {
                    foreach (KeyValuePair <string, Struct43> keyValuePair in @class.ItemIndex)
                    {
                        if (this.dictionary_0.ContainsKey(keyValuePair.Key))
                        {
                            if (Struct43.smethod_6(keyValuePair.Value, this.dictionary_0[keyValuePair.Key].struct43_0))
                            {
                                if (this.dictionary_0[keyValuePair.Key].enum76_0 == Enum76.const_1)
                                {
                                    this.dictionary_0[keyValuePair.Key].enum76_0 = Enum76.const_3;
                                }
                                this.dictionary_0[keyValuePair.Key].struct43_0 = keyValuePair.Value;
                            }
                        }
                        else if (Class136.smethod_8(keyValuePair.Key))
                        {
                            if (this.method_4(keyValuePair.Key))
                            {
                                this.dictionary_0.Add(keyValuePair.Key, new Class102.Class403(keyValuePair.Value, Enum76.const_0));
                            }
                            else
                            {
                                this.dictionary_0.Add(keyValuePair.Key, new Class102.Class403(keyValuePair.Value, Enum76.const_3));
                                this.InstallState = Enum76.const_3;
                            }
                        }
                    }
                    foreach (KeyValuePair <string, Class102.Class403> keyValuePair2 in this.dictionary_0)
                    {
                        if ([email protected](keyValuePair2.Key))
                        {
                            Enum76 @enum = keyValuePair2.Value.enum76_0;
                            if (@enum == Enum76.const_1)
                            {
                                keyValuePair2.Value.enum76_0 = Enum76.const_4;
                            }
                            else
                            {
                                hashSet.Add(keyValuePair2.Key);
                            }
                        }
                    }
                    this.Name               = @class.Name;
                    this.UpdateUri          = @class.UpdateUri;
                    this.VersionType        = @class.Type;
                    this.ContentPackVersion = @class.Version;
                    this.LoaderPack         = @class.LoaderPack;
                    if (this.VersionType == Enum82.const_0)
                    {
                        this.DataHash = @class.DataHash;
                    }
                }
                if (this.VersionType != Enum82.const_0)
                {
                    using (Stream stream = File.Open(this.FileName, FileMode.Open, FileAccess.Read, FileShare.None))
                    {
                        this.DataHash = stream.smethod_2();
                    }
                }
                this.dictionary_0.smethod_8(hashSet);
            }
        }