Exemple #1
0
        private static string ToExpressionValue(Node value, CartoReaderContext cntx)
        {
            string result = null;

            Number num = value as Number;

            if (num != null)
            {
                result = num.Value.ToString();
            }
            else
            {
                Quoted quoted = value as Quoted;
                if (quoted != null)
                {
                    result = QuoteValue(quoted.Value.ToString());
                }
                else
                {
                    result = cntx.GetValue(value);
                }
            }

            return(result);
        }
Exemple #2
0
 public Import Import(string currentPath, Quoted path, IImporter importer, Value features, bool isOnce, NodeLocation location)
 {
     return(new Import(currentPath, path, importer, features, isOnce)
     {
         Location = location
     });
 }
Exemple #3
0
 public Import Import(Quoted path, IImporter importer, Value features, int index)
 {
     return(new Import(path, importer, features)
     {
         Index = index
     });
 }
Exemple #4
0
 public Import Import(Quoted path, Importer importer, int index)
 {
     return(new Import(path, importer)
     {
         Index = index
     });
 }
 public Import Import(Quoted path, IImporter importer, Value features, bool isOnce, NodeLocation location)
 {
     return(new Import(path, importer, features, isOnce)
     {
         Location = location
     });
 }
 public Import Import(Quoted path, Value features, ImportOptions option, NodeLocation location)
 {
     return(new Import(path, features, option)
     {
         Location = location
     });
 }
        private static string ToExpressionValue(Node value)
        {
            string result = null;

            Number num = value as Number;

            if (num != null)
            {
                result = num.Value.ToString();
            }
            else
            {
                Quoted quoted = value as Quoted;
                if (quoted != null)
                {
                    result = QuoteValue(quoted.Value.ToString());
                }
                else
                {
                    result = value.ToString();
                }
            }

            return(result);
        }
Exemple #8
0
 public void Update(IEnumerable <Post> newPosts)
 {
     foreach (Post newReply in newPosts)
     {
         if (newReply.Message.Contains(">>" + PostNumber))
         {
             Quoted?.Invoke(this, newReply);
         }
     }
 }
Exemple #9
0
        public IHttpActionResult GetQuotedCaseList(int clientId)
        {
            registration record = null;

            try
            {
                List <CasesQuotesDto> casesQuotesDtoList = new List <CasesQuotesDto>();

                var caseList = ecaseEntity.cases.Where(x => x.clientid == clientId).ToList();

                foreach (var cas in caseList)
                {
                    CasesQuotesDto casesQuotesDto = new CasesQuotesDto();
                    casesQuotesDto.title            = cas.title;
                    casesQuotesDto.description      = cas.description;
                    casesQuotesDto.id               = cas.id;
                    casesQuotesDto.approvedLaywerId = Convert.ToInt32(cas.approvedlawyerid);
                    if (cas.approvedlawyerid != 0)
                    {
                        var lawrecord = ecaseEntity.registrations.First(x => x.id == cas.approvedlawyerid);
                        casesQuotesDto.LawyerName = lawrecord.firstname + " " + lawrecord.lastname;
                    }
                    casesQuotesDto.specialityName = ecaseEntity.specialities.First(x => x.id == cas.specialityid).name;


                    List <Quoted> quotedList = new List <Quoted>();
                    var           QuoteList  = ecaseEntity.quotes.Where(x => x.caseid == cas.id).ToList();

                    foreach (var quote  in QuoteList)
                    {
                        Quoted quoted = new Quoted();
                        quoted.id          = quote.id;
                        quoted.description = quote.description;
                        quoted.duration    = quote.duration;
                        quoted.price       = quote.price;
                        quoted.lawyerid    = Convert.ToInt32(quote.lawyerid);
                        var lawyer = ecaseEntity.registrations.First(x => x.id == quote.lawyerid);
                        quoted.lawyername = lawyer.firstname + " " + lawyer.lastname;
                        quoted.emailId    = lawyer.email;

                        quotedList.Add(quoted);
                    }

                    casesQuotesDto.Quoteds = quotedList;
                    casesQuotesDtoList.Add(casesQuotesDto);
                }

                return(Ok(casesQuotesDtoList));
            }
            catch (Exception ex)
            {
                record = null;
                return(Ok(record));
            }
        }
Exemple #10
0
        public Node Operate(Operation op, Node other)
        {
            var otherField = other as CartoFieldNode;

            if (otherField == null)
            {
                Quoted otherQuoted = other as Quoted;

                return(new Quoted(this.Value + op.Operator + ConvertUtility.QuoteValue(otherQuoted.Value), otherQuoted.Escaped));
            }
            else
            {
                return(new CartoFieldNode(this.Value + otherField.Value));
            }
        }
Exemple #11
0
        public void QuotedOfT_WithExpressionPolicy()
        {
            var policy = new TestPolicy
            {
                InMemoryCache   = new ExpressionHeap(),
                DelegateCache   = new SimpleCompiledDelegateCache(),
                ConstantHoister = ConstantHoister.Create(useDefaultForNull: false)
            };

            var expr = Expression.Constant(42, typeof(int));

            var q = new Quoted <int>(expr, policy);

            Assert.AreEqual(42, q.Value);
            Assert.AreNotSame(expr, q.Expression);
            Assert.IsTrue(new ExpressionEqualityComparer().Equals(expr, q.Expression));
        }
Exemple #12
0
        public void QuotedOfT_NoValue()
        {
            var c = new ValueCell(42);

            Expression <Func <int> > f = () => c.Value;

            var e = f.Body;

            var q = new Quoted <int>(e);

            var v = q.Value;

            Assert.AreEqual(42, q.Value);
            Assert.AreSame(e, q.Expression);

            Assert.IsTrue(c.HasAccessed);

            Assert.IsTrue(q.ToString().Contains("42"));
        }
        public Node Operate(Operation op, Node other)
        {
            Quoted otherQuoted = other as Quoted;

            if (otherQuoted != null)
            {
                return(new Quoted(ConvertUtility.QuoteValue(this.Value) + op.Operator + ConvertUtility.QuoteValue(otherQuoted.Value), this.Escaped));
            }
            else
            {
                CartoFieldNode fieldNode = other as CartoFieldNode;

                if (fieldNode != null)
                {
                    return(new Quoted(ConvertUtility.QuoteValue(this.Value) + op.Operator + fieldNode.Value, this.Escaped));
                }
                else
                {
                    throw new Exception();
                }
            }
        }
 public CartoQuotedNode(Quoted quoted) : base(quoted.Value, quoted.Quote, quoted.Escaped)
 {
 }
Exemple #15
0
 public WinProcess AddArgument(Quoted arg)
 => AddArgument(arg.Value());
 public Import Import(Quoted path, Importer importer, int index)
 {
     return new Import(path, importer) { Index = index };
 }
        public override int GetHashCode()
        {
            int hashcode = 157;

            unchecked {
                if (isset.delimiter)
                {
                    hashcode = (hashcode * 397) + Delimiter.GetHashCode();
                }
                if (isset.null_str)
                {
                    hashcode = (hashcode * 397) + Null_str.GetHashCode();
                }
                if (isset.has_header)
                {
                    hashcode = (hashcode * 397) + Has_header.GetHashCode();
                }
                if (isset.quoted)
                {
                    hashcode = (hashcode * 397) + Quoted.GetHashCode();
                }
                if (isset.quote)
                {
                    hashcode = (hashcode * 397) + Quote.GetHashCode();
                }
                if (isset.escape)
                {
                    hashcode = (hashcode * 397) + Escape.GetHashCode();
                }
                if (isset.line_delim)
                {
                    hashcode = (hashcode * 397) + Line_delim.GetHashCode();
                }
                if (isset.array_delim)
                {
                    hashcode = (hashcode * 397) + Array_delim.GetHashCode();
                }
                if (isset.array_begin)
                {
                    hashcode = (hashcode * 397) + Array_begin.GetHashCode();
                }
                if (isset.array_end)
                {
                    hashcode = (hashcode * 397) + Array_end.GetHashCode();
                }
                if (isset.threads)
                {
                    hashcode = (hashcode * 397) + Threads.GetHashCode();
                }
                if (isset.file_type)
                {
                    hashcode = (hashcode * 397) + File_type.GetHashCode();
                }
                if (isset.s3_access_key)
                {
                    hashcode = (hashcode * 397) + S3_access_key.GetHashCode();
                }
                if (isset.s3_secret_key)
                {
                    hashcode = (hashcode * 397) + S3_secret_key.GetHashCode();
                }
                if (isset.s3_region)
                {
                    hashcode = (hashcode * 397) + S3_region.GetHashCode();
                }
                if (isset.geo_coords_encoding)
                {
                    hashcode = (hashcode * 397) + Geo_coords_encoding.GetHashCode();
                }
                if (isset.geo_coords_comp_param)
                {
                    hashcode = (hashcode * 397) + Geo_coords_comp_param.GetHashCode();
                }
                if (isset.geo_coords_type)
                {
                    hashcode = (hashcode * 397) + Geo_coords_type.GetHashCode();
                }
                if (isset.geo_coords_srid)
                {
                    hashcode = (hashcode * 397) + Geo_coords_srid.GetHashCode();
                }
                if (isset.sanitize_column_names)
                {
                    hashcode = (hashcode * 397) + Sanitize_column_names.GetHashCode();
                }
                if (isset.geo_layer_name)
                {
                    hashcode = (hashcode * 397) + Geo_layer_name.GetHashCode();
                }
                if (isset.s3_endpoint)
                {
                    hashcode = (hashcode * 397) + S3_endpoint.GetHashCode();
                }
                if (isset.geo_assign_render_groups)
                {
                    hashcode = (hashcode * 397) + Geo_assign_render_groups.GetHashCode();
                }
                if (isset.geo_explode_collections)
                {
                    hashcode = (hashcode * 397) + Geo_explode_collections.GetHashCode();
                }
            }
            return(hashcode);
        }
Exemple #18
0
 public WinProcess AddArgument(string name, Quoted value)
 => AddArgument(name, value.Value());
 public Import Import(Quoted path, IImporter importer, Value features, bool isOnce, NodeLocation location)
 {
     return new Import(path, importer, features, isOnce) { Location = location };
 }
 public Import Import(Quoted path, Value features, ImportOptions option, NodeLocation location)
 {
     return new Import(path, features, option) { Location = location };
 }
 public Import Import(Quoted path, IImporter importer, Value features, int index)
 {
     return new Import(path, importer, features) { Index = index };
 }
 public override Quoted VisitQuoted(Quoted quoted)
 {
     quoted = quotedDelegate?.Invoke(quoted) ?? quoted;
     return(base.VisitQuoted(quoted));
 }