Наследование: DatumType
Пример #1
0
        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);
        }
Пример #2
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;
     }
 }
Пример #3
0
        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
 /// <summary>
 /// Deserializes workflow markup into an binary object
 /// </summary>
 /// <param name="input">string workflow markup to deserialize</param>
 /// <param name="obj">Output binary 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 binary obj, out System.Exception exception)
 {
     exception = null;
     obj = default(binary);
     try
     {
         obj = Deserialize(input);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
Пример #5
0
 public static bool LoadFromFile(string fileName, out binary obj)
 {
     System.Exception exception;
     return LoadFromFile(fileName, out obj, out exception);
 }
Пример #6
0
 /// <summary>
 /// Deserializes xml markup from file into an binary object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output binary 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 binary obj, out System.Exception exception)
 {
     exception = null;
     obj = default(binary);
     try
     {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
Пример #7
0
 public static bool Deserialize(string input, out binary obj)
 {
     System.Exception exception;
     return Deserialize(input, out obj, out exception);
 }