Ejemplo n.º 1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing && !_isDisposed)
            {
                _isDisposed = true;
                PickerManager.Dispose(this);
            }

            base.Dispose(disposing);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 执行抓取
 /// </summary>
 private void DoPick()
 {
     Task.Run(() =>
     {
         List <Type> managerList = ReflectionHelper.GetClasses <PickerManager>();//.Where(t => t.Name == "JSK3PickerManager").ToList();
         ParallelOptions options = new ParallelOptions {
             MaxDegreeOfParallelism = 10
         };
         Parallel.ForEach(managerList, type =>
         {
             try
             {
                 PickerManager pickerManager = Activator.CreateInstance(type) as PickerManager;
                 while (true)
                 {
                     try
                     {
                         List <OpenResult> list = pickerManager.DoPick(TaskCount);
                         int result             = OpenResultApp.Insert(list);
                         if (result < 0)
                         {
                             lock (locker)
                             {
                                 log.Error($"插入结果到数据库失败。数量:{list.Count},类型:{type.ToString()}");
                             }
                         }
                         Thread.Sleep(SleepTime);
                     }
                     catch (Exception ex)
                     {
                         lock (locker)
                         {
                             this.log.Error($"抓取异常。详情:{ex.ToString()}");
                         }
                         Thread.Sleep(SleepTime);
                     }
                 }
             }
             catch (Exception ex)
             {
                 lock (locker)
                 {
                     this.log.Error($"抓取异常。详情:{ex.ToString()}");
                 }
             }
         });
     });
 }
Ejemplo n.º 3
0
 void Awake()
 {
     instance = this;
 }
Ejemplo n.º 4
0
 protected override void OnFocusChanged(bool gainFocus, [GeneratedEnum] FocusSearchDirection direction, Rect previouslyFocusedRect)
 {
     base.OnFocusChanged(gainFocus, direction, previouslyFocusedRect);
     PickerManager.OnFocusChanged(gainFocus, this, (IPopupTrigger)Parent.Parent);
 }
Ejemplo n.º 5
0
 public override bool OnTouchEvent(MotionEvent e)
 {
     PickerManager.OnTouchEvent(this, e);
     return(base.OnTouchEvent(e));            // raises the OnClick event if focus is already received
 }
Ejemplo n.º 6
0
 public MaterialPickerEditText(Context context, IAttributeSet attrs, int defStyleAttr) : base(context, attrs, defStyleAttr)
 {
     PickerManager.Init(this);
 }
Ejemplo n.º 7
0
 public MaterialPickerEditText(Context context, IAttributeSet attrs) : base(context, attrs)
 {
     PickerManager.Init(this);
 }
Ejemplo n.º 8
0
 protected MaterialPickerEditText(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
 {
     PickerManager.Init(this);
 }
Ejemplo n.º 9
0
 public MaterialPickerEditText(Context context) : base(context)
 {
     PickerManager.Init(this);
 }