Esempio n. 1
0
        private async Task LoadProjectTypesLookupAsync()
        {
            ProjectTypes.Clear();
            ProjectTypes.Add(new NullLookupItem {
                DisplayMember = " - "
            });
            var lookup = await _projectTypeLookupDataService.GetProjectTypeLookupAsync();

            foreach (var lookupItem in lookup)
            {
                ProjectTypes.Add(lookupItem);
            }
        }
Esempio n. 2
0
        public static void InitializeAddOnTypes()
        {
            List <Type> types = new List <Type>();

            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                Type[] exportedTypes = new Type[0];
                try { exportedTypes = assembly.GetExportedTypes(); }
                catch { }
                finally { types.AddRange(exportedTypes); }
            }

            AddOnTypes.Clear();
            AddOnTypes.AddRange(types
                                .Where(t => t.GetCustomAttribute <AddOnAttribute>() != null && t.IsClass && !t.IsAbstract)
                                .Where(t => t.GetInterface(typeof(IAddOn).FullName) != null));

            ProjectTypes.Clear();
            ProjectTypes.AddRange(types
                                  .Where(t => t.GetCustomAttribute <ProjectTypeAttribute>() != null && t.IsClass && !t.IsAbstract));
        }