MarkerTag CreateAssertionFailureMarkerTag()
        {
            MarkerTag markerTag = new MarkerTag(Marker.AssertionFailure);

            markerTag.Contents.Add(CreateAssertionFailureSectionTag());
            return(markerTag);
        }
示例#2
0
        private void SetInProgressOrdersMarker(OrderSalepoint order)
        {
            if (order.EndLatLng == null || this.inprogressOrdersMarkers.ContainsKey(order.Id))
            {
                return;
            }

            MarkerOptions options = new MarkerOptions();
            MarkerTag     tag     = new MarkerTag {
                OrderId = order.Id
            };

            tag.Type = MarkerType.InProgressOrder;

            BitmapDescriptor icon = BitmapDescriptorFactory.FromResource(Resource.Drawable.marker);

            options.SetIcon(icon);

            string title = string.Concat(order.DestinationCity, ", ", order.DestinationAddress);

            options.SetTitle(title);
            options.SetPosition(new LatLng(order.EndLatLng.lat, order.EndLatLng.lng));

            this.activity.RunOnUiThread(() =>
            {
                Marker marker = this.map.AddMarker(options);
                marker.Tag    = tag;
                inprogressOrdersMarkers.Add(order.Id, marker);
            });
        }
        //markers
        private void MarkerClickEvent(object sender, MarkerClickEventArgs e)
        {
            MarkerTag tag = (MarkerTag)e.Marker.Tag;

            this.map.AnimateCamera(CameraUpdateFactory.NewLatLng(e.Marker.Position));

            switch (tag.Type)
            {
            case MarkerType.Order:
                this.ViewModel.ShowOrderDetails.Execute(tag.OrderId.Value);
                break;

            case MarkerType.Salepoint:
                //if selected salepoint id equals active salepoint id
                if (this.ViewModel.SelectedSalepointId.HasValue && this.ViewModel.SelectedSalepointId.Value == tag.SalepointId.Value)
                {
                    return;
                }
                this.ViewModel.SelectedSalepointId = tag.SalepointId;
                break;

            case MarkerType.ActiveRoutePoint:
            case MarkerType.PendingRoutePoint:
                e.Marker.ShowInfoWindow();
                break;
            }
        }
示例#4
0
    private void addOneMoneyAtMarker(Transform marker, Transform inparent, TerrainTag interrainTag)
    {
        GameObject newObject;

        newObject = moneyElementFactory.GetNewObject();

        //set position & rotation
        newObject.transform.position = marker.position;

        MarkerTag markerTag = newObject.GetComponent <MarkerTag>();

        if (markerTag)
        {
            markerTag.ApplyRotation(marker.rotation, interrainTag.singleTransform.rotation);
        }
        else
        {
            newObject.transform.rotation = marker.rotation;
        }

        if (interrainTag)
        {
            interrainTag.PushToAllElements(newObject.GetComponent <AbstractTag>());
        }

        if (!MakeObstacleSet)
        {
            newObject.transform.parent = inparent;
        }
    }
示例#5
0
 public override void VisitMarkerTag(MarkerTag tag)
 {
     if (!Truncating)
     {
         using (writer.BeginMarker(tag.Marker))
             tag.AcceptContents(this);
     }
 }
        MarkerTag CreateStackTraceMarkerTag()
        {
            MarkerTag markerTag = new MarkerTag(Marker.StackTrace);

            markerTag.Contents.Add(CreateStackTraceTextTag());
            markerTag.Contents.Add(CreateCodeLocationMarkerTag());
            return(markerTag);
        }
		public void VisitMarkerTag(MarkerTag tag)
		{
			if (tag.Class == Marker.StackTraceClass) {
				testResultMessage = textBuilder.ToString();
				textBuilder = new StringBuilder();
			}
			tag.AcceptContents(this);
		}
        MarkerTag CreateCodeLocationMarkerTag()
        {
            CodeLocation location  = new CodeLocation();
            Marker       marker    = Marker.CodeLocation(location);
            MarkerTag    markerTag = new MarkerTag(marker);

            markerTag.Contents.Add(CreateCodeLocationTextTag());
            return(markerTag);
        }
示例#9
0
        //markers
        public void MarkerClickEvent(object sender, MarkerClickEventArgs e)
        {
            MarkerTag tag = (MarkerTag)e.Marker.Tag;

            this.map.AnimateCamera(CameraUpdateFactory.NewLatLng(e.Marker.Position));

            e.Marker.ShowInfoWindow();
            //this.ViewModel.Show
        }
示例#10
0
 public void VisitMarkerTag(MarkerTag tag)
 {
     if (tag.Class == Marker.StackTraceClass)
     {
         testResultMessage = textBuilder.ToString();
         textBuilder       = new StringBuilder();
     }
     tag.AcceptContents(this);
 }
示例#11
0
 public override void VisitMarkerTag(MarkerTag tag)
 {
     if (tag.Class == Marker.StackTraceClass)
     {
         action(tag.ToString());
     }
     else
     {
         base.VisitMarkerTag(tag);
     }
 }
        public void GetMarkerAttributeValue(string searched, string expectedValue)
        {
            // Create sample marker tag.
            var tag = new MarkerTag(Marker.Label);
            tag.Attributes.Add(new MarkerTag.Attribute("name1", "value1"));
            tag.Attributes.Add(new MarkerTag.Attribute("name2", "value2"));
            tag.Attributes.Add(new MarkerTag.Attribute("name3", "value3"));

            // Find attribute value.
            string value = FormatContentsHelper.GetMarkerAttributeValue(tag, searched);
            Assert.AreEqual(expectedValue, value);
        }
        public void GetMarkerAttributeValue(string searched, string expectedValue)
        {
            // Create sample marker tag.
            var tag = new MarkerTag(Marker.Label);

            tag.Attributes.Add(new MarkerTag.Attribute("name1", "value1"));
            tag.Attributes.Add(new MarkerTag.Attribute("name2", "value2"));
            tag.Attributes.Add(new MarkerTag.Attribute("name3", "value3"));

            // Find attribute value.
            string value = FormatContentsHelper.GetMarkerAttributeValue(tag, searched);

            Assert.AreEqual(expectedValue, value);
        }
		public void Init()
		{
			GallioBodyTagFactory factory = new GallioBodyTagFactory();
			structuredStream = factory.CreateAssertionFailureStructuredStream();
			bodyTag = structuredStream.Body;
			assertionFailureMarkerTag = GetFirstChildMarkerTag(bodyTag);
			expectedValueToBeTrueSectionTag = GetFirstChildSectionTag(assertionFailureMarkerTag);
			expectedValueToBeTrueTextTag = GetFirstChildTextTag(expectedValueToBeTrueSectionTag);
			monoSpaceMarkerTag = GetSecondChildMarkerTag(expectedValueToBeTrueSectionTag);
			textTagAfterMonoSpaceMarkerTag = GetThirdChildTextTag(expectedValueToBeTrueSectionTag);
			stackTraceMarkerTag = GetFourthChildMarkerTag(expectedValueToBeTrueSectionTag);
			stackTraceTextTag = GetFirstChildTextTag(stackTraceMarkerTag);
			codeLocationMarkerTag = GetSecondChildMarkerTag(stackTraceMarkerTag);
			codeLocationTextTag = GetFirstChildTextTag(codeLocationMarkerTag);
		}
            private void VisitCodeLocationMarkerTag(MarkerTag tag)
            {
                Marker marker = tag.Marker;
                string path, line, column;

                marker.Attributes.TryGetValue(Marker.CodeLocationPathAttrib, out path);
                marker.Attributes.TryGetValue(Marker.CodeLocationLineNumberAttrib, out line);
                marker.Attributes.TryGetValue(Marker.CodeLocationColumnNumberAttrib, out column);

                CodeLocation location = new CodeLocation(path,
                                                         line != null ? int.Parse(line, CultureInfo.InvariantCulture) : 0,
                                                         column != null ? int.Parse(column, CultureInfo.InvariantCulture) : 0);

                WriteCodeLocationLink(writer, location, () => tag.AcceptContents(this));
            }
示例#16
0
        public void Init()
        {
            GallioBodyTagFactory factory = new GallioBodyTagFactory();

            structuredStream                = factory.CreateAssertionFailureStructuredStream();
            bodyTag                         = structuredStream.Body;
            assertionFailureMarkerTag       = GetFirstChildMarkerTag(bodyTag);
            expectedValueToBeTrueSectionTag = GetFirstChildSectionTag(assertionFailureMarkerTag);
            expectedValueToBeTrueTextTag    = GetFirstChildTextTag(expectedValueToBeTrueSectionTag);
            monoSpaceMarkerTag              = GetSecondChildMarkerTag(expectedValueToBeTrueSectionTag);
            textTagAfterMonoSpaceMarkerTag  = GetThirdChildTextTag(expectedValueToBeTrueSectionTag);
            stackTraceMarkerTag             = GetFourthChildMarkerTag(expectedValueToBeTrueSectionTag);
            stackTraceTextTag               = GetFirstChildTextTag(stackTraceMarkerTag);
            codeLocationMarkerTag           = GetSecondChildMarkerTag(stackTraceMarkerTag);
            codeLocationTextTag             = GetFirstChildTextTag(codeLocationMarkerTag);
        }
示例#17
0
    private void addOneUniqueAtMarker(Transform marker, TerrainTag interrainTag)
    {
        GameObject newObject;

        newObject = uniqueElementFactory.GetNewObjectWithName(marker.name);

        if (!newObject)
        {
            Debug.Log("Object Not Found - " + marker.name);
            return;
        }

        //set position & rotation
        newObject.transform.position = marker.position;

        MarkerTag markerTag = newObject.GetComponent <MarkerTag>();

        if (markerTag)
        {
            markerTag.ApplyRotation(marker.rotation, interrainTag.singleTransform.rotation);
        }
        else
        {
            newObject.transform.rotation = marker.rotation;
        }

        if (interrainTag)
        {
            interrainTag.PushToAllElements(newObject.GetComponent <AbstractTag>());
        }

        if (MakeTerrains)
        {
            GameObject vspObject;
            vspObject = new GameObject();
            Transform vspTerrain = vspObject.transform;

            vspTerrain.parent   = marker.parent;
            vspTerrain.position = marker.position;
            vspTerrain.rotation = marker.rotation;

            marker.parent = null;

            vspTerrain.name = marker.name;
        }
    }
示例#18
0
            public override void VisitMarkerTag(MarkerTag tag)
            {
                string oldMarkerClass = currentMarkerClass;

                if (IsRecognizedMarkerClass(tag.Class))
                {
                    currentMarkerClass = tag.Class;
                }

                if (currentMarkerClass == Marker.ExceptionClass ||
                    currentBuilder == null && currentMarkerClass == Marker.StackTraceClass)
                {
                    ExceptionDataBuilder oldBuilder = currentBuilder;
                    currentBuilder = new ExceptionDataBuilder();

                    base.VisitMarkerTag(tag);

                    // Handle the case where the stack trace is not part of an exception but appears
                    // within a section that provides additional information since we don't have an exception
                    // type or anything else.  In particular, this is the case for AssertionFailures.
                    if (currentBuilder.Message.Length == 0 && currentSectionName != null)
                    {
                        currentBuilder.Message.Append(currentSectionName);
                    }

                    FlushExceptionProperty(string.Empty);

                    ExceptionData currentException = currentBuilder.ToExceptionData();
                    if (oldBuilder != null)
                    {
                        oldBuilder.Inner = currentException;
                    }
                    else
                    {
                        publishException(currentException);
                    }

                    currentBuilder = oldBuilder;
                }
                else
                {
                    base.VisitMarkerTag(tag);
                }

                currentMarkerClass = oldMarkerClass;
            }
            private void VisitLinkMarkerTag(MarkerTag tag)
            {
                Marker marker = tag.Marker;
                string url;

                marker.Attributes.TryGetValue(Marker.LinkUrlAttrib, out url);

                if (url != null)
                {
                    writer.Write("<a class=\"crossref\" href=\"");
                    WriteHtmlEncoded(writer, url);
                    writer.Write("\">");
                    tag.AcceptContents(this);
                    writer.Write("</a>");
                }
                else
                {
                    tag.AcceptContents(this);
                }
            }
示例#20
0
        private void SetRouteSalepointMarker(RoutePoint point, bool active)
        {
            if (point.Order.SalepointLatLng == null || this.routePointsMarkers.ContainsKey(point.Id))
            {
                return;
            }

            MarkerOptions options = new MarkerOptions();
            MarkerTag     tag     = new MarkerTag {
                PointId = point.Id, OrderId = point.OrderId, SalepointId = point.Order.SalepointId
            };


            options.SetTitle(string.Concat(point.Order.SalepointCity, ", ", point.Order.SalepointAddress));
            options.SetPosition(new LatLng(point.Order.SalepointLatLng.lat, point.Order.SalepointLatLng.lng));

            BitmapDescriptor icon;

            if (active)
            {
                tag.Type = MarkerType.ActiveRoutePoint;
                icon     = BitmapDescriptorFactory.FromResource(Resource.Drawable.salepoint_marker);
            }
            else
            {
                tag.Type = MarkerType.PendingRoutePoint;
                icon     = BitmapDescriptorFactory.FromResource(Resource.Drawable.marker_bw);
            }

            options.SetIcon(icon);


            this.activity.RunOnUiThread(() =>
            {
                Marker marker = this.map.AddMarker(options);
                marker.Tag    = tag;
                this.routePointsMarkers.Add(point.Id, marker);
            });
        }
            public void VisitMarkerTag(MarkerTag tag)
            {
                writer.Write("<span class=\"logStreamMarker-");
                WriteHtmlEncoded(writer, tag.Class);
                writer.Write("\">");

                switch (tag.Class)
                {
                case Marker.CodeLocationClass:
                    VisitCodeLocationMarkerTag(tag);
                    break;

                case Marker.LinkClass:
                    VisitLinkMarkerTag(tag);
                    break;

                default:
                    tag.AcceptContents(this);
                    break;
                }

                writer.Write("</span>");
            }
示例#22
0
    private IEnumerator addOneObstacleFromSetAtMarker(Transform marker, Transform inparent, TerrainTag interrainTag, int recursion, bool FlagCoRoutine)
    {
        GameObject newObject, vspObject;
        bool       flagCompiled = false;

        newObject = obstacleElementFactory.GetNewObjectWithName(marker.name);

        if (!newObject)
        {
            //Debug.Log (marker.name+" NOT FOUND!!!");
            if (FlagCoRoutine)
            {
                yield return(null);
            }
        }

        //set position & rotation
        newObject.transform.position = marker.position;

        MarkerTag markerTag = newObject.GetComponent <MarkerTag>();

        if (markerTag)
        {
            markerTag.ApplyRotation(marker.rotation, interrainTag.singleTransform.rotation);
        }
        else
        {
            newObject.transform.rotation = marker.rotation;
        }

        if (interrainTag)
        {
            interrainTag.PushToAllElements(newObject.GetComponent <AbstractTag>());
        }

        if (marker.name == "TochkaSbora")
        {
            fermaMissionEmmiter.AddMissionEmmitterListener(newObject.GetComponentInChildren <TochkaSbora>());
            if (fermaMissionEmmiter.GetCurrentMissions().Count == 0)
            {
                newObject.GetComponentInChildren <AbstractEnemy>().MakeInactiveParent();
            }
        }

        //if compiled object
        if (marker.name.Contains("Compiled"))
        {
            flagCompiled = true;
            int j;
            //ищем контейнер
            Transform Container;
            Transform Container2;
            Container = marker.transform.FindChild("ContainerOfObjects");
            if (MakeObstacleSet)
            {
                vspObject  = new GameObject();
                Container2 = vspObject.transform;

                Container2.parent   = Container.parent;
                Container2.position = Container.position;
                Container2.rotation = Container.rotation;

                Container2.name = Container.name;
            }
            else
            {
                Container2 = newObject.transform.FindChild("ContainerOfObjects");
            }
            if (Container)
            {
                Transform[] allChildren = Container.gameObject.GetComponentsInChildren <Transform>();
                //обрабатываем все трансформы
                for (j = 1; j < allChildren.Length; j++)
                {
                    //bug with NUULLS
                    if (allChildren[j].name == "money")
                    {
                        addOneMoneyAtMarker(allChildren[j], Container2, interrainTag);
                        continue;
                    }

                    if (allChildren[j].name == "boost")
                    {
                        addOneBoostAtMarker(allChildren[j], Container2, interrainTag);
                        continue;
                    }
                    //reqursively
                    if (FlagCoRoutine)
                    {
                        yield return(null);
                    }
                    StartCoroutine(addOneObstacleFromSetAtMarker(allChildren[j], Container2, interrainTag, recursion + 1, FlagCoRoutine));
                }
                if (MakeObstacleSet)
                {
                    DestroyImmediate(Container.gameObject);
                }
            }
        }

        if (MakeObstacleSet)
        {
            vspObject = new GameObject();
            if (marker.name == "MonetaContainer")
            {
                vspObject.name = "money";
            }

            else if (marker.name == "VodkaContainer" || marker.name == "MagnitContainer" || marker.name == "PostalContainer" || marker.name == "KopilkaContainer")
            {
                vspObject.name = "boost";
            }
            else
            {
                vspObject.name = marker.name;
            }
            vspObject.transform.position = marker.position;
            vspObject.transform.rotation = marker.rotation;
            vspObject.transform.parent   = inparent;

            if (recursion == 0 && !flagCompiled)
            {
                DestroyImmediate(marker.gameObject);
            }

            if (recursion == 0 && flagCompiled)
            {
                Transform Container = marker.transform.FindChild("ContainerOfObjects");
                Container.parent = vspObject.transform;
                DestroyImmediate(marker.gameObject);
            }
        }
        else
        {
            newObject.transform.parent = inparent;
        }

        if (FlagCoRoutine)
        {
            yield return(null);
        }
    }
 /// <summary>
 /// Returns the value of the specified attribute in a marker tag.
 /// </summary>
 /// <param name="markerTag">The marker tag.</param>
 /// <param name="name">The name of the searched attribute.</param>
 /// <returns>The value of the attribute, or an empty string if not found.</returns>
 public static string GetMarkerAttributeValue(MarkerTag markerTag, string name)
 {
     int index = markerTag.Attributes.FindIndex(x => x.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
     return (index < 0) ? String.Empty : markerTag.Attributes[index].Value;
 }
            public void VisitMarkerTag(MarkerTag tag)
            {
                writer.Write("<span class=\"logStreamMarker-");
                WriteHtmlEncoded(writer, tag.Class);
                writer.Write("\">");

                switch (tag.Class)
                {
                    case Marker.CodeLocationClass:
                        VisitCodeLocationMarkerTag(tag);
                        break;

                    case Marker.LinkClass:
                        VisitLinkMarkerTag(tag);
                        break;

                    default:
                        tag.AcceptContents(this);
                        break;
                }

                writer.Write("</span>");
            }
            private void VisitCodeLocationMarkerTag(MarkerTag tag)
            {
                Marker marker = tag.Marker;
                string path, line, column;
                marker.Attributes.TryGetValue(Marker.CodeLocationPathAttrib, out path);
                marker.Attributes.TryGetValue(Marker.CodeLocationLineNumberAttrib, out line);
                marker.Attributes.TryGetValue(Marker.CodeLocationColumnNumberAttrib, out column);

                CodeLocation location = new CodeLocation(path,
                    line != null ? int.Parse(line, CultureInfo.InvariantCulture) : 0,
                    column != null ? int.Parse(column, CultureInfo.InvariantCulture) : 0);

                WriteCodeLocationLink(writer, location, () => tag.AcceptContents(this));
            }
            private void VisitLinkMarkerTag(MarkerTag tag)
            {
                Marker marker = tag.Marker;
                string url;
                marker.Attributes.TryGetValue(Marker.LinkUrlAttrib, out url);

                if (url != null)
                {
                    writer.Write("<a class=\"crossref\" href=\"");
                    WriteHtmlEncoded(writer, url);
                    writer.Write("\">");
                    tag.AcceptContents(this);
                    writer.Write("</a>");
                }
                else
                {
                    tag.AcceptContents(this);
                }
            }
示例#27
0
        /// <summary>
        /// Returns the value of the specified attribute in a marker tag.
        /// </summary>
        /// <param name="markerTag">The marker tag.</param>
        /// <param name="name">The name of the searched attribute.</param>
        /// <returns>The value of the attribute, or an empty string if not found.</returns>
        public static string GetMarkerAttributeValue(MarkerTag markerTag, string name)
        {
            int index = markerTag.Attributes.FindIndex(x => x.Name.Equals(name, StringComparison.OrdinalIgnoreCase));

            return((index < 0) ? String.Empty : markerTag.Attributes[index].Value);
        }
示例#28
0
    private void addOneTreeAtMarker(Transform marker, TerrainTag interrainTag)
    {
        int                    i;
        GameObject             newObject;
        AbstractElementFactory treeElementFactory = null;

        //findTreeFactory
        for (i = 0; i < treeElementFactories.Count; i++)
        {
            //нашли
            if ((treeElementFactories[i] as GameObject).name == interrainTag.treeElementFactory.name)
            {
                treeElementFactory = (treeElementFactories[i] as GameObject).GetComponent <AbstractElementFactory>();
                break;
            }
        }

        if (!treeElementFactory)
        {
            GameObject newTreeFactory;
            newTreeFactory = Instantiate(interrainTag.treeElementFactory) as GameObject;
            treeElementFactories.Add(newTreeFactory);
            newTreeFactory.name = interrainTag.treeElementFactory.name;
            treeElementFactory  = newTreeFactory.GetComponent <AbstractElementFactory>();
        }


        newObject = treeElementFactory.GetNewObject();

        //set position & rotation
        newObject.transform.position = marker.position;

        MarkerTag marderTag = newObject.GetComponent <MarkerTag>();

        if (marderTag)
        {
            marderTag.ApplyRotation(marker.rotation, interrainTag.singleTransform.rotation);
        }
        else
        {
            newObject.transform.rotation = marker.rotation;
        }

        if (interrainTag)
        {
            interrainTag.PushToAllElements(newObject.GetComponent <AbstractTag>());
        }

        if (MakeTerrains)
        {
            GameObject vspObject;
            vspObject = new GameObject();
            Transform vspTerrain = vspObject.transform;

            vspTerrain.parent   = marker.parent;
            vspTerrain.position = marker.position;
            vspTerrain.rotation = marker.rotation;

            marker.parent = null;

            vspTerrain.name = marker.name;
        }
    }
示例#29
0
            public override void VisitMarkerTag(MarkerTag tag)
            {
                string oldMarkerClass = currentMarkerClass;

                if (IsRecognizedMarkerClass(tag.Class))
                    currentMarkerClass = tag.Class;

                if (currentMarkerClass == Marker.ExceptionClass ||
                    currentBuilder == null && currentMarkerClass == Marker.StackTraceClass)
                {
                    ExceptionDataBuilder oldBuilder = currentBuilder;
                    currentBuilder = new ExceptionDataBuilder();

                    base.VisitMarkerTag(tag);

                    // Handle the case where the stack trace is not part of an exception but appears
                    // within a section that provides additional information since we don't have an exception
                    // type or anything else.  In particular, this is the case for AssertionFailures.
                    if (currentBuilder.Message.Length == 0 && currentSectionName != null)
                        currentBuilder.Message.Append(currentSectionName);

                    FlushExceptionProperty(string.Empty);

                    ExceptionData currentException = currentBuilder.ToExceptionData();
                    if (oldBuilder != null)
                        oldBuilder.Inner = currentException;
                    else
                        publishException(currentException);

                    currentBuilder = oldBuilder;
                }
                else
                {
                    base.VisitMarkerTag(tag);
                }

                currentMarkerClass = oldMarkerClass;
            }
示例#30
0
 /// <inheritdoc />
 public virtual void VisitMarkerTag(MarkerTag tag)
 {
     tag.AcceptContents(this);
 }