Exemplo n.º 1
0
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (((context != null) && (context.Instance != null)) && (provider != null))
     {
         IWindowsFormsEditorService wfes = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
         if (wfes != null)
         {
             c__DisplayClass3 class3 = new c__DisplayClass3();
             c__DisplayClass1 class4 = new c__DisplayClass1();
             c__DisplayClass3 CS__a8locals4 = class3;
             c__DisplayClass1 CS__a8locals2 = class4;
             ListBox lst = new ListBox();
             DataTable factoryClasses = DbProviderFactories.GetFactoryClasses();
             lst.DataSource = factoryClasses;
             lst.DisplayMember = "InvariantName";
             lst.ValueMember = "InvariantName";
             lst.SelectionMode = SelectionMode.One;
             lst.DoubleClick += delegate(object sender, EventArgs e)
             {
                 CS__a8locals4.wfes.CloseDropDown();
                 CS__a8locals2.value = lst.SelectedValue;
             };
             wfes.DropDownControl(lst);
             value = lst.Text;
             if (LoggingService.IsDebugEnabled)
             {
                 LoggingService.DebugFormatted("选择数据源类型是:{0}", new object[] { value });
             }
             return value;
         }
     }
     return value;
 }
Exemplo n.º 2
0
 private void EnsureDirtory(string ftpfile)
 {
     if (!this.FtpFileExists(ftpfile))
     {
         c__DisplayClass1 class3 = new c__DisplayClass1();
         string[] dirArray = ftpfile.Split(new char[] { '\\', '/' }, StringSplitOptions.RemoveEmptyEntries);
         string dirpath = string.Empty;
         FTPdirectory pdirectory = this.ListDirectoryDetail(string.Empty);
         Predicate<FTPfileInfo> match = null;
         c__DisplayClass1 CS_8__locals2 = class3;
         for (int i = 0; i < (dirArray.Length - 1); i++)
         {
             dirpath = dirpath + "/" + dirArray[i].Trim();
             if (pdirectory != null)
             {
                 if (match == null)
                 {
                     match = delegate (FTPfileInfo f) {
                         return (f.FileType == FTPfileInfo.DirectoryEntryTypes.Directory) && (f.Filename == CS_8__locals2.dirArray[i]);
                     };
                 }
                 if (pdirectory.Exists(match))
                 {
                     goto Label_00AC;
                 }
             }
             this.FtpCreateDirectory(dirpath);
             if (pdirectory != null)
             {
                 pdirectory = null;
             }
             goto Label_00B4;
         Label_00AC:
             pdirectory = this.ListDirectoryDetail(dirpath);
         Label_00B4:;
         }
     }
 }