src/RumahScarlett/RumahScarlett.Presentation/Helper/RoleManager.cs
/// <summary>
/// Ambil semua Type form di Assembly
/// </summary>
/// <param name="assembly">Assembly aplikasi</param>
Ambil semua Type form di Assembly
Ambil semua Type form di Assembly
private void GetTypeFromAssembly(Assembly assembly)
      {
         var formTypes = assembly.GetTypes().Where(t => t.IsClass && (t.BaseType.Name.Contains("View") &&
                         !(t.Name.Contains("Main") || t.Name.Contains("Entry") || t.Name.Contains("Base"))));
         foreach (var type in formTypes)
         {
            Form form = (Form)Activator.CreateInstance(type);
            if (form.TagIgnore()) continue;
            PopulateButtonFormToFormAction(form);
         }
      }
private void GetTypeFromAssembly ( Assembly assembly ) { var formTypes = assembly . GetTypes ( ) . Where ( t => t . IsClass && ( t . BaseType . Name . Contains ( " " ) && ! ( t . Name . Contains ( " " ) || t . Name . Contains ( " " ) || t . Name . Contains ( " " ) ) ) ) ; foreach ( var type in formTypes ) { Form form = ( Form ) Activator . CreateInstance ( type ) ; if ( form . TagIgnore ( ) ) continue ; PopulateButtonFormToFormAction ( form ) ; } }
Ambil semua Type form di Assembly
Ambil semua Type form di Assembly
// Ambil semua object di assembly yang bertipe class dan WindowsForm, // dan form yang tidak mengandung nama Main atau Base // Looping semua Form di list formTypes // Buat instance Form dari Type Form tersebut // Lewati jika Form mempunyai Tag ignore
assembly
Assembly
None