Пример #1
0
 private void CheckPoint(MessageType status, string message)
 {
     if (!this.cancelled)
     {
         NewMainForm.ShowMessage(this, status, message);
     }
 }
Пример #2
0
 static DynamicEditor()
 {
     editorTable = new Hashtable();
     editorTable[typeof(object)]   = Activator.CreateInstance(typeof(UITypeEditor));
     editorTable[typeof(DataSet)]  = Activator.CreateInstance(typeof(DataSetEditor));
     editorTable[typeof(DateTime)] = Activator.CreateInstance(typeof(DateTimeEditor));
     foreach (CustomHandler handler in Configuration.MasterConfig.DataEditors)
     {
         Type type = Type.GetType(handler.TypeName);
         if (type == null)
         {
             NewMainForm.ShowMessage(typeof(DynamicEditor), MessageType.Warning, string.Format(typeNotFoundMessage, handler.TypeName));
         }
         else
         {
             Type type2 = Type.GetType(handler.Handler);
             if (type2 == null)
             {
                 NewMainForm.ShowMessage(typeof(DynamicEditor), MessageType.Warning, string.Format(typeNotFoundMessage, handler.Handler));
             }
             else
             {
                 editorTable[type] = Activator.CreateInstance(type2);
             }
         }
     }
 }
Пример #3
0
        public MacroPlayer(NewMainForm mainForm, string file)
        {
            form     = mainForm;
            fileName = file;
            string text = System.IO.File.ReadAllText(fileName);

            tokens = Regex.Split(text, @"\s+");
        }
 private void InitAdditionalProperties(HttpWebClientProtocol proxy)
 {
     if (proxyTypeHandlers == null)
     {
         proxyTypeHandlers = new Hashtable();
         CustomHandler[] proxyProperties = Configuration.MasterConfig.ProxyProperties;
         if ((proxyProperties != null) && (proxyProperties.Length > 0))
         {
             foreach (CustomHandler handler in proxyProperties)
             {
                 string typeName = handler.TypeName;
                 string str2     = handler.Handler;
                 if (((typeName != null) && (typeName.Length != 0)) && ((str2 != null) && (str2.Length != 0)))
                 {
                     Type key = Type.GetType(typeName);
                     if (key == null)
                     {
                         NewMainForm.ShowMessage(this, MessageType.Warning, string.Format(typeNotFoundMessage, typeName));
                     }
                     else
                     {
                         Type type = Type.GetType(str2);
                         if (type == null)
                         {
                             NewMainForm.ShowMessage(this, MessageType.Warning, string.Format(typeNotFoundMessage, str2));
                         }
                         else
                         {
                             proxyTypeHandlers.Add(key, type);
                         }
                     }
                 }
             }
         }
     }
     for (Type type3 = proxy.GetType(); type3 != typeof(object); type3 = type3.BaseType)
     {
         Type type4 = proxyTypeHandlers[type3] as Type;
         if (type4 != null)
         {
             this.AdditionalProperties = (IAdditionalProperties)Activator.CreateInstance(type4, new object[] { proxy });
             break;
         }
     }
 }
Пример #5
0
 static DynamicConverter()
 {
     converterTable = new Hashtable();
     converterTable[typeof(bool)]        = Activator.CreateInstance(typeof(BooleanConverter));
     converterTable[typeof(byte)]        = Activator.CreateInstance(typeof(ByteConverter));
     converterTable[typeof(sbyte)]       = Activator.CreateInstance(typeof(SByteConverter));
     converterTable[typeof(char)]        = Activator.CreateInstance(typeof(CharConverter));
     converterTable[typeof(double)]      = Activator.CreateInstance(typeof(DoubleConverter));
     converterTable[typeof(string)]      = Activator.CreateInstance(typeof(StringConverter));
     converterTable[typeof(int)]         = Activator.CreateInstance(typeof(Int32Converter));
     converterTable[typeof(short)]       = Activator.CreateInstance(typeof(Int16Converter));
     converterTable[typeof(long)]        = Activator.CreateInstance(typeof(Int64Converter));
     converterTable[typeof(float)]       = Activator.CreateInstance(typeof(SingleConverter));
     converterTable[typeof(ushort)]      = Activator.CreateInstance(typeof(UInt16Converter));
     converterTable[typeof(uint)]        = Activator.CreateInstance(typeof(UInt32Converter));
     converterTable[typeof(ulong)]       = Activator.CreateInstance(typeof(UInt64Converter));
     converterTable[typeof(object)]      = Activator.CreateInstance(typeof(ExpandableObjectConverter));
     converterTable[typeof(void)]        = Activator.CreateInstance(typeof(TypeConverter));
     converterTable[typeof(CultureInfo)] = Activator.CreateInstance(typeof(CultureInfoConverter));
     converterTable[typeof(DateTime)]    = Activator.CreateInstance(typeof(DateTimeConverter));
     converterTable[typeof(decimal)]     = Activator.CreateInstance(typeof(DecimalConverter));
     converterTable[typeof(TimeSpan)]    = Activator.CreateInstance(typeof(TimeSpanConverter));
     converterTable[typeof(Guid)]        = Activator.CreateInstance(typeof(GuidConverter));
     foreach (CustomHandler handler in Configuration.MasterConfig.TypeConverters)
     {
         Type type = Type.GetType(handler.TypeName);
         if (type == null)
         {
             NewMainForm.ShowMessage(typeof(DynamicConverter), MessageType.Warning, string.Format(typeNotFoundMessage, handler.TypeName));
         }
         else
         {
             Type type2 = Type.GetType(handler.Handler);
             if (type2 == null)
             {
                 NewMainForm.ShowMessage(typeof(DynamicConverter), MessageType.Warning, string.Format(typeNotFoundMessage, handler.Handler));
             }
             else
             {
                 converterTable[type] = Activator.CreateInstance(type2);
             }
         }
     }
 }