conflict_resolution
stringlengths
27
16k
<<<<<<< using Elasticsearch.Net; using System; using System.Collections.Generic; ======= using System; >>>>>>> using Elasticsearch.Net; using System;
<<<<<<< /// <inheritdoc /> IExistsResponse AliasExists(Func<AliasExistsDescriptor, AliasExistsDescriptor> selector); /// <inheritdoc /> IExistsResponse AliasExists(IAliasExistsRequest AliasRequest); /// <inheritdoc /> Task<IExistsResponse> AliasExistsAsync(Func<AliasExistsDescriptor, AliasExistsDescriptor> selector); /// <inheritdoc /> Task<IExistsResponse> AliasExistsAsync(IAliasExistsRequest AliasRequest); ======= /// <inheritdoc /> IExistsResponse TypeExists(Func<TypeExistsDescriptor, TypeExistsDescriptor> selector); /// <inheritdoc /> IExistsResponse TypeExists(ITypeExistsRequest TypeRequest); /// <inheritdoc /> Task<IExistsResponse> TypeExistsAsync(Func<TypeExistsDescriptor, TypeExistsDescriptor> selector); /// <inheritdoc /> Task<IExistsResponse> TypeExistsAsync(ITypeExistsRequest TypeRequest); >>>>>>> /// <inheritdoc /> IExistsResponse AliasExists(Func<AliasExistsDescriptor, AliasExistsDescriptor> selector); /// <inheritdoc /> IExistsResponse AliasExists(IAliasExistsRequest AliasRequest); /// <inheritdoc /> Task<IExistsResponse> AliasExistsAsync(Func<AliasExistsDescriptor, AliasExistsDescriptor> selector); /// <inheritdoc /> Task<IExistsResponse> AliasExistsAsync(IAliasExistsRequest AliasRequest); /// <inheritdoc /> IExistsResponse TypeExists(Func<TypeExistsDescriptor, TypeExistsDescriptor> selector); /// <inheritdoc /> IExistsResponse TypeExists(ITypeExistsRequest TypeRequest); /// <inheritdoc /> Task<IExistsResponse> TypeExistsAsync(Func<TypeExistsDescriptor, TypeExistsDescriptor> selector); /// <inheritdoc /> Task<IExistsResponse> TypeExistsAsync(ITypeExistsRequest TypeRequest);
<<<<<<< { Parser.Min, 11 } ======= { Parser.Top, 12 }, >>>>>>> { Parser.Min, 11 }, { Parser.Top, 12 }, <<<<<<< case 11: aggregate = GetBoxplotAggregate(ref reader, formatterResolver, meta); break; ======= case 12: aggregate = GetTopMetricsAggregate(ref reader, formatterResolver, meta); break; >>>>>>> case 11: aggregate = GetBoxplotAggregate(ref reader, formatterResolver, meta); break; case 12: aggregate = GetTopMetricsAggregate(ref reader, formatterResolver, meta); break; <<<<<<< private IAggregate GetBoxplotAggregate(ref JsonReader reader, IJsonFormatterResolver formatterResolver, IReadOnlyDictionary<string, object> meta) { var boxplot = new BoxplotAggregate { Min = reader.ReadDouble(), Meta = meta }; reader.ReadNext(); // , reader.ReadNext(); // "max" reader.ReadNext(); // : boxplot.Max = reader.ReadDouble(); reader.ReadNext(); // , reader.ReadNext(); // "q1" reader.ReadNext(); // : boxplot.Q1 = reader.ReadDouble(); reader.ReadNext(); // , reader.ReadNext(); // "q2" reader.ReadNext(); // : boxplot.Q2 = reader.ReadDouble(); reader.ReadNext(); // , reader.ReadNext(); // "q3" reader.ReadNext(); // : boxplot.Q3 = reader.ReadDouble(); return boxplot; } ======= private IAggregate GetTopMetricsAggregate(ref JsonReader reader, IJsonFormatterResolver formatterResolver, IReadOnlyDictionary<string, object> meta) { var topMetrics = new TopMetricsAggregate { Meta = meta }; var formatter = formatterResolver.GetFormatter<List<TopMetric>>(); topMetrics.Top = formatter.Deserialize(ref reader, formatterResolver); return topMetrics; } >>>>>>> private IAggregate GetBoxplotAggregate(ref JsonReader reader, IJsonFormatterResolver formatterResolver, IReadOnlyDictionary<string, object> meta) { var boxplot = new BoxplotAggregate { Min = reader.ReadDouble(), Meta = meta }; reader.ReadNext(); // , reader.ReadNext(); // "max" reader.ReadNext(); // : boxplot.Max = reader.ReadDouble(); reader.ReadNext(); // , reader.ReadNext(); // "q1" reader.ReadNext(); // : boxplot.Q1 = reader.ReadDouble(); reader.ReadNext(); // , reader.ReadNext(); // "q2" reader.ReadNext(); // : boxplot.Q2 = reader.ReadDouble(); reader.ReadNext(); // , reader.ReadNext(); // "q3" reader.ReadNext(); // : boxplot.Q3 = reader.ReadDouble(); return boxplot; } private IAggregate GetTopMetricsAggregate(ref JsonReader reader, IJsonFormatterResolver formatterResolver, IReadOnlyDictionary<string, object> meta) { var topMetrics = new TopMetricsAggregate { Meta = meta }; var formatter = formatterResolver.GetFormatter<List<TopMetric>>(); topMetrics.Top = formatter.Deserialize(ref reader, formatterResolver); return topMetrics; }
<<<<<<< internal static IEnumerable<T> EmptyIfNull<T>(this IEnumerable<T> xs) => xs ?? new T[0]; ======= >>>>>>>
<<<<<<< ======= using Nest.Resolvers.Converters; using Newtonsoft.Json; >>>>>>> using Nest.Resolvers.Converters; using Newtonsoft.Json;
<<<<<<< public StatsAgg(string name, Field field) : base(name, field) { } ======= internal StatsAggregation() { } public StatsAggregation(string name, FieldName field) : base(name, field) { } >>>>>>> internal StatsAggregation() { } public StatsAggregation(string name, Field field) : base(name, field) { }
<<<<<<< void Visit(IBoxplotAggregation aggregation); ======= void Visit(ITopMetricsAggregation aggregation); >>>>>>> void Visit(IBoxplotAggregation aggregation); void Visit(ITopMetricsAggregation aggregation); <<<<<<< public virtual void Visit(IBoxplotAggregation aggregation) { } ======= public virtual void Visit(ITopMetricsAggregation aggregation) { } >>>>>>> public virtual void Visit(IBoxplotAggregation aggregation) { } public virtual void Visit(ITopMetricsAggregation aggregation) { }
<<<<<<< public CardinalityAgg(string name, Field field) : base(name, field) { } ======= public CardinalityAggregation(string name, FieldName field) : base(name, field) { } >>>>>>> public CardinalityAggregation(string name, Field field) : base(name, field) { }
<<<<<<< [JsonProperty("children")] IChildrenAggregator Children { get; set; } ======= [JsonProperty("scripted_metric")] IScriptedMetricAggregator ScriptedMetric { get; set; } >>>>>>> [JsonProperty("children")] IChildrenAggregator Children { get; set; } [JsonProperty("scripted_metric")] IScriptedMetricAggregator ScriptedMetric { get; set; } <<<<<<< private IChildrenAggregator _children; ======= private IScriptedMetricAggregator _scriptedMetric; >>>>>>> private IChildrenAggregator _children; private IScriptedMetricAggregator _scriptedMetric; <<<<<<< public IChildrenAggregator Children { get { return _children; } set { _children = value; } } ======= public IScriptedMetricAggregator ScriptedMetric { get { return _scriptedMetric; } set { _scriptedMetric = value; } } >>>>>>> public IChildrenAggregator Children { get { return _children; } set { _children = value; } } public IScriptedMetricAggregator ScriptedMetric { get { return _scriptedMetric; } set { _scriptedMetric = value; } } <<<<<<< IChildrenAggregator IAggregationContainer.Children { get; set; } ======= IScriptedMetricAggregator IAggregationContainer.ScriptedMetric { get; set; } >>>>>>> IChildrenAggregator IAggregationContainer.Children { get; set; } IScriptedMetricAggregator IAggregationContainer.ScriptedMetric { get; set; } <<<<<<< public AggregationDescriptor<T> Children(string name, Func<ChildrenAggregationDescriptor<T>, ChildrenAggregationDescriptor<T>> selector) { return this.Children<T>(name, selector); } public AggregationDescriptor<T> Children<K>(string name, Func<ChildrenAggregationDescriptor<K>, ChildrenAggregationDescriptor<K>> selector) where K : class { return _SetInnerAggregation(name, selector, (a, d) => a.Children = d); } ======= public AggregationDescriptor<T> ScriptedMetric(string name, Func<ScriptedMetricAggregationDescriptor<T>, ScriptedMetricAggregationDescriptor<T>> selector) { return _SetInnerAggregation(name, selector, (a, d) => a.ScriptedMetric = d); } >>>>>>> public AggregationDescriptor<T> Children(string name, Func<ChildrenAggregationDescriptor<T>, ChildrenAggregationDescriptor<T>> selector) { return this.Children<T>(name, selector); } public AggregationDescriptor<T> Children<K>(string name, Func<ChildrenAggregationDescriptor<K>, ChildrenAggregationDescriptor<K>> selector) where K : class { return _SetInnerAggregation(name, selector, (a, d) => a.Children = d); } public AggregationDescriptor<T> ScriptedMetric(string name, Func<ScriptedMetricAggregationDescriptor<T>, ScriptedMetricAggregationDescriptor<T>> selector) { return _SetInnerAggregation(name, selector, (a, d) => a.ScriptedMetric = d); }
<<<<<<< /// <inheritdoc /> IExistsResponse TemplateExists(Func<TemplateExistsDescriptor, TemplateExistsDescriptor> selector); /// <inheritdoc /> IExistsResponse TemplateExists(ITemplateExistsRequest templateRequest); /// <inheritdoc /> Task<IExistsResponse> TemplateExistsAsync(Func<TemplateExistsDescriptor, TemplateExistsDescriptor> selector); /// <inheritdoc /> Task<IExistsResponse> TemplateExistsAsync(ITemplateExistsRequest templateRequest); ======= /// <summary> /// Executes a HEAD request to the cluster to determine whether it's up or not. /// </summary> IPingResponse Ping(Func<PingDescriptor, PingDescriptor> pingSelector = null); /// <inheritdoc /> Task<IPingResponse> PingAsync(Func<PingDescriptor, PingDescriptor> pingSelector = null); /// <inheritdoc /> IPingResponse Ping(IPingRequest pingRequest); /// <inheritdoc /> Task<IPingResponse> PingAsync(IPingRequest pingRequest); >>>>>>> /// <inheritdoc /> IExistsResponse TemplateExists(Func<TemplateExistsDescriptor, TemplateExistsDescriptor> selector); /// <inheritdoc /> IExistsResponse TemplateExists(ITemplateExistsRequest templateRequest); /// <inheritdoc /> Task<IExistsResponse> TemplateExistsAsync(Func<TemplateExistsDescriptor, TemplateExistsDescriptor> selector); /// <inheritdoc /> Task<IExistsResponse> TemplateExistsAsync(ITemplateExistsRequest templateRequest); /// <summary> /// Executes a HEAD request to the cluster to determine whether it's up or not. /// </summary> IPingResponse Ping(Func<PingDescriptor, PingDescriptor> pingSelector = null); /// <inheritdoc /> Task<IPingResponse> PingAsync(Func<PingDescriptor, PingDescriptor> pingSelector = null); /// <inheritdoc /> IPingResponse Ping(IPingRequest pingRequest); /// <inheritdoc /> Task<IPingResponse> PingAsync(IPingRequest pingRequest);
<<<<<<< Do("POST", "/mydefaultindex/doc/_percolate", c => c.Percolate<Doc>(p => p.Document(new Doc {Id = "1"}))); Do("POST", "/mydefaultindex/otherdoc/_percolate", c => c.Percolate<OtherDoc>(p => p.Document(new OtherDoc {Name = "hello"}))); Do("POST", "/mycustomindex/mycustomtype/_percolate", c => c.Percolate<OtherDoc>(p => p.Document(new OtherDoc {Name = "hello"}).Index("mycustomindex").Type("mycustomtype"))); ======= Do("POST", "/mydefaultindex/doc/_percolate", c => c.Percolate<Doc>(p => p.Document(new Doc { Id = "1" }))); Do("POST", "/mydefaultindex/otherdoc/_percolate", c => c.Percolate<OtherDoc>(p => p.Document(new OtherDoc { Name = "hello" }))); Do("POST", "/mycustomindex/mycustomtype/_percolate", c => c.Percolate<OtherDoc>(p => p.Document(new OtherDoc { Name = "hello" }).Index("mycustomindex").Type("mycustomtype"))); >>>>>>> Do("POST", "/mydefaultindex/doc/_percolate", c => c.Percolate<Doc>(p => p.Document(new Doc { Id = "1" }))); Do("POST", "/mydefaultindex/otherdoc/_percolate", c => c.Percolate<OtherDoc>(p => p.Document(new OtherDoc { Name = "hello" }))); Do("POST", "/mycustomindex/mycustomtype/_percolate", c => c.Percolate<OtherDoc>(p => p.Document(new OtherDoc {Name = "hello"}).Index("mycustomindex").Type("mycustomtype"))); <<<<<<< Do("POST", "/_scripts/lang/id", c => c.PutScript(s => s.Lang("lang").Id("id"))); Do("GET", "/_scripts/lang/id", c => c.GetScript(s => s.Lang("lang").Id("id"))); Do("DELETE", "/_scripts/lang/id", c => c.DeleteScript(s => s.Lang("lang").Id("id"))); Do("GET", "/_all/_mappings%2C_aliases", c => c.GetIndex(d => d.AllIndices().Features(GetIndexFeature.Aliases | GetIndexFeature.Mappings))); Do("GET", "/_all", c => c.GetIndex(d => d.AllIndices().Features(GetIndexFeature.All))); Do("GET", "/_all", c => c.GetIndex(d => d.AllIndices())); ======= Do("POST", "/_scripts/lang/id", c => c.PutScript(s => s.Lang("lang").Id("id"))); Do("GET", "/_scripts/lang/id", c => c.GetScript(s => s.Lang("lang").Id("id"))); Do("DELETE", "/_scripts/lang/id", c => c.DeleteScript(s => s.Lang("lang").Id("id"))); Do("GET", "/mydefaultindex/doc/_search/exists?q=term", c => c.SearchExists<Doc>(s => s.QueryString("term"))); Do("GET", "/mydefaultindex/doc/_search/exists?source=%7B%7D", c => c.SearchExists<Doc>(s=>s.Source("{}"))); Do("GET", "/mydefaultindex/doc/_search/exists", c => c.SearchExists<Doc>(s=>s)); Do("POST", "/mydefaultindex/doc/_search/exists", c => c.SearchExists<Doc>(s=>s.Query(q=>q.MatchAll()))); Do("POST", "/_snapshot/my_repos/_verify", c => c.VerifyRepository("my_repos")); } >>>>>>> Do("POST", "/_scripts/lang/id", c => c.PutScript(s => s.Lang("lang").Id("id"))); Do("GET", "/_scripts/lang/id", c => c.GetScript(s => s.Lang("lang").Id("id"))); Do("DELETE", "/_scripts/lang/id", c => c.DeleteScript(s => s.Lang("lang").Id("id"))); Do("GET", "/_all/_mappings%2C_aliases", c => c.GetIndex(d => d.AllIndices().Features(GetIndexFeature.Aliases | GetIndexFeature.Mappings))); Do("GET", "/_all", c => c.GetIndex(d => d.AllIndices().Features(GetIndexFeature.All))); Do("GET", "/_all", c => c.GetIndex(d => d.AllIndices())); Do("GET", "/mydefaultindex/doc/_search/exists?q=term", c => c.SearchExists<Doc>(s => s.QueryString("term"))); Do("GET", "/mydefaultindex/doc/_search/exists?source=%7B%7D", c => c.SearchExists<Doc>(s=>s.Source("{}"))); Do("GET", "/mydefaultindex/doc/_search/exists", c => c.SearchExists<Doc>(s=>s)); Do("POST", "/mydefaultindex/doc/_search/exists", c => c.SearchExists<Doc>(s=>s.Query(q=>q.MatchAll()))); Do("POST", "/_snapshot/my_repos/_verify", c => c.VerifyRepository("my_repos"));
<<<<<<< var ndexResponse = _client.Index<IngestedAttachment>(Document, i => i ======= var ndexResponse = _client.Index(Document, i => i >>>>>>> var indexResponse = _client.Index(Document, i => i <<<<<<< var ndexResponse = _client.Index<IngestedAttachment>(ingestedAttachment, i => i ======= var ndexResponse = _client.Index(ingestedAttachment, i => i >>>>>>> var indexResponse = _client.Index(ingestedAttachment, i => i
<<<<<<< public MaxAgg(string name, Field field) : base(name, field) { } ======= internal MaxAggregation() { } public MaxAggregation(string name, FieldName field) : base(name, field) { } >>>>>>> internal MaxAggregation() { } public MaxAggregation(string name, Field field) : base(name, field) { }
<<<<<<< using Elasticsearch.Net; ======= using System; using System.Collections.Generic; using System.Linq; using System.Text; using Elasticsearch.Net; using Newtonsoft.Json; >>>>>>> using Elasticsearch.Net; using Newtonsoft.Json;
<<<<<<< [InterfaceDataContract] ======= /// <summary> /// Metadata about a hit matching a query /// </summary> /// <typeparam name="TDocument">The type of the source document</typeparam> [InterfaceDataContract] >>>>>>> /// <summary> /// Metadata about a hit matching a query /// </summary> /// <typeparam name="TDocument">The type of the source document</typeparam> [InterfaceDataContract] <<<<<<< [DataMember(Name = "_id")] ======= /// <summary> /// The id of the hit /// </summary> [DataMember(Name = "_id")] >>>>>>> /// <summary> /// The id of the hit /// </summary> [DataMember(Name = "_id")] <<<<<<< [DataMember(Name = "_index")] ======= /// <summary> /// The index in which the hit resides /// </summary> [DataMember(Name = "_index")] >>>>>>> /// <summary> /// The index in which the hit resides /// </summary> [DataMember(Name = "_index")] <<<<<<< [DataMember(Name = "_routing")] ======= /// <summary> /// The primary term of the hit /// </summary> [DataMember(Name = "_primary_term")] long? PrimaryTerm { get; } /// <summary> /// The routing value for the hit /// </summary> [DataMember(Name = "_routing")] >>>>>>> /// <summary> /// The primary term of the hit /// </summary> [DataMember(Name = "_primary_term")] long? PrimaryTerm { get; } /// <summary> /// The routing value for the hit /// </summary> [DataMember(Name = "_routing")] <<<<<<< [DataMember(Name = "_source")] ======= /// <summary> /// The sequence number for this hit /// </summary> [DataMember(Name = "_seq_no")] long? SequenceNumber { get; } /// <summary> /// The source document for the hit /// </summary> [DataMember(Name = "_source")] >>>>>>> /// <summary> /// The sequence number for this hit /// </summary> [DataMember(Name = "_seq_no")] long? SequenceNumber { get; } /// <summary> /// The source document for the hit /// </summary> [DataMember(Name = "_source")] <<<<<<< // TODO obsolete or remove type on response [DataMember(Name = "_type")] ======= /// <summary> /// The type of hit /// </summary> [DataMember(Name = "_type")] >>>>>>> /// <summary> /// The type of hit /// </summary> [DataMember(Name = "_type")] <<<<<<< [DataMember(Name = "_version")] long? Version { get; } ======= /// <summary> /// The version of the hit /// </summary> [DataMember(Name = "_version")] long Version { get; } >>>>>>> /// <summary> /// The version of the hit /// </summary> [DataMember(Name = "_version")] long Version { get; } <<<<<<< [InterfaceDataContract] ======= /// <summary> /// A hit matching a query /// </summary> /// <typeparam name="TDocument">The type of the source document</typeparam> [InterfaceDataContract] >>>>>>> /// <summary> /// A hit matching a query /// </summary> /// <typeparam name="TDocument">The type of the source document</typeparam> [InterfaceDataContract] <<<<<<< [DataMember(Name = "_explanation")] ======= /// <summary> /// An explanation for why the hit is a match for a query /// </summary> [DataMember(Name = "_explanation")] >>>>>>> /// <summary> /// An explanation for why the hit is a match for a query /// </summary> [DataMember(Name = "_explanation")] <<<<<<< [DataMember(Name = "fields")] ======= /// <summary> /// The individual fields requested for a hit /// </summary> [DataMember(Name = "fields")] >>>>>>> /// <summary> /// The individual fields requested for a hit /// </summary> [DataMember(Name = "fields")] <<<<<<< [DataMember(Name = "inner_hits")] [JsonFormatter(typeof(VerbatimInterfaceReadOnlyDictionaryKeysFormatter<string, InnerHitsResult>))] ======= /// <summary> /// The field highlights /// </summary> [DataMember(Name = "highlight")] IReadOnlyDictionary<string, IReadOnlyCollection<string>> Highlight { get; } /// <summary> /// The inner hits /// </summary> [DataMember(Name = "inner_hits")] [JsonFormatter(typeof(VerbatimInterfaceReadOnlyDictionaryKeysFormatter<string, InnerHitsResult>))] >>>>>>> /// <summary> /// The field highlights /// </summary> [DataMember(Name = "highlight")] IReadOnlyDictionary<string, IReadOnlyCollection<string>> Highlight { get; } /// <summary> /// The inner hits /// </summary> [DataMember(Name = "inner_hits")] [JsonFormatter(typeof(VerbatimInterfaceReadOnlyDictionaryKeysFormatter<string, InnerHitsResult>))] <<<<<<< [DataMember(Name = "_nested")] NestedIdentity Nested { get; } [DataMember(Name = "matched_queries")] ======= /// <summary> /// Which queries the hit is a match for, when a compound query is involved /// and named queries used /// </summary> [DataMember(Name = "matched_queries")] >>>>>>> [DataMember(Name = "_nested")] NestedIdentity Nested { get; } /// <summary> /// Which queries the hit is a match for, when a compound query is involved /// and named queries used /// </summary> [DataMember(Name = "matched_queries")] <<<<<<< [DataMember(Name = "_score")] ======= [DataMember(Name = "_nested")] NestedIdentity Nested { get; } /// <summary> /// The score for the hit in relation to the query /// </summary> [DataMember(Name = "_score")] >>>>>>> /// <summary> /// The score for the hit in relation to the query /// </summary> [DataMember(Name = "_score")] <<<<<<< [DataMember(Name = "sort")] ======= /// <summary> /// The sort values used in sorting the hit relative to other hits /// </summary> [DataMember(Name = "sort")] >>>>>>> /// <summary> /// The sort values used in sorting the hit relative to other hits /// </summary> [DataMember(Name = "sort")] <<<<<<< ======= /// <inheritdoc /> >>>>>>> /// <inheritdoc /> <<<<<<< public string Id { get; internal set; } public string Index { get; internal set; } public IReadOnlyDictionary<string, InnerHitsResult> InnerHits { get; internal set; } = EmptyReadOnly<string, InnerHitsResult>.Dictionary; public IReadOnlyCollection<string> MatchedQueries { get; internal set; } = EmptyReadOnly<string>.Collection; public NestedIdentity Nested { get; internal set; } public string Routing { get; internal set; } public double? Score { get; set; } public IReadOnlyCollection<object> Sorts { get; internal set; } = EmptyReadOnly<object>.Collection; public TDocument Source { get; internal set; } public string Type { get; internal set; } public long? Version { get; internal set; } public Dictionary<string, List<string>> Highlight { get; set; } public HighlightFieldDictionary Highlights { get { if (Highlight == null) return new HighlightFieldDictionary(); var highlights = Highlight.Select(kv => new HighlightHit { DocumentId = Id, Field = kv.Key, Highlights = kv.Value }) .ToDictionary(k => k.Field, v => v); return new HighlightFieldDictionary(highlights); } } ======= /// <inheritdoc /> public IReadOnlyDictionary<string, IReadOnlyCollection<string>> Highlight { get; internal set; } = EmptyReadOnly<string, IReadOnlyCollection<string>>.Dictionary; /// <inheritdoc /> public string Id { get; internal set; } /// <inheritdoc /> public string Index { get; internal set; } /// <inheritdoc /> public IReadOnlyDictionary<string, InnerHitsResult> InnerHits { get; internal set; } = EmptyReadOnly<string, InnerHitsResult>.Dictionary; /// <inheritdoc /> public IReadOnlyCollection<string> MatchedQueries { get; internal set; } = EmptyReadOnly<string>.Collection; /// <inheritdoc /> public NestedIdentity Nested { get; internal set; } /// <inheritdoc /> public long? PrimaryTerm { get; internal set; } /// <inheritdoc /> public string Routing { get; internal set; } /// <inheritdoc /> public double? Score { get; set; } /// <inheritdoc /> public long? SequenceNumber { get; internal set; } /// <inheritdoc /> public IReadOnlyCollection<object> Sorts { get; internal set; } = EmptyReadOnly<object>.Collection; /// <inheritdoc /> public TDocument Source { get; internal set; } /// <inheritdoc /> public string Type { get; internal set; } /// <inheritdoc /> public long Version { get; internal set; } >>>>>>> /// <inheritdoc /> public IReadOnlyDictionary<string, IReadOnlyCollection<string>> Highlight { get; internal set; } = EmptyReadOnly<string, IReadOnlyCollection<string>>.Dictionary; /// <inheritdoc /> public string Id { get; internal set; } /// <inheritdoc /> public string Index { get; internal set; } /// <inheritdoc /> public IReadOnlyDictionary<string, InnerHitsResult> InnerHits { get; internal set; } = EmptyReadOnly<string, InnerHitsResult>.Dictionary; /// <inheritdoc /> public IReadOnlyCollection<string> MatchedQueries { get; internal set; } = EmptyReadOnly<string>.Collection; /// <inheritdoc /> public NestedIdentity Nested { get; internal set; } /// <inheritdoc /> public long? PrimaryTerm { get; internal set; } /// <inheritdoc /> public string Routing { get; internal set; } /// <inheritdoc /> public double? Score { get; set; } /// <inheritdoc /> public long? SequenceNumber { get; internal set; } /// <inheritdoc /> public IReadOnlyCollection<object> Sorts { get; internal set; } = EmptyReadOnly<object>.Collection; /// <inheritdoc /> public TDocument Source { get; internal set; } /// <inheritdoc /> public string Type { get; internal set; } /// <inheritdoc /> public long Version { get; internal set; }
<<<<<<< using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit.Framework; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Nest; using Newtonsoft.Json.Converters; using Nest.Resolvers.Converters; using Nest.Tests.MockData.Domain; using FluentAssertions; namespace Nest.Tests.Integration.Core.Get { [TestFixture] public class GetFullTests : IntegrationTests { private void DefaultAssertations(IGetResponse<ElasticSearchProject> result) { result.IsValid.Should().BeTrue(); result.Id.Should().Be("1"); result.Index.Should().Be(ElasticsearchConfiguration.DefaultIndex); result.Type.Should().Be("elasticsearchprojects"); result.Version.Should().Be("1"); } [Test] public void GetSimple() { var result = this._client.GetFull<ElasticSearchProject>(1); this.DefaultAssertations(result); } [Test] public void GetWithPathInfo() { var result = this._client.GetFull<ElasticSearchProject>(ElasticsearchConfiguration.DefaultIndex, "elasticsearchprojects", 1); this.DefaultAssertations(result); } [Test] public void GetUsingDescriptorWithTypeAndFields() { var result = this._client.GetFull<ElasticSearchProject>(g => g .Index(ElasticsearchConfiguration.DefaultIndex) .Type("elasticsearchprojects") .Id(1) .Fields(p=>p.Content, p=>p.Name, p=>p.Id, p=>p.DoubleValue) ); this.DefaultAssertations(result); result.Source.Should().BeNull(); result.Fields.Should().NotBeNull(); result.Fields.FieldValues.Should().NotBeNull().And.HaveCount(4); result.Fields.FieldValue<string>(p => p.Name).Should().Be("pyelasticsearch"); result.Fields.FieldValue<int>(p => p.Id).Should().Be(1); result.Fields.FieldValue<double>(p => p.DoubleValue).Should().BeApproximately(31.931359384177D, 0.00000001D); } } } ======= using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit.Framework; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Nest; using Newtonsoft.Json.Converters; using Nest.Resolvers.Converters; using Nest.Tests.MockData.Domain; using FluentAssertions; namespace Nest.Tests.Integration.Core.Get { [TestFixture] public class GetFullTests : CleanStateIntegrationTests { private void DefaultAssertations(IGetResponse<ElasticSearchProject> result) { result.IsValid.Should().BeTrue(); result.Id.Should().Be("1"); result.Index.Should().Be("nest_test_data"); result.Type.Should().Be("elasticsearchprojects"); result.Version.Should().Be("1"); result.Exists.Should().BeTrue(); } [Test] public void GetSimple() { var result = this._client.GetFull<ElasticSearchProject>(1); this.DefaultAssertations(result); } [Test] public void GetWithPathInfo() { var result = this._client.GetFull<ElasticSearchProject>("nest_test_data", "elasticsearchprojects", 1); this.DefaultAssertations(result); } [Test] public void GetUsingDescriptorWithTypeAndFields() { var result = this._client.GetFull<ElasticSearchProject>(g => g .Index("nest_test_data") .Type("elasticsearchprojects") .Id(1) .Fields(p=>p.Content, p=>p.Name, p=>p.Id, p=>p.DoubleValue) ); this.DefaultAssertations(result); result.Source.Should().BeNull(); result.Fields.Should().NotBeNull(); result.Fields.FieldValues.Should().NotBeNull().And.HaveCount(4); result.Fields.FieldValue<string>(p => p.Name).Should().Be("pyelasticsearch"); result.Fields.FieldValue<int>(p => p.Id).Should().Be(1); result.Fields.FieldValue<double>(p => p.DoubleValue).Should().BeApproximately(31.931359384177D, 0.00000001D); } [Test] public void GetMissing() { int doesNotExistId = 1234567; var result = this._client.GetFull<ElasticSearchProject>(doesNotExistId); result.Exists.Should().BeFalse(); } } } >>>>>>> using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit.Framework; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Nest; using Newtonsoft.Json.Converters; using Nest.Resolvers.Converters; using Nest.Tests.MockData.Domain; using FluentAssertions; namespace Nest.Tests.Integration.Core.Get { [TestFixture] public class GetFullTests : IntegrationTests { private void DefaultAssertations(IGetResponse<ElasticSearchProject> result) { result.IsValid.Should().BeTrue(); result.Id.Should().Be("1"); result.Index.Should().Be(ElasticsearchConfiguration.DefaultIndex); result.Type.Should().Be("elasticsearchprojects"); result.Version.Should().Be("1"); result.Exists.Should().BeTrue(); } [Test] public void GetSimple() { var result = this._client.GetFull<ElasticSearchProject>(1); this.DefaultAssertations(result); } [Test] public void GetWithPathInfo() { var result = this._client.GetFull<ElasticSearchProject>(ElasticsearchConfiguration.DefaultIndex, "elasticsearchprojects", 1); this.DefaultAssertations(result); } [Test] public void GetUsingDescriptorWithTypeAndFields() { var result = this._client.GetFull<ElasticSearchProject>(g => g .Index(ElasticsearchConfiguration.DefaultIndex) .Type("elasticsearchprojects") .Id(1) .Fields(p=>p.Content, p=>p.Name, p=>p.Id, p=>p.DoubleValue) ); this.DefaultAssertations(result); result.Source.Should().BeNull(); result.Fields.Should().NotBeNull(); result.Fields.FieldValues.Should().NotBeNull().And.HaveCount(4); result.Fields.FieldValue<string>(p => p.Name).Should().Be("pyelasticsearch"); result.Fields.FieldValue<int>(p => p.Id).Should().Be(1); result.Fields.FieldValue<double>(p => p.DoubleValue).Should().BeApproximately(31.931359384177D, 0.00000001D); } [Test] public void GetMissing() { int doesNotExistId = 1234567; var result = this._client.GetFull<ElasticSearchProject>(doesNotExistId); result.Exists.Should().BeFalse(); } } }
<<<<<<< ======= using System.Linq; using System.Linq.Expressions; using System.Text; >>>>>>> using System.Linq.Expressions; <<<<<<< using Newtonsoft.Json; ======= using Nest.Resolvers; using Newtonsoft.Json; >>>>>>> using Newtonsoft.Json;
<<<<<<< await audit.TraceCall(new ClientCall { { SniffOnStartup}, { SniffFailure, 9200}, { SniffFailure, 9201}, { SniffSuccess, 9202}, { PingSuccess , 9200}, { HealthyResponse, 9200} ======= await audit.TraceCall(new CallTrace { { AuditEvent.SniffOnStartup}, { AuditEvent.SniffFailure, 9200}, { AuditEvent.SniffFailure, 9201}, { AuditEvent.SniffSuccess, 9202}, { AuditEvent.PingSuccess , 9200}, { AuditEvent.HealthyResponse, 9200} >>>>>>> await audit.TraceCall(new ClientCall { { AuditEvent.SniffOnStartup}, { AuditEvent.SniffFailure, 9200}, { AuditEvent.SniffFailure, 9201}, { AuditEvent.SniffSuccess, 9202}, { AuditEvent.PingSuccess , 9200}, { AuditEvent.HealthyResponse, 9200} <<<<<<< await audit.TraceCall(new ClientCall { { SniffOnStartup}, { SniffFailure, 9200}, { SniffFailure, 9201}, { SniffSuccess, 9202}, { PingSuccess, 9204}, { HealthyResponse, 9204} ======= await audit.TraceCall(new CallTrace { { AuditEvent.SniffOnStartup}, { AuditEvent.SniffFailure, 9200}, { AuditEvent.SniffFailure, 9201}, { AuditEvent.SniffSuccess, 9202}, { AuditEvent.PingSuccess, 9204}, { AuditEvent.HealthyResponse, 9204} >>>>>>> await audit.TraceCall(new ClientCall { { AuditEvent.SniffOnStartup}, { AuditEvent.SniffFailure, 9200}, { AuditEvent.SniffFailure, 9201}, { AuditEvent.SniffSuccess, 9202}, { AuditEvent.PingSuccess, 9204}, { AuditEvent.HealthyResponse, 9204} <<<<<<< await audit.TraceCall(new ClientCall { { SniffOnStartup}, { SniffFailure, 9200}, { SniffFailure, 9201}, { SniffFailure, 9202}, { SniffFailure, 9203}, { SniffFailure, 9204}, { SniffFailure, 9205}, { SniffFailure, 9206}, { SniffFailure, 9207}, { SniffFailure, 9208}, { SniffSuccess, 9209}, { PingSuccess, 9200}, { HealthyResponse, 9200} ======= await audit.TraceCall(new CallTrace { { AuditEvent.SniffOnStartup}, { AuditEvent.SniffFailure, 9200}, { AuditEvent.SniffFailure, 9201}, { AuditEvent.SniffFailure, 9202}, { AuditEvent.SniffFailure, 9203}, { AuditEvent.SniffFailure, 9204}, { AuditEvent.SniffFailure, 9205}, { AuditEvent.SniffFailure, 9206}, { AuditEvent.SniffFailure, 9207}, { AuditEvent.SniffFailure, 9208}, { AuditEvent.SniffSuccess, 9209}, { AuditEvent.PingSuccess, 9200}, { AuditEvent.HealthyResponse, 9200} >>>>>>> await audit.TraceCall(new ClientCall { { AuditEvent.SniffOnStartup}, { AuditEvent.SniffFailure, 9200}, { AuditEvent.SniffFailure, 9201}, { AuditEvent.SniffFailure, 9202}, { AuditEvent.SniffFailure, 9203}, { AuditEvent.SniffFailure, 9204}, { AuditEvent.SniffFailure, 9205}, { AuditEvent.SniffFailure, 9206}, { AuditEvent.SniffFailure, 9207}, { AuditEvent.SniffFailure, 9208}, { AuditEvent.SniffSuccess, 9209}, { AuditEvent.PingSuccess, 9200}, { AuditEvent.HealthyResponse, 9200} <<<<<<< await audit.TraceCall(new ClientCall { { SniffOnStartup}, { SniffSuccess, 9202}, { PingSuccess, 9200}, { HealthyResponse, 9200} ======= await audit.TraceCall(new CallTrace { { AuditEvent.SniffOnStartup}, { AuditEvent.SniffSuccess, 9202}, { AuditEvent.PingSuccess, 9200}, { AuditEvent.HealthyResponse, 9200} >>>>>>> await audit.TraceCall(new ClientCall { { AuditEvent.SniffOnStartup}, { AuditEvent.SniffSuccess, 9202}, { AuditEvent.PingSuccess, 9200}, { AuditEvent.HealthyResponse, 9200}
<<<<<<< /// <summary> /// Basic access authorization credentials to specify with this request. /// Overrides any credentials that are set at the global IConnectionSettings level. /// </summary> BasicAuthorizationCredentials BasicAuthorizationCredentials { get; set; } ======= /// <summary> /// Whether or not this request should be pipelined. http://en.wikipedia.org/wiki/HTTP_pipelining /// <para>Note: HTTP pipelining must also be enabled in Elasticsearch for this to work properly.</para> /// </summary> bool EnableHttpPipelining { get; set; } >>>>>>> /// <summary> /// Basic access authorization credentials to specify with this request. /// Overrides any credentials that are set at the global IConnectionSettings level. /// </summary> BasicAuthorizationCredentials BasicAuthorizationCredentials { get; set; } /// <summary> /// Whether or not this request should be pipelined. http://en.wikipedia.org/wiki/HTTP_pipelining /// <para>Note: HTTP pipelining must also be enabled in Elasticsearch for this to work properly.</para> /// </summary> bool EnableHttpPipelining { get; set; }
<<<<<<< using Elasticsearch.Net; ======= using System; using System.Collections.Generic; using System.Linq; using System.Text; using Elasticsearch.Net; using Newtonsoft.Json; >>>>>>> using Elasticsearch.Net; using Newtonsoft.Json;
<<<<<<< /// <inheritdoc /> ISearchShardsResponse SearchShards<T>(Func<SearchShardsDescriptor<T>, SearchShardsDescriptor<T>> searchSelector) where T : class; ISearchShardsResponse SearchShards(ISearchShardsRequest request); /// <inheritdoc /> Task<ISearchShardsResponse> SearchShardsAsync<T>(Func<SearchShardsDescriptor<T>, SearchShardsDescriptor<T>> searchSelector) where T : class; Task<ISearchShardsResponse> SearchShardsAsync(ISearchShardsRequest request); /// <inheritdoc /> IGetRepositoryResponse GetRepository(Func<GetRepositoryDescriptor, GetRepositoryDescriptor> selector); /// <inheritdoc /> IGetRepositoryResponse GetRepository(IGetRepositoryRequest request); /// <inheritdoc /> Task<IGetRepositoryResponse> GetRepositoryAsync(Func<GetRepositoryDescriptor, GetRepositoryDescriptor> selector); /// <inheritdoc /> Task<IGetRepositoryResponse> GetRepositoryAsync(IGetRepositoryRequest request); ======= /// <inheritdoc /> ISnapshotStatusResponse SnapshotStatus(Func<SnapshotStatusDescriptor, SnapshotStatusDescriptor> selector = null); /// <inheritdoc /> ISnapshotStatusResponse SnapshotStatus(ISnapshotStatusRequest getSnapshotRequest); /// <inheritdoc /> Task<ISnapshotStatusResponse> SnapshotStatusAsync(Func<SnapshotStatusDescriptor, SnapshotStatusDescriptor> selector = null); /// <inheritdoc /> Task<ISnapshotStatusResponse> SnapshotStatusAsync(ISnapshotStatusRequest getSnapshotRequest); IRecoveryStatusResponse RecoveryStatus(Func<RecoveryStatusDescriptor, RecoveryStatusDescriptor> selector = null); /// <inheritdoc /> IRecoveryStatusResponse RecoveryStatus(IRecoveryStatusRequest statusRequest); /// <inheritdoc /> Task<IRecoveryStatusResponse> RecoveryStatusAsync(Func<RecoveryStatusDescriptor, RecoveryStatusDescriptor> selector = null); /// <inheritdoc /> Task<IRecoveryStatusResponse> RecoveryStatusAsync(IRecoveryStatusRequest statusRequest); >>>>>>> /// <inheritdoc /> ISearchShardsResponse SearchShards<T>(Func<SearchShardsDescriptor<T>, SearchShardsDescriptor<T>> searchSelector) where T : class; ISearchShardsResponse SearchShards(ISearchShardsRequest request); /// <inheritdoc /> Task<ISearchShardsResponse> SearchShardsAsync<T>(Func<SearchShardsDescriptor<T>, SearchShardsDescriptor<T>> searchSelector) where T : class; Task<ISearchShardsResponse> SearchShardsAsync(ISearchShardsRequest request); /// <inheritdoc /> IGetRepositoryResponse GetRepository(Func<GetRepositoryDescriptor, GetRepositoryDescriptor> selector); /// <inheritdoc /> IGetRepositoryResponse GetRepository(IGetRepositoryRequest request); /// <inheritdoc /> Task<IGetRepositoryResponse> GetRepositoryAsync(Func<GetRepositoryDescriptor, GetRepositoryDescriptor> selector); /// <inheritdoc /> Task<IGetRepositoryResponse> GetRepositoryAsync(IGetRepositoryRequest request); ISnapshotStatusResponse SnapshotStatus(Func<SnapshotStatusDescriptor, SnapshotStatusDescriptor> selector = null); /// <inheritdoc /> ISnapshotStatusResponse SnapshotStatus(ISnapshotStatusRequest getSnapshotRequest); /// <inheritdoc /> Task<ISnapshotStatusResponse> SnapshotStatusAsync(Func<SnapshotStatusDescriptor, SnapshotStatusDescriptor> selector = null); /// <inheritdoc /> Task<ISnapshotStatusResponse> SnapshotStatusAsync(ISnapshotStatusRequest getSnapshotRequest); IRecoveryStatusResponse RecoveryStatus(Func<RecoveryStatusDescriptor, RecoveryStatusDescriptor> selector = null); /// <inheritdoc /> IRecoveryStatusResponse RecoveryStatus(IRecoveryStatusRequest statusRequest); /// <inheritdoc /> Task<IRecoveryStatusResponse> RecoveryStatusAsync(Func<RecoveryStatusDescriptor, RecoveryStatusDescriptor> selector = null); /// <inheritdoc /> Task<IRecoveryStatusResponse> RecoveryStatusAsync(IRecoveryStatusRequest statusRequest);
<<<<<<< using System.Reflection; using Elasticsearch.Net; ======= using Elasticsearch.Net.CrossPlatform; using Elasticsearch.Net.Utf8Json; >>>>>>> using Elasticsearch.Net.CrossPlatform; using System.Reflection; using Elasticsearch.Net.Utf8Json;
<<<<<<< using Elasticsearch.Net; ======= using System; using System.Collections.Generic; using System.Linq; using System.Text; using Elasticsearch.Net; using Newtonsoft.Json; >>>>>>> using Elasticsearch.Net; using Newtonsoft.Json;
<<<<<<< .Consistency(ConsistencyOptions.Quorum) .Index<ElasticsearchProject>(i => i.Document(new ElasticsearchProject {Id = 2})) .Create<ElasticsearchProject>(i => i.Document(new ElasticsearchProject { Id = 3 })) .Delete<ElasticsearchProject>(i => i.Document(new ElasticsearchProject { Id = 4 })) ======= .Consistency(Consistency.Quorum) .Index<ElasticsearchProject>(i => i.Object(new ElasticsearchProject {Id = 2})) .Create<ElasticsearchProject>(i => i.Object(new ElasticsearchProject { Id = 3 })) .Delete<ElasticsearchProject>(i => i.Object(new ElasticsearchProject { Id = 4 })) >>>>>>> .Consistency(Consistency.Quorum) .Index<ElasticsearchProject>(i => i.Document(new ElasticsearchProject {Id = 2})) .Create<ElasticsearchProject>(i => i.Document(new ElasticsearchProject { Id = 3 })) .Delete<ElasticsearchProject>(i => i.Document(new ElasticsearchProject { Id = 4 }))
<<<<<<< ======= using System.Linq; using System.Text; >>>>>>> <<<<<<< ======= using Nest.Resolvers.Converters; using Newtonsoft.Json; >>>>>>> using Nest.Resolvers.Converters; using Newtonsoft.Json;
<<<<<<< internal override ApiUrls ApiUrls => GetPrivilegesRequest.Urls; ======= ///<summary>/_security/privilege</summary> public GetPrivilegesDescriptor() : base(){} ///<summary>/_security/privilege/{application}</summary> ///<param name="application">Optional, accepts null</param> public GetPrivilegesDescriptor(Name application) : base(r => r.Optional("application", application)){} >>>>>>> internal override ApiUrls ApiUrls => GetPrivilegesRequest.Urls; ///<summary>/_security/privilege</summary> public GetPrivilegesDescriptor() : base(){} ///<summary>/_security/privilege/{application}</summary> ///<param name="application">Optional, accepts null</param> public GetPrivilegesDescriptor(Name application) : base(r => r.Optional("application", application)){}
<<<<<<< public BulkError Error { get; internal set; } ======= public Error Error { get; internal set; } >>>>>>> public Error Error { get; internal set; } <<<<<<< ======= >>>>>>>
<<<<<<< using System.Linq; using Elasticsearch.Net.ConnectionPool; using Elasticsearch.Net.Serialization; using Elasticsearch.Net.Connection.Security; using System.Diagnostics.CodeAnalysis; ======= >>>>>>> using System.Diagnostics.CodeAnalysis; <<<<<<< [SuppressMessage( "Potential Code Quality Issues", "RECS0021:Warns about calls to virtual member functions occuring in the constructor", ======= [System.Diagnostics.CodeAnalysis.SuppressMessage( "Potential Code Quality Issues", "RECS0021:Warns about calls to virtual member functions occuring in the constructor", >>>>>>> [SuppressMessage( "Potential Code Quality Issues", "RECS0021:Warns about calls to virtual member functions occuring in the constructor",
<<<<<<< var timeout = TimeSpan.FromSeconds(60); #if DOTNETCORE var handle = new Signal(false); #else var handle = new ManualResetEvent(false); #endif ======= var timeout = TimeSpan.FromMinutes(1); var handle = new ManualResetEvent(false); >>>>>>> var timeout = TimeSpan.FromMinutes(1); #if DOTNETCORE var handle = new Signal(false); #else var handle = new ManualResetEvent(false); #endif
<<<<<<< ======= using System.Text; >>>>>>> <<<<<<< ======= using Newtonsoft.Json; >>>>>>> using Newtonsoft.Json;
<<<<<<< using Elasticsearch.Net; ======= using System; using System.Collections.Generic; using System.Linq; using System.Text; using Elasticsearch.Net; using Newtonsoft.Json; >>>>>>> using Elasticsearch.Net; using Newtonsoft.Json;
<<<<<<< private IPercentileRanksAggregaor _percentileRanks; ======= >>>>>>> private IPercentileRanksAggregaor _percentileRanks;
<<<<<<< public TestMode Mode { get; } = TestMode.Unit; public string ElasticsearchVersion { get; } = "2.0.0-rc1"; public virtual bool ForceReseed { get; } public virtual bool DoNotSpawnIfAlreadyRunning { get; } ======= public TestMode Mode { get; private set; } = TestMode.Unit; public string ElasticsearchVersion { get; private set; } = "2.0.0"; public bool ForceReseed { get; private set; } = false; public bool DoNotSpawnIfAlreadyRunning { get; private set; } = true; >>>>>>> public TestMode Mode { get; } = TestMode.Unit; public string ElasticsearchVersion { get; private set; } = "2.0.0"; public virtual bool ForceReseed { get; } = false; public virtual bool DoNotSpawnIfAlreadyRunning { get; } = true; <<<<<<< .ToDictionary(ConfigName, ConfigValue); ======= .Where(l=>!l.Trim().StartsWith("#")) .ToDictionary(l => ConfigName(l), l => ConfigValue(l)); >>>>>>> .Where(l=>!l.Trim().StartsWith("#")) .ToDictionary(ConfigName, ConfigValue);
<<<<<<< //TODO NOT Readonly [Collection(IntegrationContext.ReadOnly)] public abstract class PutMapping : ApiIntegrationTestBase<IIndicesResponse, IPutMappingRequest, PutMappingDescriptor<Project>, PutMappingRequest<Project>> ======= [Collection(IntegrationContext.Indexing)] public class PutMappingApiTests : ApiTestBase<IIndicesResponse, IPutMappingRequest, PutMappingDescriptor<Project>, PutMappingRequest<Project>> >>>>>>> [Collection(IntegrationContext.Indexing)] public class PutMappingApiTests : ApiIntegrationTestBase<IIndicesResponse, IPutMappingRequest, PutMappingDescriptor<Project>, PutMappingRequest<Project>>
<<<<<<< public GeoUnit? Unit { get; set; } public GeoDistanceType? DistanceType { get; set; } public IEnumerable<Range<double>> Ranges { get; set; } ======= internal GeoDistanceAggregation() { } >>>>>>> internal GeoDistanceAggregation() { } <<<<<<< GeoDistanceType? IGeoDistanceAggregator.DistanceType { get; set; } ======= GeoDistance? IGeoDistanceAggregation.DistanceType { get; set; } >>>>>>> GeoDistanceType? IGeoDistanceAggregation.DistanceType { get; set; } <<<<<<< public GeoDistanceAggregatorDescriptor<T> DistanceType(GeoDistanceType geoDistance) => Assign(a => a.DistanceType = geoDistance); ======= public GeoDistanceAggregationDescriptor<T> DistanceType(GeoDistance geoDistance) => Assign(a => a.DistanceType = geoDistance); >>>>>>> public GeoDistanceAggregationDescriptor<T> DistanceType(GeoDistanceType? geoDistance) => Assign(a => a.DistanceType = geoDistance);
<<<<<<< /// <inheritdoc /> IEmptyResponse ClearScroll(Func<ClearScrollDescriptor, ClearScrollDescriptor> clearScrollSelector); /// <inheritdoc /> Task<IEmptyResponse> ClearScrollAsync(Func<ClearScrollDescriptor, ClearScrollDescriptor> clearScrollSelector); ======= /// <summary> /// The suggest feature suggests similar looking terms based on a provided text by using a suggester. /// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-status.html /// </summary> /// <typeparam name="T">The type used to strongly type parts of the suggest operation</typeparam> /// <param name="selector">The suggesters to use this operation (can be multiple)</param> ISuggestResponse Suggest<T>(Func<SuggestDescriptor<T>, SuggestDescriptor<T>> selector) where T : class; /// <summary> /// The suggest feature suggests similar looking terms based on a provided text by using a suggester. /// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-status.html /// </summary> /// <typeparam name="T">The type used to strongly type parts of the suggest operation</typeparam> /// <param name="selector">The suggesters to use this operation (can be multiple)</param> Task<ISuggestResponse> SuggestAsync<T>(Func<SuggestDescriptor<T>, SuggestDescriptor<T>> selector) where T : class; >>>>>>> /// <summary> /// The suggest feature suggests similar looking terms based on a provided text by using a suggester. /// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-status.html /// </summary> /// <typeparam name="T">The type used to strongly type parts of the suggest operation</typeparam> /// <param name="selector">The suggesters to use this operation (can be multiple)</param> ISuggestResponse Suggest<T>(Func<SuggestDescriptor<T>, SuggestDescriptor<T>> selector) where T : class; /// <summary> /// The suggest feature suggests similar looking terms based on a provided text by using a suggester. /// <para> </para>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-status.html /// </summary> /// <typeparam name="T">The type used to strongly type parts of the suggest operation</typeparam> /// <param name="selector">The suggesters to use this operation (can be multiple)</param> Task<ISuggestResponse> SuggestAsync<T>(Func<SuggestDescriptor<T>, SuggestDescriptor<T>> selector) where T : class; /// <inheritdoc /> IEmptyResponse ClearScroll(Func<ClearScrollDescriptor, ClearScrollDescriptor> clearScrollSelector); /// <inheritdoc /> Task<IEmptyResponse> ClearScrollAsync(Func<ClearScrollDescriptor, ClearScrollDescriptor> clearScrollSelector);
<<<<<<< Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Sum(default (IQueryable<double ? >))), source.Expression); return await ((IQueryProvider)source.Provider).ExecuteExAsync<decimal ? >(expression, cancellationToken).ConfigureAwait(false); ======= Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Sum(default (IQueryable<decimal ? >))), source.Expression); return await ((IQueryProvider)source.Provider).ExecuteExAsync<decimal ? >(expression, cancellationToken).ConfigureAwait(false); } public static Task<int> SumAsync<T>(this IQueryable<T> source, Expression<Func<T, int>> selector) { return SumAsync(source, selector, CancellationToken.None); } public static async Task<int> SumAsync<T>(this IQueryable<T> source, Expression<Func<T, int>> selector, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Sum(default (IQueryable<T>), c => default (int))), source.Expression, Expression.Quote(selector)); return await ((IQueryProvider)source.Provider).ExecuteExAsync<int>(expression, cancellationToken).ConfigureAwait(false); } public static Task<int ? > SumAsync<T>(this IQueryable<T> source, Expression<Func<T, int ? >> selector) { return SumAsync(source, selector, CancellationToken.None); } public static async Task<int ? > SumAsync<T>(this IQueryable<T> source, Expression<Func<T, int ? >> selector, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Sum(default (IQueryable<T>), c => default (int ? ))), source.Expression, Expression.Quote(selector)); return await ((IQueryProvider)source.Provider).ExecuteExAsync<int ? >(expression, cancellationToken).ConfigureAwait(false); } public static Task<long> SumAsync<T>(this IQueryable<T> source, Expression<Func<T, long>> selector) { return SumAsync(source, selector, CancellationToken.None); } public static async Task<long> SumAsync<T>(this IQueryable<T> source, Expression<Func<T, long>> selector, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Sum(default (IQueryable<T>), c => default (long))), source.Expression, Expression.Quote(selector)); return await ((IQueryProvider)source.Provider).ExecuteExAsync<long>(expression, cancellationToken).ConfigureAwait(false); } public static Task<long ? > SumAsync<T>(this IQueryable<T> source, Expression<Func<T, long ? >> selector) { return SumAsync(source, selector, CancellationToken.None); } public static async Task<long ? > SumAsync<T>(this IQueryable<T> source, Expression<Func<T, long ? >> selector, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Sum(default (IQueryable<T>), c => default (long ? ))), source.Expression, Expression.Quote(selector)); return await ((IQueryProvider)source.Provider).ExecuteExAsync<long ? >(expression, cancellationToken).ConfigureAwait(false); } public static Task<float> SumAsync<T>(this IQueryable<T> source, Expression<Func<T, float>> selector) { return SumAsync(source, selector, CancellationToken.None); } public static async Task<float> SumAsync<T>(this IQueryable<T> source, Expression<Func<T, float>> selector, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Sum(default (IQueryable<T>), c => default (float))), source.Expression, Expression.Quote(selector)); return await ((IQueryProvider)source.Provider).ExecuteExAsync<float>(expression, cancellationToken).ConfigureAwait(false); } public static Task<float ? > SumAsync<T>(this IQueryable<T> source, Expression<Func<T, float ? >> selector) { return SumAsync(source, selector, CancellationToken.None); } public static async Task<float ? > SumAsync<T>(this IQueryable<T> source, Expression<Func<T, float ? >> selector, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Sum(default (IQueryable<T>), c => default (float ? ))), source.Expression, Expression.Quote(selector)); return await ((IQueryProvider)source.Provider).ExecuteExAsync<float ? >(expression, cancellationToken).ConfigureAwait(false); } public static Task<double> SumAsync<T>(this IQueryable<T> source, Expression<Func<T, double>> selector) { return SumAsync(source, selector, CancellationToken.None); } public static async Task<double> SumAsync<T>(this IQueryable<T> source, Expression<Func<T, double>> selector, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Sum(default (IQueryable<T>), c => default (double))), source.Expression, Expression.Quote(selector)); return await ((IQueryProvider)source.Provider).ExecuteExAsync<double>(expression, cancellationToken).ConfigureAwait(false); } public static Task<double ? > SumAsync<T>(this IQueryable<double ? > source, Expression<Func<T, double ? >> selector) { return SumAsync(source, selector, CancellationToken.None); } public static async Task<double ? > SumAsync<T>(this IQueryable<double ? > source, Expression<Func<T, double ? >> selector, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Sum(default (IQueryable<T>), c => default (double ? ))), source.Expression, Expression.Quote(selector)); return await ((IQueryProvider)source.Provider).ExecuteExAsync<double ? >(expression, cancellationToken).ConfigureAwait(false); } public static Task<decimal> SumAsync<T>(this IQueryable<T> source, Expression<Func<T, decimal>> selector) { return SumAsync(source, selector, CancellationToken.None); } public static async Task<decimal> SumAsync<T>(this IQueryable<T> source, Expression<Func<T, decimal>> selector, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Sum(default (IQueryable<T>), c => default (decimal))), source.Expression, Expression.Quote(selector)); return await ((IQueryProvider)source.Provider).ExecuteExAsync<decimal>(expression, cancellationToken).ConfigureAwait(false); } public static Task<decimal ? > SumAsync<T>(this IQueryable<decimal ? > source, Expression<Func<T, decimal ? >> selector) { return SumAsync(source, selector, CancellationToken.None); } public static async Task<decimal ? > SumAsync<T>(this IQueryable<decimal ? > source, Expression<Func<T, decimal ? >> selector, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Sum(default (IQueryable<T>), c => default (decimal ? ))), source.Expression, Expression.Quote(selector)); return await ((IQueryProvider)source.Provider).ExecuteExAsync<decimal ? >(expression, cancellationToken).ConfigureAwait(false); } public static Task<int> AverageAsync(this IQueryable<int> source) { return AverageAsync(source, CancellationToken.None); } public static async Task<int> AverageAsync(this IQueryable<int> source, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Average(default (IQueryable<int>))), source.Expression); return await ((IQueryProvider)source.Provider).ExecuteExAsync<int>(expression, cancellationToken).ConfigureAwait(false); } public static Task<int ? > AverageAsync(this IQueryable<int ? > source) { return AverageAsync(source, CancellationToken.None); } public static async Task<int ? > AverageAsync(this IQueryable<int ? > source, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Average(default (IQueryable<int ? >))), source.Expression); return await ((IQueryProvider)source.Provider).ExecuteExAsync<int ? >(expression, cancellationToken).ConfigureAwait(false); } public static Task<long> AverageAsync(this IQueryable<long> source) { return AverageAsync(source, CancellationToken.None); } public static async Task<long> AverageAsync(this IQueryable<long> source, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Average(default (IQueryable<long>))), source.Expression); return await ((IQueryProvider)source.Provider).ExecuteExAsync<long>(expression, cancellationToken).ConfigureAwait(false); } public static Task<long ? > AverageAsync(this IQueryable<long ? > source) { return AverageAsync(source, CancellationToken.None); } public static async Task<long ? > AverageAsync(this IQueryable<long ? > source, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Average(default (IQueryable<long ? >))), source.Expression); return await ((IQueryProvider)source.Provider).ExecuteExAsync<long ? >(expression, cancellationToken).ConfigureAwait(false); } public static Task<float> AverageAsync(this IQueryable<float> source) { return AverageAsync(source, CancellationToken.None); } public static async Task<float> AverageAsync(this IQueryable<float> source, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Average(default (IQueryable<float>))), source.Expression); return await ((IQueryProvider)source.Provider).ExecuteExAsync<float>(expression, cancellationToken).ConfigureAwait(false); } public static Task<float ? > AverageAsync(this IQueryable<float ? > source) { return AverageAsync(source, CancellationToken.None); } public static async Task<float ? > AverageAsync(this IQueryable<float ? > source, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Average(default (IQueryable<float ? >))), source.Expression); return await ((IQueryProvider)source.Provider).ExecuteExAsync<float ? >(expression, cancellationToken).ConfigureAwait(false); } public static Task<double> AverageAsync(this IQueryable<double> source) { return AverageAsync(source, CancellationToken.None); } public static async Task<double> AverageAsync(this IQueryable<double> source, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Average(default (IQueryable<double>))), source.Expression); return await ((IQueryProvider)source.Provider).ExecuteExAsync<double>(expression, cancellationToken).ConfigureAwait(false); } public static Task<double ? > AverageAsync(this IQueryable<double ? > source) { return AverageAsync(source, CancellationToken.None); } public static async Task<double ? > AverageAsync(this IQueryable<double ? > source, CancellationToken cancellationToken) { Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Average(default (IQueryable<double ? >))), source.Expression); return await ((IQueryProvider)source.Provider).ExecuteExAsync<double ? >(expression, cancellationToken).ConfigureAwait(false); >>>>>>> Expression expression = Expression.Call(TypeUtils.GetMethod(() => Queryable.Sum(default (IQueryable<decimal ? >))), source.Expression); return await ((IQueryProvider)source.Provider).ExecuteExAsync<decimal ? >(expression, cancellationToken).ConfigureAwait(false);
<<<<<<< public class JobsConfiguration { private readonly string _authToken; public JobsConfiguration(string authToken) { _authToken = authToken; } public bool IsValidAuthToken(string authToken) { return string.IsNullOrEmpty(_authToken) == false && _authToken == authToken; } } ======= public class CsvExportConfiguration { public CsvExportConfiguration(string delimiter) { Delimiter = delimiter; } public string Delimiter { get; } } >>>>>>> public class CsvExportConfiguration { public CsvExportConfiguration(string delimiter) { Delimiter = delimiter; } public string Delimiter { get; } } public class JobsConfiguration { private readonly string _authToken; public JobsConfiguration(string authToken) { _authToken = authToken; } public bool IsValidAuthToken(string authToken) { return string.IsNullOrEmpty(_authToken) == false && _authToken == authToken; } }
<<<<<<< if (instance.Netcom != null) { Instance.Netcom.ClientDisconnected -= new EventHandler<DisconnectedEventArgs>(Netcom_ClientDisconnected); } ======= //Client.Avatars.AvatarAnimation -= new EventHandler<AvatarAnimationEventArgs>(AvatarAnimationChanged); Instance.Netcom.ClientDisconnected -= new EventHandler<DisconnectedEventArgs>(Netcom_ClientDisconnected); >>>>>>> Instance.Netcom.ClientDisconnected -= new EventHandler<DisconnectedEventArgs>(Netcom_ClientDisconnected); //Client.Avatars.AvatarAnimation -= new EventHandler<AvatarAnimationEventArgs>(AvatarAnimationChanged); if (instance.Netcom != null) { Instance.Netcom.ClientDisconnected -= new EventHandler<DisconnectedEventArgs>(Netcom_ClientDisconnected); }
<<<<<<< Imgui.SameLine(350); if (!CoopClient.Instance.ClientPlaying) ======= if (!CoopClient.Instance.Connected) >>>>>>> if (!CoopClient.Instance.ClientPlaying)
<<<<<<< if (Campaign.Current == null) { throw new Exception("Unable to initialize game entities: Unexpected state. No game loaded?"); } room.AddNewEntity<WorldEntityServer>(); ======= WorldEntityServer = room.AddNewEntity<WorldEntityServer>(); >>>>>>> if (Campaign.Current == null) { throw new Exception("Unable to initialize game entities: Unexpected state. No game loaded?"); } WorldEntityServer = room.AddNewEntity<WorldEntityServer>();
<<<<<<< [JSReplacement("Array.prototype.sort.call($array)")] public static void Sort (AnyType[] array) { throw new InvalidOperationException(); } [JSReplacement("Array.prototype.sort.call($array)")] public static void Sort<T> (T[] array) { throw new InvalidOperationException(); } ======= [JSReplacement("Array.prototype.slice.call($this)")] public object Clone () { throw new InvalidOperationException(); } >>>>>>> [JSReplacement("Array.prototype.slice.call($this)")] public object Clone () { throw new InvalidOperationException(); } [JSReplacement("Array.prototype.sort.call($array)")] public static void Sort (AnyType[] array) { throw new InvalidOperationException(); } [JSReplacement("Array.prototype.sort.call($array)")] public static void Sort<T> (T[] array) { throw new InvalidOperationException(); }
<<<<<<< ======= using System; using System.Diagnostics; using System.IO; using Helpers; >>>>>>> using Helpers; <<<<<<< services.Configure<AppSettings> (Configuration.GetSection ("AppSettingsSectionName")); services.AddApplicationInsightsTelemetry (Configuration); services.AddMvc (); ======= services.Configure<AppSettings>(Configuration.GetSection(nameof(AppSettings))); services.AddApplicationInsightsTelemetry(Configuration); services.AddMvc(); services.AddSingleton<IPasswordChangeProvider, PasswordChangeProvider>(); >>>>>>> services.Configure<AppSettings> (Configuration.GetSection ("AppSettingsSectionName")); services.AddApplicationInsightsTelemetry (Configuration); services.AddMvc (); services.AddSingleton<IPasswordChangeProvider, PasswordChangeProvider>();
<<<<<<< this.tableLayoutPanel1.Size = new System.Drawing.Size(731, 478); ======= this.tableLayoutPanel1.Size = new System.Drawing.Size(581, 479); >>>>>>> this.tableLayoutPanel1.Size = new System.Drawing.Size(731, 478); <<<<<<< this.tableLayoutPanel10.Size = new System.Drawing.Size(246, 207); ======= this.tableLayoutPanel10.Size = new System.Drawing.Size(186, 218); >>>>>>> this.tableLayoutPanel10.Size = new System.Drawing.Size(246, 207); <<<<<<< this.tableLayoutPanel3.Location = new System.Drawing.Point(33, 162); ======= this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 173); >>>>>>> this.tableLayoutPanel3.Location = new System.Drawing.Point(33, 162); <<<<<<< this.tableLayoutPanel5.Size = new System.Drawing.Size(246, 159); ======= this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel5.Size = new System.Drawing.Size(186, 170); >>>>>>> this.tableLayoutPanel5.Size = new System.Drawing.Size(246, 170); this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); <<<<<<< this.ReconnectLabel.Location = new System.Drawing.Point(46, 71); ======= this.ReconnectLabel.Location = new System.Drawing.Point(6, 93); >>>>>>> this.ReconnectLabel.Location = new System.Drawing.Point(46, 93); <<<<<<< this.NumReconnect.Location = new System.Drawing.Point(131, 66); ======= this.NumReconnect.Location = new System.Drawing.Point(71, 89); >>>>>>> this.NumReconnect.Location = new System.Drawing.Point(131, 89); <<<<<<< this.TTLLabel.Location = new System.Drawing.Point(94, 133); ======= this.TTLLabel.Location = new System.Drawing.Point(42, 147); >>>>>>> this.TTLLabel.Location = new System.Drawing.Point(94, 147); <<<<<<< this.NumTTL.Location = new System.Drawing.Point(131, 128); ======= this.NumTTL.Location = new System.Drawing.Point(71, 143); >>>>>>> this.NumTTL.Location = new System.Drawing.Point(131, 143); <<<<<<< this.labelTimeout.Location = new System.Drawing.Point(6, 102); ======= this.labelTimeout.Location = new System.Drawing.Point(12, 120); >>>>>>> this.labelTimeout.Location = new System.Drawing.Point(12, 120); <<<<<<< this.NumTimeout.Location = new System.Drawing.Point(131, 97); ======= this.NumTimeout.Location = new System.Drawing.Point(71, 116); >>>>>>> this.NumTimeout.Location = new System.Drawing.Point(131, 116); <<<<<<< private System.Windows.Forms.CheckBox checkSwitchAutoCloseAll; ======= private System.Windows.Forms.Label label3; private System.Windows.Forms.TextBox LocalDNSText; >>>>>>> private System.Windows.Forms.CheckBox checkSwitchAutoCloseAll; private System.Windows.Forms.Label label3; private System.Windows.Forms.TextBox LocalDNSText;
<<<<<<< HotFix = GameFrameworkMode.GetModule<HotFixManager>(); ======= Localization = GameFrameworkMode.GetModule<LocalizationManager>(); >>>>>>> HotFix = GameFrameworkMode.GetModule<HotFixManager>(); Localization = GameFrameworkMode.GetModule<LocalizationManager>();
<<<<<<< UnitTest.RegisterAllMethods<ArrayTest>(); ======= UnitTest.RegisterAllMethods<ZeroArgumentTest>(); >>>>>>> UnitTest.RegisterAllMethods<ZeroArgumentTest>(); UnitTest.RegisterAllMethods<ArrayTest>();
<<<<<<< public override MachineType MachineType { get { return MachineType.IA_64; } } ======= /// <value> /// The type of the elf machine. /// </value> public override MachineType MachineType { get { return MachineType.Intel386; } } >>>>>>> public override MachineType MachineType { get { return MachineType.Intel386; } }
<<<<<<< using System; using System.Linq; using System.Text.RegularExpressions; using System.Xml.Linq; namespace SimpleBrowser { internal class HtmlElement { private readonly XElement _element; public HtmlElement(XElement element) { _element = element; } private XAttribute GetAttribute(string name) { return GetAttribute(Element, name); } public XElement XElement { get { return _element; } } private XAttribute GetAttribute(XElement x, string name) { return x.Attributes().Where(h => h.Name.LocalName.ToLower() == name.ToLower()).FirstOrDefault(); } internal string GetAttributeValue(string name) { return GetAttributeValue(Element, name); } private string GetAttributeValue(XElement x, string name) { var attr = GetAttribute(x, name); return attr == null ? null : attr.Value; } public string TagName { get { return Element.Name.LocalName; } } public bool Disabled { get { return GetAttribute("disabled") != null; } } public bool Checked { get { return GetAttribute("checked") != null; } set { if(Checked != value) Click(); } } public string InputType { get { return GetAttributeValue("type"); } } public event Action<HtmlElement> Clicked; public event Action<HtmlElement> FormSubmitted; public event Action<HtmlElement, string> AspNetPostBackLinkClicked; public void Click() { if(Clicked != null) Clicked(this); } public void SubmitForm() { if(FormSubmitted != null) FormSubmitted(this); } public void DoAspNetLinkPostBack() { if(TagName == "a") { var match = Regex.Match(GetAttributeValue("href"), @"javascript\:__doPostBack\('([^\']*)\'"); if(match.Success) { var name = match.Groups[1].Value; if(AspNetPostBackLinkClicked != null) AspNetPostBackLinkClicked(this, name); return; } } throw new InvalidOperationException("This method must only be called on <a> elements having a __doPostBack javascript call in the href attribute"); } public string Value { get { var name = Element.Name.LocalName.ToLower(); switch(name) { case "input": var attr = GetAttribute("value"); if(attr == null) return null; return attr.Value; case "select": var options = Element.Descendants("option"); var optionEl = options.Where(d => d.Attribute("selected") != null).FirstOrDefault() ?? options.FirstOrDefault(); if(optionEl == null) return null; var valueAttr = optionEl.Attribute("value"); return valueAttr == null ? optionEl.Value : valueAttr.Value; default: return Element.Value; } } set { switch(Element.Name.LocalName.ToLower()) { case "textarea": Element.RemoveNodes(); Element.AddFirst(value); break; case "input": Element.SetAttributeValue("value", value); break; case "select": foreach(XElement x in Element.Descendants("option")) { var attr = GetAttribute(x, "value"); string val = attr == null ? x.Value : attr.Value; x.SetAttributeValue("selected", val == value ? "selected" : null); } break; default: throw new InvalidOperationException("Can only set the Value attribute for select, textarea and input elements"); } } } internal XElement Element { get { return _element; } } } } ======= using System; using System.Linq; using System.Xml.Linq; namespace SimpleBrowser { internal class HtmlElement { private readonly XElement _element; public HtmlElement(XElement element) { _element = element; } private XAttribute GetAttribute(string name) { return GetAttribute(Element, name); } public XElement XElement { get { return _element; } } private XAttribute GetAttribute(XElement x, string name) { return x.Attributes().Where(h => h.Name.LocalName.ToLower() == name.ToLower()).FirstOrDefault(); } internal string GetAttributeValue(string name) { return GetAttributeValue(Element, name); } private string GetAttributeValue(XElement x, string name) { var attr = GetAttribute(x, name); return attr == null ? null : attr.Value; } public string TagName { get { return Element.Name.LocalName; } } public bool Disabled { get { return GetAttribute("disabled") != null; } } public bool Checked { get { return GetAttribute("checked") != null; } set { if(Checked != value) Click(); } } public string InputType { get { return GetAttributeValue("type"); } } public event Func<HtmlElement, ClickResult> Clicked; public event Func<HtmlElement, bool> FormSubmitted; public ClickResult Click() { if(Clicked != null) return Clicked(this); return ClickResult.SucceededNoOp; } public bool SubmitForm() { if(FormSubmitted != null) return FormSubmitted(this); return false; } public string Value { get { var name = Element.Name.LocalName.ToLower(); switch(name) { case "input": var attr = GetAttribute("value"); if(attr == null) return null; return attr.Value; case "select": var options = Element.Descendants("option"); var optionEl = options.Where(d => d.Attribute("selected") != null).FirstOrDefault() ?? options.FirstOrDefault(); if(optionEl == null) return null; var valueAttr = optionEl.Attribute("value"); return valueAttr == null ? optionEl.Value : valueAttr.Value; default: return Element.Value; } } set { switch(Element.Name.LocalName.ToLower()) { case "textarea": Element.RemoveNodes(); Element.AddFirst(value); break; case "input": Element.SetAttributeValue("value", value); break; case "select": foreach(XElement x in Element.Descendants("option")) { var attr = GetAttribute(x, "value"); string val = attr == null ? x.Value : attr.Value; x.SetAttributeValue("selected", val == value ? "selected" : null); } break; default: throw new InvalidOperationException("Can only set the Value attribute for select, textarea and input elements"); } } } internal XElement Element { get { return _element; } } } } >>>>>>> using System; using System.Linq; using System.Text.RegularExpressions; using System.Xml.Linq; namespace SimpleBrowser { internal class HtmlElement { private readonly XElement _element; public HtmlElement(XElement element) { _element = element; } private XAttribute GetAttribute(string name) { return GetAttribute(Element, name); } public XElement XElement { get { return _element; } } private XAttribute GetAttribute(XElement x, string name) { return x.Attributes().Where(h => h.Name.LocalName.ToLower() == name.ToLower()).FirstOrDefault(); } internal string GetAttributeValue(string name) { return GetAttributeValue(Element, name); } private string GetAttributeValue(XElement x, string name) { var attr = GetAttribute(x, name); return attr == null ? null : attr.Value; } public string TagName { get { return Element.Name.LocalName; } } public bool Disabled { get { return GetAttribute("disabled") != null; } } public bool Checked { get { return GetAttribute("checked") != null; } set { if(Checked != value) Click(); } } public string InputType { get { return GetAttributeValue("type"); } } public event Func<HtmlElement, ClickResult> Clicked; public event Func<HtmlElement, bool> FormSubmitted; public event Action<HtmlElement, string> AspNetPostBackLinkClicked; public ClickResult Click() { if(Clicked != null) return Clicked(this); return ClickResult.SucceededNoOp; } public bool SubmitForm() { if(FormSubmitted != null) return FormSubmitted(this); return false; } public void DoAspNetLinkPostBack() { if(TagName == "a") { var match = Regex.Match(GetAttributeValue("href"), @"javascript\:__doPostBack\('([^\']*)\'"); if(match.Success) { var name = match.Groups[1].Value; if(AspNetPostBackLinkClicked != null) AspNetPostBackLinkClicked(this, name); return; } } throw new InvalidOperationException("This method must only be called on <a> elements having a __doPostBack javascript call in the href attribute"); } public string Value { get { var name = Element.Name.LocalName.ToLower(); switch(name) { case "input": var attr = GetAttribute("value"); if(attr == null) return null; return attr.Value; case "select": var options = Element.Descendants("option"); var optionEl = options.Where(d => d.Attribute("selected") != null).FirstOrDefault() ?? options.FirstOrDefault(); if(optionEl == null) return null; var valueAttr = optionEl.Attribute("value"); return valueAttr == null ? optionEl.Value : valueAttr.Value; default: return Element.Value; } } set { switch(Element.Name.LocalName.ToLower()) { case "textarea": Element.RemoveNodes(); Element.AddFirst(value); break; case "input": Element.SetAttributeValue("value", value); break; case "select": foreach(XElement x in Element.Descendants("option")) { var attr = GetAttribute(x, "value"); string val = attr == null ? x.Value : attr.Value; x.SetAttributeValue("selected", val == value ? "selected" : null); } break; default: throw new InvalidOperationException("Can only set the Value attribute for select, textarea and input elements"); } } } internal XElement Element { get { return _element; } } } }
<<<<<<< else if (property is IntegerShaderProperty) { AddSlot(new Vector1MaterialSlot(OutputSlotId, "Out", "Out", SlotType.Output, 0)); RemoveSlotsNameNotMatching(new[] { OutputSlotId }); } else if (property is SliderShaderProperty) { AddSlot(new Vector1MaterialSlot(OutputSlotId, "Out", "Out", SlotType.Output, 0)); RemoveSlotsNameNotMatching(new[] { OutputSlotId }); } ======= else if (property is BooleanShaderProperty) { AddSlot(new BooleanMaterialSlot(OutputSlotId, "Out", "Out", SlotType.Output, false)); RemoveSlotsNameNotMatching(new[] { OutputSlotId }); } >>>>>>> else if (property is IntegerShaderProperty) { AddSlot(new Vector1MaterialSlot(OutputSlotId, "Out", "Out", SlotType.Output, 0)); RemoveSlotsNameNotMatching(new[] { OutputSlotId }); } else if (property is SliderShaderProperty) { AddSlot(new Vector1MaterialSlot(OutputSlotId, "Out", "Out", SlotType.Output, 0)); RemoveSlotsNameNotMatching(new[] { OutputSlotId }); } else if (property is BooleanShaderProperty) { AddSlot(new BooleanMaterialSlot(OutputSlotId, "Out", "Out", SlotType.Output, false)); RemoveSlotsNameNotMatching(new[] { OutputSlotId }); } <<<<<<< else if (property is IntegerShaderProperty) { var result = string.Format("{0} {1} = {2};" , precision , GetVariableNameForSlot(OutputSlotId) , property.referenceName); visitor.AddShaderChunk(result, true); } else if (property is SliderShaderProperty) { var result = string.Format("{0} {1} = {2};" , precision , GetVariableNameForSlot(OutputSlotId) , property.referenceName); visitor.AddShaderChunk(result, true); } ======= else if (property is BooleanShaderProperty) { var result = string.Format("{0} {1} = {2};" , precision , GetVariableNameForSlot(OutputSlotId) , property.referenceName); visitor.AddShaderChunk(result, true); } >>>>>>> else if (property is IntegerShaderProperty) { var result = string.Format("{0} {1} = {2};" , precision , GetVariableNameForSlot(OutputSlotId) , property.referenceName); visitor.AddShaderChunk(result, true); } else if (property is SliderShaderProperty) { var result = string.Format("{0} {1} = {2};" , precision , GetVariableNameForSlot(OutputSlotId) , property.referenceName); visitor.AddShaderChunk(result, true); } else if (property is BooleanShaderProperty) { var result = string.Format("{0} {1} = {2};" , precision , GetVariableNameForSlot(OutputSlotId) , property.referenceName); visitor.AddShaderChunk(result, true); }
<<<<<<< WaitForSqlAvailabilityAsync(loggerFactory, app).Wait(); ======= OrderingContextSeed.SeedAsync(app).Wait(); ConfigureEventBus(app); >>>>>>> WaitForSqlAvailabilityAsync(loggerFactory, app).Wait(); ConfigureEventBus(app);
<<<<<<< using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Threading.Tasks; ======= using Identity.API.Certificate; using Autofac.Extensions.DependencyInjection; using Autofac; >>>>>>> using Identity.API.Certificate; using Autofac.Extensions.DependencyInjection; using Autofac; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Threading.Tasks; <<<<<<< public void ConfigureServices(IServiceCollection services) { ======= public IServiceProvider ConfigureServices(IServiceCollection services) { >>>>>>> public IServiceProvider ConfigureServices(IServiceCollection services) { <<<<<<< .AddConfigurationStore(builder => builder.UseSqlServer(connectionString, options => options.MigrationsAssembly(migrationsAssembly))) .AddOperationalStore(builder => builder.UseSqlServer(connectionString, options => options.MigrationsAssembly(migrationsAssembly))) .Services.AddTransient<IProfileService, ProfileService>(); ======= .Services.AddTransient<IProfileService, ProfileService>(); var container = new ContainerBuilder(); container.Populate(services); return new AutofacServiceProvider(container.Build()); >>>>>>> .AddConfigurationStore(builder => builder.UseSqlServer(connectionString, options => options.MigrationsAssembly(migrationsAssembly))) .AddOperationalStore(builder => builder.UseSqlServer(connectionString, options => options.MigrationsAssembly(migrationsAssembly))) .Services.AddTransient<IProfileService, ProfileService>(); var container = new ContainerBuilder(); container.Populate(services); return new AutofacServiceProvider(container.Build());
<<<<<<< services.AddScoped<IOrderingService, OrderingService>(); services.AddGrpcClient<OrderingGrpc.OrderingGrpcClient>((services, options) => { var orderingApi = services.GetRequiredService<IOptions<UrlsConfig>>().Value.GrpcOrdering; options.Address = new Uri(orderingApi); }).AddInterceptor<GrpcExceptionInterceptor>(); ======= services.AddScoped<ICatalogService, CatalogService>(); services.AddGrpcClient<Catalog.CatalogClient>((services, options) => { var catalogApi = services.GetRequiredService<IOptions<UrlsConfig>>().Value.GrpcCatalog; options.Address = new Uri(catalogApi); }).AddInterceptor<GrpcExceptionInterceptor>(); >>>>>>> services.AddScoped<ICatalogService, CatalogService>(); services.AddGrpcClient<Catalog.CatalogClient>((services, options) => { var catalogApi = services.GetRequiredService<IOptions<UrlsConfig>>().Value.GrpcCatalog; options.Address = new Uri(catalogApi); }).AddInterceptor<GrpcExceptionInterceptor>(); services.AddScoped<IOrderingService, OrderingService>(); services.AddGrpcClient<OrderingGrpc.OrderingGrpcClient>((services, options) => { var orderingApi = services.GetRequiredService<IOptions<UrlsConfig>>().Value.GrpcOrdering; options.Address = new Uri(orderingApi); }).AddInterceptor<GrpcExceptionInterceptor>();
<<<<<<< WaitForSqlAvailabilityAsync(loggerFactory, app).Wait(); ======= OrderingContextSeed.SeedAsync(app).Wait(); ConfigureEventBus(app); >>>>>>> WaitForSqlAvailabilityAsync(loggerFactory, app).Wait(); ConfigureEventBus(app);
<<<<<<< using eShopOnContainers.Core.Services.Dependency; using eShopOnContainers.Core.Services.Settings; using eShopOnContainers.Core.Services.FixUri; using Xamarin.Forms; ======= using TinyIoC; >>>>>>> using eShopOnContainers.Core.Services.Dependency; using eShopOnContainers.Core.Services.Settings; using eShopOnContainers.Core.Services.FixUri; using Xamarin.Forms; using TinyIoC; <<<<<<< private static IContainer _container; public static readonly BindableProperty AutoWireViewModelProperty = BindableProperty.CreateAttached("AutoWireViewModel", typeof(bool), typeof(ViewModelLocator), default(bool), propertyChanged: OnAutoWireViewModelChanged); public static bool GetAutoWireViewModel(BindableObject bindable) { return (bool)bindable.GetValue(ViewModelLocator.AutoWireViewModelProperty); } public static void SetAutoWireViewModel(BindableObject bindable, bool value) { bindable.SetValue(ViewModelLocator.AutoWireViewModelProperty, value); } public static bool UseMockService { get; set; } public static void RegisterDependencies(bool useMockServices) { var builder = new ContainerBuilder(); // View models builder.RegisterType<BasketViewModel>(); builder.RegisterType<CatalogViewModel>(); builder.RegisterType<CheckoutViewModel>(); builder.RegisterType<LoginViewModel>(); builder.RegisterType<MainViewModel>(); builder.RegisterType<OrderDetailViewModel>(); builder.RegisterType<ProfileViewModel>(); builder.RegisterType<SettingsViewModel>(); builder.RegisterType<CampaignViewModel>(); builder.RegisterType<CampaignDetailsViewModel>(); ======= private static TinyIoCContainer _container; public static readonly BindableProperty AutoWireViewModelProperty = BindableProperty.CreateAttached("AutoWireViewModel", typeof(bool), typeof(ViewModelLocator), default(bool), propertyChanged: OnAutoWireViewModelChanged); public static bool GetAutoWireViewModel(BindableObject bindable) { return (bool)bindable.GetValue(ViewModelLocator.AutoWireViewModelProperty); } public static void SetAutoWireViewModel(BindableObject bindable, bool value) { bindable.SetValue(ViewModelLocator.AutoWireViewModelProperty, value); } public static bool UseMockService { get; set; } static ViewModelLocator() { _container = new TinyIoCContainer(); // View models _container.Register<BasketViewModel>(); _container.Register<CatalogViewModel>(); _container.Register<CheckoutViewModel>(); _container.Register<LoginViewModel>(); _container.Register<MainViewModel>(); _container.Register<OrderDetailViewModel>(); _container.Register<ProfileViewModel>(); _container.Register<SettingsViewModel>(); _container.Register<CampaignViewModel>(); _container.Register<CampaignDetailsViewModel>(); >>>>>>> private static TinyIoCContainer _container; public static readonly BindableProperty AutoWireViewModelProperty = BindableProperty.CreateAttached("AutoWireViewModel", typeof(bool), typeof(ViewModelLocator), default(bool), propertyChanged: OnAutoWireViewModelChanged); public static bool GetAutoWireViewModel(BindableObject bindable) { return (bool)bindable.GetValue(ViewModelLocator.AutoWireViewModelProperty); } public static void SetAutoWireViewModel(BindableObject bindable, bool value) { bindable.SetValue(ViewModelLocator.AutoWireViewModelProperty, value); } public static bool UseMockService { get; set; } static ViewModelLocator() { _container = new TinyIoCContainer(); // View models _container.Register<BasketViewModel>(); _container.Register<CatalogViewModel>(); _container.Register<CheckoutViewModel>(); _container.Register<LoginViewModel>(); _container.Register<MainViewModel>(); _container.Register<OrderDetailViewModel>(); _container.Register<ProfileViewModel>(); _container.Register<SettingsViewModel>(); _container.Register<CampaignViewModel>(); _container.Register<CampaignDetailsViewModel>(); <<<<<<< builder.RegisterType<NavigationService>().As<INavigationService>().SingleInstance(); builder.RegisterType<DialogService>().As<IDialogService>(); builder.RegisterType<OpenUrlService>().As<IOpenUrlService>(); builder.RegisterType<IdentityService>().As<IIdentityService>(); builder.RegisterType<RequestProvider>().As<IRequestProvider>(); builder.RegisterType<LocationService>().As<ILocationService>().SingleInstance(); builder.RegisterType<Services.Dependency.DependencyService>().As<IDependencyService>(); builder.RegisterType<SettingsService>().As<ISettingsService>().SingleInstance(); builder.RegisterType<FixUriService>().As<FixUriService>().SingleInstance(); ======= _container.Register<INavigationService, NavigationService>().AsSingleton(); _container.Register<IDialogService, DialogService>(); _container.Register<IOpenUrlService, OpenUrlService>(); _container.Register<IIdentityService, IdentityService>(); _container.Register<IRequestProvider, RequestProvider>(); _container.Register<ILocationService, LocationService>().AsSingleton(); _container.Register<ICatalogService, CatalogMockService>().AsSingleton(); _container.Register<IBasketService, BasketMockService>().AsSingleton(); _container.Register<IOrderService, OrderMockService>().AsSingleton(); _container.Register<IUserService, UserMockService>().AsSingleton(); _container.Register<ICampaignService, CampaignMockService>().AsSingleton(); } public static void UpdateDependencies(bool useMockServices) { // Change injected dependencies >>>>>>> _container.Register<INavigationService, NavigationService>().AsSingleton(); _container.Register<IDialogService, DialogService>(); _container.Register<IOpenUrlService, OpenUrlService>(); _container.Register<IIdentityService, IdentityService>(); _container.Register<IRequestProvider, RequestProvider>(); _container.Register<ILocationService, LocationService>().AsSingleton(); _container.Register<ICatalogService, CatalogMockService>().AsSingleton(); _container.Register<IBasketService, BasketMockService>().AsSingleton(); _container.Register<IOrderService, OrderMockService>().AsSingleton(); _container.Register<IUserService, UserMockService>().AsSingleton(); _container.Register<ICampaignService, CampaignMockService>().AsSingleton(); } public static void UpdateDependencies(bool useMockServices) { // Change injected dependencies <<<<<<< { builder.RegisterInstance(new CatalogMockService()).As<ICatalogService>(); builder.RegisterInstance(new BasketMockService()).As<IBasketService>(); builder.RegisterInstance(new OrderMockService()).As<IOrderService>(); builder.RegisterInstance(new UserMockService()).As<IUserService>(); builder.RegisterInstance(new CampaignMockService()).As<ICampaignService>(); ======= { _container.Register<ICatalogService, CatalogMockService>().AsSingleton(); _container.Register<IBasketService, BasketMockService>().AsSingleton(); _container.Register<IOrderService, OrderMockService>().AsSingleton(); _container.Register<IUserService, UserMockService>().AsSingleton(); _container.Register<ICampaignService, CampaignMockService>().AsSingleton(); >>>>>>> { _container.Register<ICatalogService, CatalogMockService>().AsSingleton(); _container.Register<IBasketService, BasketMockService>().AsSingleton(); _container.Register<IOrderService, OrderMockService>().AsSingleton(); _container.Register<IUserService, UserMockService>().AsSingleton(); _container.Register<ICampaignService, CampaignMockService>().AsSingleton(); <<<<<<< } else { builder.RegisterType<CatalogService>().As<ICatalogService>().SingleInstance(); builder.RegisterType<BasketService>().As<IBasketService>().SingleInstance(); builder.RegisterType<OrderService>().As<IOrderService>().SingleInstance(); builder.RegisterType<UserService>().As<IUserService>().SingleInstance(); builder.RegisterType<CampaignService>().As<ICampaignService>().SingleInstance(); ======= } else { _container.Register<ICatalogService, CatalogService>().AsSingleton(); _container.Register<IBasketService, BasketService>().AsSingleton(); _container.Register<IOrderService, OrderService>().AsSingleton(); _container.Register<IUserService, UserService>().AsSingleton(); _container.Register<ICampaignService, CampaignService>().AsSingleton(); >>>>>>> } else { _container.Register<ICatalogService, CatalogService>().AsSingleton(); _container.Register<IBasketService, BasketService>().AsSingleton(); _container.Register<IOrderService, OrderService>().AsSingleton(); _container.Register<IUserService, UserService>().AsSingleton(); _container.Register<ICampaignService, CampaignService>().AsSingleton(); <<<<<<< } if (_container != null) { _container.Dispose(); } _container = builder.Build(); } public static T Resolve<T>() { return _container.Resolve<T>(); } private static void OnAutoWireViewModelChanged(BindableObject bindable, object oldValue, object newValue) { var view = bindable as Element; if (view == null) { return; } var viewType = view.GetType(); var viewName = viewType.FullName.Replace(".Views.", ".ViewModels."); var viewAssemblyName = viewType.GetTypeInfo().Assembly.FullName; var viewModelName = string.Format(CultureInfo.InvariantCulture, "{0}Model, {1}", viewName, viewAssemblyName); var viewModelType = Type.GetType(viewModelName); if (viewModelType == null) { return; } var viewModel = _container.Resolve(viewModelType); view.BindingContext = viewModel; } } ======= } } public static T Resolve<T>() where T : class { return _container.Resolve<T>(); } private static void OnAutoWireViewModelChanged(BindableObject bindable, object oldValue, object newValue) { var view = bindable as Element; if (view == null) { return; } var viewType = view.GetType(); var viewName = viewType.FullName.Replace(".Views.", ".ViewModels."); var viewAssemblyName = viewType.GetTypeInfo().Assembly.FullName; var viewModelName = string.Format(CultureInfo.InvariantCulture, "{0}Model, {1}", viewName, viewAssemblyName); var viewModelType = Type.GetType(viewModelName); if (viewModelType == null) { return; } var viewModel = _container.Resolve(viewModelType); view.BindingContext = viewModel; } } >>>>>>> } } public static T Resolve<T>() where T : class { return _container.Resolve<T>(); } private static void OnAutoWireViewModelChanged(BindableObject bindable, object oldValue, object newValue) { var view = bindable as Element; if (view == null) { return; } var viewType = view.GetType(); var viewName = viewType.FullName.Replace(".Views.", ".ViewModels."); var viewAssemblyName = viewType.GetTypeInfo().Assembly.FullName; var viewModelName = string.Format(CultureInfo.InvariantCulture, "{0}Model, {1}", viewName, viewAssemblyName); var viewModelType = Type.GetType(viewModelName); if (viewModelType == null) { return; } var viewModel = _container.Resolve(viewModelType); view.BindingContext = viewModel; } }
<<<<<<< private readonly IBuyerRepository _buyerRepository; private readonly IOrderRepository _orderRepository; ======= private readonly IOrderRepository<Order> _orderRepository; >>>>>>> private readonly IOrderRepository _orderRepository; <<<<<<< public CreateOrderCommandHandler(IBuyerRepository buyerRepository, IOrderRepository orderRepository, IIdentityService identityService) ======= public CreateOrderCommandHandler(IMediator mediator, IOrderRepository<Order> orderRepository, IIdentityService identityService) >>>>>>> public CreateOrderCommandHandler(IMediator mediator, IOrderRepository orderRepository, IIdentityService identityService)
<<<<<<< ======= var identityUrl = Configuration.GetValue<string>("IdentityUrl"); var callBackUrl = Configuration.GetValue<string>("CallBackUrl"); var useLoadTest = Configuration.GetValue<bool>("UseLoadTest"); >>>>>>>
<<<<<<< using global::Catalog.API.Infrastructure.Filters; using global::Catalog.API.IntegrationEvents; ======= >>>>>>> using global::Catalog.API.Infrastructure.Filters; using global::Catalog.API.IntegrationEvents; <<<<<<< var sqlConnection = new SqlConnection(Configuration["ConnectionString"]); // Add framework services. services.AddMvc(options => { options.Filters.Add(typeof(HttpGlobalExceptionFilter)); }).AddControllersAsServices(); services.AddDbContext<CatalogContext>(c => ======= services.AddDbContext<CatalogContext>(options => >>>>>>> // Add framework services. services.AddMvc(options => { options.Filters.Add(typeof(HttpGlobalExceptionFilter)); }).AddControllersAsServices(); services.AddDbContext<CatalogContext>(c =>
<<<<<<< services.AddScoped<IOrderingService, OrderingService>(); services.AddGrpcClient<OrderingGrpc.OrderingGrpcClient>((services, options) => { var orderingApi = services.GetRequiredService<IOptions<UrlsConfig>>().Value.GrpcOrdering; options.Address = new Uri(orderingApi); }).AddInterceptor<GrpcExceptionInterceptor>(); ======= services.AddScoped<ICatalogService, CatalogService>(); services.AddGrpcClient<Catalog.CatalogClient>((services, options) => { var catalogApi = services.GetRequiredService<IOptions<UrlsConfig>>().Value.GrpcCatalog; options.Address = new Uri(catalogApi); }).AddInterceptor<GrpcExceptionInterceptor>(); >>>>>>> services.AddScoped<ICatalogService, CatalogService>(); services.AddGrpcClient<Catalog.CatalogClient>((services, options) => { var catalogApi = services.GetRequiredService<IOptions<UrlsConfig>>().Value.GrpcCatalog; options.Address = new Uri(catalogApi); }).AddInterceptor<GrpcExceptionInterceptor>(); services.AddScoped<IOrderingService, OrderingService>(); services.AddGrpcClient<OrderingGrpc.OrderingGrpcClient>((services, options) => { var orderingApi = services.GetRequiredService<IOptions<UrlsConfig>>().Value.GrpcOrdering; options.Address = new Uri(orderingApi); }).AddInterceptor<GrpcExceptionInterceptor>();
<<<<<<< private readonly Mock<IBuyerRepository> _buyerRepositoryMock; private readonly Mock<IOrderRepository> _orderRepositoryMock; ======= private readonly Mock<IOrderRepository<Order>> _orderRepositoryMock; >>>>>>> private readonly Mock<IOrderRepository> _orderRepositoryMock; <<<<<<< _buyerRepositoryMock = new Mock<IBuyerRepository>(); _orderRepositoryMock = new Mock<IOrderRepository>(); ======= _orderRepositoryMock = new Mock<IOrderRepository<Order>>(); >>>>>>> _orderRepositoryMock = new Mock<IOrderRepository>();
<<<<<<< ======= using StackExchange.Redis; using System; using System.Linq; using System.Net; >>>>>>> using StackExchange.Redis; using System; using System.Linq; using System.Net; <<<<<<< using StackExchange.Redis; using Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus; using Microsoft.Azure.ServiceBus; ======= >>>>>>> using Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus; using Microsoft.Azure.ServiceBus; <<<<<<< RegisterEventBus(services); ======= services.AddTransient<IIdentityService, IdentityService>(); RegisterServiceBus(services); services.AddOptions(); var container = new ContainerBuilder(); container.Populate(services); return new AutofacServiceProvider(container.Build()); >>>>>>> services.AddTransient<IIdentityService, IdentityService>(); RegisterEventBus(services); services.AddOptions(); var container = new ContainerBuilder(); container.Populate(services); return new AutofacServiceProvider(container.Build());
<<<<<<< public bool UseCustomizationData { get; set; } ======= public bool AzureStorageEnabled { get; set; } >>>>>>> public bool UseCustomizationData { get; set; } public bool AzureStorageEnabled { get; set; }
<<<<<<< Task<CustomerBasket> GetBasketAsync(string customerId); Task<CustomerBasket> UpdateBasketAsync(CustomerBasket basket); Task<bool> DeleteBasketAsync(string id); ======= Task<CustomerBasket> GetBasket(string customerId); Task<IEnumerable<string>> GetUsers(); Task<CustomerBasket> UpdateBasket(CustomerBasket basket); Task<bool> DeleteBasket(string id); >>>>>>> Task<CustomerBasket> GetBasketAsync(string customerId); Task<IEnumerable<string>> GetUsers(); Task<CustomerBasket> UpdateBasketAsync(CustomerBasket basket); Task<bool> DeleteBasketAsync(string id);
<<<<<<< services.AddScoped<IOrderingService, OrderingService>(); services.AddGrpcClient<OrderingGrpc.OrderingGrpcClient>((services, options) => { var orderingApi = services.GetRequiredService<IOptions<UrlsConfig>>().Value.GrpcOrdering; options.Address = new Uri(orderingApi); }).AddInterceptor<GrpcExceptionInterceptor>(); ======= services.AddScoped<ICatalogService, CatalogService>(); services.AddGrpcClient<Catalog.CatalogClient>((services, options) => { var catalogApi = services.GetRequiredService<IOptions<UrlsConfig>>().Value.GrpcCatalog; options.Address = new Uri(catalogApi); }).AddInterceptor<GrpcExceptionInterceptor>(); >>>>>>> services.AddScoped<ICatalogService, CatalogService>(); services.AddGrpcClient<Catalog.CatalogClient>((services, options) => { var catalogApi = services.GetRequiredService<IOptions<UrlsConfig>>().Value.GrpcCatalog; options.Address = new Uri(catalogApi); }).AddInterceptor<GrpcExceptionInterceptor>(); services.AddScoped<IOrderingService, OrderingService>(); services.AddGrpcClient<OrderingGrpc.OrderingGrpcClient>((services, options) => { var orderingApi = services.GetRequiredService<IOptions<UrlsConfig>>().Value.GrpcOrdering; options.Address = new Uri(orderingApi); }).AddInterceptor<GrpcExceptionInterceptor>();
<<<<<<< #region Transform Rotation [PublicAPI] public static Tweener<Vector3, Transform> tweenLocalRotation( this Transform t, Vector3 from, Vector3 to, Ease ease, float duration ) => tweenTransformVector(t, from, to, ease, duration, TweenMutators.localEulerAngles); #endregion #region Transform Color ======= #region Color >>>>>>> #region Transform Rotation [PublicAPI] public static Tweener<Vector3, Transform> tweenLocalRotation( this Transform t, Vector3 from, Vector3 to, Ease ease, float duration ) => tweenTransformVector(t, from, to, ease, duration, TweenMutators.localEulerAngles); #endregion #region Color <<<<<<< [PublicAPI] public static Tweener<float, Graphic> tweenColorAlpha( this Graphic g, float from, float to, Ease ease, float duration ) => a(TweenLerp.float_.tween(from, to, ease, duration), g, TweenMutators.colorAlpha); ======= [PublicAPI] public static Tweener<Color, Shadow> tweenColor( this Shadow s, Color from, Color to, Ease ease, float duration ) => a(TweenLerp.color.tween(from, to, ease, duration), s, TweenMutators.shadowEffectColor); #endregion #region Image FillAmount [PublicAPI] public static Tweener<float, Image> tweenFillAmount( this Image i, float from, float to, Ease ease, float duration ) => a(TweenLerp.float_.tween(from, to, ease, duration), i, TweenMutators.fillAmount); >>>>>>> [PublicAPI] public static Tweener<float, Graphic> tweenColorAlpha( this Graphic g, float from, float to, Ease ease, float duration ) => a(TweenLerp.float_.tween(from, to, ease, duration), g, TweenMutators.colorAlpha); [PublicAPI] public static Tweener<Color, Shadow> tweenColor( this Shadow s, Color from, Color to, Ease ease, float duration ) => a(TweenLerp.color.tween(from, to, ease, duration), s, TweenMutators.shadowEffectColor); #endregion #region Image [PublicAPI] public static Tweener<float, Image> tweenFillAmount( this Image i, float from, float to, Ease ease, float duration ) => a(TweenLerp.float_.tween(from, to, ease, duration), i, TweenMutators.fillAmount);
<<<<<<< [PublicAPI] public static Either<string, A> load<A>(PathStr loadPath) where A : Object { var path = loadPath.unityPath; var csr = Resources.Load<ResourceReference<A>>(path); return csr ? F.right<string, A>(csr.reference) : F.left<string, A>(notFound(path)); } [PublicAPI] public static Tpl<ResourceRequest, Future<Either<ErrorMsg, A>>> loadAsync<A>( ======= [PublicAPI] public static Tpl<IAsyncOperation, Future<Either<string, A>>> loadAsync<A>( >>>>>>> [PublicAPI] public static Tpl<IAsyncOperation, Future<Either<ErrorMsg, A>>> loadAsync<A>( <<<<<<< loadAsync<A>(loadPath).map2(future => future.dropError(logOnError)); [PublicAPI] public static IEnumerator waitForLoadCoroutine<A>( ResourceRequest request, Action<Either<ErrorMsg, A>> whenDone, string path ) where A : Object { yield return request; var csr = (ResourceReference<A>) request.asset; whenDone( csr ? F.right<ErrorMsg, A>(csr.reference) : F.left<ErrorMsg, A>(new ErrorMsg(notFound(path))) ); } ======= ResourceLoader.loadAsyncIgnoreErrors<ResourceReference<A>>(loadPath, logOnError) .map2(future => future.map(_ => _.reference)); >>>>>>> ResourceLoader.loadAsyncIgnoreErrors<ResourceReference<A>>(loadPath, logOnError) .map2(future => future.map(_ => _.reference));
<<<<<<< foreach (var customValidationResults in customValidator(containingComponent, o)) { yield return createCustomError(hierarchyToString(fieldHierarchy), customValidationResults); ======= foreach (var _err in customValidator(o)) { yield return createCustomError(hierarchyToString(fieldHierarchy), _err); >>>>>>> foreach (var _err in customValidator(containingComponent, o)) { yield return createCustomError(hierarchyToString(fieldHierarchy), _err);
<<<<<<< routes.MapRoute("60", "feed", new { controller = "Feed", action = "Feed", feedName = (string)null }); routes.MapRoute("61", "feeds/{*feedName}", new { controller = "Feed", action = "Feed" }); routes.MapRoute("62", "commentfeed", new { controller = "Feed", action = "CommentFeed" }); ======= routes.MapRoute(R(), "feeds/{feedName}", new { controller = "Feed", action = "Feed", feedName = "recent" }); routes.MapRoute(R(), "commentfeed", new { controller = "Feed", action = "CommentFeed" }); >>>>>>> routes.MapRoute(R(), "feed", new { controller = "Feed", action = "Feed", feedName = (string)null }); routes.MapRoute(R(), "feeds/{*feedName}", new { controller = "Feed", action = "Feed" }); routes.MapRoute(R(), "commentfeed", new { controller = "Feed", action = "CommentFeed" });
<<<<<<< using Terraria.Audio; using Terraria.ModLoader.Audio; using Terraria.Localization; using log4net; using System.Linq; using Terraria.ModLoader.Config; ======= >>>>>>> using Terraria.Audio; using Terraria.ModLoader.Audio; using Terraria.Localization; using log4net; using System.Linq; using Terraria.ModLoader.Config; <<<<<<< public void AddTile(string name, ModTile tile, string texture) { if (!loading) throw new Exception("AddTile can only be called from Mod.Load or Mod.Autoload"); ======= public void AddTile(string name, ModTile tile, string texture) { if (!loading) { throw new Exception("AddItem can only be called from Mod.Load or Mod.Autoload"); } >>>>>>> public void AddTile(string name, ModTile tile, string texture) { if (!loading) { throw new Exception("AddItem can only be called from Mod.Load or Mod.Autoload"); }
<<<<<<< private void LoadTexture(string path, int len, BinaryReader reader, bool rawimg) { try { var texTask = rawimg ? ImageIO.RawToTexture2DAsync(Main.instance.GraphicsDevice, reader) : ImageIO.PngToTexture2DAsync(Main.instance.GraphicsDevice, new MemoryStream(reader.ReadBytes(len)));//needs a seekable stream AsyncLoadQueue.Enqueue(texTask.ContinueWith(t => { var tex = t.Result; tex.Name = Name + "/" + path; lock (textures) textures[path] = tex; })); } catch (Exception e) { throw new ResourceLoadException(Language.GetTextValue("tModLoader.LoadErrorTextureFailedToLoad", path), e); } } private void LoadWav(string path, byte[] bytes) { try { if (path.StartsWith("Sounds/Music/")) { musics[path] = new MusicData(bytes, false); } else { //SoundEffect.FromStream needs a stream with a length sounds[path] = SoundEffect.FromStream(new MemoryStream(bytes)); } } catch (Exception e) { throw new ResourceLoadException(Language.GetTextValue("tModLoader.LoadErrorWavSoundFailedToLoad", path) + (Main.engine == null ? "\n" + Language.GetTextValue("tModLoader.LoadErrorSoundFailedToLoadAudioDeviceHint") : ""), e); } } private void LoadMP3(string path, byte[] bytes) { string wavCacheFilename = this.Name + "_" + path.Replace('/', '_') + "_" + Version + ".wav"; WAVCacheIO.DeleteIfOlder(File.path, wavCacheFilename); try { if (path.StartsWith("Sounds/Music/")) { if (ModLoader.musicStreamMode != 1) {//no cache musics[path] = new MusicData(bytes, true); return; } if (!WAVCacheIO.WAVCacheAvailable(wavCacheFilename)) { WAVCacheIO.CacheMP3(wavCacheFilename, new MemoryStream(bytes)); } musics[path] = new MusicData(Path.Combine(WAVCacheIO.ModCachePath, wavCacheFilename)); return; } sounds[path] = WAVCacheIO.WAVCacheAvailable(wavCacheFilename) ? SoundEffect.FromStream(WAVCacheIO.GetWavStream(wavCacheFilename)) : WAVCacheIO.CacheMP3(wavCacheFilename, new MemoryStream(bytes)); } catch (Exception e) { throw new ResourceLoadException(Language.GetTextValue("tModLoader.LoadErrorMP3SoundFailedToLoad", path) + (Main.engine == null ? "\n" + Language.GetTextValue("tModLoader.LoadErrorSoundFailedToLoadAudioDeviceHint") : ""), e); } } private void LoadFont(string path, byte[] data) { string fontFilenameNoExtension = Name + "_" + path.Replace('/', '_') + "_" + Version; string fontFilename = fontFilenameNoExtension + ".xnb"; FontCacheIO.DeleteIfOlder(File.path, fontFilename); if (!FontCacheIO.FontCacheAvailable(fontFilename)) { FileUtilities.WriteAllBytes(FontCacheIO.FontCachePath + Path.DirectorySeparatorChar + fontFilename, data, false); } try { fonts[path] = Main.instance.OurLoad<DynamicSpriteFont>("Fonts" + Path.DirectorySeparatorChar + "ModFonts" + Path.DirectorySeparatorChar + fontFilenameNoExtension); } catch (Exception e) { throw new ResourceLoadException(Language.GetTextValue("tModLoader.LoadErrorFontFailedToLoad", path), e); } } private void LoadEffect(string path, BinaryReader br) { try { char x = (char)br.ReadByte();//x char n = (char)br.ReadByte();//n char b = (char)br.ReadByte();//b char w = (char)br.ReadByte();//w byte xnbFormatVersion = br.ReadByte();//5 byte flags = br.ReadByte();//flags UInt32 compressedDataSize = br.ReadUInt32(); if ((flags & 0x80) != 0) { // TODO: figure out the compression used. throw new Exception(Language.GetTextValue("tModLoader.LoadErrorCannotLoadCompressedEffects")); //UInt32 decompressedDataSize = br.ReadUInt32(); } int typeReaderCount = br.ReadVarInt(); string typeReaderName = br.ReadString(); int typeReaderVersion = br.ReadInt32(); int sharedResourceCount = br.ReadVarInt(); int typeid = br.ReadVarInt(); UInt32 size = br.ReadUInt32(); byte[] effectBytecode = br.ReadBytes((int)size); effects[path] = new Effect(Main.instance.GraphicsDevice, effectBytecode); } catch (Exception e) { throw new ResourceLoadException(Language.GetTextValue("tModLoader.LoadErrorEffectFailedToLoad", path), e); } } internal void Autoload() { if (Code == null) return; Interface.loadMods.SetSubProgressInit(Language.GetTextValue("tModLoader.MSFinishingResourceLoading")); while (AsyncLoadQueue.Count > 0) AsyncLoadQueue.Dequeue().Wait(); AutoloadLocalization(); IList<Type> modGores = new List<Type>(); IList<Type> modSounds = new List<Type>(); foreach (Type type in Code.GetTypes().OrderBy(type => type.FullName, StringComparer.InvariantCulture)) { if (type.IsAbstract || type.GetConstructor(new Type[0]) == null)//don't autoload things with no default constructor { continue; } if (type.IsSubclassOf(typeof(ModItem))) { AutoloadItem(type); } else if (type.IsSubclassOf(typeof(GlobalItem))) { AutoloadGlobalItem(type); } else if (type.IsSubclassOf(typeof(ModPrefix))) { AutoloadPrefix(type); } else if (type.IsSubclassOf(typeof(ModDust))) { AutoloadDust(type); } else if (type.IsSubclassOf(typeof(ModTile))) { AutoloadTile(type); } else if (type.IsSubclassOf(typeof(GlobalTile))) { AutoloadGlobalTile(type); } else if (type.IsSubclassOf(typeof(ModTileEntity))) { AutoloadTileEntity(type); } else if (type.IsSubclassOf(typeof(ModWall))) { AutoloadWall(type); } else if (type.IsSubclassOf(typeof(GlobalWall))) { AutoloadGlobalWall(type); } else if (type.IsSubclassOf(typeof(ModProjectile))) { AutoloadProjectile(type); } else if (type.IsSubclassOf(typeof(GlobalProjectile))) { AutoloadGlobalProjectile(type); } else if (type.IsSubclassOf(typeof(ModNPC))) { AutoloadNPC(type); } else if (type.IsSubclassOf(typeof(GlobalNPC))) { AutoloadGlobalNPC(type); } else if (type.IsSubclassOf(typeof(ModPlayer))) { AutoloadPlayer(type); } else if (type.IsSubclassOf(typeof(ModBuff))) { AutoloadBuff(type); } else if (type.IsSubclassOf(typeof(GlobalBuff))) { AutoloadGlobalBuff(type); } else if (type.IsSubclassOf(typeof(ModMountData))) { AutoloadMountData(type); } else if (type.IsSubclassOf(typeof(ModGore))) { modGores.Add(type); } else if (type.IsSubclassOf(typeof(ModSound))) { modSounds.Add(type); } else if (type.IsSubclassOf(typeof(ModWorld))) { AutoloadModWorld(type); } else if (type.IsSubclassOf(typeof(ModUgBgStyle))) { AutoloadUgBgStyle(type); } else if (type.IsSubclassOf(typeof(ModSurfaceBgStyle))) { AutoloadSurfaceBgStyle(type); } else if (type.IsSubclassOf(typeof(GlobalBgStyle))) { AutoloadGlobalBgStyle(type); } else if (type.IsSubclassOf(typeof(ModWaterStyle))) { AutoloadWaterStyle(type); } else if (type.IsSubclassOf(typeof(ModWaterfallStyle))) { AutoloadWaterfallStyle(type); } else if (type.IsSubclassOf(typeof(GlobalRecipe))) { AutoloadGlobalRecipe(type); } else if (type.IsSubclassOf(typeof(ModCommand))) { AutoloadCommand(type); } } if (Properties.AutoloadGores) { AutoloadGores(modGores); } if (Properties.AutoloadSounds) { AutoloadSounds(modSounds); } if (Properties.AutoloadBackgrounds) { AutoloadBackgrounds(); } } internal void AutoloadConfig() { if (Code == null) return; foreach (Type type in Code.GetTypes().OrderBy(type => type.FullName)) { if (type.IsAbstract) { continue; } if (type.IsSubclassOf(typeof(ModConfig))) { var mc = (ModConfig)Activator.CreateInstance(type); // Skip loading UniquePerPlayer on Main.dedServ? if (mc.Mode == MultiplayerSyncMode.ServerDictates && (Side == ModSide.Client || Side == ModSide.NoSync)) // Client and NoSync mods can't have ServerDictates ModConfigs. Server can, but won't be synced. throw new Exception($"The ModConfig {mc.Name} can't be loaded because the config is ServerDictates but this Mods ModSide isn't Both or Server"); if (mc.Mode == MultiplayerSyncMode.UniquePerPlayer && Side == ModSide.Server) // Doesn't make sense. throw new Exception($"The ModConfig {mc.Name} can't be loaded because the config is UniquePerPlayer but this Mods ModSide is Server"); mc.mod = this; var name = type.Name; if (mc.Autoload(ref name)) AddConfig(name, mc); } } } public void AddConfig(string name, ModConfig mc) { mc.Name = name; mc.mod = this; ConfigManager.Add(mc); } ======= >>>>>>> internal void AutoloadConfig() { if (Code == null) return; foreach (Type type in Code.GetTypes().OrderBy(type => type.FullName)) { if (type.IsAbstract) { continue; } if (type.IsSubclassOf(typeof(ModConfig))) { var mc = (ModConfig)Activator.CreateInstance(type); // Skip loading UniquePerPlayer on Main.dedServ? if (mc.Mode == MultiplayerSyncMode.ServerDictates && (Side == ModSide.Client || Side == ModSide.NoSync)) // Client and NoSync mods can't have ServerDictates ModConfigs. Server can, but won't be synced. throw new Exception($"The ModConfig {mc.Name} can't be loaded because the config is ServerDictates but this Mods ModSide isn't Both or Server"); if (mc.Mode == MultiplayerSyncMode.UniquePerPlayer && Side == ModSide.Server) // Doesn't make sense. throw new Exception($"The ModConfig {mc.Name} can't be loaded because the config is UniquePerPlayer but this Mods ModSide is Server"); mc.mod = this; var name = type.Name; if (mc.Autoload(ref name)) AddConfig(name, mc); } } } public void AddConfig(string name, ModConfig mc) { mc.Name = name; mc.mod = this; ConfigManager.Add(mc); }
<<<<<<< this.buttonSetupDebugging = new System.Windows.Forms.Button(); this.patchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exactToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.offsetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.fuzzyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ======= this.buttonSetupDebugging = new System.Windows.Forms.Button(); this.hookGenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); >>>>>>> this.buttonSetupDebugging = new System.Windows.Forms.Button(); this.hookGenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.patchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exactToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.offsetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.fuzzyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); <<<<<<< // buttonSetupDebugging // this.buttonSetupDebugging.Anchor = System.Windows.Forms.AnchorStyles.Top; this.buttonSetupDebugging.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.buttonSetupDebugging.Location = new System.Drawing.Point(45, 158); this.buttonSetupDebugging.Name = "buttonSetupDebugging"; this.buttonSetupDebugging.Size = new System.Drawing.Size(129, 23); this.buttonSetupDebugging.TabIndex = 3; this.buttonSetupDebugging.Text = "Setup Debugging"; this.buttonSetupDebugging.UseVisualStyleBackColor = true; this.buttonSetupDebugging.Click += new System.EventHandler(this.buttonTask_Click); // // patchToolStripMenuItem // this.patchToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.exactToolStripMenuItem, this.offsetToolStripMenuItem, this.fuzzyToolStripMenuItem}); this.patchToolStripMenuItem.Name = "patchToolStripMenuItem"; this.patchToolStripMenuItem.Size = new System.Drawing.Size(49, 20); this.patchToolStripMenuItem.Text = "Patch"; // // exactToolStripMenuItem // this.exactToolStripMenuItem.Name = "exactToolStripMenuItem"; this.exactToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.exactToolStripMenuItem.Text = "Exact"; this.exactToolStripMenuItem.Click += new System.EventHandler(this.exactToolStripMenuItem_Click); // // offsetToolStripMenuItem // this.offsetToolStripMenuItem.Name = "offsetToolStripMenuItem"; this.offsetToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.offsetToolStripMenuItem.Text = "Offset"; this.offsetToolStripMenuItem.Click += new System.EventHandler(this.offsetToolStripMenuItem_Click); // // fuzzyToolStripMenuItem // this.fuzzyToolStripMenuItem.Name = "fuzzyToolStripMenuItem"; this.fuzzyToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.fuzzyToolStripMenuItem.Text = "Fuzzy"; this.fuzzyToolStripMenuItem.Click += new System.EventHandler(this.fuzzyToolStripMenuItem_Click); // ======= // buttonSetupDebugging // this.buttonSetupDebugging.Anchor = System.Windows.Forms.AnchorStyles.Top; this.buttonSetupDebugging.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.buttonSetupDebugging.Location = new System.Drawing.Point(45, 158); this.buttonSetupDebugging.Name = "buttonSetupDebugging"; this.buttonSetupDebugging.Size = new System.Drawing.Size(129, 23); this.buttonSetupDebugging.TabIndex = 3; this.buttonSetupDebugging.Text = "Setup Debugging"; this.buttonSetupDebugging.UseVisualStyleBackColor = true; this.buttonSetupDebugging.Click += new System.EventHandler(this.buttonTask_Click); // // hookGenToolStripMenuItem // this.hookGenToolStripMenuItem.Name = "hookGenToolStripMenuItem"; this.hookGenToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.hookGenToolStripMenuItem.Text = "HookGen"; this.hookGenToolStripMenuItem.Click += new System.EventHandler(this.menuItemHookGen_Click); // >>>>>>> // buttonSetupDebugging // this.buttonSetupDebugging.Anchor = System.Windows.Forms.AnchorStyles.Top; this.buttonSetupDebugging.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.buttonSetupDebugging.Location = new System.Drawing.Point(45, 158); this.buttonSetupDebugging.Name = "buttonSetupDebugging"; this.buttonSetupDebugging.Size = new System.Drawing.Size(129, 23); this.buttonSetupDebugging.TabIndex = 3; this.buttonSetupDebugging.Text = "Setup Debugging"; this.buttonSetupDebugging.UseVisualStyleBackColor = true; this.buttonSetupDebugging.Click += new System.EventHandler(this.buttonTask_Click); // // hookGenToolStripMenuItem // this.hookGenToolStripMenuItem.Name = "hookGenToolStripMenuItem"; this.hookGenToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.hookGenToolStripMenuItem.Text = "HookGen"; this.hookGenToolStripMenuItem.Click += new System.EventHandler(this.menuItemHookGen_Click); // // patchToolStripMenuItem // this.patchToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.exactToolStripMenuItem, this.offsetToolStripMenuItem, this.fuzzyToolStripMenuItem}); this.patchToolStripMenuItem.Name = "patchToolStripMenuItem"; this.patchToolStripMenuItem.Size = new System.Drawing.Size(49, 20); this.patchToolStripMenuItem.Text = "Patch"; // // exactToolStripMenuItem // this.exactToolStripMenuItem.Name = "exactToolStripMenuItem"; this.exactToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.exactToolStripMenuItem.Text = "Exact"; this.exactToolStripMenuItem.Click += new System.EventHandler(this.exactToolStripMenuItem_Click); // // offsetToolStripMenuItem // this.offsetToolStripMenuItem.Name = "offsetToolStripMenuItem"; this.offsetToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.offsetToolStripMenuItem.Text = "Offset"; this.offsetToolStripMenuItem.Click += new System.EventHandler(this.offsetToolStripMenuItem_Click); // // fuzzyToolStripMenuItem // this.fuzzyToolStripMenuItem.Name = "fuzzyToolStripMenuItem"; this.fuzzyToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.fuzzyToolStripMenuItem.Text = "Fuzzy"; this.fuzzyToolStripMenuItem.Click += new System.EventHandler(this.fuzzyToolStripMenuItem_Click); // <<<<<<< private System.Windows.Forms.ToolStripMenuItem patchToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exactToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem offsetToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem fuzzyToolStripMenuItem; ======= private System.Windows.Forms.ToolStripMenuItem hookGenToolStripMenuItem; >>>>>>> private System.Windows.Forms.ToolStripMenuItem hookGenToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem patchToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exactToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem offsetToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem fuzzyToolStripMenuItem;
<<<<<<< Utility.PopulateEntityReferenceNames(toReturn, db); toReturn.Id = entity.Id; toReturn.EntityState = entity.EntityState; ======= toReturn.Id = entity.Id; toReturn.EntityState = entity.EntityState; >>>>>>> toReturn.Id = entity.Id; toReturn.EntityState = entity.EntityState; <<<<<<< #if !(XRM_MOCKUP_2011 || XRM_MOCKUP_2013 || XRM_MOCKUP_2015) toReturn.KeyAttributes = entity.CloneKeyAttributes(); #endif return toReturn; ======= Utility.PopulateEntityReferenceNames(toReturn, db); return toReturn; >>>>>>> #if !(XRM_MOCKUP_2011 || XRM_MOCKUP_2013 || XRM_MOCKUP_2015) toReturn.KeyAttributes = entity.CloneKeyAttributes(); #endif Utility.PopulateEntityReferenceNames(toReturn, db); return toReturn; <<<<<<< #endregion ======= #endregion >>>>>>> #endregion <<<<<<< internal EntityMetadata GetEntityMetadata(string entityLogicalName) { return metadata.EntityMetadata[entityLogicalName]; } ======= #if !(XRM_MOCKUP_2011 || XRM_MOCKUP_2013) internal void ExecuteCalculatedFields(DbRow row) { var attributes = row.Metadata.Attributes.Where( m => m.SourceType == 1 && !(m is MoneyAttributeMetadata && m.LogicalName.EndsWith("_base"))); foreach (var attr in attributes) { string definition = (attr as BooleanAttributeMetadata)?.FormulaDefinition; if (attr is BooleanAttributeMetadata) definition = (attr as BooleanAttributeMetadata).FormulaDefinition; else if (attr is DateTimeAttributeMetadata) definition = (attr as DateTimeAttributeMetadata).FormulaDefinition; else if (attr is DecimalAttributeMetadata) definition = (attr as DecimalAttributeMetadata).FormulaDefinition; else if (attr is IntegerAttributeMetadata) definition = (attr as IntegerAttributeMetadata).FormulaDefinition; else if (attr is MoneyAttributeMetadata) definition = (attr as MoneyAttributeMetadata).FormulaDefinition; else if (attr is PicklistAttributeMetadata) definition = (attr as PicklistAttributeMetadata).FormulaDefinition; else if (attr is StringAttributeMetadata) definition = (attr as StringAttributeMetadata).FormulaDefinition; if (definition == null) { var trace = this.ServiceFactory.GetService(typeof(ITracingService)) as ITracingService; trace.Trace($"Calculated field on {attr.EntityLogicalName} field {attr.LogicalName} is empty"); return; } var tree = WorkflowConstructor.ParseCalculated(definition); var factory = this.ServiceFactory; tree.Execute(row.ToEntity().CloneEntity(row.Metadata, new ColumnSet(true)), this.TimeOffset, this.GetWorkflowService(), factory, factory.GetService(typeof(ITracingService)) as ITracingService); } } #endif #if XRM_MOCKUP_365 public void TriggerExtension(IOrganizationService service, OrganizationRequest request, Entity currentEntity, Entity preEntity, EntityReference userRef) { foreach (var mockUpExtension in settings.MockUpExtensions) { mockUpExtension.TriggerExtension(service, request, currentEntity, preEntity, userRef); } } #endif } internal class XrmExtension : IOrganizationService { private readonly Core _core; private readonly EntityReference _userRef; private readonly PluginContext _pluginContext; public XrmExtension(Core core, EntityReference userRef, PluginContext pluginContext) { _core = core; _userRef = userRef ?? throw new ArgumentNullException(nameof(userRef)); _pluginContext = pluginContext; } public Guid Create(Entity entity) { var response = (CreateResponse)_core.Execute(new CreateRequest(), _userRef, _pluginContext); return response.id; } public Entity Retrieve(string entityName, Guid id, ColumnSet columnSet) { var response = (RetrieveResponse)_core.Execute( new RetrieveRequest { ColumnSet = columnSet, Target = new EntityReference(entityName, id) }, _userRef, _pluginContext); return response.Entity; } public void Update(Entity entity) { _core.Execute(new UpdateRequest { Target = entity }, _userRef, _pluginContext); } public void Delete(string entityName, Guid id) { _core.Execute(new DeleteRequest { Target = new EntityReference(entityName, id) }, _userRef, _pluginContext); } public OrganizationResponse Execute(OrganizationRequest request) { return _core.Execute(request, _userRef, _pluginContext); } public void Associate(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities) { _core.Execute( new AssociateRequest { Target = new EntityReference(entityName, entityId), Relationship = relationship, RelatedEntities = relatedEntities }, _userRef, _pluginContext); } public void Disassociate(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities) { _core.Execute( new DisassociateRequest { Target = new EntityReference(entityName, entityId), Relationship = relationship, RelatedEntities = relatedEntities }, _userRef, _pluginContext); } public EntityCollection RetrieveMultiple(QueryBase query) { var response = (RetrieveMultipleResponse)_core.Execute(new RetrieveMultipleRequest { Query = query }, _userRef, _pluginContext); return response.EntityCollection; } >>>>>>> internal EntityMetadata GetEntityMetadata(string entityLogicalName) { return metadata.EntityMetadata[entityLogicalName]; } #if !(XRM_MOCKUP_2011 || XRM_MOCKUP_2013) internal void ExecuteCalculatedFields(DbRow row) { var attributes = row.Metadata.Attributes.Where( m => m.SourceType == 1 && !(m is MoneyAttributeMetadata && m.LogicalName.EndsWith("_base"))); foreach (var attr in attributes) { string definition = (attr as BooleanAttributeMetadata)?.FormulaDefinition; if (attr is BooleanAttributeMetadata) definition = (attr as BooleanAttributeMetadata).FormulaDefinition; else if (attr is DateTimeAttributeMetadata) definition = (attr as DateTimeAttributeMetadata).FormulaDefinition; else if (attr is DecimalAttributeMetadata) definition = (attr as DecimalAttributeMetadata).FormulaDefinition; else if (attr is IntegerAttributeMetadata) definition = (attr as IntegerAttributeMetadata).FormulaDefinition; else if (attr is MoneyAttributeMetadata) definition = (attr as MoneyAttributeMetadata).FormulaDefinition; else if (attr is PicklistAttributeMetadata) definition = (attr as PicklistAttributeMetadata).FormulaDefinition; else if (attr is StringAttributeMetadata) definition = (attr as StringAttributeMetadata).FormulaDefinition; if (definition == null) { var trace = this.ServiceFactory.GetService(typeof(ITracingService)) as ITracingService; trace.Trace($"Calculated field on {attr.EntityLogicalName} field {attr.LogicalName} is empty"); return; } var tree = WorkflowConstructor.ParseCalculated(definition); var factory = this.ServiceFactory; tree.Execute(row.ToEntity().CloneEntity(row.Metadata, new ColumnSet(true)), this.TimeOffset, this.GetWorkflowService(), factory, factory.GetService(typeof(ITracingService)) as ITracingService); } } #endif #if XRM_MOCKUP_365 public void TriggerExtension(IOrganizationService service, OrganizationRequest request, Entity currentEntity, Entity preEntity, EntityReference userRef) { foreach (var mockUpExtension in settings.MockUpExtensions) { mockUpExtension.TriggerExtension(service, request, currentEntity, preEntity, userRef); } } #endif } internal class XrmExtension : IOrganizationService { private readonly Core _core; private readonly EntityReference _userRef; private readonly PluginContext _pluginContext; public XrmExtension(Core core, EntityReference userRef, PluginContext pluginContext) { _core = core; _userRef = userRef ?? throw new ArgumentNullException(nameof(userRef)); _pluginContext = pluginContext; } public Guid Create(Entity entity) { var response = (CreateResponse)_core.Execute(new CreateRequest(), _userRef, _pluginContext); return response.id; } public Entity Retrieve(string entityName, Guid id, ColumnSet columnSet) { var response = (RetrieveResponse)_core.Execute( new RetrieveRequest { ColumnSet = columnSet, Target = new EntityReference(entityName, id) }, _userRef, _pluginContext); return response.Entity; } public void Update(Entity entity) { _core.Execute(new UpdateRequest { Target = entity }, _userRef, _pluginContext); } public void Delete(string entityName, Guid id) { _core.Execute(new DeleteRequest { Target = new EntityReference(entityName, id) }, _userRef, _pluginContext); } public OrganizationResponse Execute(OrganizationRequest request) { return _core.Execute(request, _userRef, _pluginContext); } public void Associate(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities) { _core.Execute( new AssociateRequest { Target = new EntityReference(entityName, entityId), Relationship = relationship, RelatedEntities = relatedEntities }, _userRef, _pluginContext); } public void Disassociate(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities) { _core.Execute( new DisassociateRequest { Target = new EntityReference(entityName, entityId), Relationship = relationship, RelatedEntities = relatedEntities }, _userRef, _pluginContext); } public EntityCollection RetrieveMultiple(QueryBase query) { var response = (RetrieveMultipleResponse)_core.Execute(new RetrieveMultipleRequest { Query = query }, _userRef, _pluginContext); return response.EntityCollection; }
<<<<<<< [TestMethod] public void TestQueryExpressionIn() { var query = new QueryExpression("lead") { ColumnSet = new ColumnSet(true) }; var filter = new FilterExpression(LogicalOperator.And); filter.AddCondition(new ConditionExpression("parentcontactid", ConditionOperator.In, new Guid[] { contact1.Id, contact2.Id })); query.Criteria = filter; var res = orgAdminService.RetrieveMultiple(query).Entities.Cast<Lead>(); Assert.AreEqual(2, res.Count()); Assert.IsTrue(res.Any(x => x.Id == lead1.Id)); Assert.IsTrue(res.Any(x => x.Id == lead2.Id)); } [TestMethod] public void TestQueryExpressionInEmpty() { var query = new QueryExpression("lead") { ColumnSet = new ColumnSet(true) }; var filter = new FilterExpression(LogicalOperator.And); filter.AddCondition(new ConditionExpression("parentcontactid", ConditionOperator.In, new Guid[] {})); query.Criteria = filter; var res = orgAdminService.RetrieveMultiple(query).Entities.Cast<Lead>(); Assert.AreEqual(0, res.Count()); } [TestMethod] public void TestQueryExpressionNotIn() { var query = new QueryExpression("lead") { ColumnSet = new ColumnSet(true) }; var filter = new FilterExpression(LogicalOperator.And); filter.AddCondition(new ConditionExpression("parentcontactid", ConditionOperator.NotIn, new Guid[] { contact1.Id, contact2.Id })); query.Criteria = filter; var res = orgAdminService.RetrieveMultiple(query).Entities.Cast<Lead>(); Assert.IsTrue(!res.Any(x => x.Id == lead1.Id)); Assert.IsTrue(!res.Any(x => x.Id == lead2.Id)); } [TestMethod] public void TestQueryExpressionNotInEmpty() { var leadCount = 0; using (var context = new Xrm(orgAdminUIService)) { leadCount = context.LeadSet.Select(x => x.LeadId).ToList().Count(); } var query = new QueryExpression("lead") { ColumnSet = new ColumnSet(true) }; var filter = new FilterExpression(LogicalOperator.And); filter.AddCondition(new ConditionExpression("parentcontactid", ConditionOperator.NotIn, new Guid[] { })); query.Criteria = filter; var res = orgAdminService.RetrieveMultiple(query).Entities.Cast<Lead>(); Assert.AreEqual(leadCount, res.Count()); } } ======= >>>>>>> [TestMethod] public void TestQueryExpressionIn() { var query = new QueryExpression("lead") { ColumnSet = new ColumnSet(true) }; var filter = new FilterExpression(LogicalOperator.And); filter.AddCondition(new ConditionExpression("parentcontactid", ConditionOperator.In, new Guid[] { contact1.Id, contact2.Id })); query.Criteria = filter; var res = orgAdminService.RetrieveMultiple(query).Entities.Cast<Lead>(); Assert.AreEqual(2, res.Count()); Assert.IsTrue(res.Any(x => x.Id == lead1.Id)); Assert.IsTrue(res.Any(x => x.Id == lead2.Id)); } [TestMethod] public void TestQueryExpressionInEmpty() { var query = new QueryExpression("lead") { ColumnSet = new ColumnSet(true) }; var filter = new FilterExpression(LogicalOperator.And); filter.AddCondition(new ConditionExpression("parentcontactid", ConditionOperator.In, new Guid[] {})); query.Criteria = filter; var res = orgAdminService.RetrieveMultiple(query).Entities.Cast<Lead>(); Assert.AreEqual(0, res.Count()); } [TestMethod] public void TestQueryExpressionNotIn() { var query = new QueryExpression("lead") { ColumnSet = new ColumnSet(true) }; var filter = new FilterExpression(LogicalOperator.And); filter.AddCondition(new ConditionExpression("parentcontactid", ConditionOperator.NotIn, new Guid[] { contact1.Id, contact2.Id })); query.Criteria = filter; var res = orgAdminService.RetrieveMultiple(query).Entities.Cast<Lead>(); Assert.IsTrue(!res.Any(x => x.Id == lead1.Id)); Assert.IsTrue(!res.Any(x => x.Id == lead2.Id)); } [TestMethod] public void TestQueryExpressionNotInEmpty() { var leadCount = 0; using (var context = new Xrm(orgAdminUIService)) { leadCount = context.LeadSet.Select(x => x.LeadId).ToList().Count(); } var query = new QueryExpression("lead") { ColumnSet = new ColumnSet(true) }; var filter = new FilterExpression(LogicalOperator.And); filter.AddCondition(new ConditionExpression("parentcontactid", ConditionOperator.NotIn, new Guid[] { })); query.Criteria = filter; var res = orgAdminService.RetrieveMultiple(query).Entities.Cast<Lead>(); Assert.AreEqual(leadCount, res.Count()); }
<<<<<<< [Fact] public void RetrieveMultipleBeginsWith() { var query = new QueryExpression("account") { ColumnSet = new ColumnSet(true) }; query.Criteria.AddCondition("address1_postalcode", ConditionOperator.BeginsWith, "MK11"); var res = orgAdminService.RetrieveMultiple(query); Assert.Single(res.Entities); query = new QueryExpression("account") { ColumnSet = new ColumnSet(true) }; query.Criteria.AddCondition("address1_postalcode", ConditionOperator.DoesNotBeginWith, "MK11"); res = orgAdminService.RetrieveMultiple(query); Assert.Equal(3, res.Entities.Count); query = new QueryExpression("account") { ColumnSet = new ColumnSet(true) }; query.Criteria.AddCondition("address1_postalcode", ConditionOperator.EndsWith, "1DW"); res = orgAdminService.RetrieveMultiple(query); Assert.Single(res.Entities); query = new QueryExpression("account") { ColumnSet = new ColumnSet(true) }; query.Criteria.AddCondition("address1_postalcode", ConditionOperator.DoesNotEndWith, "1DW"); res = orgAdminService.RetrieveMultiple(query); Assert.Equal(3, res.Entities.Count); } ======= [Fact] public void TestCaseSensitivity() { var c = new Contact(); c.FirstName = "MATT"; orgAdminService.Create(c); var q = new QueryExpression("contact"); q.Criteria.AddCondition("firstname", ConditionOperator.Equal, "matt"); q.ColumnSet = new ColumnSet(true); var res = orgAdminService.RetrieveMultiple(q); Assert.Equal("MATT", res.Entities.Single().GetAttributeValue<string>("firstname")); } >>>>>>> [Fact] public void RetrieveMultipleBeginsWith() { var query = new QueryExpression("account") { ColumnSet = new ColumnSet(true) }; query.Criteria.AddCondition("address1_postalcode", ConditionOperator.BeginsWith, "MK11"); var res = orgAdminService.RetrieveMultiple(query); Assert.Single(res.Entities); query = new QueryExpression("account") { ColumnSet = new ColumnSet(true) }; query.Criteria.AddCondition("address1_postalcode", ConditionOperator.DoesNotBeginWith, "MK11"); res = orgAdminService.RetrieveMultiple(query); Assert.Equal(3, res.Entities.Count); query = new QueryExpression("account") { ColumnSet = new ColumnSet(true) }; query.Criteria.AddCondition("address1_postalcode", ConditionOperator.EndsWith, "1DW"); res = orgAdminService.RetrieveMultiple(query); Assert.Single(res.Entities); query = new QueryExpression("account") { ColumnSet = new ColumnSet(true) }; query.Criteria.AddCondition("address1_postalcode", ConditionOperator.DoesNotEndWith, "1DW"); res = orgAdminService.RetrieveMultiple(query); Assert.Equal(3, res.Entities.Count); } [Fact] public void TestCaseSensitivity() { var c = new Contact(); c.FirstName = "MATT"; orgAdminService.Create(c); var q = new QueryExpression("contact"); q.Criteria.AddCondition("firstname", ConditionOperator.Equal, "matt"); q.ColumnSet = new ColumnSet(true); var res = orgAdminService.RetrieveMultiple(q); Assert.Equal("MATT", res.Entities.Single().GetAttributeValue<string>("firstname")); }
<<<<<<< private static Boolean IsValidForFormattedValues(AttributeMetadata attributeMetadata) { return attributeMetadata is PicklistAttributeMetadata || attributeMetadata is BooleanAttributeMetadata || attributeMetadata is MoneyAttributeMetadata || attributeMetadata is LookupAttributeMetadata || attributeMetadata is IntegerAttributeMetadata || attributeMetadata is DateTimeAttributeMetadata || attributeMetadata is MemoAttributeMetadata || attributeMetadata is DoubleAttributeMetadata || attributeMetadata is DecimalAttributeMetadata; } private static string GetFormattedValueLabel(XrmDb db, AttributeMetadata metadataAtt, object value, Entity entity) { if (metadataAtt is PicklistAttributeMetadata) { var optionset = (metadataAtt as PicklistAttributeMetadata).OptionSet.Options .Where(opt => opt.Value == (value as OptionSetValue).Value).FirstOrDefault(); return optionset.Label.UserLocalizedLabel.Label; } if (metadataAtt is BooleanAttributeMetadata) { var booleanOptions = (metadataAtt as BooleanAttributeMetadata).OptionSet; var label = (bool)value ? booleanOptions.TrueOption.Label : booleanOptions.FalseOption.Label; return label.UserLocalizedLabel.Label; } if (metadataAtt is MoneyAttributeMetadata) { var currencysymbol = db.GetEntity( db.GetEntity(entity.ToEntityReference()) .GetAttributeValue<EntityReference>("transactioncurrencyid")) .GetAttributeValue<string>("currencysymbol"); return currencysymbol + (value as Money).Value.ToString(); } if (metadataAtt is LookupAttributeMetadata) { try { return (value as EntityReference).Name; } catch (NullReferenceException e) { Console.WriteLine("No lookup entity exists: " + e.Message); } } if (metadataAtt is IntegerAttributeMetadata || metadataAtt is DateTimeAttributeMetadata || metadataAtt is MemoAttributeMetadata || metadataAtt is DoubleAttributeMetadata || metadataAtt is DecimalAttributeMetadata) { return value.ToString(); } return null; } internal static void SetFormmattedValues(XrmDb db, Entity entity, EntityMetadata metadata) { var validMetadata = metadata.Attributes .Where(a => IsValidForFormattedValues(a)); var formattedValues = new List<KeyValuePair<string, string>>(); foreach (var a in entity.Attributes) { if (a.Value == null) continue; var metadataAtt = validMetadata.Where(m => m.LogicalName == a.Key).FirstOrDefault(); var formattedValuePair = new KeyValuePair<string, string>(a.Key, Utility.GetFormattedValueLabel(db, metadataAtt, a.Value, entity)); if (formattedValuePair.Value != null) { formattedValues.Add(formattedValuePair); } } if (formattedValues.Count > 0) { entity.FormattedValues.AddRange(formattedValues); } } ======= public static QueryExpression QueryByAttributeToQueryExpression(QueryByAttribute query) { var ret = new QueryExpression { EntityName = query.EntityName, TopCount = query.TopCount, PageInfo = query.PageInfo, ColumnSet = query.ColumnSet, }; for (var i = 0; i <= query.Attributes.Count - 1; i++) { ret.Criteria.Conditions.Add(new ConditionExpression(query.Attributes[i], ConditionOperator.Equal, query.Values[i])); } return ret; } >>>>>>> private static Boolean IsValidForFormattedValues(AttributeMetadata attributeMetadata) { return attributeMetadata is PicklistAttributeMetadata || attributeMetadata is BooleanAttributeMetadata || attributeMetadata is MoneyAttributeMetadata || attributeMetadata is LookupAttributeMetadata || attributeMetadata is IntegerAttributeMetadata || attributeMetadata is DateTimeAttributeMetadata || attributeMetadata is MemoAttributeMetadata || attributeMetadata is DoubleAttributeMetadata || attributeMetadata is DecimalAttributeMetadata; } private static string GetFormattedValueLabel(XrmDb db, AttributeMetadata metadataAtt, object value, Entity entity) { if (metadataAtt is PicklistAttributeMetadata) { var optionset = (metadataAtt as PicklistAttributeMetadata).OptionSet.Options .Where(opt => opt.Value == (value as OptionSetValue).Value).FirstOrDefault(); return optionset.Label.UserLocalizedLabel.Label; } if (metadataAtt is BooleanAttributeMetadata) { var booleanOptions = (metadataAtt as BooleanAttributeMetadata).OptionSet; var label = (bool)value ? booleanOptions.TrueOption.Label : booleanOptions.FalseOption.Label; return label.UserLocalizedLabel.Label; } if (metadataAtt is MoneyAttributeMetadata) { var currencysymbol = db.GetEntity( db.GetEntity(entity.ToEntityReference()) .GetAttributeValue<EntityReference>("transactioncurrencyid")) .GetAttributeValue<string>("currencysymbol"); return currencysymbol + (value as Money).Value.ToString(); } if (metadataAtt is LookupAttributeMetadata) { try { return (value as EntityReference).Name; } catch (NullReferenceException e) { Console.WriteLine("No lookup entity exists: " + e.Message); } } if (metadataAtt is IntegerAttributeMetadata || metadataAtt is DateTimeAttributeMetadata || metadataAtt is MemoAttributeMetadata || metadataAtt is DoubleAttributeMetadata || metadataAtt is DecimalAttributeMetadata) { return value.ToString(); } return null; } internal static void SetFormmattedValues(XrmDb db, Entity entity, EntityMetadata metadata) { var validMetadata = metadata.Attributes .Where(a => IsValidForFormattedValues(a)); var formattedValues = new List<KeyValuePair<string, string>>(); foreach (var a in entity.Attributes) { if (a.Value == null) continue; var metadataAtt = validMetadata.Where(m => m.LogicalName == a.Key).FirstOrDefault(); var formattedValuePair = new KeyValuePair<string, string>(a.Key, Utility.GetFormattedValueLabel(db, metadataAtt, a.Value, entity)); if (formattedValuePair.Value != null) { formattedValues.Add(formattedValuePair); } } if (formattedValues.Count > 0) { entity.FormattedValues.AddRange(formattedValues); } } public static QueryExpression QueryByAttributeToQueryExpression(QueryByAttribute query) { var ret = new QueryExpression { EntityName = query.EntityName, TopCount = query.TopCount, PageInfo = query.PageInfo, ColumnSet = query.ColumnSet, }; for (var i = 0; i <= query.Attributes.Count - 1; i++) { ret.Criteria.Conditions.Add(new ConditionExpression(query.Attributes[i], ConditionOperator.Equal, query.Values[i])); } return ret; }
<<<<<<< ======= if (Win32Helper.IsRunningOnMono()) return; m_localWindowsHook = new LocalWindowsHook(Win32.HookType.WH_CALLWNDPROCRET); >>>>>>> if (Win32Helper.IsRunningOnMono()) return; <<<<<<< sm_localWindowsHook.HookInvoked -= m_hookEventHandler; ======= if (!Win32Helper.IsRunningOnMono()) m_localWindowsHook.Dispose(); >>>>>>> if (!Win32Helper.IsRunningOnMono()) sm_localWindowsHook.HookInvoked -= m_hookEventHandler; <<<<<<< sm_localWindowsHook.HookInvoked -= m_hookEventHandler; ======= if (!Win32Helper.IsRunningOnMono()) m_localWindowsHook.HookInvoked -= m_hookEventHandler; >>>>>>> if (!Win32Helper.IsRunningOnMono()) sm_localWindowsHook.HookInvoked -= m_hookEventHandler; <<<<<<< sm_localWindowsHook.HookInvoked += m_hookEventHandler; ======= if (!Win32Helper.IsRunningOnMono()) m_localWindowsHook.HookInvoked += m_hookEventHandler; >>>>>>> if (!Win32Helper.IsRunningOnMono()) sm_localWindowsHook.HookInvoked += m_hookEventHandler;
<<<<<<< private Lazy<string> _template; private bool _templateCompileException; private bool _templateCompiled; ======= private readonly SettingsImpl _configuration; >>>>>>> private Lazy<string> _template; private readonly SettingsImpl _configuration; private bool _templateCompileException; private bool _templateCompiled; <<<<<<< _template = LazyTemplate(); ======= var code = System.IO.File.ReadAllText(_templatePath); _template = TemplateCodeParser.Parse(_projectItem, code, _customExtensions); _configuration = new SettingsImpl(_projectItem); var templateClass = _customExtensions.FirstOrDefault(); if (templateClass?.GetConstructor(new []{typeof(Settings)}) != null) { Activator.CreateInstance(templateClass, _configuration); } >>>>>>> _template = LazyTemplate(); _configuration = new SettingsImpl(_projectItem); var templateClass = _customExtensions.FirstOrDefault(); if (templateClass?.GetConstructor(new []{typeof(Settings)}) != null) { Activator.CreateInstance(templateClass, _configuration); } <<<<<<< private Lazy<string> LazyTemplate() { _templateCompiled = false; _templateCompileException = false; return new Lazy<string>(() => { var code = System.IO.File.ReadAllText(_templatePath); try { var result = TemplateCodeParser.Parse(code, _customExtensions); _templateCompiled = true; return result; } catch (Exception) { _templateCompileException = true; throw; } }); } ======= public ICollection<string> GetFilesToRender() { return ProjectHelpers.GetProjectItems(_projectItem.DTE, _configuration.IncludedProjects, "*.cs").ToList(); } public bool ShouldRenderFile(string filename) { return ProjectHelpers.ProjectListContainsItem(_projectItem.DTE, filename, _configuration.IncludedProjects); } >>>>>>> private Lazy<string> LazyTemplate() { _templateCompiled = false; _templateCompileException = false; return new Lazy<string>(() => { var code = System.IO.File.ReadAllText(_templatePath); try { var result = TemplateCodeParser.Parse(code, _customExtensions); _templateCompiled = true; return result; } catch (Exception) { _templateCompileException = true; throw; } }); } public ICollection<string> GetFilesToRender() { return ProjectHelpers.GetProjectItems(_projectItem.DTE, _configuration.IncludedProjects, "*.cs").ToList(); } public bool ShouldRenderFile(string filename) { return ProjectHelpers.ProjectListContainsItem(_projectItem.DTE, filename, _configuration.IncludedProjects); } <<<<<<< try { return Parser.Parse(_template.Value, _customExtensions, file, out success); } catch (Exception ex) { Log.Error(ex.Message + " Template: " + _templatePath); success = false; return null; } ======= return Parser.Parse(_projectItem, file.FullName, _template, _customExtensions, file, out success); >>>>>>> try { return Parser.Parse(_template, _customExtensions, file, out success); } catch (Exception ex) { Log.Error(ex.Message + " Template: " + _templatePath); success = false; return null; } <<<<<<< SaveFile(file.FullName, output); ======= SaveFile(file, output, saveProjectFile); >>>>>>> SaveFile(file, output); <<<<<<< public void RenameFile(string oldPath, string newPath) ======= public void RenameFile(File file, string oldPath, string newPath, bool saveProjectFile) >>>>>>> public void RenameFile(string oldPath, string newPath, bool saveProjectFile) <<<<<<< var newOutputPath = GetOutputPath(newPath); ======= var newOutputPath = GetOutputPath(file); >>>>>>> var newOutputPath = GetOutputPath(file);
<<<<<<< if (inputFrame.FrameReference.SourceKind == MediaFrameSourceKind.Depth) { // Use a special pseudo color to render 16 bits depth frame. var depthScale = (float)inputFrame.DepthMediaFrame.DepthFormat.DepthScaleInMeters; var minReliableDepth = inputFrame.DepthMediaFrame.MinReliableDepth; var maxReliableDepth = inputFrame.DepthMediaFrame.MaxReliableDepth; result = TransformBitmap(inputBitmap, (w, i, o) => PseudoColorHelper.PseudoColorForDepth(w, i, o, depthScale, minReliableDepth, maxReliableDepth)); } else { // Use pseudo color to render 16 bits frames. result = TransformBitmap(inputBitmap, PseudoColorHelper.PseudoColorFor16BitInfrared); } } else if (inputBitmap.BitmapPixelFormat == BitmapPixelFormat.Gray8) { // Use pseudo color to render 8 bits frames. result = TransformBitmap(inputBitmap, PseudoColorHelper.PseudoColorFor8BitInfrared); } else { try { // Convert to Bgra8 Premultiplied SoftwareBitmap, so xaml can display in UI. result = SoftwareBitmap.Convert(inputBitmap, BitmapPixelFormat.Bgra8, BitmapAlphaMode.Premultiplied); } catch (ArgumentException exception) { // Conversion of software bitmap format is not supported. Drop this frame. System.Diagnostics.Debug.WriteLine(exception.Message); } ======= case MediaFrameSourceKind.Color: // XAML requires Bgra8 with premultiplied alpha. // We requested Bgra8 from the MediaFrameReader, so all that's // left is fixing the alpha channel if necessary. if (inputBitmap.BitmapPixelFormat != BitmapPixelFormat.Bgra8) { Debug.WriteLine("Color frame in unexpected format."); } else if (inputBitmap.BitmapAlphaMode == BitmapAlphaMode.Premultiplied) { // Already in the correct format. result = SoftwareBitmap.Copy(inputBitmap); } else { // Convert to premultiplied alpha. result = SoftwareBitmap.Convert(inputBitmap, BitmapPixelFormat.Bgra8, BitmapAlphaMode.Premultiplied); } break; case MediaFrameSourceKind.Depth: // We requested D16 from the MediaFrameReader, so the frame should // be in Gray16 format. if (inputBitmap.BitmapPixelFormat == BitmapPixelFormat.Gray16) { // Use a special pseudo color to render 16 bits depth frame. var depthScale = (float)inputFrame.DepthMediaFrame.DepthFormat.DepthScaleInMeters; result = TransformBitmap(inputBitmap, (w, i, o) => PseudoColorHelper.PseudoColorForDepth(w, i, o, depthScale)); } else { Debug.WriteLine("Depth frame in unexpected format."); } break; case MediaFrameSourceKind.Infrared: // We requested L8 or L16 from the MediaFrameReader, so the frame should // be in Gray8 or Gray16 format. switch (inputBitmap.BitmapPixelFormat) { case BitmapPixelFormat.Gray16: // Use pseudo color to render 16 bits frames. result = TransformBitmap(inputBitmap, PseudoColorHelper.PseudoColorFor16BitInfrared); break; case BitmapPixelFormat.Gray8: // Use pseudo color to render 8 bits frames. result = TransformBitmap(inputBitmap, PseudoColorHelper.PseudoColorFor8BitInfrared); break; default: Debug.WriteLine("Infrared frame in unexpected format."); break; } break; >>>>>>> case MediaFrameSourceKind.Color: // XAML requires Bgra8 with premultiplied alpha. // We requested Bgra8 from the MediaFrameReader, so all that's // left is fixing the alpha channel if necessary. if (inputBitmap.BitmapPixelFormat != BitmapPixelFormat.Bgra8) { Debug.WriteLine("Color frame in unexpected format."); } else if (inputBitmap.BitmapAlphaMode == BitmapAlphaMode.Premultiplied) { // Already in the correct format. result = SoftwareBitmap.Copy(inputBitmap); } else { // Convert to premultiplied alpha. result = SoftwareBitmap.Convert(inputBitmap, BitmapPixelFormat.Bgra8, BitmapAlphaMode.Premultiplied); } break; case MediaFrameSourceKind.Depth: // We requested D16 from the MediaFrameReader, so the frame should // be in Gray16 format. if (inputBitmap.BitmapPixelFormat == BitmapPixelFormat.Gray16) { // Use a special pseudo color to render 16 bits depth frame. var depthScale = (float)inputFrame.DepthMediaFrame.DepthFormat.DepthScaleInMeters; var minReliableDepth = inputFrame.DepthMediaFrame.MinReliableDepth; var maxReliableDepth = inputFrame.DepthMediaFrame.MaxReliableDepth; result = TransformBitmap(inputBitmap, (w, i, o) => PseudoColorHelper.PseudoColorForDepth(w, i, o, depthScale, minReliableDepth, maxReliableDepth)); } else { Debug.WriteLine("Depth frame in unexpected format."); } break; case MediaFrameSourceKind.Infrared: // We requested L8 or L16 from the MediaFrameReader, so the frame should // be in Gray8 or Gray16 format. switch (inputBitmap.BitmapPixelFormat) { case BitmapPixelFormat.Gray16: // Use pseudo color to render 16 bits frames. result = TransformBitmap(inputBitmap, PseudoColorHelper.PseudoColorFor16BitInfrared); break; case BitmapPixelFormat.Gray8: // Use pseudo color to render 8 bits frames. result = TransformBitmap(inputBitmap, PseudoColorHelper.PseudoColorFor8BitInfrared); break; default: Debug.WriteLine("Infrared frame in unexpected format."); break; } break;
<<<<<<< internal void ResetBackoff() { // Logger.Debug("resetting backoff for " + context.PackageName); Context context = Android.App.Application.Context; SetBackoff(DefaultBackOffMilliseconds); } internal int GetBackoff() { Context context = Android.App.Application.Context; var prefs = GetGCMPreferences(context); return prefs.GetInt(PushNotificationKey.BackOffMilliseconds, DefaultBackOffMilliseconds); } internal void SetBackoff(int backoff) { Context context = Android.App.Application.Context; var prefs = GetGCMPreferences(context); var editor = prefs.Edit(); editor.PutInt(PushNotificationKey.BackOffMilliseconds, backoff); editor.Commit(); } public static void CreateNotification(string title, string message) ======= public static void CreateNotification(string title, string message, int notifyId, string tag) >>>>>>> internal void ResetBackoff() { // Logger.Debug("resetting backoff for " + context.PackageName); Context context = Android.App.Application.Context; SetBackoff(DefaultBackOffMilliseconds); } internal int GetBackoff() { Context context = Android.App.Application.Context; var prefs = GetGCMPreferences(context); return prefs.GetInt(PushNotificationKey.BackOffMilliseconds, DefaultBackOffMilliseconds); } internal void SetBackoff(int backoff) { Context context = Android.App.Application.Context; var prefs = GetGCMPreferences(context); var editor = prefs.Edit(); editor.PutInt(PushNotificationKey.BackOffMilliseconds, backoff); editor.Commit(); } public static void CreateNotification(string title, string message, int notifyId, string tag)
<<<<<<< using (var reader = assembly.GetManifestResourceStream("aggregator.cli.Rules.function.json")) ======= using (var stream = assembly.GetManifestResourceStream("aggregator.cli.Rules.function.json")) >>>>>>> using (var stream = assembly.GetManifestResourceStream("aggregator.cli.Rules.function.json")) <<<<<<< _logger.WriteVerbose($"Uploading {Path.GetFileName(file)} to {instance.PlainName}..."); string fileUrl = $"{relativeUrl}{Path.GetFileName(file)}"; ======= logger.WriteVerbose($"Uploading {fileName} to {instance.PlainName}..."); var fileUrl = $"{relativeUrl}{fileName}"; >>>>>>> _logger.WriteVerbose($"Uploading {fileName} to {instance.PlainName}..."); var fileUrl = $"{relativeUrl}{fileName}";
<<<<<<< [Fact] public async Task CustomStringField_HasValue_Succeeds() { int workItemId = 42; WorkItem workItem = new WorkItem { Id = workItemId, Fields = new Dictionary<string, object> { { "System.WorkItemType", "Bug" }, { "System.Title", "Hello" }, { "System.TeamProject", ProjectName }, { "MyOrg.CustomStringField", "some value" }, } }; client.GetWorkItemAsync(workItemId, expand: WorkItemExpand.All).Returns(workItem); string ruleCode = @" var customField = self.GetFieldValue<string>(""MyOrg.CustomStringField"", ""MyDefault""); return customField; "; var engine = new RuleEngine(logger, ruleCode.Mince(), SaveMode.Default, dryRun: true); string result = await engine.ExecuteAsync(projectId, workItem, client, CancellationToken.None); Assert.Equal("some value", result); } [Fact] public async Task CustomStringField_NoValue_ReturnsDefault() { int workItemId = 42; WorkItem workItem = new WorkItem { Id = workItemId, Fields = new Dictionary<string, object> { { "System.WorkItemType", "Bug" }, { "System.Title", "Hello" }, { "System.TeamProject", ProjectName }, } }; client.GetWorkItemAsync(workItemId, expand: WorkItemExpand.All).Returns(workItem); string ruleCode = @" var customField = self.GetFieldValue<string>(""MyOrg.CustomStringField"", ""MyDefault""); return customField; "; var engine = new RuleEngine(logger, ruleCode.Mince(), SaveMode.Default, dryRun: true); string result = await engine.ExecuteAsync(projectId, workItem, client, CancellationToken.None); Assert.Equal("MyDefault", result); } [Fact] public async Task CustomNumericField_HasValue_Succeeds() { int workItemId = 42; WorkItem workItem = new WorkItem { Id = workItemId, Fields = new Dictionary<string, object> { { "System.WorkItemType", "Bug" }, { "System.Title", "Hello" }, { "System.TeamProject", ProjectName }, { "MyOrg.CustomNumericField", 42 }, } }; client.GetWorkItemAsync(workItemId, expand: WorkItemExpand.All).Returns(workItem); string ruleCode = @" var customField = self.GetFieldValue<decimal>(""MyOrg.CustomNumericField"", 3.0m); return customField.ToString(""N""); "; var engine = new RuleEngine(logger, ruleCode.Mince(), SaveMode.Default, dryRun: true); string result = await engine.ExecuteAsync(projectId, workItem, client, CancellationToken.None); Assert.Equal("42.00", result); } [Fact] public async Task CustomNumericField_NoValue_ReturnsDefault() { int workItemId = 42; WorkItem workItem = new WorkItem { Id = workItemId, Fields = new Dictionary<string, object> { { "System.WorkItemType", "Bug" }, { "System.Title", "Hello" }, { "System.TeamProject", ProjectName }, } }; client.GetWorkItemAsync(workItemId, expand: WorkItemExpand.All).Returns(workItem); string ruleCode = @" var customField = self.GetFieldValue<decimal>(""MyOrg.CustomNumericField"", 3.0m); return customField.ToString(""N""); "; var engine = new RuleEngine(logger, ruleCode.Mince(), SaveMode.Default, dryRun: true); string result = await engine.ExecuteAsync(projectId, workItem, client, CancellationToken.None); Assert.Equal("3.00", result); } ======= [Fact] public async Task HelloWorldRuleOnUpdate_Succeeds() { var workItem = ExampleTestData.Instance.WorkItem; var workItemUpdate = ExampleTestData.Instance.WorkItemUpdateFields; client.GetWorkItemAsync(workItem.Id.Value, expand: WorkItemExpand.All).Returns(workItem); string ruleCode = @" return $""Hello #{ selfChanges.WorkItemId } - Update { selfChanges.Id } changed Title from { selfChanges.Fields[""System.Title""].OldValue } to { selfChanges.Fields[""System.Title""].NewValue }!""; "; var engine = new RuleEngine(logger, ruleCode.Mince(), SaveMode.Default, dryRun: true); string result = await engine.ExecuteAsync(projectId, new WorkItemData(workItem, workItemUpdate), client, CancellationToken.None); Assert.Equal("Hello #22 - Update 3 changed Title from Initial Title to Hello!", result); await client.DidNotReceive().GetWorkItemAsync(Arg.Any<int>(), expand: Arg.Any<WorkItemExpand>()); } [Fact] public async Task DocumentationRuleOnUpdateExample_Succeeds() { var workItem = ExampleTestData.Instance.WorkItem; var workItemUpdate = ExampleTestData.Instance.WorkItemUpdateFields; client.GetWorkItemAsync(workItem.Id.Value, expand: WorkItemExpand.All).Returns(workItem); string ruleCode = @" if (selfChanges.Fields.ContainsKey(""System.Title"")) { var titleUpdate = selfChanges.Fields[""System.Title""]; return $""Title was changed from '{titleUpdate.OldValue}' to '{titleUpdate.NewValue}'""; } else { return ""Title was not updated""; } "; var engine = new RuleEngine(logger, ruleCode.Mince(), SaveMode.Default, dryRun: true); string result = await engine.ExecuteAsync(projectId, new WorkItemData(workItem, workItemUpdate), client, CancellationToken.None); Assert.Equal("Title was changed from 'Initial Title' to 'Hello'", result); await client.DidNotReceive().GetWorkItemAsync(Arg.Any<int>(), expand: Arg.Any<WorkItemExpand>()); } >>>>>>> [Fact] public async Task HelloWorldRuleOnUpdate_Succeeds() { var workItem = ExampleTestData.Instance.WorkItem; var workItemUpdate = ExampleTestData.Instance.WorkItemUpdateFields; client.GetWorkItemAsync(workItem.Id.Value, expand: WorkItemExpand.All).Returns(workItem); string ruleCode = @" return $""Hello #{ selfChanges.WorkItemId } - Update { selfChanges.Id } changed Title from { selfChanges.Fields[""System.Title""].OldValue } to { selfChanges.Fields[""System.Title""].NewValue }!""; "; var engine = new RuleEngine(logger, ruleCode.Mince(), SaveMode.Default, dryRun: true); string result = await engine.ExecuteAsync(projectId, new WorkItemData(workItem, workItemUpdate), client, CancellationToken.None); Assert.Equal("Hello #22 - Update 3 changed Title from Initial Title to Hello!", result); await client.DidNotReceive().GetWorkItemAsync(Arg.Any<int>(), expand: Arg.Any<WorkItemExpand>()); } [Fact] public async Task DocumentationRuleOnUpdateExample_Succeeds() { var workItem = ExampleTestData.Instance.WorkItem; var workItemUpdate = ExampleTestData.Instance.WorkItemUpdateFields; client.GetWorkItemAsync(workItem.Id.Value, expand: WorkItemExpand.All).Returns(workItem); string ruleCode = @" if (selfChanges.Fields.ContainsKey(""System.Title"")) { var titleUpdate = selfChanges.Fields[""System.Title""]; return $""Title was changed from '{titleUpdate.OldValue}' to '{titleUpdate.NewValue}'""; } else { return ""Title was not updated""; } "; var engine = new RuleEngine(logger, ruleCode.Mince(), SaveMode.Default, dryRun: true); string result = await engine.ExecuteAsync(projectId, new WorkItemData(workItem, workItemUpdate), client, CancellationToken.None); Assert.Equal("Title was changed from 'Initial Title' to 'Hello'", result); await client.DidNotReceive().GetWorkItemAsync(Arg.Any<int>(), expand: Arg.Any<WorkItemExpand>()); } [Fact] public async Task CustomStringField_HasValue_Succeeds() { int workItemId = 42; WorkItem workItem = new WorkItem { Id = workItemId, Fields = new Dictionary<string, object> { { "System.WorkItemType", "Bug" }, { "System.Title", "Hello" }, { "System.TeamProject", ProjectName }, { "MyOrg.CustomStringField", "some value" }, } }; client.GetWorkItemAsync(workItemId, expand: WorkItemExpand.All).Returns(workItem); string ruleCode = @" var customField = self.GetFieldValue<string>(""MyOrg.CustomStringField"", ""MyDefault""); return customField; "; var engine = new RuleEngine(logger, ruleCode.Mince(), SaveMode.Default, dryRun: true); string result = await engine.ExecuteAsync(projectId, workItem, client, CancellationToken.None); Assert.Equal("some value", result); } [Fact] public async Task CustomStringField_NoValue_ReturnsDefault() { int workItemId = 42; WorkItem workItem = new WorkItem { Id = workItemId, Fields = new Dictionary<string, object> { { "System.WorkItemType", "Bug" }, { "System.Title", "Hello" }, { "System.TeamProject", ProjectName }, } }; client.GetWorkItemAsync(workItemId, expand: WorkItemExpand.All).Returns(workItem); string ruleCode = @" var customField = self.GetFieldValue<string>(""MyOrg.CustomStringField"", ""MyDefault""); return customField; "; var engine = new RuleEngine(logger, ruleCode.Mince(), SaveMode.Default, dryRun: true); string result = await engine.ExecuteAsync(projectId, workItem, client, CancellationToken.None); Assert.Equal("MyDefault", result); } [Fact] public async Task CustomNumericField_HasValue_Succeeds() { int workItemId = 42; WorkItem workItem = new WorkItem { Id = workItemId, Fields = new Dictionary<string, object> { { "System.WorkItemType", "Bug" }, { "System.Title", "Hello" }, { "System.TeamProject", ProjectName }, { "MyOrg.CustomNumericField", 42 }, } }; client.GetWorkItemAsync(workItemId, expand: WorkItemExpand.All).Returns(workItem); string ruleCode = @" var customField = self.GetFieldValue<decimal>(""MyOrg.CustomNumericField"", 3.0m); return customField.ToString(""N""); "; var engine = new RuleEngine(logger, ruleCode.Mince(), SaveMode.Default, dryRun: true); string result = await engine.ExecuteAsync(projectId, workItem, client, CancellationToken.None); Assert.Equal("42.00", result); } [Fact] public async Task CustomNumericField_NoValue_ReturnsDefault() { int workItemId = 42; WorkItem workItem = new WorkItem { Id = workItemId, Fields = new Dictionary<string, object> { { "System.WorkItemType", "Bug" }, { "System.Title", "Hello" }, { "System.TeamProject", ProjectName }, } }; client.GetWorkItemAsync(workItemId, expand: WorkItemExpand.All).Returns(workItem); string ruleCode = @" var customField = self.GetFieldValue<decimal>(""MyOrg.CustomNumericField"", 3.0m); return customField.ToString(""N""); "; var engine = new RuleEngine(logger, ruleCode.Mince(), SaveMode.Default, dryRun: true); string result = await engine.ExecuteAsync(projectId, workItem, client, CancellationToken.None); Assert.Equal("3.00", result); }
<<<<<<< using System.Linq; ======= >>>>>>> using System.Linq; <<<<<<< else { _logger.WriteError($"{response.ReasonPhrase} {await response.Content.ReadAsStringAsync()}"); return new KuduFunction[0]; } ======= logger.WriteError($"{response.ReasonPhrase} {await response.Content.ReadAsStringAsync()}"); return new KuduFunction[0]; >>>>>>> _logger.WriteError($"{response.ReasonPhrase} {await response.Content.ReadAsStringAsync()}"); return new KuduFunction[0]; <<<<<<< else { string error = await response.Content.ReadAsStringAsync(); _logger.WriteError($"Failed to retrieve function key: {error}"); throw new ApplicationException("Failed to retrieve function key."); } ======= string error = await response.Content.ReadAsStringAsync(); logger.WriteError($"Failed to retrieve function key: {error}"); throw new InvalidOperationException("Failed to retrieve function key."); >>>>>>> string error = await response.Content.ReadAsStringAsync(); _logger.WriteError($"Failed to retrieve function key: {error}"); throw new InvalidOperationException("Failed to retrieve function key."); <<<<<<< var ruleContent = await File.ReadAllLinesAsync(filePath); var engineLogger = new EngineWrapperLogger(_logger); try { var ruleEngine = new Engine.RuleEngine(engineLogger, ruleContent, SaveMode.Batch, true); (var success, var diagnostics) = ruleEngine.VerifyRule(); if (success) { _logger.WriteInfo($"Rule file is valid"); } else { _logger.WriteInfo($"Rule file is invalid"); var messages = string.Join('\n', diagnostics.Select(d => d.ToString())); if (!string.IsNullOrEmpty(messages)) { _logger.WriteError($"Errors in the rule file {filePath}:\n{messages}"); } return false; } } catch { _logger.WriteInfo($"Rule file is invalid"); return false; } _logger.WriteVerbose($"Layout rule files"); string baseDirPath = LayoutRuleFiles(name, filePath); _logger.WriteInfo($"Packaging {filePath} into rule {name} complete."); ======= logger.WriteVerbose($"Layout rule files"); string baseDirPath = await LayoutRuleFilesAsync(name, filePath); logger.WriteInfo($"Packaging {filePath} into rule {name} complete."); >>>>>>> var ruleContent = await File.ReadAllLinesAsync(filePath); var engineLogger = new EngineWrapperLogger(_logger); try { var ruleEngine = new Engine.RuleEngine(engineLogger, ruleContent, SaveMode.Batch, true); (var success, var diagnostics) = ruleEngine.VerifyRule(); if (success) { _logger.WriteInfo($"Rule file is valid"); } else { _logger.WriteInfo($"Rule file is invalid"); var messages = string.Join('\n', diagnostics.Select(d => d.ToString())); if (!string.IsNullOrEmpty(messages)) { _logger.WriteError($"Errors in the rule file {filePath}:\n{messages}"); } return false; } } catch { _logger.WriteInfo($"Rule file is invalid"); return false; } _logger.WriteVerbose($"Layout rule files"); string baseDirPath = await LayoutRuleFilesAsync(name, filePath); _logger.WriteInfo($"Packaging {filePath} into rule {name} complete."); <<<<<<< _logger.WriteInfo($"Function {name} created."); ======= logger.WriteInfo($"Function {name} created."); >>>>>>> _logger.WriteInfo($"Function {name} created."); <<<<<<< _logger.WriteInfo($"{Path.GetFileName(file)} uploaded to {instance.PlainName}."); } ======= logger.WriteInfo($"{Path.GetFileName(file)} uploaded to {instance.PlainName}."); }//for >>>>>>> _logger.WriteInfo($"{Path.GetFileName(file)} uploaded to {instance.PlainName}."); }//for <<<<<<< else { _logger.WriteError($"Failed with {response.ReasonPhrase}"); return false; } ======= logger.WriteError($"Failed with {response.ReasonPhrase}"); return false; >>>>>>> _logger.WriteError($"Failed with {response.ReasonPhrase}"); return false;
<<<<<<< ======= CleanupRuleFiles(baseDirPath); logger.WriteInfo($"Cleaned local working directory."); >>>>>>> <<<<<<< private async Task<bool> UploadRuleFilesAsync(InstanceName instance, string name, IDictionary<string, string> inMemoryFiles) ======= void CleanupRuleFiles(string baseDirPath) { // clean-up: everything is in memory Directory.Delete(baseDirPath, true); } private async Task<bool> UploadRuleFiles(InstanceName instance, string name, string baseDirPath, CancellationToken cancellationToken) >>>>>>> private async Task<bool> UploadRuleFilesAsync(InstanceName instance, string name, IDictionary<string, string> inMemoryFiles, CancellationToken cancellationToken) <<<<<<< _logger.WriteVerbose($"Creating function {name} in {instance.PlainName}..."); using (var request = await kudu.GetRequestAsync(HttpMethod.Put, relativeUrl)) ======= logger.WriteVerbose($"Creating function {name} in {instance.PlainName}..."); using (var request = await kudu.GetRequestAsync(HttpMethod.Put, relativeUrl, cancellationToken)) >>>>>>> _logger.WriteVerbose($"Creating function {name} in {instance.PlainName}..."); using (var request = await kudu.GetRequestAsync(HttpMethod.Put, relativeUrl, cancellationToken)) <<<<<<< _logger.WriteVerbose($"Uploading {fileName} to {instance.PlainName}..."); var fileUrl = $"{relativeUrl}{fileName}"; using (var request = await kudu.GetRequestAsync(HttpMethod.Put, fileUrl)) ======= logger.WriteVerbose($"Uploading {Path.GetFileName(file)} to {instance.PlainName}..."); string fileUrl = $"{relativeUrl}{Path.GetFileName(file)}"; using (var request = await kudu.GetRequestAsync(HttpMethod.Put, fileUrl, cancellationToken)) >>>>>>> _logger.WriteVerbose($"Uploading {fileName} to {instance.PlainName}..."); var fileUrl = $"{relativeUrl}{fileName}"; using (var request = await kudu.GetRequestAsync(HttpMethod.Put, fileUrl, cancellationToken)) <<<<<<< request.Content = new StringContent(fileContent); using (var response = await client.SendAsync(request)) ======= request.Content = new StringContent(File.ReadAllText(file)); using (var response = await client.SendAsync(request, cancellationToken)) >>>>>>> request.Content = new StringContent(fileContent); using (var response = await client.SendAsync(request, cancellationToken)) <<<<<<< var kudu = new KuduApi(instance, _azure, _logger); var instances = new AggregatorInstances(_azure, _logger); ======= var kudu = new KuduApi(instance, azure, logger); >>>>>>> var kudu = new KuduApi(instance, _azure, _logger); <<<<<<< var package = new FunctionRuntimePackage(_logger); bool ok = await package.UpdateVersion(requiredVersion, instance, _azure); ======= var package = new FunctionRuntimePackage(logger); bool ok = await package.UpdateVersionAsync(requiredVersion, instance, azure, cancellationToken); >>>>>>> var package = new FunctionRuntimePackage(_logger); bool ok = await package.UpdateVersionAsync(requiredVersion, instance, _azure, cancellationToken); <<<<<<< await devops.ConnectAsync(); _logger.WriteInfo($"Connected to Azure DevOps"); ======= await devops.ConnectAsync(cancellationToken); logger.WriteInfo($"Connected to Azure DevOps"); >>>>>>> await devops.ConnectAsync(cancellationToken); _logger.WriteInfo($"Connected to Azure DevOps"); <<<<<<< _logger.WriteVerbose($"Rule code found at {ruleFilePath}"); string[] ruleCode = File.ReadAllLines(ruleFilePath); ======= logger.WriteVerbose($"Rule code found at {ruleFilePath}"); var ruleCode = await File.ReadAllLinesAsync(ruleFilePath, cancellationToken); >>>>>>> _logger.WriteVerbose($"Rule code found at {ruleFilePath}"); var ruleCode = await File.ReadAllLinesAsync(ruleFilePath, cancellationToken); <<<<<<< string result = await engine.ExecuteAsync(collectionUrl, teamProjectId, teamProjectName, devopsLogonData.Token, workItemId, witClient); _logger.WriteInfo($"Rule returned '{result}'"); ======= string result = await engine.ExecuteAsync(collectionUrl, teamProjectId, teamProjectName, devopsLogonData.Token, workItemId, witClient, cancellationToken); logger.WriteInfo($"Rule returned '{result}'"); >>>>>>> string result = await engine.ExecuteAsync(collectionUrl, teamProjectId, teamProjectName, devopsLogonData.Token, workItemId, witClient, cancellationToken); _logger.WriteInfo($"Rule returned '{result}'"); <<<<<<< var kudu = new KuduApi(instance, _azure, _logger); ======= >>>>>>> <<<<<<< _logger.WriteVerbose($"Retrieving {ruleName} Function Key..."); (string ruleUrl, string ruleKey) = await this.GetInvocationUrlAndKey(instance, ruleName); _logger.WriteInfo($"{ruleName} Function Key retrieved."); ======= logger.WriteVerbose($"Retrieving {ruleName} Function Key..."); var (ruleUrl, ruleKey) = await GetInvocationUrlAndKey(instance, ruleName, cancellationToken); logger.WriteInfo($"{ruleName} Function Key retrieved."); >>>>>>> _logger.WriteVerbose($"Retrieving {ruleName} Function Key..."); var (ruleUrl, ruleKey) = await GetInvocationUrlAndKey(instance, ruleName, cancellationToken); _logger.WriteInfo($"{ruleName} Function Key retrieved.");
<<<<<<< public static bool SubStringTest() { string main = "abcdefghi"; string sub1 = main.Substring(6); string sub2 = main.Substring(0, 3); return string.Equals("ghi", sub1) && string.Equals("abc", sub2); } public static bool IndexOfTest() { string main = "abcdefghi"; return main.IndexOf('c') == 2; } public static bool LengthTest() { string main = "123456789"; ======= public static bool SubStringTest() { string main = "abcdefghi"; string sub = main.Substring(6); return string.Equals("ghi", sub); } public static bool IndexOfTest() { string main = "abcdefghi"; return main.IndexOf('c') == 2; } public static bool LengthTest() { string main = "123456789"; >>>>>>> public static bool SubStringTest() { string main = "abcdefghi"; string sub1 = main.Substring(6); string sub2 = main.Substring(0, 3); return string.Equals("ghi", sub); } public static bool IndexOfTest() { string main = "abcdefghi"; return main.IndexOf('c') == 2; } public static bool LengthTest() { string main = "123456789";
<<<<<<< text = text ?? string.Empty; style.SetPainter("self", StyleState.Normal); //textInfo = new TextInfo2(new TextSpan2(text, style.GetTextStyle())); // textInfo.UpdateSpan(0, text); // textInfo.Layout(); ======= >>>>>>> text = text ?? string.Empty; style.SetPainter("self", StyleState.Normal); //textInfo = new TextInfo2(new TextSpan2(text, style.GetTextStyle())); // textInfo.UpdateSpan(0, text); // textInfo.Layout(); <<<<<<< // textInfo = new TextInfo2(new TextSpan(text, style.GetTextStyle())); // textInfo.UpdateSpan(0, text); // textInfo.Layout(); ======= style.SetTextWhitespaceMode(WhitespaceMode.PreserveNewLines, StyleState.Normal); textInfo = new TextInfo(new TextSpan(text, style.GetTextStyle())); textInfo.UpdateSpan(0, text); textInfo.Layout(); Application.InputSystem.RegisterFocusable(this); >>>>>>> // textInfo = new TextInfo2(new TextSpan(text, style.GetTextStyle())); // textInfo.UpdateSpan(0, text); // textInfo.Layout(); // style.SetTextWhitespaceMode(WhitespaceMode.PreserveNewLines, StyleState.Normal); // textInfo = new TextInfo(new TextSpan(text, style.GetTextStyle())); // textInfo.UpdateSpan(0, text); // textInfo.Layout(); Application.InputSystem.RegisterFocusable(this);
<<<<<<< ======= int soundCount = 0; >>>>>>> int soundCount = 0; <<<<<<< if (optionName == nameof(AnimationOptions.duration)) { options.duration = (int) StylePropertyMappers.MapNumber(value, context); ======= switch (optionName) { case nameof(AnimationOptions.duration): options.duration = StylePropertyMappers.MapUITimeMeasurement(value, context); break; case nameof(AnimationOptions.iterations): options.iterations = (int) StylePropertyMappers.MapNumberOrInfinite(value, context); break; case nameof(AnimationOptions.loopTime): options.loopTime = StylePropertyMappers.MapNumber(value, context); break; case nameof(AnimationOptions.delay): options.delay = StylePropertyMappers.MapUITimeMeasurement(value, context); break; case nameof(AnimationOptions.direction): options.direction = StylePropertyMappers.MapEnum<AnimationDirection>(value, context); break; case nameof(AnimationOptions.loopType): options.loopType = StylePropertyMappers.MapEnum<AnimationLoopType>(value, context); break; case nameof(AnimationOptions.forwardStartDelay): options.forwardStartDelay = (int)StylePropertyMappers.MapNumber(value, context); break; case nameof(AnimationOptions.reverseStartDelay): options.reverseStartDelay = (int)StylePropertyMappers.MapNumber(value, context); break; case nameof(AnimationOptions.timingFunction): options.timingFunction = StylePropertyMappers.MapEnum<EasingFunction>(value, context); break; default: throw new CompileException(optionNodes[i], "Invalid option argument for animation"); >>>>>>> switch (optionName) { case nameof(AnimationOptions.duration): options.duration = StylePropertyMappers.MapUITimeMeasurement(value, context); break; case nameof(AnimationOptions.iterations): options.iterations = (int) StylePropertyMappers.MapNumberOrInfinite(value, context); break; case nameof(AnimationOptions.loopTime): options.loopTime = StylePropertyMappers.MapNumber(value, context); break; case nameof(AnimationOptions.delay): options.delay = StylePropertyMappers.MapUITimeMeasurement(value, context); break; case nameof(AnimationOptions.direction): options.direction = StylePropertyMappers.MapEnum<AnimationDirection>(value, context); break; case nameof(AnimationOptions.loopType): options.loopType = StylePropertyMappers.MapEnum<AnimationLoopType>(value, context); break; case nameof(AnimationOptions.forwardStartDelay): options.forwardStartDelay = (int)StylePropertyMappers.MapNumber(value, context); break; case nameof(AnimationOptions.reverseStartDelay): options.reverseStartDelay = (int)StylePropertyMappers.MapNumber(value, context); break; case nameof(AnimationOptions.timingFunction): options.timingFunction = StylePropertyMappers.MapEnum<EasingFunction>(value, context); break; default: throw new CompileException(optionNodes[i], "Invalid option argument for animation"); <<<<<<< else if (optionName == nameof(AnimationOptions.loopTime)) { options.loopTime = StylePropertyMappers.MapNumber(value, context); } else if (optionName == nameof(AnimationOptions.delay)) { options.delay = StylePropertyMappers.MapNumber(value, context); } else if (optionName == nameof(AnimationOptions.direction)) { options.direction = StylePropertyMappers.MapEnum<AnimationDirection>(value, context); } else if (optionName == nameof(AnimationOptions.loopType)) { options.loopType = StylePropertyMappers.MapEnum<AnimationLoopType>(value, context); } else if (optionName == nameof(AnimationOptions.playbackType)) { options.playbackType = StylePropertyMappers.MapEnum<AnimationPlaybackType>(value, context); } else if (optionName == nameof(AnimationOptions.forwardStartDelay)) { options.forwardStartDelay = (int) StylePropertyMappers.MapNumber(value, context); } else if (optionName == nameof(AnimationOptions.reverseStartDelay)) { options.reverseStartDelay = (int) StylePropertyMappers.MapNumber(value, context); ======= else { throw new CompileException(spriteSheetProperties[i], "Invalid option argument for animation"); >>>>>>> else { throw new CompileException(spriteSheetProperties[i], "Invalid option argument for animation"); <<<<<<< CompileStyleGroups(styleRoot, styleType, scratchGroupList, defaultGroup, styleSheetAnimations); ======= CompileStyleGroups(styleRoot, styleType, styleGroups, defaultGroup, styleSheetAnimations, uiSoundData); >>>>>>> CompileStyleGroups(styleRoot, styleType, scratchGroupList, defaultGroup, styleSheetAnimations, uiSoundData); <<<<<<< private void CompileStyleGroups(StyleNodeContainer root, StyleType styleType, LightList<UIStyleGroup> groups, UIStyleGroup targetGroup, AnimationData[] styleSheetAnimations) { ======= private void CompileStyleGroups(StyleNodeContainer root, StyleType styleType, LightList<UIStyleGroup> groups, UIStyleGroup targetGroup, AnimationData[] styleSheetAnimations, UISoundData[] uiSoundData) { >>>>>>> private void CompileStyleGroups(StyleNodeContainer root, StyleType styleType, LightList<UIStyleGroup> groups, UIStyleGroup targetGroup, AnimationData[] styleSheetAnimations, UISoundData[] uiSoundData) { <<<<<<< if (runNode.commmand is AnimationCommandNode animationCommandNode) { UIStyleRunCommand cmd = new UIStyleRunCommand() { style = targetGroup.normal.style, runCommands = targetGroup.normal.runCommands ?? new LightList<IRunCommand>(4) }; ======= UIStyleRunCommand cmd = new UIStyleRunCommand() { style = targetGroup.normal.style, runCommands = targetGroup.normal.runCommands ?? new LightList<IRunCommand>(4) }; if (runNode.command is AnimationCommandNode animationCommandNode) { >>>>>>> UIStyleRunCommand cmd = new UIStyleRunCommand() { style = targetGroup.normal.style, runCommands = targetGroup.normal.runCommands ?? new LightList<IRunCommand>(4) }; if (runNode.command is AnimationCommandNode animationCommandNode) { <<<<<<< cmd.runCommands.Add(new AnimationRunCommand(animationCommandNode.isExit, animationCommandNode.runAction) { animationData = FindAnimationData(styleSheetAnimations, animationCommandNode.animationName), }); ======= cmd.runCommands.Add(MapAnimationRunCommand(styleSheetAnimations, animationCommandNode)); } private AnimationRunCommand MapAnimationRunCommand(AnimationData[] styleSheetAnimations, AnimationCommandNode animationCommandNode) { return new AnimationRunCommand(animationCommandNode.isExit, animationCommandNode.runAction) { animationData = FindAnimationData(styleSheetAnimations, animationCommandNode.animationName), }; >>>>>>> cmd.runCommands.Add(MapAnimationRunCommand(styleSheetAnimations, animationCommandNode)); } private AnimationRunCommand MapAnimationRunCommand(AnimationData[] styleSheetAnimations, AnimationCommandNode animationCommandNode) { return new AnimationRunCommand(animationCommandNode.isExit, animationCommandNode.runAction) { animationData = FindAnimationData(styleSheetAnimations, animationCommandNode.animationName), }; <<<<<<< case RunNode runNode: if (runNode.commmand is AnimationCommandNode animationCommandNode) { targetStyle.runCommands = targetStyle.runCommands ?? new LightList<IRunCommand>(4); ======= case RunNode runNode : targetStyle.runCommands = targetStyle.runCommands ?? new LightList<IRunCommand>(4); if (runNode.command is AnimationCommandNode animationCommandNode) { >>>>>>> case RunNode runNode : targetStyle.runCommands = targetStyle.runCommands ?? new LightList<IRunCommand>(4); if (runNode.command is AnimationCommandNode animationCommandNode) { <<<<<<< ======= else if (runNode.command is SoundCommandNode soundCommandNode) { MapSoundCommand(soundData, targetStyle, soundCommandNode); } >>>>>>> else if (runNode.command is SoundCommandNode soundCommandNode) { MapSoundCommand(soundData, targetStyle, soundCommandNode); }
<<<<<<< using UIForia.Layout; using UIForia.Parsing.Expression; ======= using UIForia.Layout; using UIForia.Parsing; using UIForia.Parsing.Expressions; >>>>>>> using UIForia.Layout; using UIForia.Parsing; using UIForia.Parsing.Expressions; <<<<<<< internal int frameId; protected internal readonly List<UIView> m_Views; ======= internal CompiledTemplateData templateData; >>>>>>> internal CompiledTemplateData templateData; internal int frameId; <<<<<<< m_BindingSystem = new BindingSystem(); m_LayoutSystem = new AwesomeLayoutSystem(this); ======= m_LayoutSystem = new FastLayoutSystem(this, m_StyleSystem); >>>>>>> m_LayoutSystem = new AwesomeLayoutSystem(this); <<<<<<< // SetTraversalIndex(); ======= SetTraversalIndex(); >>>>>>> <<<<<<< ======= UnsetEnabledThisFrame(); } // todo -- get rid of this private void UnsetEnabledThisFrame() { LightStack<UIElement> stack = LightStack<UIElement>.Get(); for (int i = 0; i < m_Views.Count; i++) { stack.Push(m_Views[i].dummyRoot); } while (stack.size > 0) { UIElement currentElement = stack.array[--stack.size]; currentElement.flags &= ~(UIElementFlags.EnabledThisFrame | UIElementFlags.DisabledThisFrame); if (currentElement.children == null) { continue; } UIElement[] childArray = currentElement.children.array; int childCount = currentElement.children.size; stack.EnsureAdditionalCapacity(childCount); for (int i = 0; i < childCount; i++) { stack.array[stack.size++] = childArray[i]; } } LightStack<UIElement>.Release(ref stack); } private void SetTraversalIndex() { LightStack<UIElement> stack = LightStack<UIElement>.Get(); for (int i = 0; i < m_Views.Count; i++) { stack.Push(m_Views[i].dummyRoot); } int idx = 0; while (stack.size > 0) { UIElement currentElement = stack.array[--stack.size]; currentElement.depthTraversalIndex = idx++; UIElement[] childArray = currentElement.children.array; int childCount = currentElement.children.size; stack.EnsureAdditionalCapacity(childCount); for (int i = childCount - 1; i >= 0; i--) { // todo -- direct flag check if (childArray[i].isDisabled) { continue; } stack.array[stack.size++] = childArray[i]; } } LightStack<UIElement>.Release(ref stack); >>>>>>> <<<<<<< // if ((child.flags & UIElementFlags.HasBeenEnabled) == 0) { // child.View.ElementCreated(child); // } ======= if ((child.flags & UIElementFlags.HasBeenEnabled) == 0) { child.View.ElementCreated(child); // run once bindings if present } >>>>>>> if ((child.flags & UIElementFlags.HasBeenEnabled) == 0) { child.View.ElementCreated(child); // run once bindings if present } <<<<<<< ======= internal void InsertChild(UIElement parent, CompiledTemplate template, int index) { // UIElement ptr = parent; // LinqBindingNode bindingNode = null; // // while (ptr != null) { // bindingNode = ptr.bindingNode; // // if (bindingNode != null) { // break; // } // // ptr = ptr.parent; // } // // TemplateScope2 templateScope = new TemplateScope2(this, null); // UIElement root = elementPool.Get(template.elementType); // root.siblingIndex = index; // // if (parent.isEnabled) { // root.flags |= UIElementFlags.AncestorEnabled; // } // // root.depth = parent.depth + 1; // root.View = parent.View; // template.Create(root, templateScope); // // parent.children.Insert(index, root); } >>>>>>> internal void InsertChild(UIElement parent, CompiledTemplate template, int index) { // UIElement ptr = parent; // LinqBindingNode bindingNode = null; // // while (ptr != null) { // bindingNode = ptr.bindingNode; // // if (bindingNode != null) { // break; // } // // ptr = ptr.parent; // } // // TemplateScope2 templateScope = new TemplateScope2(this, null); // UIElement root = elementPool.Get(template.elementType); // root.siblingIndex = index; // // if (parent.isEnabled) { // root.flags |= UIElementFlags.AncestorEnabled; // } // // root.depth = parent.depth + 1; // root.View = parent.View; // template.Create(root, templateScope); // // parent.children.Insert(index, root); } <<<<<<< view.EndAddingElements(); ======= LightStack<UIElement>.Release(ref stack); >>>>>>>
<<<<<<< using UIForia.Layout; using UIForia.Parsing; ======= using UIForia.Parsing.Expression; >>>>>>> using UIForia.Layout; using UIForia.Parsing; <<<<<<< protected LinqBindingSystem linqBindingSystem; ======= protected UISoundSystem m_UISoundSystem; >>>>>>> protected UISoundSystem m_UISoundSystem; protected LinqBindingSystem linqBindingSystem; <<<<<<< // public event Action<UIElement> onElementCreated; ======= >>>>>>> // public event Action<UIElement> onElementCreated; <<<<<<< linqBindingSystem = new LinqBindingSystem(); ======= m_UISoundSystem = new UISoundSystem(); styleImporter = new StyleSheetImporter(this); templateParser = new TemplateParser(this); >>>>>>> linqBindingSystem = new LinqBindingSystem(); m_UISoundSystem = new UISoundSystem(); <<<<<<< // TemplateSettings settings = new TemplateSettings(); // settings.applicationName = frameId.ToString(); // settings.assemblyName = "Assembly-CSharp"; // settings.outputPath = Path.Combine(UnityEngine.Application.dataPath, "UIForiaGenerated"); // settings.codeFileExtension = "generated.cs"; // settings.preCompiledTemplatePath = "Assets/UIForia_Generated/" + frameId; // settings.templateResolutionBasePath = Path.Combine(UnityEngine.Application.dataPath); // TemplateCompiler compiler = new TemplateCompiler(settings); // // CompiledTemplateData compiledOutput = new RuntimeTemplateData(settings); // // Debug.Log("Starting"); // Stopwatch watch = new Stopwatch(); // watch.Start(); // compiler.CompileTemplates(m_Views[0].RootElement.GetType(), compiledOutput); // watch.Stop(); // Debug.Log("loaded app in " + watch.ElapsedMilliseconds); // ======= >>>>>>> <<<<<<< linqBindingSystem.OnUpdate(); ======= bindingTimer.Reset(); bindingTimer.Start(); m_BindingSystem.OnUpdate(); bindingTimer.Stop(); >>>>>>> bindingTimer.Reset(); bindingTimer.Start(); linqBindingSystem.OnUpdate(); bindingTimer.Stop(); <<<<<<< ======= layoutTimer.Reset(); layoutTimer.Start(); >>>>>>> layoutTimer.Reset(); layoutTimer.Start(); <<<<<<< elemRefStack.Push(new ElemRef() {element = child}); ======= /* * It is possible that an element, while being inserted, creates views on its own * during the "current.OnCreate();" method call some lines down. This would * trigger a call to this method and while in the recursive execution of Insert * the elementRefStack would be emptied and at least the view assignment would be * wrong. An element of the default view might create a view, its inserted elements * would be processed in recursion here, finding an elemRefStack that contains * elements from the default view. Well anyway, this is a quick fix. */ bool isRecursiveElementCreation = this.elemRefStack.Count > 0; StructStack<ElemRef> elemRefStack = isRecursiveElementCreation ? StructStack<ElemRef>.Get() : this.elemRefStack; elemRefStack.Push(new ElemRef() {element = child}); view.BeginAddingElements(); >>>>>>> StructStack<ElemRef> elemRefStack = StructStack<ElemRef>.Get(); elemRefStack.Push(new ElemRef() {element = child}); <<<<<<< for (int i = 0; i < parent.children.size; i++) { parent.children.array[i].siblingIndex = i; ======= if (isRecursiveElementCreation) { // ...see the lengthy comment above, this is part of that bugfix. StructStack<ElemRef>.Release(ref elemRefStack); } for (int i = 0; i < parent.children.Count; i++) { parent.children[i].siblingIndex = i; >>>>>>> for (int i = 0; i < parent.children.size; i++) { parent.children.array[i].siblingIndex = i; } for (int i = 0; i < parent.children.Count; i++) { parent.children[i].siblingIndex = i; <<<<<<< // might be the same as HydrateTemplate really but with templateId not hard coded public UIElement CreateSlot(int templateId, UIElement root, UIElement parent, TemplateScope scope) { throw new NotImplementedException("Deprecate"); } public UIElement CreateSlot2(string slotName, TemplateScope scope, int defaultSlotId, UIElement root, UIElement parent) { int slotId = ResolveSlotId(slotName, scope.slotInputs, defaultSlotId, out UIElement contextRoot); if (contextRoot == null) { Assert.AreEqual(slotId, defaultSlotId); contextRoot = root; } UIElement retn = templateData.slots[slotId](contextRoot, parent, scope); // retn.bindingNode = new LinqBindingNode(); retn.View = parent.View; return retn; } // todo -- override that accepts an index into an array instead of a type, to save a dictionary lookup // todo -- don't create a list for every type, maybe a single pool list w/ sorting & a jump search or similar // todo -- register element in type map for selectors, might need to support subclass matching ie <KlangButton> and <OtherButton> with matching on <Button> // todo -- make children a linked list instead /// Returns the shell of a UI Element, space is allocated for children but no child data is associated yet, only a parent, view, and depth public UIElement CreateElementFromPool(int typeId, UIElement parent, int childCount, int attributeCount, int originTemplateId) { // children get assigned in the template function but we need to setup the list here UIElement retn = templateData.ConstructElement(typeId); retn.templateMetaData = templateData.templateMetaData[originTemplateId]; retn.id = NextElementId; retn.style = new UIStyleSet(retn); retn.layoutResult = new LayoutResult(retn); retn.flags = UIElementFlags.Enabled | UIElementFlags.Alive; retn.children = LightList<UIElement>.Get(); retn.children.EnsureCapacity(childCount); retn.children.size = childCount; if (attributeCount > 0) { retn.attributes = new StructList<ElementAttribute>(attributeCount); retn.attributes.size = attributeCount; } retn.parent = parent; retn.View = parent?.View; return retn; } public UIElement CreateElementFromPoolWithType(int typeId, UIElement parent, int childCount, int attrCount, int originTemplateId) { return CreateElementFromPool(typeId, parent, childCount, attrCount, originTemplateId); } public static int ResolveSlotId(string slotName, StructList<SlotUsage> slotList, int defaultId, out UIElement contextRoot) { if (slotList == null) { contextRoot = null; return defaultId; } for (int i = 0; i < slotList.size; i++) { if (slotList.array[i].slotName == slotName) { contextRoot = slotList.array[i].outerContext; return slotList.array[i].slotId; } } contextRoot = null; return defaultId; } // Doesn't expect to create the root public void HydrateTemplate(int templateId, UIElement root, TemplateScope scope) { templateData.templates[templateId](root, scope); } public void AddTemplateChildren(SlotTemplateElement slotTemplateElement, int templateId, int count) { throw new Exception("Verify this"); if (templateId < 0) return; TemplateScope scope = new TemplateScope(this, null); for (int i = 0; i < count; i++) { UIElement root = slotTemplateElement.bindingNode.root; UIElement child = templateData.slots[templateId](root, root, scope); InsertChild(slotTemplateElement, child, (uint) slotTemplateElement.children.Count); } } } ======= internal void GetElementCount(out int totalElementCount, out int enabledElementCount, out int disabledElementCount) { LightStack<UIElement> stack = LightStack<UIElement>.Get(); totalElementCount = 0; enabledElementCount = 0; for (int i = 0; i < m_Views.Count; i++) { stack.Push(m_Views[i].RootElement); >>>>>>> internal void GetElementCount(out int totalElementCount, out int enabledElementCount, out int disabledElementCount) { LightStack<UIElement> stack = LightStack<UIElement>.Get(); totalElementCount = 0; enabledElementCount = 0; for (int i = 0; i < m_Views.Count; i++) { stack.Push(m_Views[i].RootElement);
<<<<<<< private static readonly EnumAliasSource<UIForia.Layout.AlignmentBehavior> s_EnumSource_AlignmentBehavior = new EnumAliasSource<UIForia.Layout.AlignmentBehavior>(); ======= private static readonly EnumAliasSource<UIForia.Layout.AlignmentTarget> s_EnumSource_AlignmentTarget = new EnumAliasSource<UIForia.Layout.AlignmentTarget>(); private static readonly EnumAliasSource<UIForia.Layout.LayoutFit> s_EnumSource_LayoutFit = new EnumAliasSource<UIForia.Layout.LayoutFit>(); >>>>>>> private static readonly EnumAliasSource<UIForia.Layout.AlignmentTarget> s_EnumSource_AlignmentTarget = new EnumAliasSource<UIForia.Layout.AlignmentTarget>();
<<<<<<< application = new GameApplication(applicationId); view = application.AddView(new Rect(0, 0, Screen.width, Screen.height), type); application.SetCamera(camera); ======= view = Application.Game.AddView(new Rect(0, 0, Screen.width, Screen.height), type); Application.Game.SetCamera(camera); Application.RegisterCustomPainter("Painter0", new Painter()); >>>>>>> application = new GameApplication(applicationId); view = application.AddView(new Rect(0, 0, Screen.width, Screen.height), type); application.SetCamera(camera); Application.RegisterCustomPainter("Painter0", new Painter());
<<<<<<< [Test] public void MockFile_Delete_Should_RemoveFiles() { const string filePath = @"c:\something\demo.txt"; const string fileContent = "this is some content"; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>{{filePath, new MockFileData(fileContent) }}); Assert.AreEqual(1, fileSystem.AllFiles.Count()); fileSystem.File.Delete(filePath); Assert.AreEqual(0, fileSystem.AllFiles.Count()); } [Test] public void MockFile_Delete_No_File_Does_Nothing() { const string filePath = @"c:\something\demo.txt"; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>()); fileSystem.File.Delete(filePath); } } ======= [Test] public void MockFile_Delete_ShouldRemoveFileFromFileSystem() { const string fullPath = @"c:\something\demo.txt"; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { fullPath, new MockFileData("Demo text content") } }); var file = new MockFile(fileSystem); file.Delete(fullPath); Assert.That(fileSystem.FileExists(fullPath), Is.False); } [Test] public void Mockfile_Create_ShouldCreateNewStream() { const string fullPath = @"c:\something\demo.txt"; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>()); var sut = new MockFile(fileSystem); Assert.That(fileSystem.FileExists(fullPath), Is.False); sut.Create(fullPath).Close(); Assert.That(fileSystem.FileExists(fullPath), Is.True); } [Test] public void Mockfile_Create_CanWriteToNewStream() { const string fullPath = @"c:\something\demo.txt"; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>()); var data = new UTF8Encoding(false).GetBytes("Test string"); var sut = new MockFile(fileSystem); using (var stream = sut.Create(fullPath)) { stream.Write(data, 0, data.Length); } var mockFileData = fileSystem.GetFile(fullPath); var fileData = mockFileData.Contents; Assert.That(fileData, Is.EqualTo(data)); } } >>>>>>> [Test] public void MockFile_Delete_ShouldRemoveFileFromFileSystem() { const string fullPath = @"c:\something\demo.txt"; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { { fullPath, new MockFileData("Demo text content") } }); var file = new MockFile(fileSystem); file.Delete(fullPath); Assert.That(fileSystem.FileExists(fullPath), Is.False); } [Test] public void Mockfile_Create_ShouldCreateNewStream() { const string fullPath = @"c:\something\demo.txt"; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>()); var sut = new MockFile(fileSystem); Assert.That(fileSystem.FileExists(fullPath), Is.False); sut.Create(fullPath).Close(); Assert.That(fileSystem.FileExists(fullPath), Is.True); } [Test] public void Mockfile_Create_CanWriteToNewStream() { const string fullPath = @"c:\something\demo.txt"; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>()); var data = new UTF8Encoding(false).GetBytes("Test string"); var sut = new MockFile(fileSystem); using (var stream = sut.Create(fullPath)) { stream.Write(data, 0, data.Length); } var mockFileData = fileSystem.GetFile(fullPath); var fileData = mockFileData.Contents; Assert.That(fileData, Is.EqualTo(data)); } } [Test] public void MockFile_Delete_Should_RemoveFiles() { const string filePath = @"c:\something\demo.txt"; const string fileContent = "this is some content"; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>{{filePath, new MockFileData(fileContent) }}); Assert.AreEqual(1, fileSystem.AllFiles.Count()); fileSystem.File.Delete(filePath); Assert.AreEqual(0, fileSystem.AllFiles.Count()); } [Test] public void MockFile_Delete_No_File_Does_Nothing() { const string filePath = @"c:\something\demo.txt"; var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>()); fileSystem.File.Delete(filePath); } }
<<<<<<< readonly PathBase path; ======= readonly IDirectoryInfoFactory directoryInfoFactory; >>>>>>> readonly PathBase path; readonly IDirectoryInfoFactory directoryInfoFactory; <<<<<<< path = new MockPath(); ======= directoryInfoFactory = new MockDirectoryInfoFactory(this); >>>>>>> path = new MockPath(); directoryInfoFactory = new MockDirectoryInfoFactory(this); <<<<<<< public PathBase Path { get { return path; } } ======= public IDirectoryInfoFactory DirectoryInfo { get { return directoryInfoFactory; } } >>>>>>> public PathBase Path { get { return path; } } public IDirectoryInfoFactory DirectoryInfo { get { return directoryInfoFactory; } }
<<<<<<< TaskManager = new TaskManager(UIScheduler); ======= CancellationTokenSource = new CancellationTokenSource(); // accessing Environment triggers environment initialization if it hasn't happened yet Platform = new Platform(Environment, Environment.FileSystem); >>>>>>> TaskManager = new TaskManager(UIScheduler); // accessing Environment triggers environment initialization if it hasn't happened yet Platform = new Platform(Environment, Environment.FileSystem); <<<<<<< Platform = new Platform(Environment, FileSystem); ======= >>>>>>> <<<<<<< Logging.TracingEnabled = UserSettings.Get("EnableTraceLogging", false); ======= >>>>>>> Logging.TracingEnabled = UserSettings.Get("EnableTraceLogging", false); <<<<<<< Platform.Initialize(ProcessManager, TaskManager); GitClient = new GitClient(Environment, ProcessManager, Platform.CredentialManager, TaskManager); ======= Platform.Initialize(ProcessManager, uiDispatcher); >>>>>>> Platform.Initialize(ProcessManager, TaskManager); GitClient = new GitClient(Environment, ProcessManager, Platform.CredentialManager, TaskManager); <<<<<<< protected virtual void InitializeEnvironment() { SetupRepository(); } private void SetupRepository() { if (FileSystem == null) { FileSystem = NPath.FileSystem; } FileSystem.SetCurrentDirectory(Environment.UnityProjectPath); // figure out where the repository root is repositoryLocator = new RepositoryLocator(Environment.UnityProjectPath); var repositoryPath = repositoryLocator.FindRepositoryRoot(); if (repositoryPath != null) { // Make sure CurrentDirectory always returns the repository root, so all // file system path calculations use it as a base FileSystem.SetCurrentDirectory(repositoryPath); } } ======= protected abstract string DetermineInstallationPath(); protected abstract string GetAssetsPath(); protected abstract string GetUnityPath(); >>>>>>> protected abstract string DetermineInstallationPath(); protected abstract string GetAssetsPath(); protected abstract string GetUnityPath(); <<<<<<< var gitSetup = new GitSetup(Environment, FileSystem, CancellationToken); ======= await ThreadingHelper.SwitchToThreadAsync(); var gitSetup = new GitSetup(Environment, Environment.FileSystem, CancellationToken); >>>>>>> var gitSetup = new GitSetup(Environment, Environment.FileSystem, CancellationToken);
<<<<<<< using System.Linq; ======= using System.Reflection; >>>>>>> using System.Linq; using System.Reflection;
<<<<<<< [NonSerialized] private bool isBusy; [SerializeField] private bool isPublished; ======= [SerializeField] private UserSettingsView userSettingsView = new UserSettingsView(); [SerializeField] private GitPathView gitPathView = new GitPathView(); [SerializeField] private bool isBusy; >>>>>>> [SerializeField] private UserSettingsView userSettingsView = new UserSettingsView(); [SerializeField] private GitPathView gitPathView = new GitPathView(); [NonSerialized] private bool isBusy;
<<<<<<< public ITask Fetch() { return repositoryManager.Fetch(CurrentRemote.Value.Name); } ======= public ITask Revert(string changeset) { return repositoryManager.Revert(changeset); } >>>>>>> public ITask Fetch() { return repositoryManager.Fetch(CurrentRemote.Value.Name); } public ITask Revert(string changeset) { return repositoryManager.Revert(changeset); }
<<<<<<< repositoryManagerListener.DidNotReceive().GitAheadBehindStatusUpdated(Args.GitAheadBehindStatus); repositoryManagerListener.DidNotReceive().GitStatusUpdated(Args.GitStatus); ======= repositoryManagerListener.Received().GitStatusUpdated(Args.GitStatus); >>>>>>> repositoryManagerListener.DidNotReceive().GitAheadBehindStatusUpdated(Args.GitAheadBehindStatus); repositoryManagerListener.Received().GitStatusUpdated(Args.GitStatus);
<<<<<<< public string Name { get { return "Project Evaluation"; } } ======= >>>>>>>
<<<<<<< var command = new StringBuilder("publish -r "); command.Append(repositoryName); ======= var command = new StringBuilder("publish -r \""); command.Append(newRepository.Name); command.Append("\""); >>>>>>> var command = new StringBuilder("publish -r \""); command.Append(repositoryName); command.Append("\""); <<<<<<< command.Append(" -d "); command.Append(description); ======= command.Append(" -d \""); command.Append(newRepository.Description); command.Append("\""); >>>>>>> command.Append(" -d \""); command.Append(description); command.Append("\"");
<<<<<<< ======= private bool showLocalBranches = true; private bool showRemoteBranches = true; >>>>>>> <<<<<<< [NonSerialized] private bool favoritesHasChanged; [NonSerialized] private List<string> favoritesList; ======= >>>>>>> [NonSerialized] private List<string> favoritesList; <<<<<<< [SerializeField] private bool disableDelete; [NonSerialized] private bool branchesHasChanged; ======= [SerializeField] private BranchTreeNode selectedNode; >>>>>>> [SerializeField] private bool disableDelete; [NonSerialized] private bool branchesHasChanged; <<<<<<< if (!Application.isPlaying) { favoritesHasChanged = true; } ======= Refresh(); >>>>>>> <<<<<<< if (!treeLocals.IsInitialized || branchesHasChanged) { branchesHasChanged = false; BuildTree(BranchCache.Instance.LocalBranches, BranchCache.Instance.RemoteBranches); } if (favoritesHasChanged) { favoritesList = Manager.LocalSettings.Get(FavoritesSetting, new List<string>()); favoritesHasChanged = false; } disableDelete = treeLocals.SelectedNode == null || treeLocals.SelectedNode.IsFolder || treeLocals.SelectedNode.IsActive; ======= >>>>>>> if (!treeLocals.IsInitialized || branchesHasChanged) { branchesHasChanged = false; BuildTree(BranchCache.Instance.LocalBranches, BranchCache.Instance.RemoteBranches); } disableDelete = treeLocals.SelectedNode == null || treeLocals.SelectedNode.IsFolder || treeLocals.SelectedNode.IsActive; <<<<<<< var rect = GUILayoutUtility.GetLastRect(); OnTreeGUI(new Rect(0f, rect.height + Styles.CommitAreaPadding, Position.width, Position.height - rect.height + Styles.CommitAreaPadding)); ======= GUILayout.BeginVertical(Styles.CommitFileAreaStyle); { // Local branches and "create branch" button showLocalBranches = EditorGUILayout.Foldout(showLocalBranches, LocalTitle); if (showLocalBranches) { GUILayout.BeginHorizontal(); { GUILayout.BeginVertical(); { OnTreeNodeChildrenGUI(localRoot); } GUILayout.EndVertical(); } GUILayout.EndHorizontal(); } // Remotes showRemoteBranches = EditorGUILayout.Foldout(showRemoteBranches, RemoteTitle); if (showRemoteBranches) { GUILayout.BeginHorizontal(); { GUILayout.BeginVertical(); for (var index = 0; index < remotes.Count; ++index) { var remote = remotes[index]; GUILayout.Label(new GUIContent(remote.Name, Styles.FolderIcon), GUILayout.MaxHeight(EditorGUIUtility.singleLineHeight)); // Branches of the remote GUILayout.BeginHorizontal(); { GUILayout.Space(Styles.TreeIndentation); GUILayout.BeginVertical(); { OnTreeNodeChildrenGUI(remote.Root); } GUILayout.EndVertical(); } GUILayout.EndHorizontal(); GUILayout.Space(Styles.BranchListSeperation); } GUILayout.EndVertical(); } GUILayout.EndHorizontal(); } GUILayout.FlexibleSpace(); } GUILayout.EndVertical(); >>>>>>> GUILayout.Label(FavoritesTitle); OnTreeGUI(new Rect(0f, rect.height + Styles.CommitAreaPadding, Position.width, Position.height - rect.height + Styles.CommitAreaPadding)); <<<<<<< ======= if (a.Name.Equals("master")) { return -1; } if (b.Name.Equals("master")) { return 1; } return 0; } private void BuildTree(IEnumerable<GitBranch> local, IEnumerable<GitBranch> remote) { //Clear the selected node selectedNode = null; // Sort var localBranches = new List<GitBranch>(local); var remoteBranches = new List<GitBranch>(remote); >>>>>>> <<<<<<< public TreeNode ActiveNode { get { return activeNode; } } ======= var content = new GUIContent(node.Label, iconContent); var style = node.Active ? Styles.BoldLabel : Styles.Label; var rect = GUILayoutUtility.GetRect(content, style, GUILayout.MaxHeight(EditorGUIUtility.singleLineHeight)); var clickRect = new Rect(0f, rect.y, Position.width, rect.height); >>>>>>> public TreeNode ActiveNode { get { return activeNode; } } <<<<<<< foldersKeys = Folders.Keys.Cast<string>().ToList(); } public Rect Render(Rect rect, Action<TreeNode> singleClick = null, Action<TreeNode> doubleClick = null) { RequiresRepaint = false; rect = new Rect(0f, rect.y, rect.width, ItemHeight); var titleNode = nodes[0]; bool selectionChanged = titleNode.Render(rect, 0f, selectedNode == titleNode, FolderStyle, TreeNodeStyle, ActiveTreeNodeStyle); if (selectionChanged) { ToggleNodeVisibility(0, titleNode); } RequiresRepaint = HandleInput(rect, titleNode, 0); rect.y += ItemHeight + ItemSpacing; Indent(); int level = 1; for (int i = 1; i < nodes.Count; i++) { var node = nodes[i]; if (node.Level > level && !node.IsHidden) { Indent(); } var changed = node.Render(rect, Indentation, selectedNode == node, FolderStyle, TreeNodeStyle, ActiveTreeNodeStyle); if (node.IsFolder && changed) { // toggle visibility for all the nodes under this one ToggleNodeVisibility(i, node); } if (node.Level < level) { for (; node.Level > level && indents.Count > 1; level--) { Unindent(); } } level = node.Level; if (!node.IsHidden) { RequiresRepaint = HandleInput(rect, node, i, singleClick, doubleClick); rect.y += ItemHeight + ItemSpacing; } } Unindent(); foldersKeys = Folders.Keys.Cast<string>().ToList(); return rect; } public void Focus() { bool selectionChanged = false; if (Event.current.type == EventType.KeyDown) { int directionY = Event.current.keyCode == KeyCode.UpArrow ? -1 : Event.current.keyCode == KeyCode.DownArrow ? 1 : 0; int directionX = Event.current.keyCode == KeyCode.LeftArrow ? -1 : Event.current.keyCode == KeyCode.RightArrow ? 1 : 0; if (directionY != 0 || directionX != 0) { if (directionY < 0 || directionY < 0) { SelectedNode = nodes[nodes.Count - 1]; selectionChanged = true; Event.current.Use(); } else if (directionY > 0 || directionX > 0) { SelectedNode = nodes[0]; selectionChanged = true; Event.current.Use(); } } } RequiresRepaint = selectionChanged; ======= >>>>>>> foldersKeys = Folders.Keys.Cast<string>().ToList(); } public Rect Render(Rect rect, Action<TreeNode> singleClick = null, Action<TreeNode> doubleClick = null) { RequiresRepaint = false; rect = new Rect(0f, rect.y, rect.width, ItemHeight); var titleNode = nodes[0]; bool selectionChanged = titleNode.Render(rect, 0f, selectedNode == titleNode, FolderStyle, TreeNodeStyle, ActiveTreeNodeStyle); if (selectionChanged) { ToggleNodeVisibility(0, titleNode); } RequiresRepaint = HandleInput(rect, titleNode, 0); rect.y += ItemHeight + ItemSpacing; Indent(); int level = 1; for (int i = 1; i < nodes.Count; i++) { var node = nodes[i]; if (node.Level > level && !node.IsHidden) { Indent(); } var changed = node.Render(rect, Indentation, selectedNode == node, FolderStyle, TreeNodeStyle, ActiveTreeNodeStyle); if (node.IsFolder && changed) { // toggle visibility for all the nodes under this one ToggleNodeVisibility(i, node); } if (node.Level < level) { for (; node.Level > level && indents.Count > 1; level--) { Unindent(); } } level = node.Level; if (!node.IsHidden) { RequiresRepaint = HandleInput(rect, node, i, singleClick, doubleClick); rect.y += ItemHeight + ItemSpacing; } } Unindent(); foldersKeys = Folders.Keys.Cast<string>().ToList(); return rect; } public void Focus() { bool selectionChanged = false; if (Event.current.type == EventType.KeyDown) { int directionY = Event.current.keyCode == KeyCode.UpArrow ? -1 : Event.current.keyCode == KeyCode.DownArrow ? 1 : 0; int directionX = Event.current.keyCode == KeyCode.LeftArrow ? -1 : Event.current.keyCode == KeyCode.RightArrow ? 1 : 0; if (directionY != 0 || directionX != 0) { if (directionY < 0 || directionY < 0) { SelectedNode = nodes[nodes.Count - 1]; selectionChanged = true; Event.current.Use(); } else if (directionY > 0 || directionX > 0) { SelectedNode = nodes[0]; selectionChanged = true; Event.current.Use(); } } } RequiresRepaint = selectionChanged;
<<<<<<< private const string NoRepoTitle = "To begin using GitHub, initialize a git repository"; ======= private const string NoRepoTitle = "No Git repository found for this project"; private const string NoRepoDescription = "Initialize a Git repository to track changes and collaborate with others."; private const string NoUserOrEmailError = "Name and Email must be configured in Settings"; [SerializeField] private UserSettingsView userSettingsView = new UserSettingsView(); [SerializeField] private GitPathView gitPathView = new GitPathView(); >>>>>>> private const string NoRepoTitle = "To begin using GitHub, initialize a git repository"; private const string NoRepoTitle = "No Git repository found for this project"; private const string NoRepoDescription = "Initialize a Git repository to track changes and collaborate with others."; private const string NoUserOrEmailError = "Name and Email must be configured in Settings"; [SerializeField] private UserSettingsView userSettingsView = new UserSettingsView(); [SerializeField] private GitPathView gitPathView = new GitPathView(); <<<<<<< GUILayout.EndHorizontal(); ======= GUILayout.EndVertical(); } EditorGUILayout.EndHorizontal(); gitPathView.OnGUI(); userSettingsView.OnGUI(); GUILayout.BeginVertical(Styles.GenericBoxStyle); { GUILayout.FlexibleSpace(); >>>>>>> GUILayout.EndHorizontal(); <<<<<<< EditorGUILayout.HelpBox("There was an error initializing a repository.", MessageType.Error); ======= ShowErrorMessage(); >>>>>>> EditorGUILayout.HelpBox("There was an error initializing a repository.", MessageType.Error);