Ejemplo n.º 1
0
        private void AddingToList()
        {
            Dictionary <int, List <int> > mine = new Dictionary <int, List <int> >();

            ExcelParsers.FetchConnectivityMatrix <int, int>(mine, ExcelInputFile_01, true);
            DotHelpers.BuildConnectivityGraph(mine);
        }
Ejemplo n.º 2
0
        private async void CSVTest_Impl()
        {
            Dictionary <int, List <int> > mine = new Dictionary <int, List <int> >();
            var reader = new StreamReader(CsvInputFile);
            var config = new CsvHelper.Configuration.Configuration();

            config.HasHeaderRecord = false;

            using (var csv = new CsvReader(reader, config)) {
                var records = csv.GetRecords <Foo>();
                // System.Windows.MessageBox.Show("Number of entries found: " + records.Count().ToString());
                foreach (var record in records)
                {
                    // System.Windows.MessageBox.Show(record.Id.ToString() + " has value of " + record.Name);
                    mine[record.Id] = record.Name.Split(',').Select(int.Parse).ToList();
                }
                DotHelpers.BuildConnectivityGraph(mine);
                // ExcelHelper.UniformFactorMethod(ExcelInputFile_01, true);
            }
            reader.Dispose();



            var path = Path.Combine(Environment.CurrentDirectory, "Projects", "Sample", "Connectivity.png");

            /* This is part of an asynchronous function */
            // For preventing file-locking...
            BitmapImage image = new BitmapImage();

            image.BeginInit();
            image.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
            image.CacheOption   = BitmapCacheOption.OnLoad;
            image.UriSource     = new Uri(path);
            image.EndInit();
            TestImageSource = image;
        }