Beispiel #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <Map> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                nativeMap.MapElementClick -= OnMapElementClick;
                nativeMap.Children.Clear();
                markerWindow = null;
                nativeMap    = null;
            }

            if (e.NewElement != null)
            {
                this.user = (e.NewElement as CustomMap).User;
                this.trip = (e.NewElement as CustomMap).Trip;

                var formsMap = (CustomMap)e.NewElement;
                nativeMap = Control as MapControl;
                nativeMap.Children.Clear();
                nativeMap.MapElementClick += OnMapElementClick;
                Generatepoint(trip.OriginCoordinates, "origin.png");
                Generatepoint(user.CurrentLocation.Latitude + " " + user.CurrentLocation.Longitude, "current.png");
                Generatepoint(trip.DestinationCoordinates, "destination.png");
            }
        }
        private void OnMapElementClick(MapControl sender, MapElementClickEventArgs args)
        {
            var mapIcon = args.MapElements.FirstOrDefault(x => x is MapIcon) as MapIcon;

            if (mapIcon != null)
            {
                if (!markerWindowShown)
                {
                    if (markerWindow == null)
                    {
                        markerWindow = new MarkerWindow(Siniestros);
                    }

                    var snPosition = new BasicGeoposition
                    {
                        Latitude  = Double.Parse(Siniestros.Latitude),
                        Longitude = Double.Parse(Siniestros.Longitude)
                    };
                    var snPoint = new Geopoint(snPosition);

                    nativeMap.Children.Add(markerWindow);
                    MapControl.SetLocation(markerWindow, snPoint);
                    MapControl.SetNormalizedAnchorPoint(markerWindow, new Windows.Foundation.Point(0.5, 1.0));

                    markerWindowShown = true;
                }
                else
                {
                    nativeMap.Children.Remove(markerWindow);
                    markerWindowShown = false;
                }
            }
        }
Beispiel #3
0
        protected override void OnElementChanged(ElementChangedEventArgs <Map> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                nativeMap.MapElementClick -= OnMapElementClick;
                nativeMap.Children.Clear();
                markerWindow = null;
                nativeMap    = null;
            }

            if (e.NewElement != null)
            {
                this.patient = (e.NewElement as CustomMap).patient;
                var formsMap = (CustomMap)e.NewElement;
                nativeMap = Control as MapControl;
                nativeMap.MapElementClick += OnMapElementClick;

                var snPosition = new BasicGeoposition
                {
                    Latitude  = patient.Latitude,
                    Longitude = patient.Longitude
                };
                var snPoint = new Geopoint(snPosition);

                var mapIcon = new MapIcon();
                mapIcon.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms:appx:///ping.png"));
                mapIcon.CollisionBehaviorDesired = MapElementCollisionBehavior.RemainVisible;
                mapIcon.Location = snPoint;
                mapIcon.NormalizedAnchorPoint = new Windows.Foundation.Point(0.5, 1.0);

                nativeMap.MapElements.Add(mapIcon);
            }
        }
Beispiel #4
0
    public static void OpenWindow()
    {
        MarkerWindow window = GetWindow <MarkerWindow>();

        window.wantsMouseMove = true;

        window.minSize = new Vector2(360, 310);
        window.maxSize = new Vector2(360, 310);

        _subStyle.fontSize    = 15;
        _subStyle.fontStyle   = FontStyle.Bold;
        _titleStyle.fontSize  = 20;
        _titleStyle.fontStyle = FontStyle.Bold;
    }
Beispiel #5
0
 override public void OpenInfoWindow()
 {
     if (!isWindowOpen)
     {
         isWindowOpen = true;
         if (myWindow == null)
         {
             myWindow = Instantiate(UIManager.instance.markerWindowPrefab, UIManager.instance.gameWindowContainer);
             myWindow.Initialize(this);
         }
         else
         {
             myWindow.gameObject.SetActive(true);
         }
     }
 }
        protected override void OnMouseDown(List <SeriesEditParameter> parameters,
                                            MouseEventArgs e, Keys modifierKeys, out IChartInteractiveObject objectToEdit)
        {
            objectToEdit = null;
            if (e.Button != MouseButtons.Left)
            {
                return;
            }
            // по одному клику добавить маркер, по двум - открыть
            // редактор

            // получить время и цену
            var clientPoint = Chart.PointToScreen(new Point(e.X, e.Y));

            clientPoint = Chart.StockPane.PointToClient(clientPoint);
            var x = clientPoint.X;
            var y = clientPoint.Y;

            var markers = data.Where(aster => aster.IsIn(
                                         x - Chart.StockPane.CanvasRect.Left, y)).ToList();

            if (markers.Count > 0)
            {
                var selected = markers[markers.Count - 1];
                // показать текст маркера во всплывающем окне
                var markerDlg = new MarkerWindow {
                    Text = selected.Text
                };
                var result = markerDlg.ShowDialog();

                if (markerDlg.IsDeleteBtnPressed)
                {
                    data.Remove(selected);
                }
                else
                if (result == DialogResult.OK)
                {
                    selected.Text = markerDlg.Text;
                }
                return;
            }

            var pointD = Conversion.ScreenToWorld(new PointD(x, y),
                                                  Chart.StockPane.WorldRect, Chart.StockPane.CanvasRect);

            // поставить маркер и открыть диалог редактирования свойств
            var isShiftPressed = (modifierKeys & Keys.Shift) == Keys.Shift;

            var text           = SeriesEditParameter.TryGetParamValue(parameters, "Text", "e");
            var lineColor      = SeriesEditParameter.TryGetParamValue(parameters, "Stroke", Color.Black);
            var fillColor      = SeriesEditParameter.TryGetParamValue(parameters, "Filling", Color.White);
            var textShift      = SeriesEditParameter.TryGetParamValue(parameters, "Text_Shift", "e");
            var lineColorShift = SeriesEditParameter.TryGetParamValue(parameters, "Stroke_Shift", Color.Black);
            var fillColorShift = SeriesEditParameter.TryGetParamValue(parameters, "Filling_Shift", Color.White);
            var shape          = SeriesEditParameter.TryGetParamValue(parameters, "Type", AsteriskTooltip.ShapeType.СтрелкаВверх);
            var shapeShift     = SeriesEditParameter.TryGetParamValue(parameters, "Type_Shift", AsteriskTooltip.ShapeType.СтрелкаВниз);
            var alphaColor     = SeriesEditParameter.TryGetParamValue(parameters, "Transparency", 192);

            var marker = new AsteriskTooltip
            {
                Price        = (float)pointD.Y,
                CandleIndex  = (int)(Math.Round(pointD.X)),
                Shape        = isShiftPressed ? shapeShift : shape,
                Transparency = alphaColor,
                ColorFill    = isShiftPressed ? fillColorShift : fillColor,
                ColorLine    = isShiftPressed ? lineColorShift : lineColor,
                Sign         = isShiftPressed ? textShift : text,
                Owner        = this
            };

            if (Owner.Owner.Owner.AdjustObjectColorsOnCreation)
            {
                marker.AjustColorScheme(Owner.Owner.Owner);
            }

            marker.DateStart = Chart.StockSeries.GetCandleOpenTimeByIndex(marker.CandleIndex);
            data.Add(marker);
            //var dlg = new ObjectPropertyWindow(new object[] { marker });
            Chart.toolSkipMouseDown = true;
            //dlg.ShowDialog();
        }
Beispiel #7
0
            public static void Main(string[] args)
            {
                Uri uri;
                PDFPoppler reader;
                RawDocument rdoc;
                NormDocument ndoc;
                MarkupHTML marker;
                HTMLDocument htmldoc;
                string filepath, format, num;

                AppOptions options = new AppOptions (args);

                #if DEBUG
                Logger.ActivateDebug ();
                #endif

                if (options.GotNoArguments) {
                Application.Init ();
                MarkerWindow win = new MarkerWindow ();
                win.Show ();
                Application.Run ();
                } else {
                if (!options.Format && !options.numColumns) {
                options.DoHelp ();
                Environment.Exit (0);
                } else if (!options.GotNoArguments && options.Format) {
                format = options.FirstArgument;
                filepath = options.SecondArgument;
                uri = ParsePath (filepath);

                if (uri != null) {
                    try {
                        reader = new PDFPoppler (uri);

                        Logger.Debug ("Transformando PDF", "");

                        rdoc = reader.CreateRawDocument ();
                        ndoc = rdoc.Normalize (format);
                        ndoc.WriteDocument (Environment.CurrentDirectory,
                            Path.GetFileNameWithoutExtension (filepath), "norm");
                        marker = new MarkupHTML (ndoc);
                        htmldoc = marker.CreateHTMLDocument ();
                        htmldoc.WriteDocument (Environment.CurrentDirectory,
                            Path.GetFileNameWithoutExtension (filepath), "htm");
                        reader.GetNonText ();

                        Logger.Debug ("Finalizando", "");
                    } catch (FileNotFoundException) {
                        Logger.Error ("El archivo {0} no existe", filepath);
                        Environment.Exit (1);
                    }
                } else {
                    Logger.Error ("Solo se acepta la ruta a un documento PDF", "");
                    Environment.Exit (1);
                }
                } else if (!options.GotNoArguments && options.numColumns) {
                num = options.FirstArgument;
                filepath = options.SecondArgument;
                format = options.ThirdArgument;
                uri = ParsePath (filepath);

                if (uri != null) {
                    try {
                        Console.WriteLine ("En opcion de columnas");
                        reader = new PDFPoppler (uri);

                        Console.WriteLine ("Transformando PDF ... ");

                        rdoc = reader.CreateRawDocument ();

                        Console.WriteLine ("Buscando las {0} columnas.", num);
                        rdoc.BreakColumns();
                        Console.WriteLine ("Rompio las {0} columnas here......", rdoc.GetText());
                        rdoc.WriteDocument (Environment.CurrentDirectory,
                        Path.GetFileNameWithoutExtension (filepath), "column");
                        Console.WriteLine ("Finalizando\n");
                    } catch (FileNotFoundException) {
                        Console.WriteLine ("Error: El archivo {0} no existe.", filepath);
                        Environment.Exit (1);
                    }
                }
                }
                }
            }