Example #1
0
 private void lvTypes_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (lvTypes.SelectedIndex > -1)
     {
         SelectedType = lvTypes.SelectedItem as DataTypeItem;
         DialogResult = true;
     }
 }
Example #2
0
        private void LoadTypes()
        {
            _types.Clear();

            List <string> files = new List <string>(1000);

            foreach (var path in _asmPaths)
            {
                files.AddRange(Directory.GetFiles(path, "*.dll"));
            }

            files.Add(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\NServiceBus.dll");


            List <string> processed = new List <string>(files.Count);

            foreach (var dll in files)
            {
                var fileName = System.IO.Path.GetFileName(dll);

                if (processed.Contains(fileName))
                {
                    continue;
                }

                try {
                    var asm = Assembly.LoadFrom(dll);

                    foreach (Type t in asm.GetTypes())
                    {
                        if ((t.IsClass || t.IsInterface) && !IsCompilerGenerated(t))
                        {
                            var item = new DataTypeItem()
                            {
                                Type = t, Name = t.Name, Namespace = t.Namespace
                            };

                            _types.Add(item);
                        }
                    }

                    processed.Add(fileName);
                } catch { }
            }

            _Alltypes.AddRange(_types.ToArray());
        }
 private void lvTypes_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if( lvTypes.SelectedIndex > -1 ) {
     SelectedType = lvTypes.SelectedItem as DataTypeItem;
     DialogResult = true;
       }
 }
        private void LoadTypes()
        {
            _types.Clear();

              List<string> files = new List<string>(1000);

              foreach( var path in _asmPaths )
            files.AddRange(Directory.GetFiles(path, "*.dll"));

              files.Add(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\NServiceBus.dll");

              List<string> processed = new List<string>(files.Count);

              foreach( var dll in files ) {
            var fileName = System.IO.Path.GetFileName(dll);

            if( processed.Contains(fileName) )
              continue;

            try {
              var asm = Assembly.LoadFrom(dll);

              foreach( Type t in asm.GetTypes() ) {
            if( ( t.IsClass || t.IsInterface ) && !IsCompilerGenerated(t) ) {

              var item = new DataTypeItem() { Type = t, Name = t.Name, Namespace = t.Namespace };

              _types.Add(item);
            }
              }

              processed.Add( fileName );

            } catch { }

              }

              _Alltypes.AddRange(_types.ToArray());
        }
 private void btnOK_Click(object sender, RoutedEventArgs e)
 {
     SelectedType = lvTypes.SelectedItem as DataTypeItem;
       DialogResult = true;
 }
Example #6
0
 private void btnOK_Click(object sender, RoutedEventArgs e)
 {
     SelectedType = lvTypes.SelectedItem as DataTypeItem;
     DialogResult = true;
 }