Beispiel #1
0
        private Task <string> FindAndExecuteAsync()
        {
            return(Task.Run(() =>
            {
                var msg = new StringBuilder();
                foreach (var item in SettingsViewModel.SearchTasks)
                {
                    try
                    {
                        switch (item.Converter)
                        {
                        case KnownConverter.InterfaceConverter:
                            {
                                InterfaceConverter.FindAndExecute(item);
                                break;
                            }

                        case KnownConverter.StructConverter:
                            {
                                StructConverter.FindAndExecute(item);
                                break;
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        msg.AppendLine(e.Message);
                        msg.AppendLine(e.StackTrace);
                    }
                }
                return msg.ToString();
            }));
        }