Inheritance: DatumType
コード例 #1
0
 private void btnDatum_Click(object sender, EventArgs e)
 {
     DatumForm form = new DatumForm();
     ControlsToData();
     form.Datum = _doubleValue;
     if (DialogResult.OK == form.ShowDialog())
     {
         _doubleValue = form.Datum as @double;
         DataToControls();
     }
 }
コード例 #2
0
 private void ControlsToData()
 {
     if (!edtDoubleValue.HasValue())
         _doubleValue = null;
     else
     {
         if (_doubleValue == null)
             _doubleValue = new @double();
         _doubleValue.value = edtDoubleValue.GetValue<double>();
         _doubleValue.standardUnit = standardUnitControl.StandardUnit;
     }
 }
コード例 #3
0
ファイル: Common.cs プロジェクト: zhaoshijian/ATMLWorkBench
        public static DatumType GetDatumFromType(ComboBox combo)
        {
            DatumType datum = null;

            switch (combo.SelectedIndex)
            {
            case (int)DatumTypes.BINARY:
                datum = new binary();
                break;

            case (int)DatumTypes.BOOL:
                datum = new boolean();
                break;

            case (int)DatumTypes.DATETIME:
                datum = new dateTime();
                break;

            case (int)DatumTypes.DOUBLE:
                datum = new @double();
                break;

            case (int)DatumTypes.HEX:
                datum = new hexadecimal();
                break;

            case (int)DatumTypes.INT:
                datum = new integer();
                break;

            case (int)DatumTypes.LONG:
                datum = new @long();
                break;

            case (int)DatumTypes.OCT:
                datum = new octal();
                break;

            case (int)DatumTypes.STRING:
                datum = new @string();
                break;

            case (int)DatumTypes.UINT:
                datum = new unsignedInteger();
                break;

            case (int)DatumTypes.ULONG:
                datum = new unsignedLong();
                break;
            }
            return(datum);
        }
コード例 #4
0
 private void SetEditStates(int idx)
 {
     switch (idx)
     {
         case (int) Datum.DatumTypes.BINARY:
             DatumType = new binary();
             break;
         case (int) Datum.DatumTypes.BOOL:
             DatumType = new boolean();
             break;
         case (int) Datum.DatumTypes.COMPLEX:
             DatumType = new complex();
             break;
         case (int) Datum.DatumTypes.DATETIME:
             DatumType = new dateTime();
             break;
         case (int) Datum.DatumTypes.DOUBLE:
             DatumType = new @double();
             break;
         case (int) Datum.DatumTypes.HEX:
             DatumType = new hexadecimal();
             break;
         case (int) Datum.DatumTypes.INT:
             DatumType = new integer();
             break;
         case (int) Datum.DatumTypes.LONG:
             DatumType = new @long();
             break;
         case (int) Datum.DatumTypes.OCT:
             DatumType = new octal();
             break;
         case (int) Datum.DatumTypes.STRING:
             DatumType = new @string();
             break;
         case (int) Datum.DatumTypes.UINT:
             DatumType = new unsignedInteger();
             break;
         case (int) Datum.DatumTypes.ULONG:
             DatumType = new unsignedLong();
             break;
     }
 }
コード例 #5
0
ファイル: Common.cs プロジェクト: UtrsSoftware/ATMLWorkBench
        public static DatumType GetDatumFromType(ComboBox combo)
        {
            DatumType datum = null;

            switch (combo.SelectedIndex)
            {
                case (int) DatumTypes.BINARY:
                    datum = new binary();
                    break;
                case (int) DatumTypes.BOOL:
                    datum = new boolean();
                    break;
                case (int) DatumTypes.DATETIME:
                    datum = new dateTime();
                    break;
                case (int) DatumTypes.DOUBLE:
                    datum = new @double();
                    break;
                case (int) DatumTypes.HEX:
                    datum = new hexadecimal();
                    break;
                case (int) DatumTypes.INT:
                    datum = new integer();
                    break;
                case (int) DatumTypes.LONG:
                    datum = new @long();
                    break;
                case (int) DatumTypes.OCT:
                    datum = new octal();
                    break;
                case (int) DatumTypes.STRING:
                    datum = new @string();
                    break;
                case (int) DatumTypes.UINT:
                    datum = new unsignedInteger();
                    break;
                case (int) DatumTypes.ULONG:
                    datum = new unsignedLong();
                    break;
            }
            return datum;
        }
コード例 #6
0
 public static bool LoadFromFile(string fileName, out @double obj)
 {
     System.Exception exception;
     return LoadFromFile(fileName, out obj, out exception);
 }
コード例 #7
0
 /// <summary>
 /// Deserializes xml markup from file into an double object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output double object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out @double obj, out System.Exception exception)
 {
     exception = null;
     obj = default(@double);
     try
     {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
コード例 #8
0
 public static bool Deserialize(string input, out @double obj)
 {
     System.Exception exception;
     return Deserialize(input, out obj, out exception);
 }
コード例 #9
0
 /// <summary>
 /// Deserializes workflow markup into an double object
 /// </summary>
 /// <param name="input">string workflow markup to deserialize</param>
 /// <param name="obj">Output double object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string input, out @double obj, out System.Exception exception)
 {
     exception = null;
     obj = default(@double);
     try
     {
         obj = Deserialize(input);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }