Пример #1
0
 public bool Compare(Assembly obj)
 {
     if (obj == null) throw new ArgumentNullException("obj");
     if (!this.CLRName.Equals(obj.CLRName)) return false;
     if (!this.PermissionSet.Equals(obj.PermissionSet)) return false;
     if (!this.Owner.Equals(obj.Owner)) return false;
     if (!this.Text.Equals(obj.Text)) return false;
     if (this.Files.Count != obj.Files.Count) return false;
     for (int j = 0; j < this.Files.Count; j++)
         if (!this.Files[j].Content.Equals(obj.Files[j].Content)) return false;
     return true;
 }
Пример #2
0
 public override ISchemaBase Clone(ISchemaBase parent)
 {
     Assembly item = new Assembly(parent)
                         {
                             Id = this.Id,
                             Name = this.Name,
                             Owner = this.Owner,
                             Visible = this.Visible,
                             Text = this.Text,
                             PermissionSet = this.PermissionSet,
                             CLRName = this.CLRName,
                             Guid = this.Guid,
                             Files = this.Files
                         };
     this.DependenciesOut.ForEach(dep => item.DependenciesOut.Add(dep));
     this.ExtendedProperties.ForEach(ep => item.ExtendedProperties.Add(ep));
     return item;
 }
Пример #3
0
 public void Fill(Database database, string connectionString)
 {
     int lastViewId = 0;
     if (database.Options.Ignore.FilterAssemblies)
     {
         using (SqlConnection conn = new SqlConnection(connectionString))
         {
             using (SqlCommand command = new SqlCommand(GetSQL(), conn))
             {
                 conn.Open();
                 command.CommandTimeout = 0;
                 using (SqlDataReader reader = command.ExecuteReader())
                 {
                     Assembly item = null;
                     while (reader.Read())
                     {
                         if (lastViewId != (int)reader["assembly_id"])
                         {
                             item = new Assembly(database)
                                        {
                                            Id = (int) reader["assembly_id"],
                                            Name = reader["Name"].ToString(),
                                            Owner = reader["Owner"].ToString(),
                                            CLRName = reader["clr_name"].ToString(),
                                            PermissionSet = reader["permission_set_desc"].ToString(),
                                            Text = ToHex((byte[]) reader["content"]),
                                            Visible = (bool) reader["is_visible"]
                                        };
                             lastViewId = item.Id;
                             database.Assemblies.Add(item);
                         }
                         if (!String.IsNullOrEmpty(reader["Dependency"].ToString()))
                             item.DependenciesOut.Add(reader["Dependency"].ToString());
                         if (!String.IsNullOrEmpty(reader["ObjectDependency"].ToString()))
                             item.DependenciesOut.Add(reader["ObjectDependency"].ToString());
                         if (!String.IsNullOrEmpty(reader["UDTName"].ToString()))
                             item.DependenciesOut.Add(reader["UDTName"].ToString());
                     }
                 }
             }
             FillFiles(database, connectionString);
         }
     }
 }