Пример #1
0
        public static bool _ConvertFromString_System_ComponentModel_Int32Converter_System_ComponentModel_ITypeDescriptorContext_System_String( )
        {
            //class object
            System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter();

            //Parameters
            System.ComponentModel.ITypeDescriptorContext context = null;
            System.String text = null;

            //ReturnType/Value
            System.Object returnVal_Real        = null;
            System.Object returnVal_Intercepted = null;

            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                returnVal_Real = _System_ComponentModel_Int32Converter.ConvertFromString(context, text);
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                returnVal_Intercepted = _System_ComponentModel_Int32Converter.ConvertFromString(context, text);
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted));
        }
        public static bool _ConvertFromString_System_ComponentModel_Int32Converter_System_ComponentModel_ITypeDescriptorContext_System_String( )
        {
            //class object
            System.ComponentModel.Int32Converter _System_ComponentModel_Int32Converter = new System.ComponentModel.Int32Converter();

               //Parameters
               System.ComponentModel.ITypeDescriptorContext context = null;
               System.String text = null;

               //ReturnType/Value
               System.Object returnVal_Real = null;
               System.Object returnVal_Intercepted = null;

               //Exception
               System.Exception exception_Real = null;
               System.Exception exception_Intercepted = null;

               InterceptionMaintenance.disableInterception( );

               try
               {
              returnVal_Real = _System_ComponentModel_Int32Converter.ConvertFromString(context,text);
               }

               catch( System.Exception e )
               {
              exception_Real = e;
               }

               InterceptionMaintenance.enableInterception( );

               try
               {
              returnVal_Intercepted = _System_ComponentModel_Int32Converter.ConvertFromString(context,text);
               }

               catch( System.Exception e )
               {
              exception_Intercepted = e;
               }

               return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) );
        }
Пример #3
0
 private void LoadKeyNames()
 {
     System.ComponentModel.Int32Converter conv = new System.ComponentModel.Int32Converter();
     foreach (string st1 in KeyNamesStr.Split('\n'))
     {
         string[] st = st1.Trim().Split(new char[] { '=' }, 2);
         KeyNames[(int)(conv.ConvertFromString(st[0]))] = st[1];
     }
     LocalSt.KeyNames = KeyNames;
 }
Пример #4
0
        /// <summary>
        /// one of these should go away
        /// move to BLL and springify
        /// this one does not use XMLReader (i hope)
        /// </summary>
        public static void LoadScreenListFromXml()
#if true        
        {
            XmlReaderSettings settings = new XmlReaderSettings();
            XmlReader reader = default(XmlReader);
            settings.ConformanceLevel = ConformanceLevel.Fragment;
            settings.IgnoreWhitespace = true;
            settings.IgnoreComments = true;

            ////see Nunit test pp 99 
            ////this is what it used to be
            //// you have to test for scr.xml
            //// don't build for testing at the expense of needed functionality
            try
            {
                reader = XmlReader.Create(@"scr.xml");
            }
            catch
            {
                var sb = new StringBuilder();
                sb.AppendLine("The scr.xml file is missing or faulty");
                sb.AppendLine("Please create it ");
                sb.AppendLine(" by saving Screen Positions");
                MessageBox.Show(sb.ToString());
                return;
            }
            while (reader.Read())
            {
                switch (reader.Name)
                {
                    case "":
                        continue;
                    case "xml":
                        continue;
                    case "Screens":
                        continue;
                    case "Items":
                        continue;
                    case "Item":

                        var sd = new ScreenDimension();
                        var cvt = new System.ComponentModel.Int32Converter();

                        sd.WinTitle = reader.GetAttribute("Title");
                        sd.TopInt = (int)cvt.ConvertFromString(
                                reader.GetAttribute("Top"));
                        sd.LeftInt = (int)cvt.ConvertFromString(
                                reader.GetAttribute("Left"));
                        sd.WidthInt = (int)cvt.ConvertFromString(
                                reader.GetAttribute("Width"));
                        sd.HeightInt = (int)cvt.ConvertFromString(
                                reader.GetAttribute("Height"));

                        ScreenList.Add(sd);
                        continue;
                    default:
                        break;
                }
            }
            reader.Close();

        }
 public int[] BCL()
 {
     return(items.Select(i => _bclConverter.ConvertFromString(i)).Cast <int>().ToArray());
 }