Example #1
0
 private Result(ILocated located, IContext next, bool isSuccess, IEnumerable <INode> nodes)
 {
     Location  = located.Location;
     Next      = next;
     IsSuccess = isSuccess;
     Nodes     = nodes.ToList();
 }
Example #2
0
 protected Message(MessageSeverity severity, MessageCode code, ILocated located)
 {
     Severity = severity;
     Code     = code;
     Location = located.Location;
     Msg      = Subject(Location);
 }
Example #3
0
 private Identifier(ILocated located, string name)
     : base(located)
 {
     Parts = new List <IdPart> {
         new IdPart(located, name)
     };
 }
Example #4
0
 public FailResult(ILocated located, IContext next)
     : base(located, next, false, Empty)
 {
     if (FarthestFail == null || located.Location.Start > FarthestFail.Location.Start)
     {
         FarthestFail = this;
     }
 }
Example #5
0
 public static IResult Fail(ILocated located, IContext next)
 {
     if (located == null)
     {
         throw new InternalNullException();
     }
     return(new FailResult(located, next));
 }
Example #6
0
        protected internal Expression(ILocated located)
        {
            if (located == null)
            {
                throw new ArgumentNullException(nameof(located));
            }

            Location = located.Location;
        }
Example #7
0
        public static Identifier From(ILocated located, IEnumerable <Identifier> identifiers)
        {
            if (identifiers == null)
            {
                throw new ArgumentNullException(nameof(identifiers));
            }

            return(new Identifier(located, identifiers));
        }
Example #8
0
        private Identifier(ILocated located, IEnumerable <Identifier> identifiers)
            : base(located)
        {
            var parts = new List <IdPart>();

            foreach (var identifier in identifiers)
            {
                parts.AddRange(identifier.Parts);
            }
            Parts = parts;
        }
Example #9
0
        public IdPart(ILocated located, string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (located == null)
            {
                throw new ArgumentNullException(nameof(located));
            }

            Location = located.Location;
            Name     = name;
        }
Example #10
0
        public LocationPickerViewModel(ILocated item)
        {
            BasinMapViewModel = new BasinMapViewModel(new List <BasinMapLayer>
            {
                // new BasinMapReaches() //marker isn't showing up when reaches are visible
            });

            BasinMapViewModel.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == nameof(BasinMapViewModel.SelectedPoint))
                {
                    PointSelected(BasinMapViewModel.SelectedPoint);
                }
            };

            if (item.Location.Latitude > 0 && item.Location.Longitude > 0)
            {
                PointSelected(new MapPoint(item.Location.Longitude, item.Location.Latitude, new SpatialReference(item.Location.Wkid)));
            }
        }
Example #11
0
 public static ClassRangeExpression From(ILocated located, int min, int max)
 {
     return(new ClassRangeExpression(located, min, max));
 }
Example #12
0
 public static InlineExpression From(ILocated located, IRule rule)
 {
     return(new InlineExpression(located, rule));
 }
Example #13
0
 private void SelectText(ILocated loc)
 {
     SelectText(loc.File, loc.Span);
 }
Example #14
0
 private Leaf(ILocated located, string name, string value)
 {
     Location = located.Location;
     Name     = name;
     Value    = value;
 }
Example #15
0
 public MessageWarning(MessageCode code, ILocated located)
     : base(MessageSeverity.Warning, code, located)
 {
 }
Example #16
0
 private StarExpression(ILocated located, Expression expression)
     : base(located, expression)
 {
 }
Example #17
0
 private AndExpression(ILocated located, Expression expression)
     : base(located, expression)
 {
 }
Example #18
0
 private AnyExpression(ILocated located)
     : base(located)
 {
 }
 private void SelectText(ILocated loc)
 {
   SelectText(loc.Location);
 }
Example #20
0
 public static StarExpression From(ILocated located, Expression expression)
 {
     return(new StarExpression(located, expression));
 }
Example #21
0
 protected internal SimpleExpression(ILocated located)
     : base(located)
 {
 }
Example #22
0
 protected internal WithInnerExpression(ILocated located, Expression expression)
     : base(located)
 {
     Expression = expression;
 }
 private void SelectText(ILocated loc)
 {
   SelectText(loc.File, loc.Span);
 }
Example #24
0
 private Leaf(ILocated located, string name)
 {
     Location = located.Location;
     Name     = name;
     Value    = string.Empty;
 }
 public RejectedException(IModifier modifier, ILocated input) : base(modifier)
 {
     _input = input;
 }
Example #26
0
 public static INode From(ILocated located, string name, string value) => new Leaf(located, name, value);
Example #27
0
 public static NameExpression From(ILocated located, Identifier identifier)
 {
     return(new NameExpression(located, identifier));
 }
Example #28
0
 private void SelectText(ILocated loc)
 {
     SelectText(loc.Location);
 }
Example #29
0
 private NameExpression(ILocated located, Identifier identifier)
     : base(located)
 {
     Identifier = identifier;
 }
Example #30
0
 private ClassRangeExpression(ILocated located, int min, int max)
     : base(located)
 {
     Min = min;
     Max = max;
 }
Example #31
0
 protected SuffixExpression(ILocated located, Expression expression)
     : base(located, expression)
 {
 }
Example #32
0
 private InlineExpression(ILocated located, IRule inlineRule)
     : base(located)
 {
     InlineRule = inlineRule;
     Rule       = inlineRule;
 }
Example #33
0
 public static double DistanceTo(this ILocated obj1, ILocated obj2)
 {
     var dx = obj1.X - obj2.X;
     var dy = obj1.Y - obj2.Y;
     return Math.Sqrt(dx * dx + dy * dy);
 }