예제 #1
0
        protected void InitAdd()
        {
            InitExt();
            Cross   = new CrossLine(MainPanel.Params);
            Volumes = new GVerLevel(MainPanel.Params);

            //Interest = new GVerLevel(MainPanel.Params);
            GHorVolumes = new GHorVol(MainPanel.Params);

            LevelsOrders = new LevelsOrders(MainPanel.Params);
            Levels       = new LevelsFree(MainPanel.Params);

            Indicators.Clear();
            Indicators.Add(new MovingAverage(Candels.Panel));
            Indicators.Add(new IndicatorCTHV(Candels.Panel));
            Indicators.Add(new IndicatorHV(Candels.Panel));
            Indicators.Add(ActiveTrades = new ActiveTrades(Candels.Panel));
            Indicators.Add(ATR          = new IndicatorATR(Candels.Panel));
            Indicators.Add(LevelsSignal = new IndicatorPaintLevels(Candels.Panel));

            Volumes.Values.CountLineValue = 5;
            //DeltaVol.Values.CountLineValue = 4;
            //Interest.Values.CountLineValue = 5;

            MainPanel.OnChangeRect += (rect) =>
            {
                //Расчет всех панелей
                GetRectsPanels();
                if (OnResize.NotIsNull())
                {
                    OnResize(rect);
                }
            };
            InitLoopsEachCandle();
        }
예제 #2
0
        internal override void Resize(int newSize)
        {
            var oldCapacity = m_Capacity;

            m_Capacity = newSize;
            Array.Resize(ref QueryMatchIds, newSize);
            Array.Resize(ref QueryArgs, newSize);
            Array.Resize(ref Exclusivities, newSize);

            Array.Resize(ref UpdateMatchInterval, newSize);
            Array.Resize(ref TimeOuts, newSize);
            Array.Resize(ref ReAcquireOnLoss, newSize);
            Array.Resize(ref Priority, newSize);

            Array.Resize(ref Conditions, newSize);
            Array.Resize(ref TraitRequirements, newSize);
            Array.Resize(ref CachedTraits, newSize);
            Array.Resize(ref ConditionRatings, newSize);
            Array.Resize(ref ConditionMatchSets, newSize);
            Array.Resize(ref ReducedConditionRatings, newSize);

            Array.Resize(ref BestMatchDataIds, newSize);
            for (int i = oldCapacity; i < newSize; i++)
            {
                BestMatchDataIds[i] = (int)ReservedDataIDs.Invalid;
            }

            Array.Resize(ref QueryResults, newSize);
            Array.Resize(ref AcquireHandlers, newSize);
            Array.Resize(ref UpdateHandlers, newSize);
            Array.Resize(ref LossHandlers, newSize);
            Array.Resize(ref TimeoutHandlers, newSize);
            OnResize?.Invoke();
        }
예제 #3
0
        private void InvokeResizeEvents()
        {
            var event_args = new ElementResizeArgs(this, ActualRowSpan, ActualColumnSpan);

            OnResize?.Invoke(event_args);
            Grid.OnResize?.Invoke(event_args);
        }
        internal override void Resize(int newSize)
        {
            var oldCapacity = m_Capacity;

            m_Capacity = newSize;
            Array.Resize(ref QueryMatchIds, newSize);
            Array.Resize(ref Exclusivities, newSize);
            Array.Resize(ref Required, newSize);
            Array.Resize(ref Conditions, newSize);
            Array.Resize(ref TraitRequirements, newSize);
            Array.Resize(ref CachedTraits, newSize);
            Array.Resize(ref ConditionRatings, newSize);
            Array.Resize(ref ConditionMatchSets, newSize);
            Array.Resize(ref ReducedConditionRatings, newSize);

            Array.Resize(ref BestMatchDataIds, newSize);
            for (int i = oldCapacity; i < newSize; i++)
            {
                BestMatchDataIds[i] = (int)ReservedDataIDs.Invalid;
            }

            Array.Resize(ref QueryResults, newSize);
            Array.Resize(ref ObjectReferences, newSize);
            Array.Resize(ref RelationMemberships, newSize);
            OnResize?.Invoke();
        }
예제 #5
0
        private void InitializePositionEvents()
        {
			MovFun = (Glfw.Window P, int X, int Y) =>
			{
				foreach (IMonitor monitor in Environment.Platform.AvaiableMonitors)
				{
					if (Position > monitor.Position && Position < monitor.Position + monitor.CurrentResolution.ResolutionSize)
						Monitor = monitor;
				}

				OnMove?.Invoke(this, new WindowMoveEventArgs { Position = new Vector2i(X, Y) });
			};

			SizFun = (Glfw.Window P, int W, int H) =>
			{
				foreach (IMonitor monitor in Environment.Platform.AvaiableMonitors)
				{
					if (Position > monitor.Position && Position < monitor.Position + monitor.CurrentResolution.ResolutionSize)
						Monitor = monitor;
				}

				OnResize?.Invoke(this, new WindowResizeEventArgs { Size = new Vector2i(W, H) });
			};

			Glfw.SetWindowPosCallback(Handle, MovFun);
			Glfw.SetWindowSizeCallback(Handle, SizFun);
        }
 public static async Task OnBrowserResize()
 {
     if (OnResize != null)
     {
         await OnResize.Invoke();
     }
 }
 internal override void Resize(int newSize)
 {
     m_Capacity = newSize;
     Array.Resize(ref QueryMatchIds, newSize);
     Array.Resize(ref SetQueryArgs, newSize);
     Array.Resize(ref QueryResults, newSize);
     Array.Resize(ref OrderWeights, newSize);
     Array.Resize(ref UsedByMatch, newSize);
     Array.Resize(ref RelationIndexPairs, newSize);
     Array.Resize(ref LocalRelationIndexPairs, newSize);
     Array.Resize(ref RatingConfigurations, newSize);
     Array.Resize(ref MemberIndices, newSize);
     Array.Resize(ref CachedTraits, newSize);
     Array.Resize(ref Relations, newSize);
     Array.Resize(ref RelationRatings, newSize);
     Array.Resize(ref SearchData, newSize);
     Array.Resize(ref SetMatchData, newSize);
     Array.Resize(ref ReAcquireOnLoss, newSize);
     Array.Resize(ref Priorities, newSize);
     Array.Resize(ref UpdateMatchInterval, newSize);
     Array.Resize(ref LastUpdateCheckTime, newSize);
     Array.Resize(ref TimeOuts, newSize);
     Array.Resize(ref AcquireHandlers, newSize);
     Array.Resize(ref UpdateHandlers, newSize);
     Array.Resize(ref LossHandlers, newSize);
     Array.Resize(ref TimeoutHandlers, newSize);
     OnResize?.Invoke();
 }
예제 #8
0
 public void Start()
 {
     OnCorection?.Invoke();
     OnDetect?.Invoke();
     OnResize?.Invoke();
     OnCompare?.Invoke();
     pi.Save(procededImagesSavePath);
 }
예제 #9
0
 private void UpdateScreenSize()
 {
     if (screenWidth != Width || screenHeight != Height)
     {
         screenWidth  = Width;
         screenHeight = Height;
         OnResize.Dispatch(screenWidth, screenHeight);
     }
 }
예제 #10
0
        public static async Task OnBrowserResize()
        {
            if (OnResize == null)
            {
                return;
            }

            await OnResize.Invoke();
        }
예제 #11
0
 //If the screen was resized, notify listeners and reset the stored resolution
 private void LateUpdate()
 {
     if (prevResolution.x != Screen.width || prevResolution.y != Screen.height)
     {
         OnResize?.Invoke(prevResolution);
         prevResolution.x = Screen.width;
         prevResolution.y = Screen.height;
     }
 }
예제 #12
0
        // так как размеры элемента могут измениться из-за ресайза родителя, надо тречить,
        // проверки одних текущих свойств недостаточно
        void CheckUpdate()
        {
            if (WidthHeight != oldWH)
            {
                OnResize?.Invoke(oldWH);
                DoResize(oldWH);
            }

            oldWH = WidthHeight;
        }
예제 #13
0
    public void Refresh()
    {
        Target.Release();
        Target = new RenderTexture((int)(Screen.width * u), (int)(Screen.height * v), 24);
        Target.antiAliasing = 4;
        c.targetTexture     = Target;
        res.width           = Screen.width;
        res.height          = Screen.height;

        OnResize?.Invoke();
    }
예제 #14
0
        void HandleResizeEvent(EditorWindow window)
        {
            Vector2 currentWindowScale = new Vector2(window.position.width, window.position.height);

            if (currentWindowScale != windowScale)
            {
                windowScale = currentWindowScale;

                OnResize?.Invoke(window);
            }
        }
        public async ValueTask OnResizeCallback(InteropEventData evt)
        {
            switch (evt.Type)
            {
            // { evt: "resize", data: [], containerId: containerId }
            case "resize":
                await OnResize.InvokeAsync(new ValueEventArgs <string>
                {
                    Value = evt.ContainerId
                });

                break;
            }
        }
예제 #16
0
        public void Resize(int width, int height)
        {
            int minW = Math.Min(width, world.GetLength(0));
            int minH = Math.Min(height, world.GetLength(1));

            bool[,] tmp = new bool[width, height];
            for (int x = 0; x < minW; x++)
            {
                for (int y = 0; y < minH; y++)
                {
                    tmp[x, y] = world[x, y];
                }
            }
            world = tmp;
            OnResize?.Invoke();
        }
예제 #17
0
 static public void InvokeOnResize(EventArgs eventargs)
 {
     Resolution = new Size(DisplayAdapter.ClientRectangle.Width, DisplayAdapter.ClientRectangle.Height);
     if (Resolution.Width == 0)
     {
         Resolution.Width = 1;
     }
     if (Resolution.Height == 0)
     {
         Resolution.Height = 1;
     }
     DisplayAdapter.MainRenderer.Resize(Resolution.Width, Resolution.Height);
     if (OnResize != null)
     {
         OnResize.Invoke(null, eventargs);
     }
 }
예제 #18
0
        private void DoResize(int width, int height)
        {
            while (Renderer.Instance.RenderingInProgress)
            {
            }
            var rt = RenderTarget.RenderTargets[0];

            rt.Clear();
            swapChain.ResizeBuffers(1, width, height, Format.Unknown, SwapChainFlags.AllowModeSwitch);
            using (var tex = Resource.FromSwapChain <Texture2D>(swapChain, 0)) {
                rt.Update(null, new RenderTargetView(Renderer.Instance.Device, tex));
                rt.SendResizeEvent();
            }
            Viewport = new Viewport(0, 0, width, height);
            OnResize?.Invoke(this, new Event.SResizeEvent {
                Size = new System.Drawing.Size(width, height)
            });
        }
 /// <summary>
 /// Событие перемещение мыши над элементом
 /// </summary>
 protected override void OnMouseMove(MouseEventArgs e)
 {
     if (IsMouseCaptured && this.Parent is StackPanel SP && SP.Children.Count > 1)
     {
         if (SP.Children.IndexOf(this) - 1 is int index && index >= 0 && SP.Children[index] is Border b)
         {
             if (this.PointToScreen(Mouse.GetPosition(this)).X is double DragX && Math.Abs(DragX - ClickX) > 2)
             {
                 if (Math.Round(b.Width + (DragX - ClickX)) is double NewWidth && NewWidth > 0)
                 {
                     b.Width = NewWidth;
                     ClickX  = DragX;
                     OnResize?.Invoke(this, new EventArgs());
                 }
             }
         }
     }
 }
예제 #20
0
        public GenericVboMapper(VertexBufferObject vbo, VertexArrayObject vao, int elementSize, int maximumAmount,
                                OnResize onResize, BufferTarget bufferTarget = BufferTarget.ArrayBuffer)
        {
            _vbo = vbo;
            _vao = vao;

            _elementSize = elementSize;

            _onResize = onResize;

            _bufferTarget = bufferTarget;

            _amount        = 0;
            _maximumAmount = maximumAmount;

            _updates        = 0;
            _onBackground   = false;
            _requiresResize = false;

            _tasks   = new ConcurrentQueue <VboMapperTask <TKey> >();
            _offsets = new ConcurrentDictionary <TKey, int>();
            _keys    = new ConcurrentDictionary <int, TKey>();
        }
예제 #21
0
        /// <summary>
        /// Increases the buffer size. Any call to this method must be protected with a lock.
        /// </summary>
        /// <param name="size">
        /// The new buffer size.
        /// </param>
        private void Grow(int size)
        {
            if (size > maximumSize)
            {
                throw new OutOfMemoryException();
            }

            var newBuffer = ArrayPool <byte> .Shared.Rent(size);

            if (WriteWaterMark < ReadWaterMark)
            {
                // Copy the data at the start
                Array.Copy(buffer, 0, newBuffer, 0, WriteWaterMark);

                var trailingDataLength = buffer.Length - ReadWaterMark;
                Array.Copy(
                    buffer,
                    ReadWaterMark,
                    newBuffer,
                    newBuffer.Length - trailingDataLength,
                    trailingDataLength);

                ReadWaterMark += newBuffer.Length - buffer.Length;
            }
            else
            {
                // ... [Read WM] ... [Write WM] ... [newly available space]
                Array.Copy(buffer, 0, newBuffer, 0, buffer.Length);
            }

            ArrayPool <byte> .Shared.Return(buffer);

            buffer = newBuffer;

            Debug.Assert(bytesRead + AvailableReadableBytes == bytesWritten);
            OnResize?.Invoke(this, EventArgs.Empty);
        }
예제 #22
0
        public BlockVboMapper(ChunkRegion chunkRegion, VertexBufferObject vbo, VertexArrayObject vao, int elementSize,
                              int maximumAmount,
                              OnResize onResize, BufferTarget bufferTarget = BufferTarget.ArrayBuffer)
        {
            _chunkRegion         = chunkRegion;
            _regionWorldPosition = chunkRegion.Position << World2dRegion.WorldPositionShift;
            _vbo = vbo;
            _vao = vao;

            _elementSize = elementSize;

            _onResize = onResize;

            _bufferTarget = bufferTarget;

            _amount        = 0;
            _maximumAmount = maximumAmount;

            _updates        = 0;
            _onBackground   = false;
            _requiresResize = false;

            _tasks   = new ConcurrentQueue <VboMapperTask <Block> >();
            _offsets = new int[ChunkRegion.RegionLength, ChunkRegion.RegionLength, ChunkRegion.RegionLength];
            _keys    = new Dictionary <int, Vector3i>();
            for (var x = 0; x < ChunkRegion.RegionLength; x++)
            {
                for (var y = 0; y < ChunkRegion.RegionLength; y++)
                {
                    for (var z = 0; z < ChunkRegion.RegionLength; z++)
                    {
                        _offsets[x, y, z] = -1;
                    }
                }
            }
        }
예제 #23
0
 public void Component_OnResize(Vector location) => OnResize?.Invoke(this, location);
예제 #24
0
 private void Preview_SizeChanged(object sender, EventArgs e)
 {
     //При вызове изменения размеров выполняется проверка на null
     OnResize?.Invoke(sender, e);
 }
예제 #25
0
 public void Component_OnResize(Vector size) => OnResize?.Invoke(this, size);
예제 #26
0
 public static void InvokeOnResize()
 {
     OnResize?.Invoke();
 }
예제 #27
0
 public void NotifyResize(ResizeEvent e) => OnResize?.Invoke(this, e);
예제 #28
0
 /// <summary>
 ///
 /// Invoke OnResize event.
 ///
 /// </summary>
 protected void InvokeResize()
 {
     OnResize?.Invoke(this);
 }
예제 #29
0
 public static async Task OnBrowserResize()
 {
     await OnResize?.Invoke();
 }
예제 #30
0
        LRESULT WndProc(HWND hwnd, WM msg, WPARAM wParam, LPARAM lParam)
        {
            switch (msg)
            {
            case WM.CLOSE:
                OnClose?.Invoke();
                if (DestroyWhenClose == null || DestroyWhenClose())
                {
                    User32.DestroyWindow(hwnd);
                }
                return(0);

            case WM.ENABLE:
                OnEnable?.Invoke(wParam);
                break;

            case WM.SHOWWINDOW:
                OnShow?.Invoke(wParam);
                break;

            case WM.DESTROY:
                OnDestroy?.Invoke();
                return(0);

            case WM.MOUSEMOVE:
                OnMouseMove?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.LBUTTONDOWN:
                OnMouseLeftDown?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.LBUTTONUP:
                OnMouseLeftUp?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.LBUTTONDBLCLK:
                OnMouseLeftDoubleClicked?.Invoke();
                return(0);

            case WM.RBUTTONDOWN:
                OnMouseRightDown?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.RBUTTONUP:
                OnMouseRightUp?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.MBUTTONDOWN:
                OnMouseMiddleDown?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.MBUTTONUP:
                OnMouseMiddleUp?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.MOUSEWHEEL:
                OnMouseWheel?.Invoke(wParam.HiWord);
                return(0);

            case WM.RESIZE:
                OnResize?.Invoke(lParam.LowWord, lParam.HiWord);
                return(0);

            case WM.PAINT:
            {
                var ps = default(PAINTSTRUCT);
                User32.BeginPaint(hwnd, ref ps);
                OnPaint?.Invoke();
                User32.EndPaint(hwnd, ref ps);
            }
                return(0);
            }
            return(User32.DefWindowProcW(hwnd, msg, wParam, lParam));
        }