conflict_resolution
stringlengths
27
16k
<<<<<<< Console.WriteLine(" GetMerchantDetails"); ======= Console.WriteLine(" GetHostedPaymentPage"); >>>>>>> Console.WriteLine(" GetMerchantDetails"); Console.WriteLine(" GetHostedPaymentPage"); <<<<<<< case "GetMerchantDetails": GetMerchantDetails.Run(apiLoginId, transactionKey); break; ======= case "GetHostedPaymentPage": GetHostedPaymentPage.Run(apiLoginId, transactionKey, 12.23m); break; >>>>>>> case "GetMerchantDetails": GetMerchantDetails.Run(apiLoginId, transactionKey); break; case "GetHostedPaymentPage": GetHostedPaymentPage.Run(apiLoginId, transactionKey, 12.23m); break;
<<<<<<< Console.WriteLine(" GetBatchStatistics"); Console.WriteLine(" GetSettledBatchList"); ======= Console.WriteLine(" CreateCustomerShippingAddress"); Console.WriteLine(" DeleteCustomerProfile"); Console.WriteLine(" DeleteCustomerPaymentProfile"); Console.WriteLine(" DeleteCustomerShippingAddress"); >>>>>>> Console.WriteLine(" CreateCustomerShippingAddress"); Console.WriteLine(" DeleteCustomerProfile"); Console.WriteLine(" DeleteCustomerPaymentProfile"); Console.WriteLine(" DeleteCustomerShippingAddress"); Console.WriteLine(" GetBatchStatistics"); Console.WriteLine(" GetSettledBatchList"); <<<<<<< case "GetUnsettledTransactionList": GetUnsettledTransactionList.Run(apiLoginId, transactionKey); break; case "GetBatchStatistics": GetBatchStatistics.Run(apiLoginId, transactionKey); break; case "GetSettledBatchList": GetSettledBatchList.Run(apiLoginId,transactionKey); break; ======= case "CreateCustomerShippingAddress": CreateCustomerShippingAddress.Run(apiLoginId, transactionKey); break; case "DeleteCustomerProfile": DeleteCustomerProfile.Run(apiLoginId, transactionKey); break; case "DeleteCustomerPaymentProfile": DeleteCustomerPaymentProfile.Run(apiLoginId, transactionKey); break; case "DeleteCustomerShippingAddress": DeleteCustomerShippingAddress.Run(apiLoginId, transactionKey); break; >>>>>>> case "CreateCustomerShippingAddress": CreateCustomerShippingAddress.Run(apiLoginId, transactionKey); break; case "DeleteCustomerProfile": DeleteCustomerProfile.Run(apiLoginId, transactionKey); break; case "DeleteCustomerPaymentProfile": DeleteCustomerPaymentProfile.Run(apiLoginId, transactionKey); break; case "DeleteCustomerShippingAddress": DeleteCustomerShippingAddress.Run(apiLoginId, transactionKey); break; case "GetUnsettledTransactionList": GetUnsettledTransactionList.Run(apiLoginId, transactionKey); break; case "GetBatchStatistics": GetBatchStatistics.Run(apiLoginId, transactionKey); break; case "GetSettledBatchList": GetSettledBatchList.Run(apiLoginId,transactionKey);
<<<<<<< public bool CheckTemporalTables { get; set; } = false; ======= public string ReseedSql { get; private set; } >>>>>>> public string ReseedSql { get; private set; } public bool CheckTemporalTables { get; set; } = false; <<<<<<< if (_temporalTables.Count() > 0) { var turnOnVersioningCommandText = DbAdapter.BuildTurnOnSystemVersioningCommandText(_temporalTables); await ExecuteAlterSystemVersioningAsync(connection, turnOnVersioningCommandText); } } private async Task ExecuteAlterSystemVersioningAsync(DbConnection connection, string commandText) { using (var tx = connection.BeginTransaction()) using (var cmd = connection.CreateCommand()) { cmd.CommandTimeout = CommandTimeout ?? cmd.CommandTimeout; cmd.CommandText = commandText; cmd.Transaction = tx; await cmd.ExecuteNonQueryAsync(); tx.Commit(); } ======= >>>>>>> if (_temporalTables.Count() > 0) { var turnOnVersioningCommandText = DbAdapter.BuildTurnOnSystemVersioningCommandText(_temporalTables); await ExecuteAlterSystemVersioningAsync(connection, turnOnVersioningCommandText); } } private async Task ExecuteAlterSystemVersioningAsync(DbConnection connection, string commandText) { using (var tx = connection.BeginTransaction()) using (var cmd = connection.CreateCommand()) { cmd.CommandTimeout = CommandTimeout ?? cmd.CommandTimeout; cmd.CommandText = commandText; cmd.Transaction = tx; await cmd.ExecuteNonQueryAsync(); tx.Commit(); }
<<<<<<< { if (isByRef) sb.AppendLine(" ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);"); if (isMultiArr) { sb.AppendLine(string.Format(" {0} a{1} = {2};", clsName, j, p.ParameterType.GetRetrieveValueCode(clsName))); } else sb.AppendLine(string.Format(" {0} {1} = {2};", clsName, p.Name, p.ParameterType.GetRetrieveValueCode(clsName))); if (!isByRef && !p.ParameterType.IsPrimitive) sb.AppendLine(" __intp.Free(ptr_of_this_method);"); } ======= sb.AppendLine(string.Format(" {0} @{1} = {2};", clsName, p.Name, p.ParameterType.GetRetrieveValueCode(clsName))); if (!isByRef && !p.ParameterType.IsPrimitive) sb.AppendLine(" __intp.Free(ptr_of_this_method);"); >>>>>>> { if (isByRef) sb.AppendLine(" ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);"); if (isMultiArr) { sb.AppendLine(string.Format(" {0} a{1} = {2};", clsName, j, p.ParameterType.GetRetrieveValueCode(clsName))); } else sb.AppendLine(string.Format(" {0} @{1} = {2};", clsName, p.Name, p.ParameterType.GetRetrieveValueCode(clsName))); if (!isByRef && !p.ParameterType.IsPrimitive) sb.AppendLine(" __intp.Free(ptr_of_this_method);"); }
<<<<<<< ======= this.CanChangeTime = this.AccessMode.CombineLatest(this.settings.WhenAnyValue(x => x.LockTime), (accessMode, lockTime) => accessMode == Management.AccessMode.Administrator || !lockTime); this.CanChangeVolume = this.AccessMode.CombineLatest(this.settings.WhenAnyValue(x => x.LockVolume), (accessMode, lockVolume) => accessMode == Management.AccessMode.Administrator || !lockVolume); } /// <summary> /// Gets the access mode that is currently enabled. /// </summary> public IObservable<AccessMode> AccessMode { get { return this.accessModeSubject.AsObservable(); } >>>>>>> <<<<<<< this.accessControl.VerifyAccess(accessToken, this.settings.LockPlaylistRemoval); ======= if (this.settings.LockPlaylist && this.accessMode == Management.AccessMode.Party) throw new InvalidOperationException("Not allowed to remove songs when in party mode."); >>>>>>> this.accessControl.VerifyAccess(accessToken, this.settings.LockPlaylist); <<<<<<< this.accessControl.VerifyAccess(accessToken, this.settings.LockPlaylistSwitching); ======= if (this.settings.LockPlaylist && this.accessMode == Management.AccessMode.Party) throw new InvalidOperationException("Not allowed to alter the playlist when in party mode."); >>>>>>> this.accessControl.VerifyAccess(accessToken, this.settings.LockPlaylist);
<<<<<<< #region Usings using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Net.Http; using System.Text; using System.Threading; using System.Threading.Tasks; using Polly; ======= >>>>>>>
<<<<<<< #if CONTRACTS_FULL /// <summary> /// Verifies conditions that should be true for any valid state of this object. /// </summary> [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")] [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")] [ContractInvariantMethod] private void ObjectInvariant() { Contract.Invariant(this.SecuritySettings != null); Contract.Invariant(this.Channel != null); Contract.Invariant(this.EndpointOrder != null); } #endif ======= /// <summary> /// Called by derived classes when behaviors are added or removed. /// </summary> /// <param name="sender">The collection being modified.</param> /// <param name="e">The <see cref="System.Collections.Specialized.NotifyCollectionChangedEventArgs"/> instance containing the event data.</param> private void OnBehaviorsChanged(object sender, NotifyCollectionChangedEventArgs e) { foreach (IRelyingPartyBehavior profile in e.NewItems) { profile.ApplySecuritySettings(this.SecuritySettings); } } >>>>>>> /// <summary> /// Called by derived classes when behaviors are added or removed. /// </summary> /// <param name="sender">The collection being modified.</param> /// <param name="e">The <see cref="System.Collections.Specialized.NotifyCollectionChangedEventArgs"/> instance containing the event data.</param> private void OnBehaviorsChanged(object sender, NotifyCollectionChangedEventArgs e) { foreach (IRelyingPartyBehavior profile in e.NewItems) { profile.ApplySecuritySettings(this.SecuritySettings); } } #if CONTRACTS_FULL /// <summary> /// Verifies conditions that should be true for any valid state of this object. /// </summary> [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Called by code contracts.")] [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called by code contracts.")] [ContractInvariantMethod] private void ObjectInvariant() { Contract.Invariant(this.SecuritySettings != null); Contract.Invariant(this.Channel != null); Contract.Invariant(this.EndpointOrder != null); } #endif
<<<<<<< /// The name of the &lt;xriResolver&gt; sub-element. /// </summary> private const string XriResolverElementName = "xriResolver"; /// <summary> /// Gets the name of the @maxAuthenticationTime attribute. ======= /// The name of the @maxAuthenticationTime attribute. >>>>>>> /// The name of the &lt;xriResolver&gt; sub-element. /// </summary> private const string XriResolverElementName = "xriResolver"; /// <summary> /// The name of the @maxAuthenticationTime attribute.
<<<<<<< [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "no-pii", Scope = "resource", Target = "DotNetOpenAuth.OpenId.Behaviors.BehaviorStrings.resources")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "req", Scope = "member", Target = "DotNetOpenAuth.OpenId.Provider.IAuthenticationRequestContract.#DotNetOpenAuth.OpenId.Provider.IAuthenticationRequest.ClaimedIdentifier")] ======= [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "no-pii", Scope = "resource", Target = "DotNetOpenAuth.OpenId.Behaviors.BehaviorStrings.resources")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "runat", Scope = "resource", Target = "DotNetOpenAuth.OpenId.OpenIdStrings.resources")] >>>>>>> [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "no-pii", Scope = "resource", Target = "DotNetOpenAuth.OpenId.Behaviors.BehaviorStrings.resources")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "req", Scope = "member", Target = "DotNetOpenAuth.OpenId.Provider.IAuthenticationRequestContract.#DotNetOpenAuth.OpenId.Provider.IAuthenticationRequest.ClaimedIdentifier")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "runat", Scope = "resource", Target = "DotNetOpenAuth.OpenId.OpenIdStrings.resources")]
<<<<<<< Map<Uri>(uri => uri.AbsoluteUri, safeUri); Map<DateTime>(dt => XmlConvert.ToString(dt, XmlDateTimeSerializationMode.Utc), str => XmlConvert.ToDateTime(str, XmlDateTimeSerializationMode.Utc)); Map<TimeSpan>(ts => ts.ToString(), str => TimeSpan.Parse(str)); Map<byte[]>(safeFromByteArray, safeToByteArray); Map<Realm>(realm => realm.ToString(), safeRealm); Map<Identifier>(id => id.SerializedString, safeIdentifier); Map<bool>(value => value.ToString().ToLowerInvariant(), safeBool); Map<CultureInfo>(c => c.Name, str => new CultureInfo(str)); Map<CultureInfo[]>(cs => string.Join(",", cs.Select(c => c.Name).ToArray()), str => str.Split(',').Select(s => new CultureInfo(s)).ToArray()); ======= Map<Uri>(uri => uri.AbsoluteUri, uri => uri.OriginalString, safeUri); Map<DateTime>(dt => XmlConvert.ToString(dt, XmlDateTimeSerializationMode.Utc), null, str => XmlConvert.ToDateTime(str, XmlDateTimeSerializationMode.Utc)); Map<byte[]>(safeFromByteArray, null, safeToByteArray); Map<Realm>(realm => realm.ToString(), realm => realm.OriginalString, safeRealm); Map<Identifier>(id => id.SerializedString, id => id.OriginalString, safeIdentifier); Map<bool>(value => value.ToString().ToLowerInvariant(), null, safeBool); Map<CultureInfo>(c => c.Name, null, str => new CultureInfo(str)); Map<CultureInfo[]>(cs => string.Join(",", cs.Select(c => c.Name).ToArray()), null, str => str.Split(',').Select(s => new CultureInfo(s)).ToArray()); >>>>>>> Map<Uri>(uri => uri.AbsoluteUri, uri => uri.OriginalString, safeUri); Map<DateTime>(dt => XmlConvert.ToString(dt, XmlDateTimeSerializationMode.Utc), null, str => XmlConvert.ToDateTime(str, XmlDateTimeSerializationMode.Utc)); Map<TimeSpan>(ts => ts.ToString(), null, str => TimeSpan.Parse(str)); Map<byte[]>(safeFromByteArray, null, safeToByteArray); Map<Realm>(realm => realm.ToString(), realm => realm.OriginalString, safeRealm); Map<Identifier>(id => id.SerializedString, id => id.OriginalString, safeIdentifier); Map<bool>(value => value.ToString().ToLowerInvariant(), null, safeBool); Map<CultureInfo>(c => c.Name, null, str => new CultureInfo(str)); Map<CultureInfo[]>(cs => string.Join(",", cs.Select(c => c.Name).ToArray()), null, str => str.Split(',').Select(s => new CultureInfo(s)).ToArray());
<<<<<<< string xsrfKey = MessagingUtilities.GetNonCryptoRandomDataAsBase64(16); cookies.Add(new CookieHeaderValue(XsrfCookieName, xsrfKey) { ======= var context = this.Channel.GetHttpContext(); string xsrfKey = MessagingUtilities.GetNonCryptoRandomDataAsBase64(16, useWeb64: true); cookie = new HttpCookie(XsrfCookieName, xsrfKey) { >>>>>>> string xsrfKey = MessagingUtilities.GetNonCryptoRandomDataAsBase64(16, useWeb64: true); cookies.Add(new CookieHeaderValue(XsrfCookieName, xsrfKey) {
<<<<<<< /// The name of the attribute that indicates whether to disable SSL requirements across the library. /// </summary> private const string RelaxSslRequirementsConfigName = "relaxSslRequirements"; /// <summary> ======= /// The name of the attribute that controls whether messaging rules are strictly followed. /// </summary> private const string StrictConfigName = "strict"; /// <summary> >>>>>>> /// The name of the attribute that indicates whether to disable SSL requirements across the library. /// </summary> private const string RelaxSslRequirementsConfigName = "relaxSslRequirements"; /// <summary> /// The name of the attribute that controls whether messaging rules are strictly followed. /// </summary> private const string StrictConfigName = "strict"; /// <summary> <<<<<<< /// Gets or sets a value indicating whether SSL requirements within the library are disabled/relaxed. /// Use for TESTING ONLY. /// </summary> [ConfigurationProperty(RelaxSslRequirementsConfigName, DefaultValue = false)] internal bool RelaxSslRequirements { get { return (bool)this[RelaxSslRequirementsConfigName]; } set { this[RelaxSslRequirementsConfigName] = value; } } /// <summary> ======= /// Gets or sets a value indicating whether messaging rules are strictly /// adhered to. /// </summary> /// <value><c>true</c> by default.</value> /// <remarks> /// Strict will require that remote parties adhere strictly to the specifications, /// even when a loose interpretation would not compromise security. /// <c>true</c> is a good default because it shakes out interoperability bugs in remote services /// so they can be identified and corrected. But some web sites want things to Just Work /// more than they want to file bugs against others, so <c>false</c> is the setting for them. /// </remarks> [ConfigurationProperty(StrictConfigName, DefaultValue = true)] internal bool Strict { get { return (bool)this[StrictConfigName]; } set { this[StrictConfigName] = value; } } /// <summary> >>>>>>> /// Gets or sets a value indicating whether SSL requirements within the library are disabled/relaxed. /// Use for TESTING ONLY. /// </summary> [ConfigurationProperty(RelaxSslRequirementsConfigName, DefaultValue = false)] internal bool RelaxSslRequirements { get { return (bool)this[RelaxSslRequirementsConfigName]; } set { this[RelaxSslRequirementsConfigName] = value; } } /// <summary> /// Gets or sets a value indicating whether messaging rules are strictly /// adhered to. /// </summary> /// <value><c>true</c> by default.</value> /// <remarks> /// Strict will require that remote parties adhere strictly to the specifications, /// even when a loose interpretation would not compromise security. /// <c>true</c> is a good default because it shakes out interoperability bugs in remote services /// so they can be identified and corrected. But some web sites want things to Just Work /// more than they want to file bugs against others, so <c>false</c> is the setting for them. /// </remarks> [ConfigurationProperty(StrictConfigName, DefaultValue = true)] internal bool Strict { get { return (bool)this[StrictConfigName]; } set { this[StrictConfigName] = value; } } /// <summary>
<<<<<<< using System.Diagnostics.Contracts; ======= using System.Diagnostics.CodeAnalysis; >>>>>>> using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts;
<<<<<<< Identifier userSuppliedIdentifier = ((AuthenticationRequest)req).Endpoint.UserSuppliedIdentifier; req.SetCallbackArgument(AuthenticationRequest.UserSuppliedIdentifierParameterName, userSuppliedIdentifier.OriginalString); ======= req.SetUntrustedCallbackArgument(AuthenticationRequest.UserSuppliedIdentifierParameterName, this.Identifier.OriginalString); >>>>>>> Identifier userSuppliedIdentifier = ((AuthenticationRequest)req).Endpoint.UserSuppliedIdentifier; req.SetUntrustedCallbackArgument(AuthenticationRequest.UserSuppliedIdentifierParameterName, userSuppliedIdentifier.OriginalString);
<<<<<<< : this(serviceDescription, tokenManager, new NonceMemoryStore(StandardExpirationBindingElement.MaximumMessageAge), messageTypeProvider) { Contract.Requires<ArgumentNullException>(serviceDescription != null); Contract.Requires<ArgumentNullException>(tokenManager != null); Contract.Requires<ArgumentNullException>(messageTypeProvider != null); ======= : this(serviceDescription, tokenManager, DotNetOpenAuthSection.Configuration.OAuth.ServiceProvider.ApplicationStore.CreateInstance(HttpApplicationStore), messageTypeProvider) { >>>>>>> : this(serviceDescription, tokenManager, DotNetOpenAuthSection.Configuration.OAuth.ServiceProvider.ApplicationStore.CreateInstance(HttpApplicationStore), messageTypeProvider) { Contract.Requires<ArgumentNullException>(serviceDescription != null); Contract.Requires<ArgumentNullException>(tokenManager != null); Contract.Requires<ArgumentNullException>(messageTypeProvider != null);
<<<<<<< public PrivatePersonalIdentifierProviderBase(Uri baseIdentifier) { Contract.Requires<ArgumentNullException>(baseIdentifier != null); ======= protected PrivatePersonalIdentifierProviderBase(Uri baseIdentifier) { Contract.Requires(baseIdentifier != null); >>>>>>> protected PrivatePersonalIdentifierProviderBase(Uri baseIdentifier) { Contract.Requires<ArgumentNullException>(baseIdentifier != null);
<<<<<<< internal AutoResponsiveRequest(IDirectedProtocolMessage request, IProtocolMessage response) : base(request) { Contract.Requires<ArgumentNullException>(response != null); ======= /// <param name="securitySettings">The security settings.</param> internal AutoResponsiveRequest(IDirectedProtocolMessage request, IProtocolMessage response, ProviderSecuritySettings securitySettings) : base(request, securitySettings) { ErrorUtilities.VerifyArgumentNotNull(response, "response"); >>>>>>> /// <param name="securitySettings">The security settings.</param> internal AutoResponsiveRequest(IDirectedProtocolMessage request, IProtocolMessage response, ProviderSecuritySettings securitySettings) : base(request, securitySettings) { Contract.Requires<ArgumentNullException>(response != null); <<<<<<< internal AutoResponsiveRequest(IProtocolMessage response) : base(IndirectResponseBase.GetVersion(response)) { Contract.Requires<ArgumentNullException>(response != null); ======= /// <param name="securitySettings">The security settings.</param> internal AutoResponsiveRequest(IProtocolMessage response, ProviderSecuritySettings securitySettings) : base(IndirectResponseBase.GetVersion(response), securitySettings) { ErrorUtilities.VerifyArgumentNotNull(response, "response"); >>>>>>> /// <param name="securitySettings">The security settings.</param> internal AutoResponsiveRequest(IProtocolMessage response, ProviderSecuritySettings securitySettings) : base(IndirectResponseBase.GetVersion(response), securitySettings) { Contract.Requires<ArgumentNullException>(response != null);
<<<<<<< #if DEBUG internal static readonly RequestCachePolicy IdentifierDiscoveryCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.BypassCache); #else internal static readonly RequestCachePolicy IdentifierDiscoveryCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.CacheIfAvailable); #endif ======= internal static readonly RequestCachePolicy IdentifierDiscoveryCachePolicy = new HttpRequestCachePolicy(DotNetOpenAuthSection.Configuration.OpenId.CacheDiscovery ? HttpRequestCacheLevel.CacheIfAvailable : HttpRequestCacheLevel.BypassCache); >>>>>>> #if DEBUG internal static readonly RequestCachePolicy IdentifierDiscoveryCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.BypassCache); #else internal static readonly RequestCachePolicy IdentifierDiscoveryCachePolicy = new HttpRequestCachePolicy(DotNetOpenAuthSection.Configuration.OpenId.CacheDiscovery ? HttpRequestCacheLevel.CacheIfAvailable : HttpRequestCacheLevel.BypassCache); #endif
<<<<<<< : base(requireSsl) { Contract.Requires<ArgumentException>(!String.IsNullOrEmpty(xri)); Contract.Requires<FormatException>(IsValidXri(xri), OpenIdStrings.InvalidXri); ======= : base(xri, requireSsl) { Contract.Requires((xri != null && xri.Length > 0) || !string.IsNullOrEmpty(xri)); ErrorUtilities.VerifyFormat(IsValidXri(xri), OpenIdStrings.InvalidXri, xri); >>>>>>> : base(xri, requireSsl) { Contract.Requires<ArgumentException>(!String.IsNullOrEmpty(xri)); Contract.Requires<FormatException>(IsValidXri(xri), OpenIdStrings.InvalidXri);
<<<<<<< : this(serviceDescription, tokenManager, new NonceMemoryStore(StandardExpirationBindingElement.MaximumMessageAge), messageTypeProvider) { ======= : this(serviceDescription, tokenManager, new NonceMemoryStore(StandardExpirationBindingElement.DefaultMaximumMessageAge), messageTypeProvider) { Contract.Requires<ArgumentNullException>(serviceDescription != null); Contract.Requires<ArgumentNullException>(tokenManager != null); Contract.Requires<ArgumentNullException>(messageTypeProvider != null); >>>>>>> : this(serviceDescription, tokenManager, new NonceMemoryStore(StandardExpirationBindingElement.MaximumMessageAge), messageTypeProvider) { Contract.Requires<ArgumentNullException>(serviceDescription != null); Contract.Requires<ArgumentNullException>(tokenManager != null); Contract.Requires<ArgumentNullException>(messageTypeProvider != null);
<<<<<<< [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Justification = "We sign it when producing drops.")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "DotNetOpenAuth.OpenId.Extensions.OAuth")] ======= [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Justification = "We sign it when producing drops.")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "DotNetOpenAuth.Messaging.Reflection")] >>>>>>> [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Justification = "We sign it when producing drops.")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "DotNetOpenAuth.OpenId.Extensions.OAuth")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "DotNetOpenAuth.Messaging.Reflection")]
<<<<<<< DotNetOpenAuth.OpenId.Behaviors.USGovernmentLevel1.PpidIdentifierProvider = new Code.AnonymousIdentifierProvider(); ======= DotNetOpenAuth.OpenId.Behaviors.PpidGeneration.PpidIdentifierProvider = new Code.AnonymousIdentifierProvider(); >>>>>>> DotNetOpenAuth.OpenId.Behaviors.PpidGeneration.PpidIdentifierProvider = new Code.AnonymousIdentifierProvider(); DotNetOpenAuth.OpenId.Behaviors.USGovernmentLevel1.PpidIdentifierProvider = new Code.AnonymousIdentifierProvider();
<<<<<<< public void DisableDuplicateEventDetection_RemovesDisableDuplicateEventDetection() { Sut.DisableDuplicateEventDetection(); Assert.DoesNotContain(Sut.EventProcessors, p => p.GetType() == typeof(DuplicateEventDetectionEventProcessor)); } [Fact] ======= public void AddIntegration_StoredInOptions() { var expected = Substitute.For<ISdkIntegration>(); Sut.AddIntegration(expected); Assert.Contains(Sut.Integrations, actual => actual == expected); } [Fact] >>>>>>> public void DisableDuplicateEventDetection_RemovesDisableDuplicateEventDetection() { Sut.DisableDuplicateEventDetection(); Assert.DoesNotContain(Sut.EventProcessors, p => p.GetType() == typeof(DuplicateEventDetectionEventProcessor)); } [Fact] public void AddIntegration_StoredInOptions() { var expected = Substitute.For<ISdkIntegration>(); Sut.AddIntegration(expected); Assert.Contains(Sut.Integrations, actual => actual == expected); } [Fact]
<<<<<<< if (DesignMode) implementation = new Platform.Dummy.DummyGLControl(); else if (Configuration.RunningOnWindows) implementation = new Platform.Windows.WinGLControl(mode, this); else if (Configuration.RunningOnX11) implementation = new Platform.X11.X11GLControl(mode, this); else if (Configuration.RunningOnOSX) throw new PlatformNotSupportedException("Refer to http://www.opentk.com for more information."); ======= implementation = Platform.Factory.CreateGLControl(mode, this); >>>>>>> if (DesignMode) implementation = new Platform.Dummy.DummyGLControl(); else implementation = Platform.Factory.CreateGLControl(mode, this);
<<<<<<< ======= using MediaBrowser.Model.Xml; using Microsoft.Extensions.Configuration; >>>>>>> using MediaBrowser.Model.Xml; using Microsoft.Extensions.Configuration; <<<<<<< public MusicBrainzAlbumProvider(IHttpClient httpClient, IApplicationHost appHost, ILogger logger, IJsonSerializer json) ======= public MusicBrainzAlbumProvider( IHttpClient httpClient, IApplicationHost appHost, ILogger logger, IJsonSerializer json, IXmlReaderSettingsFactory xmlSettings, IConfiguration configuration) >>>>>>> public MusicBrainzAlbumProvider( IHttpClient httpClient, IApplicationHost appHost, ILogger logger, IJsonSerializer json, IConfiguration configuration) <<<<<<< ======= _xmlSettings = xmlSettings; MusicBrainzBaseUrl = configuration["MusicBrainz:BaseUrl"]; >>>>>>> MusicBrainzBaseUrl = configuration["MusicBrainz:BaseUrl"];
<<<<<<< /// <summary> /// Initializes a new instance of the <see cref="SeriesNfoProvider"/> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="fileSystem">The file system.</param> /// <param name="config">the configuration manager.</param> /// <param name="providerManager">The provider manager.</param> public SeriesNfoProvider(ILogger<SeriesNfoProvider> logger, IFileSystem fileSystem, IConfigurationManager config, IProviderManager providerManager) ======= public SeriesNfoProvider( IFileSystem fileSystem, ILogger<SeriesNfoProvider> logger, IConfigurationManager config, IProviderManager providerManager) >>>>>>> /// <summary> /// Initializes a new instance of the <see cref="SeriesNfoProvider"/> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="fileSystem">The file system.</param> /// <param name="config">the configuration manager.</param> /// <param name="providerManager">The provider manager.</param> public SeriesNfoProvider( ILogger<SeriesNfoProvider> logger, IFileSystem fileSystem, IConfigurationManager config, IProviderManager providerManager)
<<<<<<< using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; using MediaBrowser.Common.Json.Converters; using MediaBrowser.Model.Querying; ======= using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; using MediaBrowser.Common.Json.Converters; using MediaBrowser.Model.Entities; >>>>>>> using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; using MediaBrowser.Common.Json.Converters; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying;
<<<<<<< typeof(Routines.RemoveDuplicateExtras), typeof(Routines.AddDefaultPluginRepository) ======= typeof(Routines.RemoveDuplicateExtras), typeof(Routines.MigrateUserDb) >>>>>>> typeof(Routines.RemoveDuplicateExtras), typeof(Routines.AddDefaultPluginRepository) typeof(Routines.MigrateUserDb)
<<<<<<< [FromQuery] ImageType[] enableImageTypes, [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ItemFields[] fields, ======= [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ImageType[] enableImageTypes, [FromQuery] string? fields, >>>>>>> [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ImageType[] enableImageTypes, [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ItemFields[] fields, <<<<<<< [FromQuery] ImageType[] enableImageTypes, [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ItemFields[] fields, ======= [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ImageType[] enableImageTypes, [FromQuery] string? fields, >>>>>>> [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ImageType[] enableImageTypes, [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ItemFields[] fields, <<<<<<< [FromQuery] ImageType[] enableImageTypes, [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ItemFields[] fields, ======= [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ImageType[] enableImageTypes, [FromQuery] string? fields, >>>>>>> [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ImageType[] enableImageTypes, [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ItemFields[] fields,
<<<<<<< Copyright (C) 2003-2013 Dominik Reichl <[email protected]> ======= Copyright (C) 2003-2016 Dominik Reichl <[email protected]> >>>>>>> Copyright (C) 2003-2016 Dominik Reichl <[email protected]> <<<<<<< BinaryReaderEx br = null; BinaryReaderEx brDecrypted = null; Stream readerStream = null; if(kdbFormat == KdbxFormat.Default || kdbFormat == KdbxFormat.ProtocolBuffers) ======= Stream sXml; if(fmt == KdbxFormat.Default) >>>>>>> Stream sXml; if (fmt == KdbxFormat.Default || fmt == KdbxFormat.ProtocolBuffers) <<<<<<< private Stream AttachStreamDecryptor(Stream s) { MemoryStream ms = new MemoryStream(); Debug.Assert(m_pbMasterSeed.Length == 32); if(m_pbMasterSeed.Length != 32) throw new FormatException(KLRes.MasterSeedLengthInvalid); ms.Write(m_pbMasterSeed, 0, 32); if (m_slLogger != null) m_slLogger.SetText("KP2AKEY_TransformingKey", LogStatusType.AdditionalInfo); byte[] pKey32 = m_pwDatabase.MasterKey.GenerateKey32(m_pbTransformSeed, m_pwDatabase.KeyEncryptionRounds).ReadData(); if((pKey32 == null) || (pKey32.Length != 32)) throw new SecurityException(KLRes.InvalidCompositeKey); ms.Write(pKey32, 0, 32); SHA256Managed sha256 = new SHA256Managed(); byte[] aesKey = sha256.ComputeHash(ms.ToArray()); ms.Close(); Array.Clear(pKey32, 0, 32); if((aesKey == null) || (aesKey.Length != 32)) throw new SecurityException(KLRes.FinalKeyCreationFailed); ICipherEngine iEngine = CipherPool.GlobalPool.GetCipher(m_pwDatabase.DataCipherUuid); if(iEngine == null) throw new SecurityException(KLRes.FileUnknownCipher); return iEngine.DecryptStream(s, aesKey, m_pbEncryptionIV); } ======= >>>>>>>
<<<<<<< using System.Collections.Generic; ======= using Jellyfin.Server.Middleware; >>>>>>> using System.Collections.Generic; using Jellyfin.Server.Middleware; <<<<<<< c.RoutePrefix = "api-docs/swagger"; ======= c.RoutePrefix = $"{baseUrl}api-docs/swagger"; c.InjectStylesheet($"/{baseUrl}api-docs/swagger/custom.css"); >>>>>>> c.InjectStylesheet($"/{baseUrl}api-docs/swagger/custom.css"); c.RoutePrefix = "api-docs/swagger"; <<<<<<< c.RoutePrefix = "api-docs/redoc"; ======= c.RoutePrefix = $"{baseUrl}api-docs/redoc"; c.InjectStylesheet($"/{baseUrl}api-docs/redoc/custom.css"); >>>>>>> c.InjectStylesheet($"/{baseUrl}api-docs/redoc/custom.css"); c.RoutePrefix = "api-docs/redoc";
<<<<<<< /// <summary> /// Initializes a new instance of the <see cref="ArtistNfoProvider"/> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="fileSystem">The file system.</param> /// <param name="config">the configuration manager.</param> /// <param name="providerManager">The provider manager.</param> public ArtistNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager) ======= public ArtistNfoProvider( IFileSystem fileSystem, ILogger<ArtistNfoProvider> logger, IConfigurationManager config, IProviderManager providerManager) >>>>>>> /// <summary> /// Initializes a new instance of the <see cref="ArtistNfoProvider"/> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="fileSystem">The file system.</param> /// <param name="config">the configuration manager.</param> /// <param name="providerManager">The provider manager.</param> public ArtistNfoProvider( IFileSystem fileSystem, ILogger<ArtistNfoProvider> logger, IConfigurationManager config, IProviderManager providerManager)
<<<<<<< ZipClient = new ZipClient(); RegisterSingleInstance(ZipClient); ======= ZipClient = new ZipClient(FileSystemManager); serviceCollection.AddSingleton(ZipClient); >>>>>>> ZipClient = new ZipClient(); serviceCollection.AddSingleton(ZipClient); <<<<<<< UserManager = new UserManager(LoggerFactory, ServerConfigurationManager, UserRepository, XmlSerializer, NetworkManager, () => ImageProcessor, () => DtoService, this, JsonSerializer, FileSystemManager); RegisterSingleInstance(UserManager); ======= UserManager = new UserManager(LoggerFactory, ServerConfigurationManager, UserRepository, XmlSerializer, NetworkManager, () => ImageProcessor, () => DtoService, this, JsonSerializer, FileSystemManager, CryptographyProvider); serviceCollection.AddSingleton(UserManager); >>>>>>> UserManager = new UserManager(LoggerFactory, ServerConfigurationManager, UserRepository, XmlSerializer, NetworkManager, () => ImageProcessor, () => DtoService, this, JsonSerializer, FileSystemManager); serviceCollection.AddSingleton(UserManager); <<<<<<< LibraryMonitor = new LibraryMonitor(LoggerFactory, LibraryManager, ServerConfigurationManager, FileSystemManager, EnvironmentInfo); RegisterSingleInstance(LibraryMonitor); ======= LibraryMonitor = new LibraryMonitor(LoggerFactory, TaskManager, LibraryManager, ServerConfigurationManager, FileSystemManager, EnvironmentInfo); serviceCollection.AddSingleton(LibraryMonitor); >>>>>>> LibraryMonitor = new LibraryMonitor(LoggerFactory, LibraryManager, ServerConfigurationManager, FileSystemManager, EnvironmentInfo); serviceCollection.AddSingleton(LibraryMonitor); <<<<<<< DeviceManager = new DeviceManager(AuthenticationRepository, JsonSerializer, LibraryManager, LocalizationManager, UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager); RegisterSingleInstance(DeviceManager); ======= DeviceManager = new DeviceManager(AuthenticationRepository, JsonSerializer, LibraryManager, LocalizationManager, UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager, LoggerFactory, NetworkManager); serviceCollection.AddSingleton(DeviceManager); >>>>>>> DeviceManager = new DeviceManager(AuthenticationRepository, JsonSerializer, LibraryManager, LocalizationManager, UserManager, FileSystemManager, LibraryMonitor, ServerConfigurationManager); serviceCollection.AddSingleton(DeviceManager); <<<<<<< DtoService = new DtoService(LoggerFactory, LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ProviderManager, this, () => MediaSourceManager, () => LiveTvManager); RegisterSingleInstance(DtoService); ======= DtoService = new DtoService(LoggerFactory, LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ServerConfigurationManager, FileSystemManager, ProviderManager, () => ChannelManager, this, () => DeviceManager, () => MediaSourceManager, () => LiveTvManager); serviceCollection.AddSingleton(DtoService); >>>>>>> DtoService = new DtoService(LoggerFactory, LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ProviderManager, this, () => MediaSourceManager, () => LiveTvManager); serviceCollection.AddSingleton(DtoService);
<<<<<<< /// <summary> /// Initializes a new instance of the <see cref="MovieNfoProvider"/> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="fileSystem">The file system.</param> /// <param name="config">the configuration manager.</param> /// <param name="providerManager">The provider manager.</param> public MovieNfoProvider(ILogger<MovieNfoProvider> logger, IFileSystem fileSystem, IConfigurationManager config, IProviderManager providerManager) : base(logger, fileSystem, config, providerManager) ======= public MovieNfoProvider( IFileSystem fileSystem, ILogger<MovieNfoProvider> logger, IConfigurationManager config, IProviderManager providerManager) : base(fileSystem, logger, config, providerManager) { } } public class MusicVideoNfoProvider : BaseVideoNfoProvider<MusicVideo> { public MusicVideoNfoProvider( IFileSystem fileSystem, ILogger<MusicVideoNfoProvider> logger, IConfigurationManager config, IProviderManager providerManager) : base(fileSystem, logger, config, providerManager) { } } public class VideoNfoProvider : BaseVideoNfoProvider<Video> { public VideoNfoProvider( IFileSystem fileSystem, ILogger<VideoNfoProvider> logger, IConfigurationManager config, IProviderManager providerManager) : base(fileSystem, logger, config, providerManager) >>>>>>> /// <summary> /// Initializes a new instance of the <see cref="MovieNfoProvider"/> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="fileSystem">The file system.</param> /// <param name="config">the configuration manager.</param> /// <param name="providerManager">The provider manager.</param> public MovieNfoProvider( ILogger<MovieNfoProvider> logger, IFileSystem fileSystem, IConfigurationManager config, IProviderManager providerManager) : base(logger, fileSystem, config, providerManager)
<<<<<<< kdbx.Load(s, KdbxFormat.Default, slLogger); ======= Stream s = IOConnection.OpenRead(ioSource); kdbx.Load(s, KdbpFile.GetFormatToUse(ioSource), slLogger); >>>>>>> kdbx.Load(s, KdbpFile.GetFormatToUse(ioSource), slLogger);
<<<<<<< Copyright (C) 2003-2013 Dominik Reichl <[email protected]> Modified to be used with Mono for Android. Changes Copyright (C) 2013 Philipp Crocoll ======= Copyright (C) 2003-2016 Dominik Reichl <[email protected]> >>>>>>> Copyright (C) 2003-2016 Dominik Reichl <[email protected]> Modified to be used with Mono for Android. Changes Copyright (C) 2013 Philipp Crocoll <<<<<<< #if KeePassRT protected override void Dispose(bool disposing) { if(!disposing) return; #else ======= #if KeePassUAP protected override void Dispose(bool disposing) { if(!disposing) return; #else >>>>>>> #if KeePassUAP protected override void Dispose(bool disposing) { if(!disposing) return; #else
<<<<<<< /// <param name="output"></param> /// <returns></returns> internal Version GetFFmpegVersion(string output) ======= /// <param name="output">The output from "ffmpeg -version".</param> /// <returns>The FFmpeg version.</returns> internal static Version GetFFmpegVersion(string output) >>>>>>> /// <param name="output">The output from "ffmpeg -version".</param> /// <returns>The FFmpeg version.</returns> internal Version GetFFmpegVersion(string output)
<<<<<<< ItemRepository = new SqliteItemRepository(ServerConfigurationManager, this, JsonSerializer, LoggerFactory, assemblyInfo, LocalizationManager); ======= ItemRepository = new SqliteItemRepository(ServerConfigurationManager, this, JsonSerializer, LoggerFactory); >>>>>>> ItemRepository = new SqliteItemRepository(ServerConfigurationManager, this, JsonSerializer, LoggerFactory, LocalizationManager); <<<<<<< protected virtual FFMpegInstallInfo GetFfmpegInstallInfo() { var info = new FFMpegInstallInfo(); // Windows builds: http://ffmpeg.zeranoe.com/builds/ // Linux builds: http://johnvansickle.com/ffmpeg/ // OS X builds: http://ffmpegmac.net/ // OS X x64: http://www.evermeet.cx/ffmpeg/ if (EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Linux) { info.FFMpegFilename = "ffmpeg"; info.FFProbeFilename = "ffprobe"; info.ArchiveType = "7z"; info.Version = "20170308"; } else if (EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Windows) { info.FFMpegFilename = "ffmpeg.exe"; info.FFProbeFilename = "ffprobe.exe"; info.Version = "20170308"; info.ArchiveType = "7z"; } else if (EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.OSX) { info.FFMpegFilename = "ffmpeg"; info.FFProbeFilename = "ffprobe"; info.ArchiveType = "7z"; info.Version = "20170308"; } return info; } protected virtual FFMpegInfo GetFFMpegInfo() { return new FFMpegLoader(ApplicationPaths, FileSystemManager, GetFfmpegInstallInfo()) .GetFFMpegInfo(StartupOptions); } /// <summary> /// Registers the media encoder. /// </summary> /// <returns>Task.</returns> private void RegisterMediaEncoder(IServiceCollection serviceCollection) { string encoderPath = null; string probePath = null; var info = GetFFMpegInfo(); encoderPath = info.EncoderPath; probePath = info.ProbePath; var hasExternalEncoder = string.Equals(info.Version, "external", StringComparison.OrdinalIgnoreCase); var mediaEncoder = new MediaBrowser.MediaEncoding.Encoder.MediaEncoder( LoggerFactory, JsonSerializer, encoderPath, probePath, hasExternalEncoder, ServerConfigurationManager, FileSystemManager, LiveTvManager, IsoManager, LibraryManager, ChannelManager, SessionManager, () => SubtitleEncoder, () => MediaSourceManager, HttpClient, ZipClient, ProcessFactory, 5000, LocalizationManager); MediaEncoder = mediaEncoder; serviceCollection.AddSingleton(MediaEncoder); } ======= >>>>>>>
<<<<<<< using var subReader = reader.ReadSubtree(); await ParseFirstBodyChildAsync(subReader, result.Headers).ConfigureAwait(false); return result; ======= var result = new ControlRequestInfo(localName, namespaceURI); using (var subReader = reader.ReadSubtree()) { await ParseFirstBodyChildAsync(subReader, result.Headers).ConfigureAwait(false); return result; } >>>>>>> var result = new ControlRequestInfo(localName, namespaceURI); using var subReader = reader.ReadSubtree(); await ParseFirstBodyChildAsync(subReader, result.Headers).ConfigureAwait(false);
<<<<<<< /// Class GetPersonImage ======= /// Class UpdateItemImageIndex. /// </summary> [Route("/Items/{Id}/Images/{Type}/{Index}/Index", "POST", Summary = "Updates the index for an item image")] [Authenticated(Roles = "admin")] public class UpdateItemImageIndex : IReturnVoid { /// <summary> /// Gets or sets the id. /// </summary> /// <value>The id.</value> [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] public string Id { get; set; } /// <summary> /// Gets or sets the type of the image. /// </summary> /// <value>The type of the image.</value> [ApiMember(Name = "Type", Description = "Image Type", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] public ImageType Type { get; set; } /// <summary> /// Gets or sets the index. /// </summary> /// <value>The index.</value> [ApiMember(Name = "Index", Description = "Image Index", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "POST")] public int Index { get; set; } /// <summary> /// Gets or sets the new index. /// </summary> /// <value>The new index.</value> [ApiMember(Name = "NewIndex", Description = "The new image index", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")] public int NewIndex { get; set; } } /// <summary> /// Class GetPersonImage. >>>>>>> /// Class GetPersonImage. <<<<<<< /// Class ImageService ======= /// Class DeleteItemImage. /// </summary> [Route("/Items/{Id}/Images/{Type}", "DELETE")] [Route("/Items/{Id}/Images/{Type}/{Index}", "DELETE")] [Authenticated(Roles = "admin")] public class DeleteItemImage : DeleteImageRequest, IReturnVoid { /// <summary> /// Gets or sets the id. /// </summary> /// <value>The id.</value> [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")] public string Id { get; set; } } /// <summary> /// Class DeleteUserImage. /// </summary> [Route("/Users/{Id}/Images/{Type}", "DELETE")] [Route("/Users/{Id}/Images/{Type}/{Index}", "DELETE")] [Authenticated] public class DeleteUserImage : DeleteImageRequest, IReturnVoid { /// <summary> /// Gets or sets the id. /// </summary> /// <value>The id.</value> [ApiMember(Name = "Id", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")] public Guid Id { get; set; } } /// <summary> /// Class PostUserImage. /// </summary> [Route("/Users/{Id}/Images/{Type}", "POST")] [Route("/Users/{Id}/Images/{Type}/{Index}", "POST")] [Authenticated] public class PostUserImage : DeleteImageRequest, IRequiresRequestStream, IReturnVoid { /// <summary> /// Gets or sets the id. /// </summary> /// <value>The id.</value> [ApiMember(Name = "Id", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] public string Id { get; set; } /// <summary> /// The raw Http Request Input Stream. /// </summary> /// <value>The request stream.</value> public Stream RequestStream { get; set; } } /// <summary> /// Class PostItemImage. /// </summary> [Route("/Items/{Id}/Images/{Type}", "POST")] [Route("/Items/{Id}/Images/{Type}/{Index}", "POST")] [Authenticated(Roles = "admin")] public class PostItemImage : DeleteImageRequest, IRequiresRequestStream, IReturnVoid { /// <summary> /// Gets or sets the id. /// </summary> /// <value>The id.</value> [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] public string Id { get; set; } /// <summary> /// The raw Http Request Input Stream. /// </summary> /// <value>The request stream.</value> public Stream RequestStream { get; set; } } /// <summary> /// Class ImageService. >>>>>>> /// Class ImageService.
<<<<<<< @"(.+[^_\,\.\(\)\[\]\-])[_\.\(\)\[\]\-](19\d{2}|20\d{2})([ _\,\.\(\)\[\]\-][^0-9]|).*(19\d{2}|20\d{2})*", @"(.+[^_\,\.\(\)\[\]\-])[ _\.\(\)\[\]\-]+(19\d{2}|20\d{2})([ _\,\.\(\)\[\]\-][^0-9]|).*(19\d{2}|20\d{2})*", @"(.+\w)\W+\p{Ps}(19[0-9]{2}|20[0-9]{2})\p{Pe}", // Prefer year enclosed in parenthesis (){}[] @"(.+\w)\W+(19[0-9]{2}|20[0-9]{2})(\W|$)", // Secondary year surrounded by non-word chars ======= @"(.+[^_\,\.\(\)\[\]\-])[_\.\(\)\[\]\-](19[0-9]{2}|20[0-9]{2})(?![0-9]+|\W[0-9]{2}\W[0-9]{2})([ _\,\.\(\)\[\]\-][^0-9]|).*(19[0-9]{2}|20[0-9]{2})*", @"(.+[^_\,\.\(\)\[\]\-])[ _\.\(\)\[\]\-]+(19[0-9]{2}|20[0-9]{2})(?![0-9]+|\W[0-9]{2}\W[0-9]{2})([ _\,\.\(\)\[\]\-][^0-9]|).*(19[0-9]{2}|20[0-9]{2})*" >>>>>>> @"(.+[^_\,\.\(\)\[\]\-])[_\.\(\)\[\]\-](19[0-9]{2}|20[0-9]{2})(?![0-9]+|\W[0-9]{2}\W[0-9]{2})([ _\,\.\(\)\[\]\-][^0-9]|).*(19[0-9]{2}|20[0-9]{2})*", @"(.+[^_\,\.\(\)\[\]\-])[ _\.\(\)\[\]\-]+(19[0-9]{2}|20[0-9]{2})(?![0-9]+|\W[0-9]{2}\W[0-9]{2})([ _\,\.\(\)\[\]\-][^0-9]|).*(19[0-9]{2}|20[0-9]{2})*" @"(.+\w)\W+\p{Ps}(19[0-9]{2}|20[0-9]{2})\p{Pe}", // Prefer year enclosed in parenthesis (){}[] @"(.+\w)\W+(19[0-9]{2}|20[0-9]{2})(\W|$)", // Secondary year surrounded by non-word chars
<<<<<<< using Jellyfin.Server.Implementations; using Jellyfin.Server.Implementations.Activity; using Jellyfin.Server.Implementations.User; ======= using Jellyfin.Server.Implementations; using Jellyfin.Server.Implementations.Activity; >>>>>>> using Jellyfin.Server.Implementations; using Jellyfin.Server.Implementations.Activity; using Jellyfin.Server.Implementations.User; <<<<<<< ======= ((SqliteUserRepository)Resolve<IUserRepository>()).Initialize(); >>>>>>>
<<<<<<< Copyright (C) 2003-2012 Dominik Reichl <[email protected]> Modified to be used with Mono for Android. Changes Copyright (C) 2013 Philipp Crocoll ======= Copyright (C) 2003-2013 Dominik Reichl <[email protected]> >>>>>>> Copyright (C) 2003-2013 Dominik Reichl <[email protected]> Modified to be used with Mono for Android. Changes Copyright (C) 2013 Philipp Crocoll <<<<<<< public static Android.Graphics.Bitmap LoadImage(byte[] pb) ======= #if KeePassRT public static Image LoadImage(byte[] pb) { MemoryStream ms = new MemoryStream(pb, false); try { return Image.FromStream(ms); } finally { ms.Close(); } } #else public static Image LoadImage(byte[] pb) >>>>>>> public static Android.Graphics.Bitmap LoadImage(byte[] pb)
<<<<<<< [ProducesFile("video/*", "audio/*")] public ActionResult GetFile([FromRoute] Guid itemId) ======= public ActionResult GetFile([FromRoute, Required] Guid itemId) >>>>>>> [ProducesFile("video/*", "audio/*")] public ActionResult GetFile([FromRoute, Required] Guid itemId) <<<<<<< [ProducesFile("video/*", "audio/*")] public async Task<ActionResult> GetDownload([FromRoute] Guid itemId) ======= public async Task<ActionResult> GetDownload([FromRoute, Required] Guid itemId) >>>>>>> [ProducesFile("video/*", "audio/*")] public async Task<ActionResult> GetDownload([FromRoute, Required] Guid itemId)
<<<<<<< Copyright (C) 2003-2012 Dominik Reichl <[email protected]> Modified to be used with Mono for Android. Changes Copyright (C) 2013 Philipp Crocoll ======= Copyright (C) 2003-2013 Dominik Reichl <[email protected]> >>>>>>> Copyright (C) 2003-2013 Dominik Reichl <[email protected]> Modified to be used with Mono for Android. Changes Copyright (C) 2013 Philipp Crocoll <<<<<<< throw new NotSupportedException(); ======= byte[] pbPlain = StrUtil.Utf8.GetBytes(strPlainText); byte[] pbEnc = ProtectedData.Protect(pbPlain, m_pbOptEnt, DataProtectionScope.CurrentUser); #if (!KeePassLibSD && !KeePassRT) return Convert.ToBase64String(pbEnc, Base64FormattingOptions.None); #else return Convert.ToBase64String(pbEnc); #endif >>>>>>> throw new NotSupportedException();
<<<<<<< using Jellyfin.Data.Entities; ======= #pragma warning disable CS1591 >>>>>>> #pragma warning disable CS1591 using Jellyfin.Data.Entities;
<<<<<<< public ActionResult<FileStreamResult> GetGeneralImage([FromRoute, Required] string name, [FromRoute, Required] string type) ======= [ProducesImageFile] public ActionResult GetGeneralImage([FromRoute, Required] string? name, [FromRoute, Required] string? type) >>>>>>> [ProducesImageFile] public ActionResult GetGeneralImage([FromRoute, Required] string name, [FromRoute, Required] string type) <<<<<<< public ActionResult<FileStreamResult> GetRatingImage( [FromRoute, Required] string theme, [FromRoute, Required] string name) ======= [ProducesImageFile] public ActionResult GetRatingImage( [FromRoute, Required] string? theme, [FromRoute, Required] string? name) >>>>>>> [ProducesImageFile] public ActionResult GetRatingImage( [FromRoute, Required] string theme, [FromRoute, Required] string name) <<<<<<< public ActionResult<FileStreamResult> GetMediaInfoImage( [FromRoute, Required] string theme, [FromRoute, Required] string name) ======= [ProducesImageFile] public ActionResult GetMediaInfoImage( [FromRoute, Required] string? theme, [FromRoute, Required] string? name) >>>>>>> [ProducesImageFile] public ActionResult GetMediaInfoImage( [FromRoute, Required] string theme, [FromRoute, Required] string name)
<<<<<<< var mapArgs = state.IsOutputVideo ? _encodingHelper.GetMapArgs(state) : string.Empty; ======= var format = !string.IsNullOrWhiteSpace(state.Request.SegmentContainer) ? "." + state.Request.SegmentContainer : ".ts"; var directory = Path.GetDirectoryName(outputPath) ?? throw new ArgumentException($"Provided path ({outputPath}) is not valid.", nameof(outputPath)); var outputTsArg = Path.Combine(directory, Path.GetFileNameWithoutExtension(outputPath)) + "%d" + format; >>>>>>> var mapArgs = state.IsOutputVideo ? _encodingHelper.GetMapArgs(state) : string.Empty; var directory = Path.GetDirectoryName(outputPath) ?? throw new ArgumentException($"Provided path ({outputPath}) is not valid.", nameof(outputPath));
<<<<<<< using System.IO; using System.Threading.Tasks; using Jellyfin.Data.Entities; ======= using MediaBrowser.Controller.Entities; >>>>>>> using Jellyfin.Data.Entities;
<<<<<<< /// <inheritdoc /> public PackageVersionClass SystemUpdateLevel { get { #if BETA return PackageVersionClass.Beta; #else return PackageVersionClass.Release; #endif } } ======= public IFileSystem FileSystemManager { get; set; } >>>>>>> <<<<<<< serviceCollection.AddSingleton<IChannelManager, ChannelManager>(); ======= ChannelManager = new ChannelManager( UserManager, DtoService, LibraryManager, LoggerFactory.CreateLogger<ChannelManager>(), ServerConfigurationManager, FileSystemManager, UserDataManager, JsonSerializer, ProviderManager); serviceCollection.AddSingleton(ChannelManager); >>>>>>> serviceCollection.AddSingleton<IChannelManager, ChannelManager>(); <<<<<<< serviceCollection.AddSingleton<IActivityRepository, ActivityRepository>(); serviceCollection.AddSingleton<IActivityManager, ActivityManager>(); ======= var activityLogRepo = GetActivityLogRepository(); serviceCollection.AddSingleton(activityLogRepo); serviceCollection.AddSingleton<IActivityManager>(new ActivityManager(activityLogRepo, UserManager)); >>>>>>> serviceCollection.AddSingleton<IActivityRepository, ActivityRepository>(); serviceCollection.AddSingleton<IActivityManager, ActivityManager>(); <<<<<<< ======= /// Gets the user repository. /// </summary> /// <returns><see cref="Task{SqliteUserRepository}" />.</returns> private SqliteUserRepository GetUserRepository() { var repo = new SqliteUserRepository( LoggerFactory.CreateLogger<SqliteUserRepository>(), ApplicationPaths); repo.Initialize(); return repo; } private IAuthenticationRepository GetAuthenticationRepository() { var repo = new AuthenticationRepository(LoggerFactory, ServerConfigurationManager); repo.Initialize(); return repo; } private IActivityRepository GetActivityLogRepository() { var repo = new ActivityRepository(LoggerFactory.CreateLogger<ActivityRepository>(), ServerConfigurationManager.ApplicationPaths, FileSystemManager); repo.Initialize(); return repo; } /// <summary> >>>>>>> <<<<<<< SystemUpdateLevel = SystemUpdateLevel, PackageName = _startupOptions.PackageName ======= PackageName = StartupOptions.PackageName >>>>>>> PackageName = _startupOptions.PackageName
<<<<<<< /// <summary> /// Initializes a new instance of the <see cref="ChannelManager"/> class. /// </summary> /// <param name="userManager">The user manager.</param> /// <param name="dtoService">The dto service.</param> /// <param name="libraryManager">The library manager.</param> /// <param name="loggerFactory">The logger factory.</param> /// <param name="config">The server configuration manager.</param> /// <param name="fileSystem">The filesystem.</param> /// <param name="userDataManager">The user data manager.</param> /// <param name="jsonSerializer">The JSON serializer.</param> /// <param name="providerManager">The provider manager.</param> ======= private readonly ConcurrentDictionary<string, Tuple<DateTime, List<MediaSourceInfo>>> _channelItemMediaInfo = new ConcurrentDictionary<string, Tuple<DateTime, List<MediaSourceInfo>>>(); private readonly SemaphoreSlim _resourcePool = new SemaphoreSlim(1, 1); >>>>>>> private readonly ConcurrentDictionary<string, Tuple<DateTime, List<MediaSourceInfo>>> _channelItemMediaInfo = new ConcurrentDictionary<string, Tuple<DateTime, List<MediaSourceInfo>>>(); private readonly SemaphoreSlim _resourcePool = new SemaphoreSlim(1, 1); /// <summary> /// Initializes a new instance of the <see cref="ChannelManager"/> class. /// </summary> /// <param name="userManager">The user manager.</param> /// <param name="dtoService">The dto service.</param> /// <param name="libraryManager">The library manager.</param> /// <param name="loggerFactory">The logger factory.</param> /// <param name="config">The server configuration manager.</param> /// <param name="fileSystem">The filesystem.</param> /// <param name="userDataManager">The user data manager.</param> /// <param name="jsonSerializer">The JSON serializer.</param> /// <param name="providerManager">The provider manager.</param> <<<<<<< return (GetChannelProvider(i) is IHasFolderAttributes hasAttributes && hasAttributes.Attributes.Contains("Recordings", StringComparer.OrdinalIgnoreCase)) == val; ======= return (GetChannelProvider(i) is IHasFolderAttributes hasAttributes && hasAttributes.Attributes.Contains("Recordings", StringComparer.OrdinalIgnoreCase)) == val; >>>>>>> return (GetChannelProvider(i) is IHasFolderAttributes hasAttributes && hasAttributes.Attributes.Contains("Recordings", StringComparer.OrdinalIgnoreCase)) == val; <<<<<<< return _libraryManager.GetItemIds(new InternalItemsQuery { IncludeItemTypes = new[] { typeof(Channel).Name }, OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) } }).Select(i => GetChannelFeatures(i.ToString("N", CultureInfo.InvariantCulture))).ToArray(); ======= return _libraryManager.GetItemIds( new InternalItemsQuery { IncludeItemTypes = new[] { typeof(Channel).Name }, OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) } }).Select(i => GetChannelFeatures(i.ToString("N", CultureInfo.InvariantCulture))).ToArray(); >>>>>>> return _libraryManager.GetItemIds( new InternalItemsQuery { IncludeItemTypes = new[] { typeof(Channel).Name }, OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) } }).Select(i => GetChannelFeatures(i.ToString("N", CultureInfo.InvariantCulture))).ToArray(); <<<<<<< /// <summary> /// Gets the provided channel's supported features. /// </summary> /// <param name="channel">The channel.</param> /// <param name="provider">The provider.</param> /// <param name="features">The features.</param> /// <returns>The supported features.</returns> public ChannelFeatures GetChannelFeaturesDto( Channel channel, ======= public ChannelFeatures GetChannelFeaturesDto( Channel channel, >>>>>>> /// <summary> /// Gets the provided channel's supported features. /// </summary> /// <param name="channel">The channel.</param> /// <param name="provider">The provider.</param> /// <param name="features">The features.</param> /// <returns>The supported features.</returns> public ChannelFeatures GetChannelFeaturesDto( Channel channel, <<<<<<< _libraryManager.DeleteItem(deadItem, new DeleteOptions { DeleteFileLocation = false, DeleteFromExternalProvider = false }, parentItem, false); ======= _libraryManager.DeleteItem( deadItem, new DeleteOptions { DeleteFileLocation = false, DeleteFromExternalProvider = false }, parentItem, false); >>>>>>> _libraryManager.DeleteItem( deadItem, new DeleteOptions { DeleteFileLocation = false, DeleteFromExternalProvider = false }, parentItem, false);
<<<<<<< ILoggerFactory loggerFactory, IAssemblyInfo assemblyInfo, ILocalizationManager localization) ======= ILoggerFactory loggerFactory) >>>>>>> ILoggerFactory loggerFactory, ILocalizationManager localization) <<<<<<< _typeMapper = new TypeMapper(assemblyInfo); _localization = localization; ======= _typeMapper = new TypeMapper(); >>>>>>> _typeMapper = new TypeMapper(); _localization = localization;
<<<<<<< using Jellyfin.Data.Entities; ======= #pragma warning disable CS1591 >>>>>>> #pragma warning disable CS1591 using Jellyfin.Data.Entities;
<<<<<<< using MediaBrowser.Model.Querying; ======= using MediaBrowser.Model.Entities; >>>>>>> using MediaBrowser.Model.Querying; using MediaBrowser.Model.Entities; <<<<<<< /// <summary> /// Gets the filters. /// </summary> /// <param name="filters">The filter string.</param> /// <returns>IEnumerable{ItemFilter}.</returns> internal static ItemFilter[] GetFilters(string filters) { return string.IsNullOrEmpty(filters) ? Array.Empty<ItemFilter>() : Split(filters, ',', true) .Select(v => Enum.Parse<ItemFilter>(v, true)).ToArray(); } ======= /// <summary> /// Get orderby. /// </summary> /// <param name="sortBy">Sort by.</param> /// <param name="requestedSortOrder">Sort order.</param> /// <returns>Resulting order by.</returns> internal static ValueTuple<string, SortOrder>[] GetOrderBy(string? sortBy, string? requestedSortOrder) { if (string.IsNullOrEmpty(sortBy)) { return Array.Empty<ValueTuple<string, SortOrder>>(); } var vals = sortBy.Split(','); if (string.IsNullOrWhiteSpace(requestedSortOrder)) { requestedSortOrder = "Ascending"; } var sortOrders = requestedSortOrder.Split(','); var result = new ValueTuple<string, SortOrder>[vals.Length]; for (var i = 0; i < vals.Length; i++) { var sortOrderIndex = sortOrders.Length > i ? i : 0; var sortOrderValue = sortOrders.Length > sortOrderIndex ? sortOrders[sortOrderIndex] : null; var sortOrder = string.Equals(sortOrderValue, "Descending", StringComparison.OrdinalIgnoreCase) ? SortOrder.Descending : SortOrder.Ascending; result[i] = new ValueTuple<string, SortOrder>(vals[i], sortOrder); } return result; } >>>>>>> /// <summary> /// Get orderby. /// </summary> /// <param name="sortBy">Sort by.</param> /// <param name="requestedSortOrder">Sort order.</param> /// <returns>Resulting order by.</returns> internal static ValueTuple<string, SortOrder>[] GetOrderBy(string? sortBy, string? requestedSortOrder) { if (string.IsNullOrEmpty(sortBy)) { return Array.Empty<ValueTuple<string, SortOrder>>(); } var vals = sortBy.Split(','); if (string.IsNullOrWhiteSpace(requestedSortOrder)) { requestedSortOrder = "Ascending"; } var sortOrders = requestedSortOrder.Split(','); var result = new ValueTuple<string, SortOrder>[vals.Length]; for (var i = 0; i < vals.Length; i++) { var sortOrderIndex = sortOrders.Length > i ? i : 0; var sortOrderValue = sortOrders.Length > sortOrderIndex ? sortOrders[sortOrderIndex] : null; var sortOrder = string.Equals(sortOrderValue, "Descending", StringComparison.OrdinalIgnoreCase) ? SortOrder.Descending : SortOrder.Ascending; result[i] = new ValueTuple<string, SortOrder>(vals[i], sortOrder); } return result; } /// <summary> /// Gets the filters. /// </summary> /// <param name="filters">The filter string.</param> /// <returns>IEnumerable{ItemFilter}.</returns> internal static ItemFilter[] GetFilters(string filters) { return string.IsNullOrEmpty(filters) ? Array.Empty<ItemFilter>() : Split(filters, ',', true) .Select(v => Enum.Parse<ItemFilter>(v, true)).ToArray(); }
<<<<<<< using Jellyfin.Api.TypeConverters; using Jellyfin.Networking.Configuration; ======= >>>>>>> using Jellyfin.Networking.Configuration;
<<<<<<< [HttpGet("{serverId}/ContentDirectory.xml", Name = "GetContentDirectory_2")] [Produces(MediaTypeNames.Text.Xml)] ======= [HttpGet("{serverId}/ContentDirectory/ContentDirectory", Name = "GetContentDirectory_2")] [HttpGet("{serverId}/ContentDirectory/ContentDirectory.xml", Name = "GetContentDirectory_3")] [Produces(XMLContentType)] >>>>>>> [HttpGet("{serverId}/ContentDirectory/ContentDirectory", Name = "GetContentDirectory_2")] [HttpGet("{serverId}/ContentDirectory/ContentDirectory.xml", Name = "GetContentDirectory_3")] [Produces(MediaTypeNames.Text.Xml)] <<<<<<< [HttpGet("{serverId}/MediaReceiverRegistrar.xml", Name = "GetMediaReceiverRegistrar_2")] [Produces(MediaTypeNames.Text.Xml)] ======= [HttpGet("{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar", Name = "GetMediaReceiverRegistrar_2")] [HttpGet("{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar.xml", Name = "GetMediaReceiverRegistrar_3")] [Produces(XMLContentType)] >>>>>>> [HttpGet("{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar", Name = "GetMediaReceiverRegistrar_2")] [HttpGet("{serverId}/MediaReceiverRegistrar/MediaReceiverRegistrar.xml", Name = "GetMediaReceiverRegistrar_3")] [Produces(MediaTypeNames.Text.Xml)] <<<<<<< [HttpGet("{serverId}/ConnectionManager.xml", Name = "GetConnectionManager_2")] [Produces(MediaTypeNames.Text.Xml)] ======= [HttpGet("{serverId}/ConnectionManager/ConnectionManager", Name = "GetConnectionManager_2")] [HttpGet("{serverId}/ConnectionManager/ConnectionManager.xml", Name = "GetConnectionManager_3")] [Produces(XMLContentType)] >>>>>>> [HttpGet("{serverId}/ConnectionManager/ConnectionManager", Name = "GetConnectionManager_2")] [HttpGet("{serverId}/ConnectionManager/ConnectionManager.xml", Name = "GetConnectionManager_3")] [Produces(MediaTypeNames.Text.Xml)]
<<<<<<< ======= using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; >>>>>>> using MediaBrowser.Model.Querying; <<<<<<< ======= /// <summary> /// Gets the item fields. /// </summary> /// <param name="fields">The fields string.</param> /// <returns>IEnumerable{ItemFields}.</returns> internal static ItemFields[] GetItemFields(string? fields) { if (string.IsNullOrEmpty(fields)) { return Array.Empty<ItemFields>(); } return Split(fields, ',', true) .Select(v => { if (Enum.TryParse(v, true, out ItemFields value)) { return (ItemFields?)value; } return null; }).Where(i => i.HasValue) .Select(i => i!.Value) .ToArray(); } /// <summary> /// Gets the item fields. /// </summary> /// <param name="imageTypes">The image types string.</param> /// <returns>IEnumerable{ItemFields}.</returns> internal static ImageType[] GetImageTypes(string? imageTypes) { if (string.IsNullOrEmpty(imageTypes)) { return Array.Empty<ImageType>(); } return Split(imageTypes, ',', true) .Select(v => { if (Enum.TryParse(v, true, out ImageType value)) { return (ImageType?)value; } return null; }) .Where(i => i.HasValue) .Select(i => i!.Value) .ToArray(); } >>>>>>> /// <summary> /// Gets the item fields. /// </summary> /// <param name="fields">The fields string.</param> /// <returns>IEnumerable{ItemFields}.</returns> internal static ItemFields[] GetItemFields(string? fields) { if (string.IsNullOrEmpty(fields)) { return Array.Empty<ItemFields>(); } return Split(fields, ',', true) .Select(v => { if (Enum.TryParse(v, true, out ItemFields value)) { return (ItemFields?)value; } return null; }).Where(i => i.HasValue) .Select(i => i!.Value) .ToArray(); }
<<<<<<< var videoCodec = _encodingHelper.GetVideoEncoder(state, _encodingOptions); var threads = _encodingHelper.GetNumberOfThreads(state, _encodingOptions, videoCodec); ======= var videoCodec = _encodingHelper.GetVideoEncoder(state, encodingOptions); var threads = EncodingHelper.GetNumberOfThreads(state, encodingOptions, videoCodec); // GetNumberOfThreads is static. >>>>>>> var videoCodec = _encodingHelper.GetVideoEncoder(state, _encodingOptions); var threads = EncodingHelper.GetNumberOfThreads(state, _encodingOptions, videoCodec);
<<<<<<< public async Task<ActionResult> GetRemoteSubtitles([FromRoute, Required] string id) ======= [ProducesFile("text/*")] public async Task<ActionResult> GetRemoteSubtitles([FromRoute, Required] string? id) >>>>>>> [ProducesFile("text/*")] public async Task<ActionResult> GetRemoteSubtitles([FromRoute, Required] string id)
<<<<<<< [HttpGet("{serverId}/ContentDirectory.xml", Name = "GetContentDirectory_2")] [Produces(MediaTypeNames.Text.Xml)] [ProducesFile(MediaTypeNames.Text.Xml)] ======= [HttpGet("{serverId}/ContentDirectory/ContentDirectory", Name = "GetContentDirectory_2")] [HttpGet("{serverId}/ContentDirectory/ContentDirectory.xml", Name = "GetContentDirectory_3")] [Produces(XMLContentType)] >>>>>>> [HttpGet("{serverId}/ContentDirectory.xml", Name = "GetContentDirectory_2")] [Produces(MediaTypeNames.Text.Xml)] [ProducesFile(MediaTypeNames.Text.Xml)] [HttpGet("{serverId}/ContentDirectory/ContentDirectory", Name = "GetContentDirectory_2")] [HttpGet("{serverId}/ContentDirectory/ContentDirectory.xml", Name = "GetContentDirectory_3")] <<<<<<< [HttpGet("{serverId}/ConnectionManager.xml", Name = "GetConnectionManager_2")] [Produces(MediaTypeNames.Text.Xml)] [ProducesFile(MediaTypeNames.Text.Xml)] ======= [HttpGet("{serverId}/ConnectionManager/ConnectionManager", Name = "GetConnectionManager_2")] [HttpGet("{serverId}/ConnectionManager/ConnectionManager.xml", Name = "GetConnectionManager_3")] [Produces(XMLContentType)] >>>>>>> [HttpGet("{serverId}/ConnectionManager/ConnectionManager", Name = "GetConnectionManager_2")] [HttpGet("{serverId}/ConnectionManager/ConnectionManager.xml", Name = "GetConnectionManager_3")] [Produces(MediaTypeNames.Text.Xml)] [ProducesFile(MediaTypeNames.Text.Xml)]
<<<<<<< try { chapter.ImageTag = ImageProcessor.GetImageCacheTag(item, chapter); } catch (Exception ex) { Logger.LogError(ex, "Failed to create image cache tag."); } ======= chapter.ImageTag = _imageProcessor.GetImageCacheTag(item, chapter); >>>>>>> try { chapter.ImageTag = _imageProcessor.GetImageCacheTag(item, chapter); } catch (Exception ex) { Logger.LogError(ex, "Failed to create image cache tag."); }
<<<<<<< /// <summary> ======= // private static long m_lTicks2PowLess1s = 0; >>>>>>> /// <summary> // private static long m_lTicks2PowLess1s = 0; <<<<<<< /// Pack a <c>DateTime</c> object into 5 bytes. Layout: 2 zero bits, DateTime dtRoot = (new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc)).ToLocalTime(); /// year 12 bits, month 4 bits, day 5 bits, hour 5 bits, minute 6 ======= DateTime dtRoot = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); >>>>>>> /// Pack a <c>DateTime</c> object into 5 bytes. Layout: 2 zero bits, DateTime dtRoot = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); /// year 12 bits, month 4 bits, day 5 bits, hour 5 bits, minute 6
<<<<<<< byte[] Print2DCode(TwoDimensionCodeType type, string data, Size2DCode size = Size2DCode.NORMAL, CorrectionLevel2DCode correction = CorrectionLevel2DCode.PERCENT_7); ======= >>>>>>> byte[] Print2DCode(TwoDimensionCodeType type, string data, Size2DCode size = Size2DCode.NORMAL, CorrectionLevel2DCode correction = CorrectionLevel2DCode.PERCENT_7);
<<<<<<< // Specify name of the output file for the current page. args.PageFileName = string.Format(ArtifactsDir + "SavingCallback.PageFileName.Page_{0}.html", args.PageIndex); ======= // Specify name of the output file for the current page args.PageFileName = string.Format(ArtifactsDir + "Page_{0}.html", args.PageIndex); >>>>>>> // Specify name of the output file for the current page args.PageFileName = string.Format(ArtifactsDir + "SavingCallback.PageFileName.Page_{0}.html", args.PageIndex);
<<<<<<< [Test] public void FieldSymbol() { //ExStart //ExFor:FieldSymbol //ExFor:FieldSymbol.CharacterCode //ExFor:FieldSymbol.DontAffectsLineSpacing //ExFor:FieldSymbol.FontName //ExFor:FieldSymbol.FontSize //ExFor:FieldSymbol.IsAnsi //ExFor:FieldSymbol.IsShiftJis //ExFor:FieldSymbol.IsUnicode //ExSummary:Shows how to use the SYMBOL field Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); // Insert a SYMBOL field to display a symbol, designated by a character code FieldSymbol field = (FieldSymbol)builder.InsertField(FieldType.FieldSymbol, true); // The ANSI character code "U+00A9", or "169" in integer form, is reserved for the copyright symbol field.CharacterCode = 0x00a9.ToString(); field.IsAnsi = true; Assert.AreEqual(" SYMBOL 169 \\a", field.GetFieldCode()); builder.Writeln(" Line 1"); // In Unicode, the "221E" code is reserved for ths infinity symbol field = (FieldSymbol)builder.InsertField(FieldType.FieldSymbol, true); field.CharacterCode = 0x221E.ToString(); field.IsUnicode = true; // Change the appearance of our symbol // Note that some symbols can change from font to font // The full list of symbols and their fonts can be looked up in the Windows Character Map field.FontName = "Calibri"; field.FontSize = "24"; // A tall symbol like the one we placed can also be made to not push down the text on its line field.DontAffectsLineSpacing = true; Assert.AreEqual(" SYMBOL 8734 \\u \\f Calibri \\s 24 \\h", field.GetFieldCode()); builder.Writeln("Line 2"); // Display a symbol from the Shift-JIS, also known as the Windows-932 code page // With a font that supports Shift-JIS, this symbol will display "あ", which is the large Hiragana letter "A" field = (FieldSymbol)builder.InsertField(FieldType.FieldSymbol, true); field.FontName = "MS Gothic"; field.CharacterCode = 0x82A0.ToString(); field.IsShiftJis = true; Assert.AreEqual(" SYMBOL 33440 \\f \"MS Gothic\" \\j", field.GetFieldCode()); builder.Write("Line 3"); doc.Save(ArtifactsDir + "Field.SYMBOL.docx"); //ExEnd } ======= [Test] [Ignore("WORDSNET-18137")] public void FieldTemplate() { //ExStart //ExFor:FieldTemplate //ExFor:FieldTemplate.IncludeFullPath //ExSummary:Shows how to display the location of the document's template with a TEMPLATE field. Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); FieldTemplate field = (FieldTemplate)builder.InsertField(FieldType.FieldTemplate, false); Assert.AreEqual(" TEMPLATE ", field.GetFieldCode()); builder.Writeln(); field = (FieldTemplate)builder.InsertField(FieldType.FieldTemplate, false); field.IncludeFullPath = true; Assert.AreEqual(" TEMPLATE \\p", field.GetFieldCode()); doc.UpdateFields(); doc.Save(ArtifactsDir + "Field.TEMPLATE.docx"); //ExEnd } >>>>>>> [Test] [Ignore("WORDSNET-18137")] public void FieldTemplate() { //ExStart //ExFor:FieldTemplate //ExFor:FieldTemplate.IncludeFullPath //ExSummary:Shows how to display the location of the document's template with a TEMPLATE field. Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); FieldTemplate field = (FieldTemplate)builder.InsertField(FieldType.FieldTemplate, false); Assert.AreEqual(" TEMPLATE ", field.GetFieldCode()); builder.Writeln(); field = (FieldTemplate)builder.InsertField(FieldType.FieldTemplate, false); field.IncludeFullPath = true; Assert.AreEqual(" TEMPLATE \\p", field.GetFieldCode()); doc.UpdateFields(); doc.Save(ArtifactsDir + "Field.TEMPLATE.docx"); //ExEnd } [Test] public void FieldSymbol() { //ExStart //ExFor:FieldSymbol //ExFor:FieldSymbol.CharacterCode //ExFor:FieldSymbol.DontAffectsLineSpacing //ExFor:FieldSymbol.FontName //ExFor:FieldSymbol.FontSize //ExFor:FieldSymbol.IsAnsi //ExFor:FieldSymbol.IsShiftJis //ExFor:FieldSymbol.IsUnicode //ExSummary:Shows how to use the SYMBOL field Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); // Insert a SYMBOL field to display a symbol, designated by a character code FieldSymbol field = (FieldSymbol)builder.InsertField(FieldType.FieldSymbol, true); // The ANSI character code "U+00A9", or "169" in integer form, is reserved for the copyright symbol field.CharacterCode = 0x00a9.ToString(); field.IsAnsi = true; Assert.AreEqual(" SYMBOL 169 \\a", field.GetFieldCode()); builder.Writeln(" Line 1"); // In Unicode, the "221E" code is reserved for ths infinity symbol field = (FieldSymbol)builder.InsertField(FieldType.FieldSymbol, true); field.CharacterCode = 0x221E.ToString(); field.IsUnicode = true; // Change the appearance of our symbol // Note that some symbols can change from font to font // The full list of symbols and their fonts can be looked up in the Windows Character Map field.FontName = "Calibri"; field.FontSize = "24"; // A tall symbol like the one we placed can also be made to not push down the text on its line field.DontAffectsLineSpacing = true; Assert.AreEqual(" SYMBOL 8734 \\u \\f Calibri \\s 24 \\h", field.GetFieldCode()); builder.Writeln("Line 2"); // Display a symbol from the Shift-JIS, also known as the Windows-932 code page // With a font that supports Shift-JIS, this symbol will display "あ", which is the large Hiragana letter "A" field = (FieldSymbol)builder.InsertField(FieldType.FieldSymbol, true); field.FontName = "MS Gothic"; field.CharacterCode = 0x82A0.ToString(); field.IsShiftJis = true; Assert.AreEqual(" SYMBOL 33440 \\f \"MS Gothic\" \\j", field.GetFieldCode()); builder.Write("Line 3"); doc.Save(ArtifactsDir + "Field.SYMBOL.docx"); //ExEnd }
<<<<<<< [Test] public void DocumentHasSmartArtObject() { //ExStart //ExFor:Shape.HasSmartArt //ExSummary:Shows how to detect that Shape has a SmartArt object. Document doc = new Document(MyDir + "Shape.SmartArt.docx"); int count = 0; foreach (Shape shape in doc.GetChildNodes(NodeType.Shape, true)) { if (shape.HasSmartArt) count++; } Console.WriteLine("The document has {0} shapes with SmartArt.", count); //ExEnd } ======= [Test] public void OfficeMathRenderer() { //ExStart //ExFor:NodeRendererBase //ExFor:NodeRendererBase.BoundsInPoints //ExFor:NodeRendererBase.GetBoundsInPixels(Single, Single) //ExFor:NodeRendererBase.GetBoundsInPixels(Single, Single, Single) //ExFor:NodeRendererBase.GetOpaqueBoundsInPixels(Single, Single) //ExFor:NodeRendererBase.GetOpaqueBoundsInPixels(Single, Single, Single) //ExFor:NodeRendererBase.GetSizeInPixels(Single, Single) //ExFor:NodeRendererBase.GetSizeInPixels(Single, Single, Single) //ExFor:NodeRendererBase.OpaqueBoundsInPoints //ExFor:NodeRendererBase.SizeInPoints //ExFor:OfficeMathRenderer //ExFor:OfficeMathRenderer.#ctor(Math.OfficeMath) //ExSummary:Shows how to measure and scale shapes. // Open a document that contains an OfficeMath object Document doc = new Document(MyDir + "Shape.OfficeMath.docx"); // Create a renderer for the OfficeMath object OfficeMath officeMath = (OfficeMath)doc.GetChild(NodeType.OfficeMath, 0, true); OfficeMathRenderer renderer = new OfficeMathRenderer(officeMath); // We can measure the size of the image that the OfficeMath object will create when we render it Assert.AreEqual(117.0f, renderer.SizeInPoints.Width, 0.1f); Assert.AreEqual(12.9f, renderer.SizeInPoints.Height, 0.1f); Assert.AreEqual(117.0f, renderer.BoundsInPoints.Width, 0.1f); Assert.AreEqual(12.9f, renderer.BoundsInPoints.Height, 0.1f); // Shapes with transparent parts may return different values here Assert.AreEqual(117.0f, renderer.OpaqueBoundsInPoints.Width, 0.1f); Assert.AreEqual(14.7f, renderer.OpaqueBoundsInPoints.Height, 0.1f); // Get the shape size in pixels, with linear scaling to a specific DPI Rectangle bounds = renderer.GetBoundsInPixels(1.0f, 96.0f); Assert.AreEqual(156, bounds.Width); Assert.AreEqual(18, bounds.Height); // Get the shape size in pixels, but with a different DPI for the horizontal and vertical dimensions bounds = renderer.GetBoundsInPixels(1.0f, 96.0f, 150.0f); Assert.AreEqual(156, bounds.Width); Assert.AreEqual(27, bounds.Height); // The opaque bounds may vary here also bounds = renderer.GetOpaqueBoundsInPixels(1.0f, 96.0f); Assert.AreEqual(156, bounds.Width); Assert.AreEqual(20, bounds.Height); bounds = renderer.GetOpaqueBoundsInPixels(1.0f, 96.0f, 150.0f); Assert.AreEqual(156, bounds.Width); Assert.AreEqual(31, bounds.Height); //ExEnd } #if !(NETSTANDARD2_0 || __MOBILE__) //ExStart //ExFor:NodeRendererBase.RenderToScale(Graphics, Single, Single, Single) //ExFor:NodeRendererBase.RenderToSize(Graphics, Single, Single, Single, Single) //ExFor:ShapeRenderer //ExFor:ShapeRenderer.#ctor(ShapeBase) //ExSummary:Shows how to render a shape with a Graphics object. [Test, Category("IgnoreOnJenkins")] //ExSkip public void DisplayShapeForm() { // Create a new ShapeForm instance and show it as a dialog box ShapeForm shapeForm = new ShapeForm(); shapeForm.ShowDialog(); } /// <summary> /// Windows Form that renders and displays shapes from a document. /// </summary> private class ShapeForm : Form { protected override void OnPaint(PaintEventArgs e) { // Set the size of the Form canvas this.Size = new Size(1000, 800); // Open a document and get its first shape, which is a chart Document doc = new Document(MyDir + "Shape.VarietyOfShapes.docx"); Shape shape = (Shape)doc.GetChild(NodeType.Shape, 1, true); // Create a ShapeRenderer instance and a Graphics object // The ShapeRenderer will render the shape that is passed during construction over the Graphics object // Whatever is rendered on this Graphics object will be displayed on the screen inside this form ShapeRenderer renderer = new ShapeRenderer(shape); Graphics formGraphics = CreateGraphics(); // Call this method on the renderer to render the chart in the passed Graphics object, // on a specified x/y coordinate and scale renderer.RenderToScale(formGraphics, 0, 0, 1.5f); // Get another shape from the document, and render it to a specific size instead of a linear scale GroupShape groupShape = (GroupShape)doc.GetChild(NodeType.GroupShape, 0, true); renderer = new ShapeRenderer(groupShape); renderer.RenderToSize(formGraphics, 500, 400, 100, 200); } } //ExEnd #endif >>>>>>> [Test] public void DocumentHasSmartArtObject() { //ExStart //ExFor:Shape.HasSmartArt //ExSummary:Shows how to detect that Shape has a SmartArt object. Document doc = new Document(MyDir + "Shape.SmartArt.docx"); int count = 0; foreach (Shape shape in doc.GetChildNodes(NodeType.Shape, true)) { if (shape.HasSmartArt) count++; } Console.WriteLine("The document has {0} shapes with SmartArt.", count); //ExEnd } [Test] public void OfficeMathRenderer() { //ExStart //ExFor:NodeRendererBase //ExFor:NodeRendererBase.BoundsInPoints //ExFor:NodeRendererBase.GetBoundsInPixels(Single, Single) //ExFor:NodeRendererBase.GetBoundsInPixels(Single, Single, Single) //ExFor:NodeRendererBase.GetOpaqueBoundsInPixels(Single, Single) //ExFor:NodeRendererBase.GetOpaqueBoundsInPixels(Single, Single, Single) //ExFor:NodeRendererBase.GetSizeInPixels(Single, Single) //ExFor:NodeRendererBase.GetSizeInPixels(Single, Single, Single) //ExFor:NodeRendererBase.OpaqueBoundsInPoints //ExFor:NodeRendererBase.SizeInPoints //ExFor:OfficeMathRenderer //ExFor:OfficeMathRenderer.#ctor(Math.OfficeMath) //ExSummary:Shows how to measure and scale shapes. // Open a document that contains an OfficeMath object Document doc = new Document(MyDir + "Shape.OfficeMath.docx"); // Create a renderer for the OfficeMath object OfficeMath officeMath = (OfficeMath)doc.GetChild(NodeType.OfficeMath, 0, true); OfficeMathRenderer renderer = new OfficeMathRenderer(officeMath); // We can measure the size of the image that the OfficeMath object will create when we render it Assert.AreEqual(117.0f, renderer.SizeInPoints.Width, 0.1f); Assert.AreEqual(12.9f, renderer.SizeInPoints.Height, 0.1f); Assert.AreEqual(117.0f, renderer.BoundsInPoints.Width, 0.1f); Assert.AreEqual(12.9f, renderer.BoundsInPoints.Height, 0.1f); // Shapes with transparent parts may return different values here Assert.AreEqual(117.0f, renderer.OpaqueBoundsInPoints.Width, 0.1f); Assert.AreEqual(14.7f, renderer.OpaqueBoundsInPoints.Height, 0.1f); // Get the shape size in pixels, with linear scaling to a specific DPI Rectangle bounds = renderer.GetBoundsInPixels(1.0f, 96.0f); Assert.AreEqual(156, bounds.Width); Assert.AreEqual(18, bounds.Height); // Get the shape size in pixels, but with a different DPI for the horizontal and vertical dimensions bounds = renderer.GetBoundsInPixels(1.0f, 96.0f, 150.0f); Assert.AreEqual(156, bounds.Width); Assert.AreEqual(27, bounds.Height); // The opaque bounds may vary here also bounds = renderer.GetOpaqueBoundsInPixels(1.0f, 96.0f); Assert.AreEqual(156, bounds.Width); Assert.AreEqual(20, bounds.Height); bounds = renderer.GetOpaqueBoundsInPixels(1.0f, 96.0f, 150.0f); Assert.AreEqual(156, bounds.Width); Assert.AreEqual(31, bounds.Height); //ExEnd } #if !(NETSTANDARD2_0 || __MOBILE__) //ExStart //ExFor:NodeRendererBase.RenderToScale(Graphics, Single, Single, Single) //ExFor:NodeRendererBase.RenderToSize(Graphics, Single, Single, Single, Single) //ExFor:ShapeRenderer //ExFor:ShapeRenderer.#ctor(ShapeBase) //ExSummary:Shows how to render a shape with a Graphics object. [Test, Category("IgnoreOnJenkins")] //ExSkip public void DisplayShapeForm() { // Create a new ShapeForm instance and show it as a dialog box ShapeForm shapeForm = new ShapeForm(); shapeForm.ShowDialog(); } /// <summary> /// Windows Form that renders and displays shapes from a document. /// </summary> private class ShapeForm : Form { protected override void OnPaint(PaintEventArgs e) { // Set the size of the Form canvas this.Size = new Size(1000, 800); // Open a document and get its first shape, which is a chart Document doc = new Document(MyDir + "Shape.VarietyOfShapes.docx"); Shape shape = (Shape)doc.GetChild(NodeType.Shape, 1, true); // Create a ShapeRenderer instance and a Graphics object // The ShapeRenderer will render the shape that is passed during construction over the Graphics object // Whatever is rendered on this Graphics object will be displayed on the screen inside this form ShapeRenderer renderer = new ShapeRenderer(shape); Graphics formGraphics = CreateGraphics(); // Call this method on the renderer to render the chart in the passed Graphics object, // on a specified x/y coordinate and scale renderer.RenderToScale(formGraphics, 0, 0, 1.5f); // Get another shape from the document, and render it to a specific size instead of a linear scale GroupShape groupShape = (GroupShape)doc.GetChild(NodeType.GroupShape, 0, true); renderer = new ShapeRenderer(groupShape); renderer.RenderToSize(formGraphics, 500, 400, 100, 200); } } //ExEnd #endif
<<<<<<< [Test] public void ResolveFontsBeforeLoadingDocument() { //ExStart //ExFor:LoadOptions.FontSettings //ExSummary:Shows how to resolve fonts before loading HTML and SVG documents. FontSettings fontSettings = new FontSettings(); TableSubstitutionRule substitutionRule = fontSettings.SubstitutionSettings.TableSubstitution; // If "HaettenSchweiler" is not installed on the local machine, // it is still considered available, because it is substituted with "Comic Sans MS" substitutionRule.AddSubstitutes("HaettenSchweiler", new string[] { "Comic Sans MS" }); LoadOptions loadOptions = new LoadOptions(); loadOptions.FontSettings = fontSettings; // The same for SVG document Document doc = new Document(MyDir + "Document.LoadFormat.html", loadOptions); //ExEnd } ======= [Test] public void GetFontLeading() { //ExStart //ExFor:Font.LineSpacing //ExSummary:Shows how to get line spacing of current font (in points) DocumentBuilder builder = new DocumentBuilder(new Document()); builder.Font.Name = "Calibri"; builder.Writeln("qText"); // Obtain line spacing. Aspose.Words.Font font = builder.Document.FirstSection.Body.FirstParagraph.Runs[0].Font; Console.WriteLine($"lineSpacing = { font.LineSpacing }"); //ExEnd } [Test] public void HasDmlEffect() { //ExStart //ExFor:Font.HasDmlEffect(TextDmlEffect) //ExSummary:Shows how to checks if particular Dml text effect is applied. Document doc = new Document(MyDir + "Font.HasDmlEffect.docx"); RunCollection runs = doc.FirstSection.Body.FirstParagraph.Runs; Assert.True(runs[0].Font.HasDmlEffect(TextDmlEffect.Shadow)); Assert.True(runs[1].Font.HasDmlEffect(TextDmlEffect.Shadow)); Assert.True(runs[2].Font.HasDmlEffect(TextDmlEffect.Reflection)); Assert.True(runs[3].Font.HasDmlEffect(TextDmlEffect.Effect3D)); Assert.True(runs[4].Font.HasDmlEffect(TextDmlEffect.Fill)); //ExEnd } //ExStart //ExFor:StreamFontSource //ExFor:StreamFontSource.OpenFontDataStream //ExSummary:Shows how to allows to load fonts from stream. [Test] //ExSkip public void StreamFontSourceFileRendering() { FontSettings fontSettings = new FontSettings(); fontSettings.SetFontsSources(new FontSourceBase[] { new StreamFontSourceFile() }); DocumentBuilder builder = new DocumentBuilder(); builder.Document.FontSettings = fontSettings; builder.Font.Name = "Kreon-Regular"; builder.Writeln("Test aspose text when saving to PDF."); builder.Document.Save(ArtifactsDir + "Font.StreamFontSourceFileRendering.pdf"); } /// <summary> /// Load the font data only when it is required and not to store it in the memory for the "FontSettings" lifetime. /// </summary> private class StreamFontSourceFile : StreamFontSource { public override Stream OpenFontDataStream() { return File.OpenRead(FontsDir + "Kreon-Regular.ttf"); } } //ExEnd >>>>>>> [Test] public void ResolveFontsBeforeLoadingDocument() { //ExStart //ExFor:LoadOptions.FontSettings //ExSummary:Shows how to resolve fonts before loading HTML and SVG documents. FontSettings fontSettings = new FontSettings(); TableSubstitutionRule substitutionRule = fontSettings.SubstitutionSettings.TableSubstitution; // If "HaettenSchweiler" is not installed on the local machine, // it is still considered available, because it is substituted with "Comic Sans MS" substitutionRule.AddSubstitutes("HaettenSchweiler", new string[] { "Comic Sans MS" }); LoadOptions loadOptions = new LoadOptions(); loadOptions.FontSettings = fontSettings; // The same for SVG document Document doc = new Document(MyDir + "Document.LoadFormat.html", loadOptions); //ExEnd } [Test] public void GetFontLeading() { //ExStart //ExFor:Font.LineSpacing //ExSummary:Shows how to get line spacing of current font (in points) DocumentBuilder builder = new DocumentBuilder(new Document()); builder.Font.Name = "Calibri"; builder.Writeln("qText"); // Obtain line spacing. Aspose.Words.Font font = builder.Document.FirstSection.Body.FirstParagraph.Runs[0].Font; Console.WriteLine($"lineSpacing = { font.LineSpacing }"); //ExEnd } [Test] public void HasDmlEffect() { //ExStart //ExFor:Font.HasDmlEffect(TextDmlEffect) //ExSummary:Shows how to checks if particular Dml text effect is applied. Document doc = new Document(MyDir + "Font.HasDmlEffect.docx"); RunCollection runs = doc.FirstSection.Body.FirstParagraph.Runs; Assert.True(runs[0].Font.HasDmlEffect(TextDmlEffect.Shadow)); Assert.True(runs[1].Font.HasDmlEffect(TextDmlEffect.Shadow)); Assert.True(runs[2].Font.HasDmlEffect(TextDmlEffect.Reflection)); Assert.True(runs[3].Font.HasDmlEffect(TextDmlEffect.Effect3D)); Assert.True(runs[4].Font.HasDmlEffect(TextDmlEffect.Fill)); //ExEnd } //ExStart //ExFor:StreamFontSource //ExFor:StreamFontSource.OpenFontDataStream //ExSummary:Shows how to allows to load fonts from stream. [Test] //ExSkip public void StreamFontSourceFileRendering() { FontSettings fontSettings = new FontSettings(); fontSettings.SetFontsSources(new FontSourceBase[] { new StreamFontSourceFile() }); DocumentBuilder builder = new DocumentBuilder(); builder.Document.FontSettings = fontSettings; builder.Font.Name = "Kreon-Regular"; builder.Writeln("Test aspose text when saving to PDF."); builder.Document.Save(ArtifactsDir + "Font.StreamFontSourceFileRendering.pdf"); } /// <summary> /// Load the font data only when it is required and not to store it in the memory for the "FontSettings" lifetime. /// </summary> private class StreamFontSourceFile : StreamFontSource { public override Stream OpenFontDataStream() { return File.OpenRead(FontsDir + "Kreon-Regular.ttf"); } } //ExEnd
<<<<<<< // Convert the document to any format supported by Aspose.Words. doc.Save(ArtifactsDir + "Document.OpenDocumentFromWeb.docx"); ======= // Convert the document to any format supported by Aspose.Words doc.Save(ArtifactsDir + "Document.OpenFromWeb.docx"); >>>>>>> // Convert the document to any format supported by Aspose.Words doc.Save(ArtifactsDir + "Document.OpenDocumentFromWeb.docx"); <<<<<<< // Save the document to disk. // The extension of the filename can be changed to save the document into other formats. e.g PDF, DOCX, ODT, RTF. doc.Save(ArtifactsDir + "Document.InsertHtmlFromWebPage.doc"); ======= // Save the document to disk // The extension of the filename can be changed to save the document into other formats. e.g PDF, DOCX, ODT, RTF doc.Save(ArtifactsDir + "Document.HtmlPageFromWebpage.doc"); >>>>>>> // Save the document to disk // The extension of the filename can be changed to save the document into other formats. e.g PDF, DOCX, ODT, RTF. doc.Save(ArtifactsDir + "Document.InsertHtmlFromWebPage.doc"); <<<<<<< // Save the document in EPUB format. doc.Save(ArtifactsDir + "Document.Doc2EpubSave.epub"); ======= // Save the document in EPUB format doc.Save(ArtifactsDir + "Document.EpubConversion.epub"); >>>>>>> // Save the document in EPUB format doc.Save(ArtifactsDir + "Document.Doc2EpubSave.epub"); <<<<<<< // Export the document as an EPUB file. doc.Save(ArtifactsDir + "Document.Doc2EpubSaveOptions.epub", saveOptions); ======= // Export the document as an EPUB file doc.Save(ArtifactsDir + "Document.EpubConversion.epub", saveOptions); >>>>>>> // Export the document as an EPUB file doc.Save(ArtifactsDir + "Document.Doc2EpubSaveOptions.epub", saveOptions); <<<<<<< // Verify the images were saved to the correct location. Assert.IsTrue(File.Exists(ArtifactsDir + "Document.SaveHtmlWithOptions.html")); ======= // Verify the images were saved to the correct location Assert.IsTrue(File.Exists(ArtifactsDir + "Document.SaveWithOptions.html")); >>>>>>> // Verify the images were saved to the correct location Assert.IsTrue(File.Exists(ArtifactsDir + "Document.SaveHtmlWithOptions.html")); <<<<<<< String path = ArtifactsDir + "Document.AppendAllDocumentsInFolder.doc"; ======= string path = ArtifactsDir + "Document.AppendDocumentsFromFolder.doc"; >>>>>>> string path = ArtifactsDir + "Document.AppendAllDocumentsInFolder.doc"; <<<<<<< //Assert that number of columns gets correct doc = new Document(ArtifactsDir + "Document.FootnoteColumns.docx"); ======= // Assert that number of columns gets correct doc = new Document(ArtifactsDir + "Document.FootnoteOptions.docx"); >>>>>>> // Assert that number of columns gets correct doc = new Document(ArtifactsDir + "Document.FootnoteColumns.docx"); <<<<<<< //Check that revisions are in balloons doc.Save(ArtifactsDir + "Document.ShowRevisionBalloons.pdf"); ======= // Check that revisions are in balloons doc.Save(ArtifactsDir + "ShowRevisionBalloons.pdf"); >>>>>>> // Check that revisions are in balloons doc.Save(ArtifactsDir + "Document.ShowRevisionBalloons.pdf");
<<<<<<< [Test] public void InsertAtMailMerge() ======= //ExStart //ExFor:CompositeNode.HasChildNodes //ExSummary:Demonstrates how to use the InsertDocument method to insert a document into a merge field during mail merge. [Test] //ExSkip public void InsertDocumentAtMailMerge() >>>>>>> //ExStart //ExFor:CompositeNode.HasChildNodes //ExSummary:Demonstrates how to use the InsertDocument method to insert a document into a merge field during mail merge. [Test] //ExSkip public void InsertAtMailMerge()
<<<<<<< [Test] public void InsertHtml() ======= //ExStart //ExFor:DocumentBuilder.InsertHtml(String) //ExFor:MailMerge.FieldMergingCallback //ExFor:IFieldMergingCallback //ExFor:FieldMergingArgs //ExFor:FieldMergingArgsBase //ExFor:FieldMergingArgsBase.Field //ExFor:FieldMergingArgsBase.DocumentFieldName //ExFor:FieldMergingArgsBase.Document //ExFor:FieldMergingArgsBase.FieldValue //ExFor:IFieldMergingCallback.FieldMerging //ExFor:FieldMergingArgs.Text //ExFor:FieldMergeField.TextBefore //ExSummary:Shows how to mail merge HTML data into a document. [Test] //ExSkip public void MailMergeInsertHtml() >>>>>>> //ExStart //ExFor:DocumentBuilder.InsertHtml(String) //ExFor:MailMerge.FieldMergingCallback //ExFor:IFieldMergingCallback //ExFor:FieldMergingArgs //ExFor:FieldMergingArgsBase //ExFor:FieldMergingArgsBase.Field //ExFor:FieldMergingArgsBase.DocumentFieldName //ExFor:FieldMergingArgsBase.Document //ExFor:FieldMergingArgsBase.FieldValue //ExFor:IFieldMergingCallback.FieldMerging //ExFor:FieldMergingArgs.Text //ExFor:FieldMergeField.TextBefore //ExSummary:Shows how to mail merge HTML data into a document. [Test] //ExSkip public void InsertHtml() <<<<<<< // Save resulting document with a new name. doc.Save(ArtifactsDir + "MailMergeEvent.InsertHtml.doc"); ======= // Save resulting document with a new name doc.Save(ArtifactsDir + "MailMerge.InsertHtml.doc"); >>>>>>> // Save resulting document with a new name doc.Save(ArtifactsDir + "MailMergeEvent.InsertHtml.doc"); <<<<<<< [Test] public void InsertCheckBox() ======= //ExStart //ExFor:DocumentBuilder.MoveToMergeField(String) //ExFor:FieldMergingArgsBase.FieldName //ExFor:FieldMergingArgsBase.TableName //ExFor:FieldMergingArgsBase.RecordIndex //ExSummary:Shows how to insert checkbox form fields into a document during mail merge. [Test] //ExSkip public void MailMergeInsertCheckBox() >>>>>>> //ExStart //ExFor:DocumentBuilder.MoveToMergeField(String) //ExFor:FieldMergingArgsBase.FieldName //ExFor:FieldMergingArgsBase.TableName //ExFor:FieldMergingArgsBase.RecordIndex //ExSummary:Shows how to insert checkbox form fields into a document during mail merge. [Test] //ExSkip public void InsertCheckBox() <<<<<<< // Save resulting document with a new name. doc.Save(ArtifactsDir + "MailMergeEvent.InsertCheckBox.doc"); ======= // Save resulting document with a new name doc.Save(ArtifactsDir + "MailMerge.InsertCheckBox.doc"); >>>>>>> // Save resulting document with a new name doc.Save(ArtifactsDir + "MailMergeEvent.InsertCheckBox.doc"); <<<<<<< [Test] public void AlternatingRows() ======= //ExStart //ExFor:MailMerge.ExecuteWithRegions(DataTable) //ExSummary:Demonstrates how to implement custom logic in the MergeField event to apply cell formatting. [Test] //ExSkip public void MailMergeAlternatingRows() >>>>>>> //ExStart //ExFor:MailMerge.ExecuteWithRegions(DataTable) //ExSummary:Demonstrates how to implement custom logic in the MergeField event to apply cell formatting. [Test] //ExSkip public void AlternatingRows() <<<<<<< [Test] [Category("SkipMono")] public void ImageFromBlob() ======= //ExStart //ExFor:MailMerge.FieldMergingCallback //ExFor:MailMerge.ExecuteWithRegions(IDataReader,String) //ExFor:IFieldMergingCallback //ExFor:ImageFieldMergingArgs //ExFor:IFieldMergingCallback.FieldMerging //ExFor:IFieldMergingCallback.ImageFieldMerging //ExFor:ImageFieldMergingArgs.ImageStream //ExSummary:Shows how to insert images stored in a database BLOB field into a report. [Test] //ExSkip [Category("SkipMono")] //ExSkip public void MailMergeImageFromBlob() >>>>>>> //ExStart //ExFor:MailMerge.FieldMergingCallback //ExFor:MailMerge.ExecuteWithRegions(IDataReader,String) //ExFor:IFieldMergingCallback //ExFor:ImageFieldMergingArgs //ExFor:IFieldMergingCallback.FieldMerging //ExFor:IFieldMergingCallback.ImageFieldMerging //ExFor:ImageFieldMergingArgs.ImageStream //ExSummary:Shows how to insert images stored in a database BLOB field into a report. [Test] //ExSkip [Category("SkipMono")] //ExSkip public void ImageFromBlob()
<<<<<<< /// <summary> /// Range of status allowed if empty use default behavior /// </summary> public HttpStatusRanges HttpStatusCodeAllowed { get; private set; } ======= /// <summary> /// Gets or set the handler used when HttpException will be throw (can be used to transform exception). /// </summary> public Func<HttpException, Exception> EncapsulateHttpExceptionHandler { get; set; } >>>>>>> /// <summary> /// Range of status allowed if empty use default behavior /// </summary> public HttpStatusRanges HttpStatusCodeAllowed { get; private set; } /// <summary> /// Gets or set the handler used when HttpException will be throw (can be used to transform exception). /// </summary> public Func<HttpException, Exception> EncapsulateHttpExceptionHandler { get; set; }
<<<<<<< public string InteractiveGdbHost { get; set; } ======= public string RepositoryUrl { get; set; } >>>>>>> public string RepositoryUrl { get; set; } public string InteractiveGdbHost { get; set; }
<<<<<<< case AddStmt addStmt: unavailable = ProcessExpr(unavailable, addStmt.Variable); unavailable = ProcessExpr(unavailable, addStmt.Value); break; ======= >>>>>>> case AddStmt addStmt: unavailable = ProcessExpr(unavailable, addStmt.Variable); unavailable = ProcessExpr(unavailable, addStmt.Value); break;
<<<<<<< case SetType setType: var setElementTypeName = WriteTypeDefinition(output, setType.ElementType); var setTypeDeclName = context.Names.GetTemporaryName("SETTYPE"); context.WriteLine(output, $"static PRT_SETTYPE {setTypeDeclName} = {{ &{setElementTypeName}}};"); context.WriteLine(output, $"static PRT_TYPE {typeGenName} = {{ PRT_KIND_SET, {{ .set = &{setTypeDeclName} }} }};"); break; ======= >>>>>>> case SetType setType: var setElementTypeName = WriteTypeDefinition(output, setType.ElementType); var setTypeDeclName = context.Names.GetTemporaryName("SETTYPE"); context.WriteLine(output, $"static PRT_SETTYPE {setTypeDeclName} = {{ &{setElementTypeName}}};"); context.WriteLine(output, $"static PRT_TYPE {typeGenName} = {{ PRT_KIND_SET, {{ .set = &{setTypeDeclName} }} }};"); break; <<<<<<< case AddStmt addStmt: context.Write(output, "PrtSetAddEx("); WriteLValue(output, function, addStmt.Variable); context.Write(output, ", "); Debug.Assert(addStmt.Value is IVariableRef); WriteExpr(output, function, addStmt.Value); context.WriteLine(output, ", PRT_FALSE);"); var addValueVar = (IVariableRef)addStmt.Value; context.WriteLine(output, $"*({GetVariableReference(function, addValueVar)}) = NULL;"); break; ======= >>>>>>> case AddStmt addStmt: context.Write(output, "PrtSetAddEx("); WriteLValue(output, function, addStmt.Variable); context.Write(output, ", "); Debug.Assert(addStmt.Value is IVariableRef); WriteExpr(output, function, addStmt.Value); context.WriteLine(output, ", PRT_FALSE);"); var addValueVar = (IVariableRef)addStmt.Value; context.WriteLine(output, $"*({GetVariableReference(function, addValueVar)}) = NULL;"); break; <<<<<<< var isMap = PLanguageType.TypeIsOfKind(containsKeyExpr.Collection.Type, TypeKind.Map); var isSeq = PLanguageType.TypeIsOfKind(containsKeyExpr.Collection.Type, TypeKind.Sequence); var isSet = PLanguageType.TypeIsOfKind(containsKeyExpr.Collection.Type, TypeKind.Set); if (isMap) { ======= bool isMap = PLanguageType.TypeIsOfKind(containsKeyExpr.Collection.Type, TypeKind.Map); bool isSeq = PLanguageType.TypeIsOfKind(containsKeyExpr.Collection.Type, TypeKind.Sequence); if (isMap) { >>>>>>> var isMap = PLanguageType.TypeIsOfKind(containsKeyExpr.Collection.Type, TypeKind.Map); var isSeq = PLanguageType.TypeIsOfKind(containsKeyExpr.Collection.Type, TypeKind.Sequence); var isSet = PLanguageType.TypeIsOfKind(containsKeyExpr.Collection.Type, TypeKind.Set); if (isMap) { <<<<<<< } else if (isSet) { context.Write(output, "PrtMkBoolValue(PrtSetExists("); } else { ======= } else { >>>>>>> } else if (isSet) { context.Write(output, "PrtMkBoolValue(PrtSetExists("); } else {
<<<<<<< using Plang.Compiler.Backend.C; using Plang.Compiler.Backend.CSharp; ======= using Plang.Compiler.Backend.Prt; using Plang.Compiler.Backend.Coyote; using Plang.Compiler.Backend.Rvm; >>>>>>> using Plang.Compiler.Backend.C; using Plang.Compiler.Backend.CSharp; using Plang.Compiler.Backend.Rvm; <<<<<<< RegisterCodeGenerator(CompilerOutput.CSharp, new CSharpCodeGenerator()); RegisterCodeGenerator(CompilerOutput.C, new CCodeGenerator()); ======= RegisterCodeGenerator(CompilerOutput.Coyote, new CoyoteCodeGenerator()); RegisterCodeGenerator(CompilerOutput.C, new PrtCodeGenerator()); RegisterCodeGenerator(CompilerOutput.Rvm, new RvmCodeGenerator()); >>>>>>> RegisterCodeGenerator(CompilerOutput.CSharp, new CSharpCodeGenerator()); RegisterCodeGenerator(CompilerOutput.C, new CCodeGenerator()); RegisterCodeGenerator(CompilerOutput.Rvm, new RvmCodeGenerator());
<<<<<<< ======= /// <summary> /// If a config value is an empty string we return null, this is to keep /// backward compatibility with old code /// </summary> public static string GetConfigValue(string value) { return string.IsNullOrEmpty(value) ? null : value.Trim(); } >>>>>>>
<<<<<<< // this.Logger.AddDebugMessage("Total Length Data=" + Length + " RX: " + receive.ToHex()); ======= // this.Logger.AddDebugMessage("Total Length Data=" + Length + " RX: " + receive.ToHex()); >>>>>>> // this.Logger.AddDebugMessage("Total Length Data=" + Length + " RX: " + receive.ToHex()); <<<<<<< this.Enqueue(new Message(StrippedFrame, timestampmicro, 0)); return null; ======= this.Logger.AddDebugMessage("RX: " + StrippedFrame.ToHex()); if (TimeStampsEnabled) return Response.Create(ResponseStatus.Success, new Message(StrippedFrame, timestampmicro, 0)); return Response.Create(ResponseStatus.Success, new Message(StrippedFrame)); >>>>>>> this.Enqueue(new Message(StrippedFrame, timestampmicro, 0)); return null; <<<<<<< ======= else { this.Logger.AddDebugMessage("XPro: " + receive.ToHex()); return Response.Create(ResponseStatus.Success, new Message(receive)); } >>>>>>> <<<<<<< ======= >>>>>>> <<<<<<< await ReadDVIPacket(); ======= Response<Message> response = await ReadDVIPacket(this.GetReceiveTimeout()); if (response.Status == ResponseStatus.Success) { // this.Logger.AddDebugMessage("RX: " + response.Value.GetBytes().ToHex()); this.Enqueue(response.Value); return; } this.Logger.AddDebugMessage("DVI: no message waiting."); >>>>>>> await ReadDVIPacket();
<<<<<<< ======= static readonly ILogger log = LogManager.ForContext<ConnectionManager>(); readonly IVSGitServices vsGitServices; >>>>>>> static readonly ILogger log = LogManager.ForContext<ConnectionManager>();
<<<<<<< "GitHub.VisualStudio", "System.Windows.Interactivity" ======= "GitHub.VisualStudio", "GitHub.TeamFoundation", "GitHub.TeamFoundation.14", "GitHub.TeamFoundation.15" >>>>>>> "GitHub.VisualStudio", "GitHub.TeamFoundation.14", "GitHub.TeamFoundation.15"
<<<<<<< var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret"); ======= var target = new LoginManager(keychain, tfa, "id", "secret", scopes); >>>>>>> var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret", scopes); <<<<<<< var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret"); ======= var target = new LoginManager(keychain, tfa, "id", "secret", scopes); >>>>>>> var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret", scopes); await target.Login(host, client, "foo", "bar"); await keychain.Received().Save("foo", "123abc", host); } [Fact] public async Task LoggedInUserIsReturned() { var client = Substitute.For<IGitHubClient>(); var user = new User(); client.Authorization.GetOrCreateApplicationAuthentication("id", "secret", Arg.Any<NewAuthorization>()) .Returns(new ApplicationAuthorization("123abc")); client.User.Current().Returns(user); var keychain = Substitute.For<IKeychain>(); var tfa = Substitute.For<ITwoFactorChallengeHandler>(); var oauthListener = Substitute.For<IOAuthCallbackListener>(); var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret", scopes); <<<<<<< var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret"); ======= var target = new LoginManager(keychain, tfa, "id", "secret", scopes); >>>>>>> var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret", scopes); <<<<<<< var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret"); ======= var target = new LoginManager(keychain, tfa, "id", "secret", scopes); >>>>>>> var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret", scopes); <<<<<<< var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret"); ======= var target = new LoginManager(keychain, tfa, "id", "secret", scopes); >>>>>>> var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret", scopes); <<<<<<< var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret"); await Assert.ThrowsAsync<LoginAttemptsExceededException>(async () => await target.Login(host, client, "foo", "bar")); ======= var target = new LoginManager(keychain, tfa, "id", "secret", scopes); await Assert.ThrowsAsync<LoginAttemptsExceededException>(async () => await target.Login(host, client, "foo", "bar")); >>>>>>> var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret", scopes); await Assert.ThrowsAsync<LoginAttemptsExceededException>(async () => await target.Login(host, client, "foo", "bar")); <<<<<<< var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret"); ======= var target = new LoginManager(keychain, tfa, "id", "secret", scopes); >>>>>>> var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret", scopes); <<<<<<< var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret"); ======= var target = new LoginManager(keychain, tfa, "id", "secret", scopes); >>>>>>> var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret", scopes); <<<<<<< var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret"); ======= var target = new LoginManager(keychain, tfa, "id", "secret", scopes); >>>>>>> var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret", scopes); <<<<<<< var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret"); ======= var target = new LoginManager(keychain, tfa, "id", "secret", scopes); >>>>>>> var target = new LoginManager(keychain, tfa, oauthListener, "id", "secret", scopes);
<<<<<<< machine.Configure(UIViewType.Clone) .OnEntry(() => { RunView(UIViewType.Clone); }) .Permit(Trigger.Cancel, UIViewType.End) .Permit(Trigger.Next, UIViewType.End); machine.Configure(UIViewType.Publish) .OnEntry(() => { RunView(UIViewType.Publish); }) .Permit(Trigger.Cancel, UIViewType.End) .Permit(Trigger.Next, UIViewType.End); machine.Configure(UIViewType.Gist) .OnEntry(() => { RunView(UIViewType.Gist); }) .Permit(Trigger.Cancel, UIViewType.End) .Permit(Trigger.Next, UIViewType.End); machine.Configure(UIViewType.LogoutRequired) .OnEntry(() => { RunView(UIViewType.LogoutRequired); }) .Permit(Trigger.Cancel, UIViewType.End) .Permit(Trigger.Next, UIViewType.End); machine.Configure(UIViewType.End) .OnEntryFrom(Trigger.Cancel, () => End(false)) .OnEntryFrom(Trigger.Next, () => End(true)) .OnEntryFrom(Trigger.Finish, () => End(true)) .Permit(Trigger.Next, UIViewType.Finished); machine.Configure(UIViewType.Finished); ======= ConfigureUIHandlingStates(); >>>>>>> ConfigureUIHandlingStates(); <<<<<<< .Select(c => hosts.LookupHost(connection.HostAddress)) .Do(host => { machine.Configure(UIViewType.None) .Permit(Trigger.Auth, UIViewType.Login) .PermitIf(Trigger.Create, UIViewType.Create, () => host.IsLoggedIn) .PermitIf(Trigger.Create, UIViewType.Login, () => !host.IsLoggedIn) .PermitIf(Trigger.Clone, UIViewType.Clone, () => host.IsLoggedIn) .PermitIf(Trigger.Clone, UIViewType.Login, () => !host.IsLoggedIn) .PermitIf(Trigger.Publish, UIViewType.Publish, () => host.IsLoggedIn) .PermitIf(Trigger.Publish, UIViewType.Login, () => !host.IsLoggedIn) .PermitIf(Trigger.Gist, UIViewType.Gist, () => host.IsLoggedIn && host.SupportsGist) .PermitIf(Trigger.Gist, UIViewType.LogoutRequired, () => host.IsLoggedIn && !host.SupportsGist) .PermitIf(Trigger.Gist, UIViewType.Login, () => !host.IsLoggedIn); }) ======= >>>>>>>
<<<<<<< public const int createGistCommand = 0x400; ======= public const int openLinkCommand = 0x100; public const int copyLinkCommand = 0x101; >>>>>>> public const int createGistCommand = 0x400; public const int openLinkCommand = 0x100; public const int copyLinkCommand = 0x101;
<<<<<<< Copyright (C) 2003-2013 Dominik Reichl <[email protected]> ======= Copyright (C) 2003-2017 Dominik Reichl <[email protected]> >>>>>>> Copyright (C) 2003-2017 Dominik Reichl <[email protected]> <<<<<<< private Stream m_sBaseStream; private bool m_bWriting; ======= private readonly Stream m_sBaseStream; private readonly bool m_bWriting; >>>>>>> private readonly Stream m_sBaseStream; private bool m_bWriting; <<<<<<< public override void Flush() { m_sBaseStream.Flush(); } #if KeePassRT ======= >>>>>>> public override void Flush() { m_sBaseStream.Flush(); } #if KeePassRT
<<<<<<< [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1300:SpecifyMessageBoxOptions")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals")] ======= >>>>>>> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1300:SpecifyMessageBoxOptions")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals")] <<<<<<< ServiceProvider.AddTopLevelMenuItem(GuidList.guidGitHubCmdSet, PkgCmdIDList.addConnectionCommand, (s, e) => StartFlow(UIControllerFlow.Authentication)); ServiceProvider.AddTopLevelMenuItem(GuidList.guidGitHubCmdSet, PkgCmdIDList.showGitHubPaneCommand, (s, e) => { var window = FindToolWindow(typeof(GitHubPane), 0, true); if (window?.Frame == null) throw new NotSupportedException("Cannot create tool window"); var windowFrame = (IVsWindowFrame)window.Frame; ErrorHandler.ThrowOnFailure(windowFrame.Show()); }); ServiceProvider.AddDynamicMenuItem(GuidList.guidContextMenuSet, PkgCmdIDList.getLinkCommand, IsValidGithubRepo, OpenRepoInBrowser); ServiceProvider.AddDynamicMenuItem(GuidList.guidContextMenuSet, PkgCmdIDList.copyLinkCommand, IsValidGithubRepo, CopyRepoLinkToClipboard); ======= >>>>>>>
<<<<<<< //IObservable<object> Transition { get; } IObservable<IView> SelectFlow(UIControllerFlow choice); ======= IObservable<UserControl> SelectFlow(UIControllerFlow choice); /// <summary> /// Allows listening to the completion state of the ui flow - whether /// it was completed because it was cancelled or whether it succeeded. /// </summary> /// <returns>true for success, false for cancel</returns> IObservable<bool> ListenToCompletionState(); >>>>>>> IObservable<IView> SelectFlow(UIControllerFlow choice); /// <summary> /// Allows listening to the completion state of the ui flow - whether /// it was completed because it was cancelled or whether it succeeded. /// </summary> /// <returns>true for success, false for cancel</returns> IObservable<bool> ListenToCompletionState();
<<<<<<< private async Task<LastCommitAdapter> GetPullRequestLastCommitAdapter(HostAddress address, string owner, string name, int number) { if(readCommitStatuses == null) { readCommitStatuses = new Query() .Repository(Var(nameof(owner)), Var(nameof(name))) .PullRequest(Var(nameof(number))).Commits(last: 1).Nodes.Select( commit => new LastCommitAdapter { // CheckSuites = commit.Commit.CheckSuites(null, null, null, null, null).AllPages(10) // .Select(suite => new CheckSuiteModel // { // Conclusion = (CheckConclusionStateEnum?)suite.Conclusion, // Status = (CheckStatusStateEnum)suite.Status, // CreatedAt = suite.CreatedAt, // UpdatedAt = suite.UpdatedAt, // CheckRuns = suite.CheckRuns(null, null, null, null, null).AllPages(10) // .Select(run => new CheckRunModel // { // Conclusion = (CheckConclusionStateEnum?)run.Conclusion, // Status = (CheckStatusStateEnum)run.Status, // StartedAt = run.StartedAt, // CompletedAt = run.CompletedAt, // Annotations = run.Annotations(null, null, null, null).AllPages() // .Select(annotation => new CheckRunAnnotationModel // { // BlobUrl = annotation.BlobUrl, // StartLine = annotation.StartLine, // EndLine = annotation.EndLine, // Filename = annotation.Filename, // Message = annotation.Message, // Title = annotation.Title, // WarningLevel = (CheckAnnotationLevelEnum?)annotation.WarningLevel, // RawDetails = annotation.RawDetails // }).ToList() // }).ToList() // }).ToList(), Statuses = commit.Commit.Status .Select(context => context.Contexts.Select(statusContext => new StatusModel { State = (StatusStateEnum)statusContext.State, Context = statusContext.Context, TargetUrl = statusContext.TargetUrl, Description = statusContext.Description, AvatarUrl = statusContext.Creator.AvatarUrl(null) }).ToList() ).SingleOrDefault() } ).Compile(); } var vars = new Dictionary<string, object> { { nameof(owner), owner }, { nameof(name), name }, { nameof(number), number }, }; var connection = await graphqlFactory.CreateConnection(address); var result = await connection.Run(readCommitStatuses, vars); return result.First(); } ======= >>>>>>>
<<<<<<< Copyright (C) 2003-2013 Dominik Reichl <[email protected]> Modified to be used with Mono for Android. Changes Copyright (C) 2013 Philipp Crocoll ======= Copyright (C) 2003-2017 Dominik Reichl <[email protected]> >>>>>>> Copyright (C) 2003-2017 Dominik Reichl <[email protected]> Modified to be used with Mono for Android. Changes Copyright (C) 2013 Philipp Crocoll <<<<<<< ======= internal abstract class WrapperStream : Stream { private readonly Stream m_s; protected Stream BaseStream { get { return m_s; } } public override bool CanRead { get { return m_s.CanRead; } } public override bool CanSeek { get { return m_s.CanSeek; } } public override bool CanTimeout { get { return m_s.CanTimeout; } } public override bool CanWrite { get { return m_s.CanWrite; } } public override long Length { get { return m_s.Length; } } public override long Position { get { return m_s.Position; } set { m_s.Position = value; } } public override int ReadTimeout { get { return m_s.ReadTimeout; } set { m_s.ReadTimeout = value; } } public override int WriteTimeout { get { return m_s.WriteTimeout; } set { m_s.WriteTimeout = value; } } public WrapperStream(Stream sBase) : base() { if(sBase == null) throw new ArgumentNullException("sBase"); m_s = sBase; } #if !KeePassUAP public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { return m_s.BeginRead(buffer, offset, count, callback, state); } public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { return BeginWrite(buffer, offset, count, callback, state); } #endif protected override void Dispose(bool disposing) { if(disposing) m_s.Dispose(); base.Dispose(disposing); } #if !KeePassUAP public override int EndRead(IAsyncResult asyncResult) { return m_s.EndRead(asyncResult); } public override void EndWrite(IAsyncResult asyncResult) { m_s.EndWrite(asyncResult); } #endif public override void Flush() { m_s.Flush(); } public override int Read(byte[] buffer, int offset, int count) { return m_s.Read(buffer, offset, count); } public override int ReadByte() { return m_s.ReadByte(); } public override long Seek(long offset, SeekOrigin origin) { return m_s.Seek(offset, origin); } public override void SetLength(long value) { m_s.SetLength(value); } public override void Write(byte[] buffer, int offset, int count) { m_s.Write(buffer, offset, count); } public override void WriteByte(byte value) { m_s.WriteByte(value); } } internal sealed class IocStream : WrapperStream { private readonly bool m_bWrite; // Initially opened for writing private bool m_bDisposed = false; public IocStream(Stream sBase) : base(sBase) { m_bWrite = sBase.CanWrite; } protected override void Dispose(bool disposing) { base.Dispose(disposing); if(disposing && MonoWorkarounds.IsRequired(10163) && m_bWrite && !m_bDisposed) { try { Stream s = this.BaseStream; Type t = s.GetType(); if(t.Name == "WebConnectionStream") { PropertyInfo pi = t.GetProperty("Request", BindingFlags.Instance | BindingFlags.NonPublic); if(pi != null) { WebRequest wr = (pi.GetValue(s, null) as WebRequest); if(wr != null) IOConnection.DisposeResponse(wr.GetResponse(), false); else { Debug.Assert(false); } } else { Debug.Assert(false); } } } catch(Exception) { Debug.Assert(false); } } m_bDisposed = true; } public static Stream WrapIfRequired(Stream s) { if(s == null) { Debug.Assert(false); return null; } if(MonoWorkarounds.IsRequired(10163) && s.CanWrite) return new IocStream(s); return s; } } >>>>>>> internal abstract class WrapperStream : Stream { private readonly Stream m_s; protected Stream BaseStream { get { return m_s; } } public override bool CanRead { get { return m_s.CanRead; } } public override bool CanSeek { get { return m_s.CanSeek; } } public override bool CanTimeout { get { return m_s.CanTimeout; } } public override bool CanWrite { get { return m_s.CanWrite; } } public override long Length { get { return m_s.Length; } } public override long Position { get { return m_s.Position; } set { m_s.Position = value; } } public override int ReadTimeout { get { return m_s.ReadTimeout; } set { m_s.ReadTimeout = value; } } public override int WriteTimeout { get { return m_s.WriteTimeout; } set { m_s.WriteTimeout = value; } } public WrapperStream(Stream sBase) : base() { if(sBase == null) throw new ArgumentNullException("sBase"); m_s = sBase; } #if !KeePassUAP public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { return m_s.BeginRead(buffer, offset, count, callback, state); } public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { return BeginWrite(buffer, offset, count, callback, state); } #endif protected override void Dispose(bool disposing) { if(disposing) m_s.Dispose(); base.Dispose(disposing); } #if !KeePassUAP public override int EndRead(IAsyncResult asyncResult) { return m_s.EndRead(asyncResult); } public override void EndWrite(IAsyncResult asyncResult) { m_s.EndWrite(asyncResult); } #endif public override void Flush() { m_s.Flush(); } public override int Read(byte[] buffer, int offset, int count) { return m_s.Read(buffer, offset, count); } public override int ReadByte() { return m_s.ReadByte(); } public override long Seek(long offset, SeekOrigin origin) { return m_s.Seek(offset, origin); } public override void SetLength(long value) { m_s.SetLength(value); } public override void Write(byte[] buffer, int offset, int count) { m_s.Write(buffer, offset, count); } public override void WriteByte(byte value) { m_s.WriteByte(value); } } internal sealed class IocStream : WrapperStream { private readonly bool m_bWrite; // Initially opened for writing private bool m_bDisposed = false; public IocStream(Stream sBase) : base(sBase) { m_bWrite = sBase.CanWrite; } protected override void Dispose(bool disposing) { base.Dispose(disposing); if(disposing && MonoWorkarounds.IsRequired(10163) && m_bWrite && !m_bDisposed) { try { Stream s = this.BaseStream; Type t = s.GetType(); if(t.Name == "WebConnectionStream") { PropertyInfo pi = t.GetProperty("Request", BindingFlags.Instance | BindingFlags.NonPublic); if(pi != null) { WebRequest wr = (pi.GetValue(s, null) as WebRequest); if(wr != null) IOConnection.DisposeResponse(wr.GetResponse(), false); else { Debug.Assert(false); } } else { Debug.Assert(false); } } } catch(Exception) { Debug.Assert(false); } } m_bDisposed = true; } public static Stream WrapIfRequired(Stream s) { if(s == null) { Debug.Assert(false); return null; } if(MonoWorkarounds.IsRequired(10163) && s.CanWrite) return new IocStream(s); return s; } }
<<<<<<< public InlineAnnotationModel(CheckSuiteModel checkSuite, CheckRunModel checkRun, CheckRunAnnotationModel annotation) ======= /// <summary> /// Initializes the <see cref="InlineAnnotationModel"/>. /// </summary> /// <param name="checkRun">The check run model.</param> /// <param name="annotation">The annotation model.</param> public InlineAnnotationModel(CheckRunModel checkRun, CheckRunAnnotationModel annotation) >>>>>>> /// <summary> /// Initializes the <see cref="InlineAnnotationModel"/>. /// </summary> /// <param name="checkRun">The check run model.</param> /// <param name="annotation">The annotation model.</param> public InlineAnnotationModel(CheckSuiteModel checkSuite, CheckRunModel checkRun, CheckRunAnnotationModel annotation) <<<<<<< public string FileName => annotation.Path; ======= /// <inheritdoc /> >>>>>>> public string FileName => annotation.Path; /// <inheritdoc /> <<<<<<< public string CheckRunName => checkRun.Name; public string Title => annotation.Title; public CheckAnnotationLevel AnnotationLevel => annotation.AnnotationLevel.Value; public string Message => annotation.Message; public string HeadSha => checkSuite.HeadSha; public string LineDescription => $"{StartLine}:{EndLine}"; ======= /// <inheritdoc /> public CheckAnnotationLevel AnnotationLevel => annotation.AnnotationLevel; >>>>>>> /// <inheritdoc /> public CheckAnnotationLevel AnnotationLevel => annotation.AnnotationLevel; public string CheckRunName => checkRun.Name; public string Title => annotation.Title; public CheckAnnotationLevel AnnotationLevel => annotation.AnnotationLevel.Value; public string Message => annotation.Message; public string HeadSha => checkSuite.HeadSha; public string LineDescription => $"{StartLine}:{EndLine}";
<<<<<<< /// <inheritdoc/> public ILocalRepositoryModel LocalRepository { get; private set; } ======= /// <summary> /// Gets the local repository. /// </summary> public LocalRepositoryModel LocalRepository { get; private set; } >>>>>>> /// <inheritdoc/> public LocalRepositoryModel LocalRepository { get; private set; }
<<<<<<< using Rothko; using Serilog; using Environment = System.Environment; ======= using System.ComponentModel.Design; using GitHub.ViewModels; >>>>>>> using Rothko; using Serilog; using Environment = System.Environment; using System.ComponentModel.Design; using GitHub.ViewModels;
<<<<<<< if ((packageSettings?.ForkButton ?? false) && await IsAGitHubDotComRepo(ActiveRepoUri)) ======= if (await IsAGitHubDotComRepo()) >>>>>>> if (await IsAGitHubDotComRepo(ActiveRepoUri))
<<<<<<< return new RepositoryCreationViewModel(repositoryHost, os, creationService); ======= return new RepositoryCreationViewModel(repositoryHost, os, creationService, avatarProvider, usageTracker); >>>>>>> return new RepositoryCreationViewModel(repositoryHost, os, creationService, usageTracker); <<<<<<< Substitute.For<IRepositoryCreationService>()); ======= Substitute.For<IRepositoryCreationService>(), Substitute.For<IAvatarProvider>(), Substitute.For<IUsageTracker>()); >>>>>>> Substitute.For<IRepositoryCreationService>(), Substitute.For<IUsageTracker>());
<<<<<<< void ActivityLogMessage(string message); void ActivityLogWarning(string message); void ActivityLogError(string message); ======= void ClearNotifications(); >>>>>>> void ClearNotifications(); void ActivityLogMessage(string message); void ActivityLogWarning(string message); void ActivityLogError(string message); <<<<<<< public void ActivityLogMessage(string message) { var log = VisualStudio.Services.GetActivityLog(serviceProvider); if (log != null) { if (!ErrorHandler.Succeeded(log.LogEntry((UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_INFORMATION, Info.ApplicationInfo.ApplicationSafeName, message))) Console.WriteLine(string.Format(CultureInfo.CurrentCulture, "Could not log message to activity log: {0}", message)); } } public void ActivityLogError(string message) { var log = VisualStudio.Services.GetActivityLog(serviceProvider); if (log != null) { if (!ErrorHandler.Succeeded(log.LogEntry((UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_ERROR, Info.ApplicationInfo.ApplicationSafeName, message))) Console.WriteLine(string.Format(CultureInfo.CurrentCulture, "Could not log error to activity log: {0}", message)); } } public void ActivityLogWarning(string message) { var log = VisualStudio.Services.GetActivityLog(serviceProvider); if (log != null) { if (!ErrorHandler.Succeeded(log.LogEntry((UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_WARNING, Info.ApplicationInfo.ApplicationSafeName, message))) Console.WriteLine(string.Format(CultureInfo.CurrentCulture, "Could not log warning to activity log: {0}", message)); } } ======= public void ClearNotifications() { var manager = serviceProvider.TryGetService<ITeamExplorer>() as ITeamExplorerNotificationManager; if (manager != null) manager.ClearNotifications(); } >>>>>>> public void ClearNotifications() { var manager = serviceProvider.TryGetService<ITeamExplorer>() as ITeamExplorerNotificationManager; if (manager != null) manager.ClearNotifications(); } public void ActivityLogMessage(string message) { var log = VisualStudio.Services.GetActivityLog(serviceProvider); if (log != null) { if (!ErrorHandler.Succeeded(log.LogEntry((UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_INFORMATION, Info.ApplicationInfo.ApplicationSafeName, message))) Console.WriteLine(string.Format(CultureInfo.CurrentCulture, "Could not log message to activity log: {0}", message)); } } public void ActivityLogError(string message) { var log = VisualStudio.Services.GetActivityLog(serviceProvider); if (log != null) { if (!ErrorHandler.Succeeded(log.LogEntry((UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_ERROR, Info.ApplicationInfo.ApplicationSafeName, message))) Console.WriteLine(string.Format(CultureInfo.CurrentCulture, "Could not log error to activity log: {0}", message)); } } public void ActivityLogWarning(string message) { var log = VisualStudio.Services.GetActivityLog(serviceProvider); if (log != null) { if (!ErrorHandler.Succeeded(log.LogEntry((UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_WARNING, Info.ApplicationInfo.ApplicationSafeName, message))) Console.WriteLine(string.Format(CultureInfo.CurrentCulture, "Could not log warning to activity log: {0}", message)); } }
<<<<<<< ======= using GitHub.Models; using GitHub.Exports; >>>>>>> using GitHub.Models; using GitHub.Exports; <<<<<<< using NullGuard; using Serilog; using Serilog.Core; using Log = GitHub.Infrastructure.Log; ======= using NLog; >>>>>>> <<<<<<< ======= using System.Threading.Tasks; using GitHub.Extensions; >>>>>>> using System.Threading.Tasks; using GitHub.Extensions; using Serilog; using Log = GitHub.Infrastructure.Log; <<<<<<< ======= Guard.ArgumentNotNull(serviceType, nameof(serviceType)); if (!initializingLogging && log.Factory.Configuration == null) { initializingLogging = true; try { var logging = TryGetService(typeof(ILoggingConfiguration)) as ILoggingConfiguration; logging.Configure(); } catch { #if DEBUG throw; #endif } } >>>>>>> <<<<<<< Log.Assert(!string.IsNullOrEmpty(contract), "Every type must have a contract name"); ======= if (string.IsNullOrEmpty(contract)) { throw new GitHubLogicException("Every type must have a contract name"); } >>>>>>> if (string.IsNullOrEmpty(contract)) { throw new GitHubLogicException("Every type must have a contract name"); } <<<<<<< Log.Assert(part != null, "Adding an exported value must return a non-null part"); ======= if (part == null) { throw new GitHubLogicException("Adding an exported value must return a non-null part"); } >>>>>>> if (part == null) { throw new GitHubLogicException("Adding an exported value must return a non-null part"); }
<<<<<<< using GitHub.Settings; ======= using GitHub.Services.Vssdk.Commands; >>>>>>> using GitHub.Settings; using GitHub.Services.Vssdk.Commands; <<<<<<< using GitHub.VisualStudio.Menus; using GitHub.VisualStudio.Settings; ======= >>>>>>> using GitHub.VisualStudio.Settings; <<<<<<< var packageSettings = await GetServiceAsync(typeof(IPackageSettings)) as IPackageSettings; LogManager.EnableTraceLogging(packageSettings?.EnableTraceLogging ?? false); if (packageSettings != null) { packageSettings.PropertyChanged += (sender, args) => { if (args.PropertyName == "EnableTraceLogging") { LogManager.EnableTraceLogging(packageSettings.EnableTraceLogging); } }; } ======= >>>>>>> var packageSettings = await GetServiceAsync(typeof(IPackageSettings)) as IPackageSettings; LogManager.EnableTraceLogging(packageSettings?.EnableTraceLogging ?? false); if (packageSettings != null) { packageSettings.PropertyChanged += (sender, args) => { if (args.PropertyName == "EnableTraceLogging") { LogManager.EnableTraceLogging(packageSettings.EnableTraceLogging); } }; } <<<<<<< else if (serviceType == typeof(IMenuProvider)) { var serviceProvider = await GetServiceAsync(typeof(IGitHubServiceProvider)) as IGitHubServiceProvider; return new MenuProvider(serviceProvider); } ======= >>>>>>>
<<<<<<< using Serilog; ======= >>>>>>> using Serilog; <<<<<<< static readonly ILogger log = LogManager.ForContext<InlineCommentTagger>(); ======= static readonly IReadOnlyList<ITagSpan<InlineCommentTag>> EmptyTags = new ITagSpan<InlineCommentTag>[0]; >>>>>>> static readonly ILogger log = LogManager.ForContext<InlineCommentTagger>(); static readonly IReadOnlyList<ITagSpan<InlineCommentTag>> EmptyTags = new ITagSpan<InlineCommentTag>[0];
<<<<<<< catch (Exception e) { Kp2aLog.Log("Exception: " + e); ======= catch (AggregateException e) { string message = e.Message; foreach (var innerException in e.InnerExceptions) { message = innerException.Message; // Override the message shown with the last (hopefully most recent) inner exception Kp2aLog.Log("Exception: " + message); } Finish(false, "An error occured: " + message); return; } catch (Exception e) { Kp2aLog.Log("Exception: " + e.Message); >>>>>>> catch (AggregateException e) { string message = e.Message; foreach (var innerException in e.InnerExceptions) { message = innerException.Message; // Override the message shown with the last (hopefully most recent) inner exception Kp2aLog.Log("Exception: " + message); } Finish(false, "An error occured: " + message); return; } catch (Exception e) { Kp2aLog.Log("Exception: " + e);
<<<<<<< public PullRequestAnnotationItemViewModel(CheckSuiteModel checkSuite, CheckRunModel checkRun, CheckRunAnnotationModel annotation, IPullRequestSession session, IPullRequestEditorService editorService) ======= /// <summary> /// Initializes the <see cref="PullRequestAnnotationItemViewModel"/>. /// </summary> /// <param name="annotation">The check run annotation model.</param> public PullRequestAnnotationItemViewModel(CheckRunAnnotationModel annotation) >>>>>>> /// <summary> /// Initializes the <see cref="PullRequestAnnotationItemViewModel"/>. /// </summary> /// <param name="annotation">The check run annotation model.</param> public PullRequestAnnotationItemViewModel(CheckSuiteModel checkSuite, CheckRunModel checkRun, CheckRunAnnotationModel annotation, IPullRequestSession session, IPullRequestEditorService editorService) <<<<<<< public bool IsFileInPullRequest { get; } /// <summary> /// Gets the annotation model. /// </summary> ======= /// <inheritdoc /> >>>>>>> public bool IsFileInPullRequest { get; } /// <inheritdoc /> <<<<<<< public ReactiveCommand<Unit> OpenAnnotation { get; } /// <summary> /// Gets or sets a flag to control the expanded state. /// </summary> ======= /// <inheritdoc /> >>>>>>> public ReactiveCommand<Unit> OpenAnnotation { get; } /// <inheritdoc />
<<<<<<< Copyright (C) 2003-2013 Dominik Reichl <[email protected]> ======= Copyright (C) 2003-2016 Dominik Reichl <[email protected]> >>>>>>> Copyright (C) 2003-2016 Dominik Reichl <[email protected]> <<<<<<< #if KeePassRT using Org.BouncyCastle.Crypto.Engines; using Org.BouncyCastle.Crypto.Parameters; #endif ======= using KeePassLib.Cryptography; using KeePassLib.Cryptography.KeyDerivation; >>>>>>> using KeePassLib.Cryptography; using KeePassLib.Cryptography.KeyDerivation; <<<<<<< /// <summary> /// Transform the current key <c>uNumRounds</c> times. /// </summary> /// <param name="pbOriginalKey32">The original key which will be transformed. /// This parameter won't be modified.</param> /// <param name="pbKeySeed32">Seed used for key transformations. Must not /// be <c>null</c>. This parameter won't be modified.</param> /// <param name="uNumRounds">Transformation count.</param> /// <returns>256-bit transformed key.</returns> private static byte[] TransformKey(byte[] pbOriginalKey32, byte[] pbKeySeed32, ulong uNumRounds) { Debug.Assert((pbOriginalKey32 != null) && (pbOriginalKey32.Length == 32)); if (pbOriginalKey32 == null) throw new ArgumentNullException("pbOriginalKey32"); if (pbOriginalKey32.Length != 32) throw new ArgumentException(); Debug.Assert((pbKeySeed32 != null) && (pbKeySeed32.Length == 32)); if (pbKeySeed32 == null) throw new ArgumentNullException("pbKeySeed32"); if (pbKeySeed32.Length != 32) throw new ArgumentException(); byte[] pbNewKey = new byte[32]; Array.Copy(pbOriginalKey32, pbNewKey, pbNewKey.Length); // Try to use the native library first Stopwatch sw = new Stopwatch(); sw.Start(); if (NativeLib.TransformKey256(pbNewKey, pbKeySeed32, uNumRounds)) { sw.Stop(); Kp2aLog.Log("Native transform:" +sw.ElapsedMilliseconds+"ms"); return pbNewKey; } sw.Restart(); if(TransformKeyManaged(pbNewKey, pbKeySeed32, uNumRounds) == false) return null; sw.Stop(); Kp2aLog.Log("Managed transform:" +sw.ElapsedMilliseconds+"ms"); SHA256Managed sha256 = new SHA256Managed(); return sha256.ComputeHash(pbNewKey); } public static bool TransformKeyManaged(byte[] pbNewKey32, byte[] pbKeySeed32, ulong uNumRounds) { #if KeePassRT KeyParameter kp = new KeyParameter(pbKeySeed32); AesEngine aes = new AesEngine(); aes.Init(true, kp); for(ulong i = 0; i < uNumRounds; ++i) { aes.ProcessBlock(pbNewKey32, 0, pbNewKey32, 0); aes.ProcessBlock(pbNewKey32, 16, pbNewKey32, 16); } #else byte[] pbIV = new byte[16]; Array.Clear(pbIV, 0, pbIV.Length); RijndaelManaged r = new RijndaelManaged(); if(r.BlockSize != 128) // AES block size { Debug.Assert(false); r.BlockSize = 128; } r.IV = pbIV; r.Mode = CipherMode.ECB; r.KeySize = 256; r.Key = pbKeySeed32; ICryptoTransform iCrypt = r.CreateEncryptor(); // !iCrypt.CanReuseTransform -- doesn't work with Mono if((iCrypt == null) || (iCrypt.InputBlockSize != 16) || (iCrypt.OutputBlockSize != 16)) { Debug.Assert(false, "Invalid ICryptoTransform."); Debug.Assert((iCrypt.InputBlockSize == 16), "Invalid input block size!"); Debug.Assert((iCrypt.OutputBlockSize == 16), "Invalid output block size!"); return false; } for(ulong i = 0; i < uNumRounds; ++i) { iCrypt.TransformBlock(pbNewKey32, 0, 16, pbNewKey32, 0); iCrypt.TransformBlock(pbNewKey32, 16, 16, pbNewKey32, 16); } #endif return true; } /// <summary> /// Benchmark the <c>TransformKey</c> method. Within /// <paramref name="uMilliseconds"/> ms, random keys will be transformed /// and the number of performed transformations are returned. /// </summary> /// <param name="uMilliseconds">Test duration in ms.</param> /// <param name="uStep">Stepping. /// <paramref name="uStep" /> should be a prime number. For fast processors /// (PCs) a value of <c>3001</c> is recommended, for slower processors (PocketPC) /// a value of <c>401</c> is recommended.</param> /// <returns>Number of transformations performed in the specified /// amount of time. Maximum value is <c>uint.MaxValue</c>.</returns> public static ulong TransformKeyBenchmark(uint uMilliseconds, ulong uStep) { ulong uRounds; // Try native method if(NativeLib.TransformKeyBenchmark256(uMilliseconds, out uRounds)) return uRounds; byte[] pbKey = new byte[32]; byte[] pbNewKey = new byte[32]; for(int i = 0; i < pbKey.Length; ++i) { pbKey[i] = (byte)i; pbNewKey[i] = (byte)i; } #if KeePassRT KeyParameter kp = new KeyParameter(pbKey); AesEngine aes = new AesEngine(); aes.Init(true, kp); #else byte[] pbIV = new byte[16]; Array.Clear(pbIV, 0, pbIV.Length); RijndaelManaged r = new RijndaelManaged(); if(r.BlockSize != 128) // AES block size { Debug.Assert(false); r.BlockSize = 128; } r.IV = pbIV; r.Mode = CipherMode.ECB; r.KeySize = 256; r.Key = pbKey; ICryptoTransform iCrypt = r.CreateEncryptor(); // !iCrypt.CanReuseTransform -- doesn't work with Mono if((iCrypt == null) || (iCrypt.InputBlockSize != 16) || (iCrypt.OutputBlockSize != 16)) { Debug.Assert(false, "Invalid ICryptoTransform."); Debug.Assert(iCrypt.InputBlockSize == 16, "Invalid input block size!"); Debug.Assert(iCrypt.OutputBlockSize == 16, "Invalid output block size!"); return PwDefs.DefaultKeyEncryptionRounds; } #endif uRounds = 0; int tStart = Environment.TickCount; while(true) { for(ulong j = 0; j < uStep; ++j) { #if KeePassRT aes.ProcessBlock(pbNewKey, 0, pbNewKey, 0); aes.ProcessBlock(pbNewKey, 16, pbNewKey, 16); #else iCrypt.TransformBlock(pbNewKey, 0, 16, pbNewKey, 0); iCrypt.TransformBlock(pbNewKey, 16, 16, pbNewKey, 16); #endif } uRounds += uStep; if(uRounds < uStep) // Overflow check { uRounds = ulong.MaxValue; break; } uint tElapsed = (uint)(Environment.TickCount - tStart); if(tElapsed > uMilliseconds) break; } return uRounds; } ======= >>>>>>>
<<<<<<< using NullGuard; ======= using NLog; >>>>>>> <<<<<<< IsLoading = true; Repositories = repositoryHost.ModelService.GetRepositories(repositories) as TrackingCollection<IRemoteRepositoryModel>; repositories.OriginalCompleted.Subscribe( _ => { } , ex => { LoadingFailed = true; IsLoading = false; log.Error(ex, "Error while loading repositories"); }, () => IsLoading = false ======= IsBusy = true; repositoryHost.ModelService.GetRepositories(repositories); repositories.OriginalCompleted .ObserveOn(RxApp.MainThreadScheduler) .Subscribe( _ => { } , ex => { LoadingFailed = true; IsBusy = false; log.Error("Error while loading repositories", ex); }, () => IsBusy = false >>>>>>> IsBusy = true; repositoryHost.ModelService.GetRepositories(repositories); repositories.OriginalCompleted .ObserveOn(RxApp.MainThreadScheduler) .Subscribe( _ => { } , ex => { LoadingFailed = true; IsBusy = false; log.Error(ex, "Error while loading repositories"); }, () => IsBusy = false <<<<<<< IObservable<Unit> OnCloneRepository(object state) { return Observable.Start(() => { var repository = SelectedRepository; log.Assert(repository != null, "Should not be able to attempt to clone a repo when it's null"); if (repository == null) { notificationService.ShowError(Resources.RepositoryCloneFailedNoSelectedRepo); return Observable.Return(Unit.Default); } // The following is a noop if the directory already exists. operatingSystem.Directory.CreateDirectory(BaseRepositoryPath); return cloneService.CloneRepository(repository.CloneUrl, repository.Name, BaseRepositoryPath) .ContinueAfter(() => { usageTracker.IncrementCloneCount().Forget(); return Observable.Return(Unit.Default); }); }) .SelectMany(_ => _) .Catch<Unit, Exception>(e => { var repository = SelectedRepository; log.Assert(repository != null, "Should not be able to attempt to clone a repo when it's null"); notificationService.ShowError(e.GetUserFriendlyErrorMessage(ErrorType.ClonedFailed, repository.Name)); return Observable.Return(Unit.Default); }); } ======= >>>>>>> <<<<<<< log.Assert(path != null, "RepositoryCloneViewModel.IsAlreadyRepoAtPath cannot be passed null as a path parameter."); ======= Guard.ArgumentNotEmptyString(path, nameof(path)); >>>>>>> Guard.ArgumentNotEmptyString(path, nameof(path));