Beispiel #1
0
 public Calculator(DistanceDocument doc)
 {
     this.doc = doc;
     this.distances = new ObservableCollection<CalculatedDistance>();
     this.Recalculate();
     this.doc.Changed += doc_Changed;
 }
Beispiel #2
0
        public Calculator(DistanceDocument doc)
        {
            this.doc = doc;
            this.results = new DataTable();
            results.Columns.Add("Microphone");
            results.Columns.Add("Distance");

            this.doc.Changed += doc_Changed;
        }
        public MainWindow()
        {
            InitializeComponent();

            doc = new DistanceDocument();
            doc.Changed += doc_Changed;
            doc.MicrophoneAdded += doc_MicrophoneAdded;
            doc.ReferencePointAdded += doc_ReferencePointAdded;

            calc = new Calculator(doc);
            dataGrid.DataContext = calc.Distances;

            doc.Plan = new ImageBrush(new BitmapImage(new Uri(BaseUriHelper.GetBaseUri(this), "Images/plan.jpg")));
            doc.Scale = 0.3; // meter per pixel
        }
Beispiel #4
0
        private void Main_Load(object sender, EventArgs e)
        {
            pMainArea.AllowDrop = true;
            pMainArea.DragEnter += pMainArea_DragEnter;
            pMainArea.DragDrop += pMainArea_DragDrop;
            pMainArea.MouseClick += pMainArea_MouseClick;

            doc = new DistanceDocument();
            doc.Changed += doc_Changed;
            doc.MicrophoneAdded += doc_MicrophoneAdded;

            calc = new Calculator.Calculator(doc);
            dataGridView1.DataSource = calc.Results;

            doc.Plan = new Bitmap(@"C:\Users\Henrik\Documents\visual studio 2013\Projects\Distance\Distance\plan.jpg");
            doc.Scale = 0.3F; // meter per pixel
        }