예제 #1
0
 public void AddSchema(string tableName, Table schema)
 {
     if (!schemaCollection.ContainsKey(tableName))
     {
         schemaCollection.Add(tableName, schema);
     }
 }
예제 #2
0
파일: ClsQuery.cs 프로젝트: hmniaga/Reksa
        public static void SetDebugCon(string Guid, string Provider, string Server,
                                       string Database, string UserName, string Password)
        {
            string Con = "Provider=" + Provider + ";Initial Catalog=" + Database + ";" +
                         "User Id=" + UserName + ";Password="******";Data Source = " + Server;

            if (!ConDebug.ContainsKey(Guid))
            {
                ConDebug.Add(Guid, Con);
            }
            else
            {
                ConDebug[Guid] = Con;
            }
        }
예제 #3
0
        public bool VariableExists(string Name)
        {
            Name = Name.Trim();
            string key = Name.ToLower();

            return(items.ContainsKey(key));
        }
예제 #4
0
        public static void DumpOpcodes()
        {
            var files = System.IO.Directory.GetFiles(@"E:\HFS\WOWDEV\SNIFFS_CLEAN\", "*.sqlite", System.IO.SearchOption.AllDirectories).OrderBy(t => t);

            var versionOpcodeList = new System.Collections.Generic.SortedList<uint, ClientBuildCache>();

            foreach (var file in files)
            {
                uint clientBuild = 0;

                using (var con = new System.Data.SQLite.SQLiteConnection("Data Source=" + file))
                {
                    con.Open();
                    using (var sqlcommand = con.CreateCommand())
                    {
                        sqlcommand.CommandText = "select key, value from header where key = 'clientBuild'";
                        var reader = sqlcommand.ExecuteReader();

                        while (reader.Read())
                        {
                            clientBuild = (uint)reader.GetInt32(1);
                            break;
                        }
                    }

                    if (!versionOpcodeList.ContainsKey(clientBuild))
                    {
                        versionOpcodeList.Add(clientBuild, new ClientBuildCache() { ClientBuild = clientBuild, OpcodeList = new List<OpcodeCache>() });
                    }

                    var clientBuildOpcodes = versionOpcodeList[clientBuild];

                    using (var sqlcommand = con.CreateCommand())
                    {
                        sqlcommand.CommandText = "select distinct opcode, direction from packets order by opcode , direction";
                        var reader = sqlcommand.ExecuteReader();

                        while (reader.Read())
                        {
                            var opcode = (uint)reader.GetInt32(0);
                            var direction = (byte)reader.GetInt32(1);

                            if (!clientBuildOpcodes.OpcodeList.Exists(t => t.Opcode == opcode && t.Direction == direction))
                                clientBuildOpcodes.OpcodeList.Add(new OpcodeCache() { Direction = direction, Opcode = opcode });
                        }
                    }

                    con.Close();
                }
            }

            var clientBuildOpcodeList = versionOpcodeList.Select(t => t.Value).ToList();

            clientBuildOpcodeList.SaveObject("clientBuildOpcodeList.xml");
        }
예제 #5
0
            internal void RemoveLastReferencedAssembler(ushort treeId, ushort muxId, ushort processId)
            {
                ushort lastReferencedFileId;

                if (lastReferencedFileIdPerPidMux.ContainsKey(Utils.ByteConverter.ToUInt32(processId, muxId)))
                {
                    lastReferencedFileId = lastReferencedFileIdPerPidMux[Utils.ByteConverter.ToUInt32(processId, muxId)];
                }
                else if (lastReferencedFileIdPerTreeMux.ContainsKey(Utils.ByteConverter.ToUInt32(treeId, muxId)))
                {
                    lastReferencedFileId = lastReferencedFileIdPerTreeMux[Utils.ByteConverter.ToUInt32(treeId, muxId)];
                }
                else
                {
                    lastReferencedFileId = (ushort)0;
                }

                if (this.fileIdAssemblerList.ContainsKey(lastReferencedFileId))
                {
                    this.RemoveFileStreamAssembler(treeId, muxId, processId, lastReferencedFileId);
                }
            }
예제 #6
0
        public bool Add(string filename, Kom2SubFile subfile, bool overwrite)
        {
            if (subfiles.ContainsKey(filename))
            {
                if (overwrite == false)
                {
                    return(false);
                }

                subfiles.Remove(filename);
            }
            subfiles.Add(filename, subfile);
            return(true);
        }
예제 #7
0
 /// <summary>
 /// Returns true, if the integer <code>nValue</code> is contained in this collection.
 /// </summary>
 /// <param name="nValue">The integer value to test for membership.</param>
 /// <returns>True if the integer value is member of the collection.</returns>
 public bool Contains(int nValue)
 {
     return(_list.ContainsKey(nValue));
 }
예제 #8
0
 public bool IsKeyframe(int frame)
 {
     return(keyframes.ContainsKey(frame));
 }
예제 #9
0
 /// <summary>
 /// O(log(n))
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public bool ContainsKey(TKey key)
 {
     return(sortedList.ContainsKey(key));
 }