| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.ComponentModel;
- using System.Reflection;
- namespace WpfApplication19
- {
- class MeasurePoint : INotifyPropertyChanged
- {
-
- #region INotifyPropertyChanged Members
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected void Notify(string propName)
- {
- if (this.PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs(propName));
- }
- }
- #endregion
- /*
- private int _P1;
-
- public int P1
- {
- get { return _P1; }
- set
- {
-
- this._P1 = value;
- Notify("P1");
- }
- }
- */
- public int Count { get; set; }
- public double P1 { get; set; }
- public double P2 { get; set; }
- public double P3 { get; set; }
- public double P4 { get; set; }
- public double P5 { get; set; }
- public double P6 { get; set; }
- public double P7 { get; set; }
- public double P8 { get; set; }
- public double P9 { get; set; }
- public double P10 { get; set; }
- public double Avg { get; set; }
- public string Grade { get; set; }
- public string ResultGrade { get; set; }
- public string Type { get; set; }
- public int SubOrder { get; set; }
- public void setValue(string alias, double value)
- {
- PropertyInfo methodInfo =
- typeof(MeasurePoint).GetProperty("P"+alias);
-
- // Use the instance to call the method without arguments
-
- try{
- int cn = Convert.ToInt16(alias);
- if (cn >= 1 && cn <= 10)
- methodInfo.SetValue(this, value, null);
- }catch{
- return;
- }
-
- }
- public float GetValue(string alias)
- {
- PropertyInfo methodInfo =
- typeof(MeasurePoint).GetProperty(alias);
-
-
-
- return (float)methodInfo.GetValue(this, null);
- }
- }
- }
|