コード例 #1
0
 public Database(string server, string name, string user)
 {
     Server   = server;
     Name     = name;
     User     = user;
     Tables   = new TableCollection();
     Programs = new ProgramCollection();
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: Renan-Saraiva/syspec
        public int Equals(ProgramCollection programs, System.IO.StreamWriter log)
        {
            int e = 0;

            // compara os programas
            foreach (Program program in programs)
            {
                Program c = this[program.Name];
                if (c == null)
                {
                    log.WriteLine("--{0} '{1}' not found.", program.Type, program.Name);
                    log.WriteLine(program.SqlCreate());
                    log.WriteLine();
                    e++;
                }
                else
                {
                    if (!c.Equals(program, log))
                    {
                        e++;
                    }
                }
            }

            // procura programas a mais
            foreach (Program program in this)
            {
                Program c = programs[program.Name];
                if (c == null)
                {
                    log.WriteLine("--Unknown {0} '{1}' found.", program.Type, program.Name);
                    log.WriteLine("/*");
                    log.WriteLine(program.SqlDrop());
                    log.WriteLine("*/");
                    log.WriteLine();
                    e++;
                }
            }

            return(e);
        }