public EmployeeMasterCard()
        {
            _exchangeClient = new ExchangeClient();
            _exchangeClient.EMP_DATA_ACK += new _IExchangeClientEvents_EMP_DATA_ACKEventHandler(_exchangeClient_EMP_DATA_ACK);
            _exchangeClient.InitialiseExchange(0);

            if (_requestCollection == null)
                _requestCollection = new SortedDictionary<int, EmployeeMasterCardThreadData>();

            if (_emppollingCollection == null)
                _emppollingCollection = new List<Employeecarddata>();


            _thRequest = new Thread(new ThreadStart(ProcessRequest));
            _thRequest.Start();


            _thAckResponse = new ThreadDispatcher<EmployeeMasterCardThreadDataResponse>(1, "_thAckResponse_EmployeeMasterCard");
            _thAckResponse.AddProcessThreadData(new ProcessThreadDataHandler<EmployeeMasterCardThreadDataResponse>(this.ProcessResponse));
            _thAckResponse.Initialize();

            _iExchangeAdmin = (IExchangeAdmin)_exchangeClient;
            ObjectStateNotifier.AddObserver(this);

        }
		public ClrInstanceFieldDecorator(ClrInstanceField clrInstanceField, ThreadDispatcher threadDispatcher, IClrHeapDecorator heap)
		{
			_clrInstanceField = clrInstanceField;
			_threadDispatcher = threadDispatcher;

			_threadDispatcher.Process(() =>
			{
				Name = _clrInstanceField.Name;
				HasSimpleValue = _clrInstanceField.HasSimpleValue;
				Type = new ClrTypeDecorator(heap, _threadDispatcher, _clrInstanceField.Type);
				IsObjectAndNotString = _clrInstanceField.IsObjectReference() &&_clrInstanceField.ElementType != ClrElementType.String;
			});
		}
		public ClrHeapDecorator(ClrRuntime clrRuntime, ThreadDispatcher threadDispatcher)
		{
			_threadDispatcher = threadDispatcher;
			_clrHeap = threadDispatcher.Process(() => clrRuntime.GetHeap());

			

			_threadDispatcher.Process(()=>
			{
				objectIndex = IndexBuilder.Build(_clrHeap);
				GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
			});
		}
Esempio n. 4
0
        public TITO()
        {
            _exchangeClientSiteCode = new ExchangeClient();
            _exchangeClientSiteCode.OPT_PARAM_ACK += ExchangeClientSiteCodeAck;
            _exchangeClientSiteCode.InitialiseExchange(0);

            _exchangeClientTITOEnDis = new ExchangeClient();
            _exchangeClientTITOEnDis.TITO_ENDIS_ACK += ExchangeClientTITOAck;
            _exchangeClientTITOEnDis.InitialiseExchange(0);

            _exchangeClientTITOEXP = new ExchangeClient();
            _exchangeClientTITOEXP.TITO_PARAM_ACK += ExchangeClientVoucherAck;
            _exchangeClientTITOEXP.InitialiseExchange(0);

            if (dTITORequest == null)
                dTITORequest = new SortedDictionary<int, TITOThreadDataRequest>();

            if (dTicketExpireRequest == null)
                dTicketExpireRequest = new SortedDictionary<int, int>();

            if (dSiteCodeRequest == null)
                dSiteCodeRequest = new SortedDictionary<int, int>();

            _tmrRequest = new System.Timers.Timer(Int32.Parse(ConfigManager.Read("TITOConfigInterval")) * 1000);
            _tmrRequest.Elapsed += new ElapsedEventHandler(ProcessRequest);

            _thAckResponse = new ThreadDispatcher<TITOThreadDataResponse>(1, "_thTITOAckResponse");
            _thAckResponse.AddProcessThreadData(new ProcessThreadDataHandler<TITOThreadDataResponse>(this.TITOProcessResponse));
            _thAckResponse.Initialize();

            _thTicketExpireAckResponse = new ThreadDispatcher<TITOThreadDataResponse>(1, "_thTicketExpireAckResponse");
            _thTicketExpireAckResponse.AddProcessThreadData(new ProcessThreadDataHandler<TITOThreadDataResponse>(this.TicketExpireProcessResponse));
            _thTicketExpireAckResponse.Initialize();

            _thSiteCodeAckResponse = new ThreadDispatcher<TITOThreadDataResponse>(1, "_thSiteCodeAckResponse");
            _thSiteCodeAckResponse.AddProcessThreadData(new ProcessThreadDataHandler<TITOThreadDataResponse>(this.SiteCodeProcessResponse));
            _thSiteCodeAckResponse.Initialize();

            _iExchangeAdminSiteCode = (IExchangeAdmin)_exchangeClientSiteCode;
            _iExchangeAdminTITOEnDis = (IExchangeAdmin)_exchangeClientTITOEnDis;
            _iExchangeAdminTITOEXP = (IExchangeAdmin)_exchangeClientTITOEXP;

            ObjectStateNotifier.AddObserver(this);

            _tmrRequest.Start();
        }
        public EmployeeMasterCard()
        {
            _exchangeClient = new ExchangeClient();
            _exchangeClient.EMP_DATA_ACK += new _IExchangeClientEvents_EMP_DATA_ACKEventHandler(_exchangeClient_EMP_DATA_ACK);
            _exchangeClient.InitialiseExchange(0);

            if (_requestCollection == null)
                _requestCollection = new SortedDictionary<int, EmployeeMasterCardThreadData>();

            _tmrRequest = new System.Timers.Timer(Int32.Parse(ConfigManager.Read("EmployeecardTimeInterval")) * 1000);
            _tmrRequest.Elapsed += new ElapsedEventHandler(ProcessRequest);

            _thAckResponse = new ThreadDispatcher<EmployeeMasterCardThreadDataResponse>(1, "_thAckResponse_EmployeeMasterCard");
            _thAckResponse.AddProcessThreadData(new ProcessThreadDataHandler<EmployeeMasterCardThreadDataResponse>(this.ProcessResponse));
            _thAckResponse.Initialize();

            _iExchangeAdmin = (IExchangeAdmin)_exchangeClient;
            ObjectStateNotifier.AddObserver(this);

            _tmrRequest.Start();
        }
        public EnableDisable()
        {
            _exchangeClient = new ExchangeClient();
            _exchangeClient.MACEnDisAck += ExchangeClientAck;
            _exchangeClient.InitialiseExchange(0);

            if (dEnableDisableRequest == null)
                dEnableDisableRequest = new SortedDictionary<int, EnableDisableThreadData>();

            _tmrRequest = new System.Timers.Timer(Int32.Parse(ConfigManager.Read("MachineConfigInterval")) * 1000);
            _tmrRequest.Elapsed += new ElapsedEventHandler(ProcessRequest);

            _thAckResponse = new ThreadDispatcher<EnableDisableThreadDataResponse>(1, "_thAckResponse");
            _thAckResponse.AddProcessThreadData(new ProcessThreadDataHandler<EnableDisableThreadDataResponse>(this.ProcessResponse));
            _thAckResponse.Initialize();

            _iExchangeAdmin = (IExchangeAdmin)_exchangeClient;
            ObjectStateNotifier.AddObserver(this);

            _tmrRequest.Start();
        }
Esempio n. 7
0
 protected override void SetItem(int index, T item)
 {
     ThreadDispatcher.Invoke(() => base.SetItem(index, item));
 }
Esempio n. 8
0
 protected override void RemoveItem(int index)
 {
     ThreadDispatcher.Invoke(() => base.RemoveItem(index));
 }
Esempio n. 9
0
 protected override void MoveItem(int oldIndex, int newIndex)
 {
     ThreadDispatcher.Invoke(() => base.MoveItem(oldIndex, newIndex));
 }
 public HighPriorityThread(Action<ThreadDispatcher> action, ThreadDispatcher dispatcher) : base(action,dispatcher)
 {
 }
 protected Runner(Action<ThreadDispatcher> action,ThreadDispatcher dispathcer)
 {
     _action = action;
     _dispathcer = dispathcer;
 }
Esempio n. 12
0
        private void DrawComboBoxItem(DrawItemEventArgs e)
        {
            HighlightState hover;
            string         fontName = (string)base.ComboBox.Items[e.Index];
            bool           flag     = (e.State & DrawItemState.Selected) > DrawItemState.None;
            bool           flag2    = this.hasBeenShown && (e.Bounds.Width >= (base.ComboBox.DropDownWidth / 2));

            if (!flag2)
            {
                hover = HighlightState.Default;
            }
            else if (flag)
            {
                hover = HighlightState.Hover;
            }
            else
            {
                hover = HighlightState.Default;
            }
            Color selectionBackColor = SelectionHighlight.GetSelectionBackColor(hover);
            int   num  = UIUtil.ScaleWidth(3);
            int   num2 = num;
            int   num3 = -1;

            this.selectionHighlightRenderer.HighlightState = hover;
            using (IDrawingContext context = DrawingContextUtil.FromGraphics(e.Graphics, e.Bounds, false, FactorySource.PerThread))
            {
                RenderLayer layer = new RenderLayer();
                context.Clear(new ColorRgba128Float?((ColorRgba128Float)PaintDotNet.Imaging.SystemColors.Window));
                this.selectionHighlightRenderer.RenderBackground(context, e.Bounds.ToRectFloat());
                SizedFontProperties        menu      = this.systemFonts.Menu;
                PaintDotNet.UI.Media.Brush textBrush = this.selectionHighlightRenderer.EmbeddedTextBrush;
                TextLayout textLayout = UIText.CreateLayout(context, fontName, menu, null, HotkeyRenderMode.Ignore, (double)(e.Bounds.Width - num2), (double)e.Bounds.Height);
                textLayout.ParagraphAlignment = ParagraphAlignment.Center;
                textLayout.WordWrapping       = WordWrapping.NoWrap;
                int num5 = num + e.Bounds.X;
                context.DrawTextLayout((double)num5, (double)(e.Bounds.Y + num3), textLayout, textBrush, DrawTextOptions.None);
                ITextLayout  cachedOrCreateResource = context.GetCachedOrCreateResource <ITextLayout>(textLayout);
                int          num4   = (int)Math.Ceiling((double)(num5 + cachedOrCreateResource.Metrics.WidthMax));
                PlacedBitmap bitmap = this.TryGetFontPreview(fontName, 16f, textBrush);
                if (bitmap == null)
                {
                    IntPtr listHwnd = UIUtil.GetListBoxHwnd(base.ComboBox);
                    Action callback = delegate {
                        try
                        {
                            PlacedBitmap bitmap = this.GetOrCreateFontPreview(fontName, 16f, textBrush);
                            if (listHwnd != IntPtr.Zero)
                            {
                                this.ComboBox.BeginInvoke(() => UIUtil.InvalidateHwnd(listHwnd));
                            }
                        }
                        catch (Exception)
                        {
                        }
                    };
                    if (this.backgroundThread == null)
                    {
                        this.backgroundThread = new ThreadDispatcher(ApartmentState.MTA);
                    }
                    this.backgroundThread.Enqueue(QueueSide.Front, callback).Observe();
                }
                if (flag2 && (bitmap != null))
                {
                    PaintDotNet.UI.Media.Brush brush;
                    RectFloat num7;
                    RectFloat num6 = new RectFloat((float)((e.Bounds.Right - num) - bitmap.Bitmap.Size.Width), num3 + ((float)Math.Floor((double)((e.Bounds.Y + ((e.Bounds.Height - bitmap.LayoutRect.Height) / 2.0)) - bitmap.LayoutRect.Top))), (float)bitmap.Bitmap.Size.Width, (float)bitmap.Bitmap.Size.Height);
                    if (num6.Left > num4)
                    {
                        num7  = num6;
                        brush = null;
                    }
                    else
                    {
                        num7    = num6;
                        num7.X += num4 - num6.X;
                        num7.X  = (float)Math.Ceiling((double)num7.X);
                        LinearGradientBrush brush2 = new LinearGradientBrush {
                            ColorInterpolationMode = ColorInterpolationMode.SRgbLinearInterpolation,
                            SpreadMethod           = GradientSpreadMethod.Pad
                        };
                        brush2.GradientStops.Add(new GradientStop(Color.White, 0.0));
                        brush2.GradientStops.Add(new GradientStop(Color.White, ((double)(e.Bounds.Width - UIUtil.ScaleWidth(0x18))) / ((double)e.Bounds.Width)));
                        brush2.GradientStops.Add(new GradientStop(Color.Transparent, 1.0));
                        brush2.EndPoint = new PointDouble((double)e.Bounds.Width, 0.0);
                        brush           = brush2;
                    }
                    using (context.CreateLayer(null))
                    {
                        context.PushLayer(layer, new RectDouble?(num7), null, AntialiasMode.Aliased, new Matrix3x2Double?(Matrix3x2Float.Identity), 1.0, brush, LayerOptions.None);
                        context.DrawBitmap(bitmap.DeviceBitmap, new RectDouble?(num7), 1.0, BitmapInterpolationMode.Linear, null);
                        context.PopLayer();
                    }
                }
            }
        }
		public ClrRuntimeDecorator(DataTarget dataTarget, string dacFileName, ThreadDispatcher threadDispatcher)
		{
			_threadDispatcher = threadDispatcher;
			_clrRuntime = threadDispatcher.ProcessAsync(() => dataTarget.CreateRuntime(dacFileName));
		}
        public RleaseGameCap()
        {
            _exchangeClient = new ExchangeClient();
            _exchangeClient.MACEnDisAck += new _IExchangeClientEvents_MACEnDisAckEventHandler(_exchangeClient_MacEnable_DATA_ACK);
            _exchangeClient.InitialiseExchange(0);

            if (_requestCollection == null)
                _requestCollection = new SortedDictionary<int, EnableMachineThreadData>();

            if (m_SectorData == null)
                m_SectorData = new Sector203Data();
            
            if(oGameCappingBiz == null)
                oGameCappingBiz= new GameCappingBiz();
            
            if (_lstGameCapDetails == null)
                _lstGameCapDetails = new List<GameCapDetails>();
            
            _thRequest = new Thread(new ThreadStart(ProcessRequest));

            _thAckResponse = new ThreadDispatcher<EnableMachineThreadDataResponse>(1, "_thAckResponse_EnableMachine");
            _thAckResponse.AddProcessThreadData(new ProcessThreadDataHandler<EnableMachineThreadDataResponse>(this.ProcessResponse));
            _thAckResponse.Initialize();

            _iExchangeAdmin = (IExchangeAdmin)_exchangeClient;
            ObjectStateNotifier.AddObserver(this);

            _thRequest.Start();
        }
        public void Unfollow(bool all)
        {
            try
            {
                ThreadDispatcher.Invoke(() => this.CurrentContext.ProcessState = ProcessState.Running);

                if (!this.httpContainer.InstagramLogin(this.CurrentContext.UserName, this.CurrentContext.Password))
                {
                    throw new InstagramException("An error occured during login!");
                }

                var detailResponse = this.httpContainer.InstagramGet(string.Format(UserUri, this.CurrentContext.UserName));
                if (detailResponse == string.Empty)
                {
                    throw new InstagramException("Could not get followed users from instagram!");
                }

                this.referrer  = string.Format(UserUri, this.CurrentContext.UserName);
                this.csrfToken = Regex.Match(detailResponse.Replace(" ", string.Empty), "\"csrf_token\":\"(\\w+)\"").Groups[1].Value;

                var     profileJson = Regex.Matches(detailResponse, "<script type=\"text/javascript\">window._sharedData =(.*?);</script>")[0].Groups[1].Value;
                dynamic dyn         = JsonConvert.DeserializeObject(profileJson);
                dynamic dynPage     = JsonConvert.DeserializeObject(dyn.entry_data.ProfilePage[0].ToString());

                this.userId = dynPage.user.id.ToString();

                var postData = FollowingQueryPostString.Replace("%0%", this.userId);

                var json = this.httpContainer.InstagramPost(QueryUri, this.csrfToken, string.Format(UserUri, this.CurrentContext.UserName), postData);
                if (json == string.Empty)
                {
                    throw new InstagramException("Could not get followed users from instagram!");
                }

                dyn = JsonConvert.DeserializeObject(json);

                foreach (var node in dyn.follows.nodes)
                {
                    var pic = node.profile_pic_url.ToString();

                    ThreadDispatcher.Invoke(() => this.CurrentContext.UpdateCurrentImage(pic));

                    if (this.ProcessStopped())
                    {
                        return;
                    }

                    Thread.Sleep(this.GetRandomTimeout());

                    if (all || !this.Follows(node.username.ToString()))
                    {
                        this.log.Info("Unfollwing user: "******"%0%", this.userId).Replace("%1%", dyn.follows.page_info.end_cursor.ToString());

                    json = this.httpContainer.InstagramPost(QueryUri, this.csrfToken, string.Format(UserUri, this.CurrentContext.UserName), postData);
                    if (json == string.Empty)
                    {
                        throw new InstagramException("Could not get followed users from instagram!");
                    }

                    dyn = JsonConvert.DeserializeObject(json);

                    foreach (var node in dyn.follows.nodes)
                    {
                        var pic = node.profile_pic_url.ToString();

                        ThreadDispatcher.Invoke(() => this.CurrentContext.UpdateCurrentImage(pic));

                        if (this.ProcessStopped())
                        {
                            return;
                        }

                        Thread.Sleep(this.GetRandomTimeout());

                        if (all || !this.Follows(node.username.ToString()))
                        {
                            this.log.Info("Unfollwing user: "******"Finished.");
                ThreadDispatcher.Invoke(() => this.CurrentContext.ProcessState = ProcessState.Finished);
            }
            catch (Exception ex)
            {
                ThreadDispatcher.Invoke(() => this.CurrentContext.HandleException(ex));
            }
        }
		public ClrTypeDecorator(IClrHeapDecorator clrHeapDecorator, ThreadDispatcher threadDispatcher, ClrType clrType)
		{
			_clrHeapDecorator = clrHeapDecorator;
			_threadDispatcher = threadDispatcher;
			_clrType = clrType;
		}
Esempio n. 17
0
 private PdfPage(ThreadDispatcher dispatcher, FpdfDocumentT documentInstance, FpdfPageT pageInstance)
 {
     _dispatcher       = dispatcher;
     _documentInstance = documentInstance;
     _pageInstance     = pageInstance;
 }
		public ClrInfoDecorator(ClrInfo clrInfo, ThreadDispatcher threadDispatcher)
		{
			_clrInfo = clrInfo;
			_threadDispatcher = threadDispatcher;
		}
 public LowPriorityRunner(Action<ThreadDispatcher> action, ThreadDispatcher dispatcher)
     : base(action, dispatcher)
 {
     _dispatcher = dispatcher;
 }
Esempio n. 20
0
 /// <summary>
 /// Initializes this instance.
 /// </summary>
 public override void Init()
 {
     ThreadDispatcher.Initialize();
     this.InfoCommand            = this.CoreFactory.CreateContextCommand <InfoCommand, IInfoContext>(this);
     this.InstagramWindowCommand = this.CoreFactory.CreateContextCommand <InstagramWindowCommand, IInstagramContext>(this);
 }
 public AutoEnableDisable(ThreadDispatcher<MachineConfigThreadData> machineDispatcher)
 {
     _machineDispatcher = machineDispatcher;
     _machineDispatcher.AddProcessThreadData(new ProcessThreadDataHandler<MachineConfigThreadData>(this.OnMachineConfigAction));
     ObjectStateNotifier.AddObserver(this);
 }
		public ClrMethodDecorator(ClrMethod clrMethod, ThreadDispatcher threadDispatcher)
		{
			_clrMethod = clrMethod;
			_threadDispatcher = threadDispatcher;
		}
    // Exit if escape (or back, on mobile) is pressed.
    //protected virtual void Update() {
    //if (Input.GetKeyDown(KeyCode.Escape)) {
    //  Application.Quit();
    //}
    //}

    public void Awake()
    {
        // Create the ThreadDispatcher on a call that is guaranteed to run on the main Unity thread.
        MyDispatcher = new ThreadDispatcher();
    }