public static IDisposable RunApp([NotNull] ViewPanel root, [NotNull] WidgetBuilder <Widget> builder, string debugName = null) { if (root == null) { throw new ArgumentNullException(nameof(root)); } if (builder == null) { throw new ArgumentNullException(nameof(builder)); } IView view = root; var context = new BuildContext(null, null); var stateHolder = State.Create <Widget, IState>(context, builder); var render = Atom.Reaction(() => root.Render(stateHolder.Value), debugName: debugName); // ReSharper disable once ImplicitlyCapturedClosure return(new ActionDisposable(() => { render.Deactivate(); if (!Engine.IsApplicationQuiting) { view.ResetSource(); } })); }
// Start is called before the first frame update void Start() { viewPAnel = GameObject.Find("ViewPanel").GetComponent <ViewPanel>(); button = gameObject.GetComponent <Button>(); animator = gameObject.GetComponent <Animator>(); msysHand = GameObject.Find("ManagerSysHand").GetComponent <ManageSystemHand>(); }
bool CheckView() { if (Instance == null) { Init(); return(false); } if (toolbarView == null) { toolbarView = new ViewPanel("tool bar", NodeToolBarPanel.DrawToolBar); } if (nodeHandleView == null) { nodeHandleView = new ViewPanel("handle", NodeHandlePanel.Draw); } if (nodeGraphView == null) { nodeGraphView = new ViewPanel("graph", NodeEditor.DrawCanvas); } if (nodeTypeView == null) { nodeTypeView = new ViewPanel("type", NodeSelectPanel.Draw); } return(true); }
public PhotoViewer() { InitializeComponent(); this.btnBack.Clicked += BtnBack_Clicked; this.Appearing += PhotoViewer_Appearing; _viewPanel = this.photoViewer; _viewPanel.SelectChanged += _viewPanel_SelectChanged; }
void Start() { if (is2D) { viewPAnel = GameObject.Find("ViewPanel").GetComponent <ViewPanel>(); } msysHand = GameObject.Find("ManagerSysHand").GetComponent <ManageSystemHand>(); }
/// <summary> Конструктор </summary> /// <param name="countFloat"> Точность Значение (знаков после запятой)</param> public GRightValue(BaseParams param) { Panel = new ViewPanel(param); PanelCurValue = new ViewPanel(param); Panel.OnChangeRect += (rect) => { PanelCurValue.SetRect(rect); }; }
public GCandles(BaseParams param) { Panel = new ViewPanel(param); PanelLastCandle = new ViewPanel(param); Panel.OnChangeRect += (rect) => { PanelLastCandle.SetRect(rect); }; }
protected override void OnElementChanged(VisualElementChangedEventArgs e) { base.OnElementChanged(e); this.PagingEnabled = true; _viewPanel = this.Element as ViewPanel; _viewPanel.Select = Select; ((ScrollViewRenderer)this.NativeView).ShowsHorizontalScrollIndicator = false; ((ScrollViewRenderer)this.NativeView).DecelerationEnded += ScrollView_DecelerationEnded; }
private void PaintOneLevel(Graphics canvas, ViewPanel Panel, Chart Value, decimal MaxPrice, decimal MinPrice) { int y = GMath.GetCoordinate(Panel.Rect.Height, MaxPrice, MinPrice, Value.Price); int x1 = Panel.Rect.X + GMath.GetCoordinate(Panel.Rect.Width, this.Max, this.Min, Value.Volume > 0 ? 0 : Value.Volume); int x2 = Panel.Rect.X + GMath.GetCoordinate(Panel.Rect.Width, this.Max, this.Min, Value.Volume < 0 ? 0 : Value.Volume); var lineLev = new Line(); lineLev.Width = 2; lineLev.Paint(canvas, new Point(x1, y), new Point(x2, y), Value.Volume < 0 ? Color.Red : Color.Green); }
public GHorLevel(BaseParams param) { Panel = new ViewPanel(param); PanelLast = new ViewPanel(param); Values = new GRightValue(param); Values.ColorLines = Color.Gray; Panel.OnChangeRect += (rect) => { PanelLast.SetRect(rect); Values.Panel.SetRect(rect); }; }
public GHorVol(BaseParams param) { Panel = new ViewPanel(param); PanelVolume = new ViewPanel(param); Panel.OnResize += (rect) => { Panel.Clear(); }; PanelVolume.OnResize += (rect) => { PanelVolume.Clear(); }; }
void Start() { viewPAnel = GameObject.Find("ViewPanel").GetComponent <ViewPanel>(); mngsyshands = GameObject.Find("ManagerSysHand").GetComponent <ManageSystemHand>(); animatorComponent.GetComponent <Animator>(); actions.Add("start", a => SpeechAction("start")); keywordRecognizer = new KeywordRecognizer(actions.Keys.ToArray()); keywordRecognizer.OnPhraseRecognized += RecognizedSpeech; keywordRecognizer.Start(); Debug.Log(gameObject.transform.parent.gameObject.transform.parent.gameObject.name); }
public GVerLevel(BaseParams param) { Panel = new ViewPanel(param); PanelLast = new ViewPanel(param); Values = new GRightValue(param); Values.ColorLines = Color.DarkGray; Values.ColorText = Color.Black; Panel.OnChangeRect += (rect) => { Values.Panel.SetRect(rect); PanelLast.SetRect(rect); }; }
public virtual void AddEntries(T[] entries) { ViewPanel.SuspendLayout(); ViewPanel.Controls.AddRange(entries); int childIndex = 0; //Add to the beginning of Controls but in reversed order for (int i = entries.Length - 1; i >= 0; i--) { ViewPanel.Controls.SetChildIndex(entries[i], childIndex); childIndex++; } ViewPanel.ResumeLayout(); }
public void Init(Securities security) { if (security.IsNull()) { return; } var param = new BaseParams() { CountFloat = security.Scale, MarginCandle = 0.5f, Class = security.Class.Code, Code = security.Code, MinStepPrice = security.MinPriceStep }; MainPanel = new ViewPanel(param); InitAdd(); InitNativeEvents(); }
private void OnIdle(object sender, EventArgs e) { try { bool ignore = false; if (!ignore && Visible) { DateTime now = DateTime.Now; bool expired = (now - lastImageTime).TotalMilliseconds > 10; if (expired) { ICameraProxy camera = Settings.Get <ICameraProxy>(); if (camera != null) { CurrentImage = camera.AcquireImage(); lastImageTime = now; ViewPanel.Invalidate(); } else { bool lasthasImage = CurrentImage != null; CurrentImage = null; if (lasthasImage) { ViewPanel.Invalidate(); } } ILaserProxy laser = Settings.Get <ILaserProxy>(); expired = (now - lastImageTime).TotalMilliseconds > 750; if (laser != null) { LaserControl.Proxy = laser; LaserControl.AlignControls(); } } } } catch { } }
private void NewCommand_Executed(object sender, ExecutedRoutedEventArgs e) { D3DViewer aViwer = new D3DViewer(); Grid g = new Grid(); Map.Add(g, aViwer); ImageBrush anImage = new ImageBrush(aViwer.Image); //anImage.RelativeTransform = new ScaleTransform (1.0, -1.0, 0.5, 0.5); g.Background = anImage; g.MouseMove += new MouseEventHandler(g_MouseMove); g.MouseDown += new MouseButtonEventHandler(g_MouseDown); g.MouseUp += new MouseButtonEventHandler(g_MouseUp); g.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; TabItem aNewTab = new TabItem(); aNewTab.Content = g; aNewTab.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; aNewTab.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch; aNewTab.VerticalContentAlignment = System.Windows.VerticalAlignment.Stretch; g.SizeChanged += new SizeChangedEventHandler(g_SizeChanged); aNewTab.IsSelected = true; aNewTab.Header = "Document " + myDocumentCounter.ToString(); myDocumentCounter++; ViewPanel.Items.Add(aNewTab); ViewPanel.Focus(); // update XAML property RaisePropertyChanged("IsDocumentOpen"); }
// Start is called before the first frame update void Start() { Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; viewPAnel = GameObject.Find("ViewPanel").GetComponent <ViewPanel>(); actions.Add("hand mode", a => Selection("hand")); actions.Add("gestures mode", a => Selection("gesture")); actions.Add("Speech", a => Selection("speech")); actions.Add("Help", a => Selection("help")); actions.Add("Alphabet", a => Selection("alphabet")); actions.Add("back", a => Selection("back")); actions.Add("setting", a => Selection("setting")); actions.Add("about", a => Selection("about")); actions.Add("exit", a => Selection("exit")); actions.Add("yes", a => Selection("yes")); actions.Add("no", a => Selection("no")); actions.Add("general mode", a => Selection("full")); actions.Add("examples", a => Selection("examples")); actions.Add("Easy", a => Selection("Easy")); actions.Add("Medium", a => Selection("Medium")); actions.Add("start video", a => Selection("start video")); actions.Add("head movement", a => Selection("head movement")); actions.Add("head tracking", a => Selection("head tracking")); actions.Add("example one", a => Selection("example one")); actions.Add("example two", a => Selection("example two")); actions.Add("example three", a => Selection("example three")); actions.Add("example four", a => Selection("example four")); actions.Add("Hard", a => Selection("Hard")); actions.Add("Very hard", a => Selection("Very hard")); //actions.Add("Move", Go); //actions.Add("please again", PleaseRepeat); keywordRecognizer = new KeywordRecognizer(actions.Keys.ToArray()); keywordRecognizer.OnPhraseRecognized += RecognizedSpeech; keywordRecognizer.Start(); }
public CustomPagerAdapter(Context context, ViewPanel customViewPage) { _customViewPage = customViewPage; _views = customViewPage.Children; _context = context; }
public GTimeFrame(BaseParams param) { Panel = new ViewPanel(param); }
public IndicatorHV(ViewPanel mainPanel) : base(mainPanel) { //Enable = true; }
public IndicatorCountTrades(ViewPanel mainPanel) : base(mainPanel) { }
public ActiveTrades(ViewPanel mainPanel, bool enable = true) : base(mainPanel) { FastRedraw = true; Enable = enable; }
private void SwitchingBetweenPanel(ViewPanel viewPanel) { GridDownloadHtmlFile.Visibility = GridTrackSelection.Visibility = System.Windows.Visibility.Hidden; switch (viewPanel) { case ViewPanel.ResourceSelection: break; case ViewPanel.DownloadHTML: button1.Background = Brushes.Gray; GridDownloadHtmlFile.Visibility = System.Windows.Visibility.Visible; break; case ViewPanel.TrackSelection: button1.Background = Brushes.Gray; button2.Background = Brushes.Gray; GridTrackSelection.Visibility = System.Windows.Visibility.Visible; break; case ViewPanel.SelectingALocationForSaving: button1.Background = Brushes.Gray; button2.Background = Brushes.Gray; button3.Background = Brushes.Gray; GridSelectingALocationForSaving.Visibility = System.Windows.Visibility.Visible; break; case ViewPanel.ProcessDownload: case ViewPanel.ReportDownload: button1.Background = Brushes.Gray; button2.Background = Brushes.Gray; button3.Background = Brushes.Gray; button4.Background = Brushes.Gray; GridReportDownload.Visibility = System.Windows.Visibility.Visible; break; default: break; } }
private void CenterFromMouse(MouseEventArgs e) { ViewPanelCenterY = e.Y - ViewPanel.Left; ViewPanel.Invalidate(); }
public LevelsOrders(BaseParams param) { Panel = new ViewPanel(param); }
private ViewField CreateEntity() { ViewEdit view = new ViewEdit(); view.VersionId = Guid.Parse("8602d3d0-75cc-4c75-8868-b3dcaf6ccfba"); ViewPanel vp = new ViewPanel(); view.AddViewPanel(vp); ViewField obj = new ViewField(); vp.Add(obj); obj.AllowEdit = true; obj.Name = "ProductCode"; obj.CheckStatus = CheckStatus.Default; obj.ColSpan = 1; obj.IsVisible = true; obj.Property = "26a00de9-61f9-4c27-b73a-5d0840c7b2dc"; obj.RowSpan = 1; obj.Sequence = 1; obj.Title = "55c22cca-2dd9-46a5-9c74-0340df368504"; obj.ViewFieldType = ViewFieldType.Link; obj.CreateDrillDownLink(); obj.DrillDownLink.TargetViewInternal = "View-ProductsVList-{522967ec-c5bd-440c-a930-17d270eaa721}.EasyBpart"; obj.DrillDownLink.TargetViewProperty = "ca467839-09dd-4f55-9d51-ed4ddd323db8"; LinkParameter lp = new LinkParameter(); lp.Expression = "Prueba"; lp.ViewParameterInternal = "Codigo"; obj.DrillDownLink.AddLinkParameter(lp); obj.CreateViewFielLov(); obj.Lov.DisplayProperty = "14017e77 - 39ff - 4141 - bc7e - 41e1198534dc"; obj.Lov.EntityInternal = "Entity-AccountType-{e27b5580-1c07-4a7a-9fcc-e03e921f0b0d}.EasyBpart"; obj.Lov.CreateInLineLink(); obj.Lov.InLineLink.TargetViewInternal = "View-AccountTypeInLineViewEdit-{8602d3d0-75cc-4c75-8868-b3dcaf6ccfba}.EasyBpart"; obj.Lov.InLineLink.ExpressionCode = "Where a = 1"; obj.Lov.ShowPropertiesInternal.Add(Guid.Parse("7d4c8f88-ca8e-459e-9e07-503f87c6f3e4")); obj.Lov.SqlOrderBy = "Code ASC"; obj.Lov.SqlWhere = "IsActive"; obj.Lov.ValueProperty = "7d4c8f88-ca8e-459e-9e07-503f87c6f3e4"; Lov lv = new Lov(); lv.DisplayValue = "15b4a1a1-aea3-42ec-ba6f-ca77b47b6a85"; lv.Value = "Available"; Lov lv2 = new Lov(); lv2.DisplayValue = "f71449c4-786b-4f4a-85b4-b19fa24b5e13"; lv2.Value = "Loaded"; obj.Lov.AddLov(lv); obj.Lov.AddLov(lv2); return(obj); }
/// <summary> Рисует одну свечку </summary> /// <param name="canvas"></param> /// <param name="rectPaint"></param> /// <param name="candleData"></param> /// <param name="index"></param> /// <param name="maxPrice"></param> /// <param name="minPrice"></param> private CandleInfo PaintOneCandle(Graphics canvas, ViewPanel panel, CandleData candleData, int index, bool paint = true) { int tailY1 = GMath.GetCoordinate(panel.Rect.Height, panel.Params.MaxPrice, panel.Params.MinPrice, candleData.High); int tailY2 = GMath.GetCoordinate(panel.Rect.Height, panel.Params.MaxPrice, panel.Params.MinPrice, candleData.Low); int tailX1 = (int)((panel.Rect.Width - panel.Params.WidthCandle * index) + panel.Params.WidthCandle / 2); int bodyX = (int)(panel.Rect.Width - panel.Params.WidthCandle * index); int bodyY = GMath.GetCoordinate(panel.Rect.Height, panel.Params.MaxPrice, panel.Params.MinPrice, candleData.Open > candleData.Close ? candleData.Open : candleData.Close); float bodyWidth = panel.Params.WidthCandle - MarginCandle > 0.3f ? panel.Params.WidthCandle - MarginCandle : 0.3f; //- чтобы свечки не слипались int bodyHeight = GMath.GetCoordinate(panel.Rect.Height, panel.Params.MaxPrice, panel.Params.MinPrice, candleData.Open < candleData.Close ? candleData.Open : candleData.Close); bodyHeight = bodyHeight - bodyY; bodyHeight = bodyHeight == 0 ? bodyHeight + 1 : bodyHeight; //tail var line = new Line(); line.Width = 1.5f; if (paint) { line.Paint(canvas, new Point(tailX1, tailY1), new Point(tailX1, tailY2), ColorBorderCandle); } //Body var rect = new RectDraw(); var colorCandle = candleData.Open > candleData.Close ? ColorFallCandle : ColorGrowCandle; var colorBorder = ColorBorderCandle; /*if (candleData.Open < candleData.Close && candleData.VolumeBuy - candleData.VolumeSell > 0) * { * colorBorder = colorCandle = Color.DarkGreen; * } * if (candleData.Open > candleData.Close && candleData.VolumeBuy - candleData.VolumeSell < 0) * { * colorBorder = colorCandle = Color.DarkRed; * }*/ if (paint) { rect.Paint(canvas, bodyX, bodyY, bodyWidth, bodyHeight, colorBorder, colorCandle); } if (MaxValues.MinCandle.IsNull()) { MaxValues.MinCandle = candleData; } if (MaxValues.MaxCandle.IsNull()) { MaxValues.MaxCandle = candleData; } if (MaxValues.MaxPrice < candleData.High) { MaxValues.MaxPrice = candleData.High; MaxValues.MaxCandle = candleData; } if (MaxValues.MinPrice > candleData.Low) { MaxValues.MinPrice = candleData.Low; MaxValues.MinCandle = candleData; } /*if (candleData.HorVolumes.HVolCollection.MaxVolume.NotIsNull()) * { * if (MaxValues.MaxHorVolume.Volume < candleData.HorVolumes.HVolCollection.MaxVolume.Volume) * { * MaxValues.MaxHorVolume = candleData.HorVolumes.HVolCollection.MaxVolume; * } * }*/ var dCandle = new CandleInfo() { PaintRect = panel.Rect.Rectangle, Candle = candleData, TailCoord = new TailCoord() { Low = new Point(tailX1, tailY2), High = new Point(tailX1, tailY1) }, Body = new RectangleF() { X = bodyX, Y = bodyY, Width = bodyWidth, Height = bodyHeight }, Index = index - 1, MaxHorVolume = MaxValues.MaxHorVolume, TimeFrame = CurrentTimeFrame }; VerticalLines[index - 1] = dCandle.TailCoord.High.X; if (index == 1) { AllDataPaintedCandle.RemoveAll(c => c.Index == index - 1); AllDataPaintedCandle.Insert(0, dCandle); } else { AllDataPaintedCandle.Add(dCandle); } if (OnPaintedCandle.NotIsNull()) { OnPaintedCandle(dCandle); } return(dCandle); }
public ViewModel() { #if DEBUG Constants.BmpQuality = 1; #endif _selectColor = new ItemsColor { Red = 185, Blue = 168, Green = 185, NameColorRAL = "RAL 7032" }; _panelColorPortal = new ViewPanel(); _viewPanelColorPortal = _panelColorPortal.DataContext as VMViewPanel; _panelColorPlace = new ViewPanel(); _viewPanelColorPlace = _panelColorPlace.DataContext as VMViewPanel; _panelColorA = new ViewPanel(); _viewPanelColorVMA = _panelColorA.DataContext as VMViewPanel; _nameElement = new ObservableCollection <string>(); _panelColorB = new ViewPanel(); _viewPanelColorVMB = _panelColorB.DataContext as VMViewPanel; _panelColorV = new ViewPanel(); _viewPanelColorVMV = _panelColorV.DataContext as VMViewPanel; _panelColorG = new ViewPanel(); _viewPanelColorVMG = _panelColorG.DataContext as VMViewPanel; _schemePanel = new SchemePanel(); _schemePanelVM = _schemePanel.DataContext as VMSchemePanel; _viewPanelPlace = new ViewPanel(); _viewPanelPlaceVM = _viewPanelPlace.DataContext as VMViewPanel; _viewPanelA = new ViewPanel(); _viewPanelVMA = _viewPanelA.DataContext as VMViewPanel; _viewPanelB = new ViewPanel(); _viewPanelVMB = _viewPanelB.DataContext as VMViewPanel; _viewPanelV = new ViewPanel(); _viewPanelVMV = _viewPanelV.DataContext as VMViewPanel; _viewPanelG = new ViewPanel(); _viewPanelVMG = _viewPanelG.DataContext as VMViewPanel; _viewPanelPlace = new ViewPanel(); _viewPanelPlaceVM = _viewPanelPlace.DataContext as VMViewPanel; _viewPanelPortal = new ViewPanel(); _viewPanelPortalVM = _viewPanelPortal.DataContext as VMViewPanel; VisibilityExpander = Visibility.Hidden; _appThemes = AppThemes.Instance; ListViewPlaceElement = new ObservableCollection <FrameworkElement>(); ListViewPlace = new ObservableCollection <BaseDrawClass>(); ListViewPlaceElementColor = new ObservableCollection <FrameworkElement>(); ListViewPlaceColor = new ObservableCollection <BaseDrawClass>(); ListViewPortalElement = new ObservableCollection <FrameworkElement>(); ListViewPortal = new ObservableCollection <BaseDrawClass>(); ListViewPortalElementColor = new ObservableCollection <FrameworkElement>(); ListViewPortalColor = new ObservableCollection <BaseDrawClass>(); ListColorElementA = new ObservableCollection <FrameworkElement>(); ListColorVMA = new ObservableCollection <BaseDrawClass>(); ListColorElementB = new ObservableCollection <FrameworkElement>(); ListColorVMB = new ObservableCollection <BaseDrawClass>(); ListColorElementV = new ObservableCollection <FrameworkElement>(); ListColorVMV = new ObservableCollection <BaseDrawClass>(); ListColorElementG = new ObservableCollection <FrameworkElement>(); ListColorVMG = new ObservableCollection <BaseDrawClass>(); ListViewsElementA = new ObservableCollection <FrameworkElement>(); ListViewsVMA = new ObservableCollection <BaseDrawClass>(); ListViewsElementB = new ObservableCollection <FrameworkElement>(); ListViewsVMB = new ObservableCollection <BaseDrawClass>(); ListViewsElementV = new ObservableCollection <FrameworkElement>(); ListViewsVMV = new ObservableCollection <BaseDrawClass>(); ListViewsElementG = new ObservableCollection <FrameworkElement>(); ListViewsVMG = new ObservableCollection <BaseDrawClass>(); ListPages = new ObservableCollection <UserControl>(); ListSchemeElement = new ObservableCollection <FrameworkElement>(); ListScheme = new List <VMSchemeElement>(); _appThemes.AppManager = this; //_preview = new Preview(); //CellsArrange = new CellsArrange(); _wizzardMain = new WizzardMain { AppManagement = this, //_wizzardMain.Updates = this; //_wizzardMain.CellsManagement = this; RelativePositions = this, WCommonParameters = GetCommonData() }; _wizzardMain.RelativePositions = this; _wizzardMain.ToastNotifications = this; InitializeCommands(); InitializeCommandParser(); InitializeToolbars(); InitializeMainParameters(); UpdateWorker.CheckUpdate(Application.Current.Shutdown, Logger.W, new Update.AppData() { Path = Constants.AppPath, AssemblyPath = Constants.AppAssemblyPath, Title = Constants.AppName, }, new Update.LineArgs() { From = Common.AppData.LineArgs.From, To = Common.AppData.LineArgs.To, Type = Common.AppData.LineArgs.Type, }, Core.Settings.LoadSettings().UpdateChannel == UpdateChannel.Beta ? "beta" : ""); }
public CrossLine(BaseParams param) { Panel = new ViewPanel(param); }
/// <summary> /// /// </summary> /// <param name="mainPanel"></param> public Indicator(ViewPanel mainPanel) { Panel = new ViewPanel(mainPanel.Params); Panel.Rect = mainPanel.Rect; }