conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
Synchronizer = Config.UseTor.Value
? new WasabiSynchronizer(Network, BitcoinStore, () => Config.GetCurrentBackendUri(), Config.GetTorSocks5EndPoint())
: new WasabiSynchronizer(Network, BitcoinStore, Config.GetFallbackBackendUri(), null);
=======
if (Config.UseTor.Value)
{
Synchronizer = new WasabiSynchronizer(Network, BitcoinStore, () => Config.GetCurrentBackendUri(), Config.TorSocks5EndPoint);
}
else
{
Synchronizer = new WasabiSynchronizer(Network, BitcoinStore, Config.GetFallbackBackendUri(), null);
}
>>>>>>>
Synchronizer = Config.UseTor.Value
? new WasabiSynchronizer(Network, BitcoinStore, () => Config.GetCurrentBackendUri(), Config.TorSocks5EndPoint)
: new WasabiSynchronizer(Network, BitcoinStore, Config.GetFallbackBackendUri(), null);
<<<<<<<
TorManager = Config.UseTor.Value
? new TorProcessManager(Config.GetTorSocks5EndPoint(), TorLogsFile)
: TorProcessManager.Mock();
=======
if (Config.UseTor.Value)
{
TorManager = new TorProcessManager(Config.TorSocks5EndPoint, TorLogsFile);
}
else
{
TorManager = TorProcessManager.Mock();
}
>>>>>>>
TorManager = Config.UseTor.Value
? new TorProcessManager(Config.TorSocks5EndPoint, TorLogsFile)
: TorProcessManager.Mock();
<<<<<<<
ChaumianClient = Config.UseTor.Value
? new CcjClient(Synchronizer, Network, keyManager, () => Config.GetCurrentBackendUri(), Config.GetTorSocks5EndPoint())
: new CcjClient(Synchronizer, Network, keyManager, Config.GetFallbackBackendUri(), null);
=======
if (Config.UseTor.Value)
{
ChaumianClient = new CcjClient(Synchronizer, Network, keyManager, () => Config.GetCurrentBackendUri(), Config.TorSocks5EndPoint);
}
else
{
ChaumianClient = new CcjClient(Synchronizer, Network, keyManager, Config.GetFallbackBackendUri(), null);
}
>>>>>>>
ChaumianClient = Config.UseTor.Value
? new CcjClient(Synchronizer, Network, keyManager, () => Config.GetCurrentBackendUri(), Config.TorSocks5EndPoint)
: new CcjClient(Synchronizer, Network, keyManager, Config.GetFallbackBackendUri(), null); |
<<<<<<<
private NavigationStateViewModel _navigationState;
=======
>>>>>>>
private NavigationStateViewModel _navigationState;
<<<<<<<
_walletDictionary = new Dictionary<Wallet, WalletViewModelBase>();
SelectedItem = new HomePageViewModel(_navigationState);
=======
var addWalletPage = new AddWalletPageViewModel(screen);
SelectedItem = new HomePageViewModel(screen, walletManager, addWalletPage);
>>>>>>>
var addWalletPage = new AddWalletPageViewModel(_navigationState);
SelectedItem = new HomePageViewModel(_navigationState, walletManager, addWalletPage);
<<<<<<<
_bottomItems.Add(new AddWalletPageViewModel(_navigationState));
_bottomItems.Add(new SettingsPageViewModel(_navigationState));
=======
_bottomItems.Add(addWalletPage);
_bottomItems.Add(new SettingsPageViewModel(screen));
>>>>>>>
_bottomItems.Add(addWalletPage);
_bottomItems.Add(new SettingsPageViewModel(_navigationState));
<<<<<<<
Observable
.FromEventPattern<WalletState>(walletManager, nameof(WalletManager.WalletStateChanged))
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(x =>
{
var wallet = x.Sender as Wallet;
if (wallet is { } && _walletDictionary.ContainsKey(wallet))
{
if (wallet.State == WalletState.Stopping)
{
RemoveWallet(_walletDictionary[wallet]);
}
else if (_walletDictionary[wallet] is ClosedWalletViewModel cwvm && wallet.State == WalletState.Started)
{
OpenClosedWallet(walletManager, uiConfig, cwvm);
}
}
AnyWalletStarted = Items.OfType<WalletViewModelBase>().Any(x => x.WalletState == WalletState.Started);
});
Observable
.FromEventPattern<Wallet>(walletManager, nameof(WalletManager.WalletAdded))
.Select(x => x.EventArgs)
.Where(x => x is { })
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(wallet =>
{
WalletViewModelBase vm = (wallet.State <= WalletState.Starting)
? ClosedWalletViewModel.Create(_navigationState, walletManager, wallet)
: WalletViewModel.Create(_navigationState, uiConfig, wallet);
InsertWallet(vm);
});
=======
>>>>>>>
<<<<<<<
private void LoadWallets(WalletManager walletManager)
{
foreach (var wallet in walletManager.GetWallets())
{
InsertWallet(ClosedWalletViewModel.Create(_navigationState, walletManager, wallet));
}
}
private void OpenClosedWallet(WalletManager walletManager, UiConfig uiConfig, ClosedWalletViewModel closedWalletViewModel)
{
var select = SelectedItem == closedWalletViewModel;
RemoveWallet(closedWalletViewModel);
var walletViewModel = OpenWallet(walletManager, uiConfig, closedWalletViewModel.Wallet);
if (select)
{
SelectedItem = walletViewModel;
}
}
private WalletViewModelBase OpenWallet(WalletManager walletManager, UiConfig uiConfig, Wallet wallet)
{
if (_items.OfType<WalletViewModel>().Any(x => x.Title == wallet.WalletName))
{
throw new Exception("Wallet already opened.");
}
var walletViewModel = WalletViewModel.Create(_navigationState, uiConfig, wallet);
InsertWallet(walletViewModel);
if (!walletManager.AnyWallet(x => x.State >= WalletState.Started && x != walletViewModel.Wallet))
{
walletViewModel.OpenWalletTabs();
}
walletViewModel.IsExpanded = true;
return walletViewModel;
}
private void InsertWallet(WalletViewModelBase walletVM)
{
Items.InsertSorted(walletVM);
_walletDictionary.Add(walletVM.Wallet, walletVM);
}
internal void RemoveWallet(WalletViewModelBase walletVM)
{
walletVM.Dispose();
_items.Remove(walletVM);
_walletDictionary.Remove(walletVM.Wallet);
}
=======
>>>>>>> |
<<<<<<<
CoinReceived?.Invoke(this, coin);
if (coin.Unspent && coin.Label == "ZeroLink Change" && ChaumianClient.OnePiece != null)
=======
if (coin.Unspent && coin.Label == "ZeroLink Change" && !(ChaumianClient.OnePiece is null))
>>>>>>>
CoinReceived?.Invoke(this, coin);
if (coin.Unspent && coin.Label == "ZeroLink Change" && !(ChaumianClient.OnePiece is null)) |
<<<<<<<
using System.Reactive;
=======
using AvalonStudio.Extensibility.Theme;
>>>>>>>
using System.Reactive;
using AvalonStudio.Extensibility.Theme; |
<<<<<<<
if (seps.Count != 0)
{
throw new ArgumentException(
string.Format("Cannot provide key/value separators for Options taking {0} value(s).", MaxValueCount),
=======
throw new ArgumentException(
$"Cannot provide key/value separators for Options taking {MaxValueCount} value(s).",
>>>>>>>
if (seps.Count != 0)
{
throw new ArgumentException(
$"Cannot provide key/value separators for Options taking {MaxValueCount} value(s).", |
<<<<<<<
public ReactiveCommand<Unit, Unit> SaveQRCodeCommand { get; }
=======
public ReactiveCommand<Unit, Unit> DisplayAddressOnHwCommand { get; }
public ReactiveCommand<Unit, Unit> GenerateCommand { get; }
>>>>>>>
public ReactiveCommand<Unit, Unit> DisplayAddressOnHwCommand { get; }
public ReactiveCommand<Unit, Unit> GenerateCommand { get; }
public ReactiveCommand<Unit, Unit> SaveQRCodeCommand { get; } |
<<<<<<<
this.sessionFTPLogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
=======
this.rPGRLAToEmbeddedSQLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
>>>>>>>
this.sessionFTPLogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.rPGRLAToEmbeddedSQLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
<<<<<<<
private System.Windows.Forms.ToolStripMenuItem sessionFTPLogToolStripMenuItem;
=======
private System.Windows.Forms.ToolStripMenuItem rPGRLAToEmbeddedSQLToolStripMenuItem;
>>>>>>>
private System.Windows.Forms.ToolStripMenuItem sessionFTPLogToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem rPGRLAToEmbeddedSQLToolStripMenuItem; |
<<<<<<<
public WebsiteTorifier WebsiteTorifier { get; }
public Global Global { get; }
public IMemoryCache Cache { get; }
public InitConfigStartupTask(Global global, IMemoryCache cache, IWebHostEnvironment hostingEnvironment)
=======
public InitConfigStartupTask(Global global, IWebHostEnvironment hostingEnvironment)
>>>>>>>
public InitConfigStartupTask(Global global, IMemoryCache cache, IWebHostEnvironment hostingEnvironment) |
<<<<<<<
=======
else
{
Version coldCardVersion = new Version(coldCardVersionString);
if (coldCardVersion == new Version("2.1.0")) // Should never happen though.
{
reverseByteOrder = true;
}
}
HDFingerprint mfp = NBitcoinHelpers.BetterParseHDFingerprint(mfpString, reverseByteOrder: reverseByteOrder);
ExtPubKey extPubKey = NBitcoinHelpers.BetterParseExtPubKey(xpubString);
Logger.LogInfo("Creating new wallet file.");
var walletName = Global.GetNextHardwareWalletName(customPrefix: "Coldcard");
var walletFullPath = Global.GetWalletFullPath(walletName);
KeyManager.CreateNewHardwareWalletWatchOnly(mfp, extPubKey, walletFullPath);
owner.SelectLoadWallet();
>>>>>>>
else
{
Version coldCardVersion = new Version(coldCardVersionString);
if (coldCardVersion == new Version("2.1.0")) // Should never happen though.
{
reverseByteOrder = true;
}
}
HDFingerprint mfp = NBitcoinHelpers.BetterParseHDFingerprint(mfpString, reverseByteOrder: reverseByteOrder);
ExtPubKey extPubKey = NBitcoinHelpers.BetterParseExtPubKey(xpubString);
Logger.LogInfo("Creating new wallet file.");
var walletName = Global.GetNextHardwareWalletName(customPrefix: "Coldcard");
var walletFullPath = Global.GetWalletFullPath(walletName);
KeyManager.CreateNewHardwareWalletWatchOnly(mfp, extPubKey, walletFullPath);
owner.SelectLoadWallet();
<<<<<<<
});
EnumerateHardwareWalletsCommand = ReactiveCommand.CreateFromTask(async () => await EnumerateHardwareWalletsAsync());
=======
catch (Exception ex)
{
SetWarningMessage(ex.ToTypeMessageString());
Logger.LogError(ex);
}
}, outputScheduler: RxApp.MainThreadScheduler);
>>>>>>>
});
EnumerateHardwareWalletsCommand = ReactiveCommand.CreateFromTask(async () => await EnumerateHardwareWalletsAsync());
<<<<<<<
OpenBrowserCommand.ThrownExceptions.Subscribe(Logger.LogWarning<LoadWalletViewModel>);
LoadCommand.ThrownExceptions.Subscribe(Logger.LogWarning<LoadWalletViewModel>);
TestPasswordCommand.ThrownExceptions.Subscribe(Logger.LogWarning<LoadWalletViewModel>);
OpenFolderCommand.ThrownExceptions.Subscribe(ex =>
{
SetWarningMessage(ex.ToTypeMessageString());
Logger.LogError<LoadWalletViewModel>(ex);
});
ImportColdcardCommand.ThrownExceptions.Subscribe(ex =>
{
SetWarningMessage(ex.ToTypeMessageString());
Logger.LogError<LoadWalletViewModel>(ex);
});
EnumerateHardwareWalletsCommand.ThrownExceptions.Subscribe(ex =>
{
SetWarningMessage(ex.ToTypeMessageString());
Logger.LogError<LoadWalletViewModel>(ex);
});
=======
OpenBrowserCommand.ThrownExceptions.Subscribe(ex => Logger.LogWarning(ex));
LoadCommand.ThrownExceptions.Subscribe(ex => Logger.LogWarning(ex));
TestPasswordCommand.ThrownExceptions.Subscribe(ex => Logger.LogWarning(ex));
OpenFolderCommand.ThrownExceptions.Subscribe(ex => Logger.LogWarning(ex));
ImportColdcardCommand.ThrownExceptions.Subscribe(ex => Logger.LogWarning(ex));
>>>>>>>
OpenBrowserCommand.ThrownExceptions.Subscribe(Logger.LogWarning<LoadWalletViewModel>);
LoadCommand.ThrownExceptions.Subscribe(Logger.LogWarning<LoadWalletViewModel>);
TestPasswordCommand.ThrownExceptions.Subscribe(Logger.LogWarning<LoadWalletViewModel>);
OpenFolderCommand.ThrownExceptions.Subscribe(ex =>
{
SetWarningMessage(ex.ToTypeMessageString());
Logger.LogError<LoadWalletViewModel>(ex);
});
ImportColdcardCommand.ThrownExceptions.Subscribe(ex =>
{
SetWarningMessage(ex.ToTypeMessageString());
Logger.LogError<LoadWalletViewModel>(ex);
});
EnumerateHardwareWalletsCommand.ThrownExceptions.Subscribe(ex =>
{
SetWarningMessage(ex.ToTypeMessageString());
Logger.LogError<LoadWalletViewModel>(ex);
});
<<<<<<<
=======
if (selectedWallet.HardwareWalletInfo.MasterFingerprint is null)
{
throw new InvalidOperationException("Hardware wallet did not provide a master fingerprint.");
}
ExtPubKey extPubKey;
try
{
MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusBarStatus.AcquiringXpubFromHardwareWallet);
extPubKey = await HwiProcessManager.GetXpubAsync(selectedWallet.HardwareWalletInfo);
}
finally
{
MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusBarStatus.AcquiringXpubFromHardwareWallet);
}
Logger.LogInfo("Hardware wallet was not used previously on this computer. Creating new wallet file.");
if (TryFindWalletByExtPubKey(extPubKey, out string wn))
{
walletName = wn;
}
else
{
walletName = Global.GetNextHardwareWalletName(selectedWallet.HardwareWalletInfo);
var path = Global.GetWalletFullPath(walletName);
KeyManager.CreateNewHardwareWalletWatchOnly(selectedWallet.HardwareWalletInfo.MasterFingerprint.Value, extPubKey, path);
}
>>>>>>> |
<<<<<<<
bool cliException = false;
=======
Exception? appException = null;
>>>>>>>
Exception? appException = null;
bool cliException = false;
<<<<<<<
if (!cliException)
{
Global.CrashReporter.SetException(ex);
}
throw;
}
finally
{
DisposeAsync().GetAwaiter().GetResult();
=======
Global?.CrashReporter?.SetException(ex);
>>>>>>>
if (!cliException)
{
Global.CrashReporter.SetException(ex);
} |
<<<<<<<
UIBarButtonItem barButtonItem;
var xamarinSidebarMenu = ViewController as IMvxSidebarMenu;
if (xamarinSidebarMenu != null)
{
sidebarController.HasShadowing = xamarinSidebarMenu.HasShadowing;
sidebarController.MenuWidth = xamarinSidebarMenu.MenuWidth;
barButtonItem = new UIBarButtonItem(xamarinSidebarMenu.MenuButtonImage
, UIBarButtonItemStyle.Plain
, (sender, args) => sidebarController.ToggleMenu());
}
else
{
barButtonItem = new UIBarButtonItem("Menu"
, UIBarButtonItemStyle.Plain
, (sender, args) => sidebarController.ToggleMenu());
}
=======
var xamarinSidebarMenu = ViewController as IMvxSidebarMenu;
if (xamarinSidebarMenu != null)
{
sidebarController.HasShadowing = xamarinSidebarMenu.HasShadowing;
}
var barButtonItem = new UIBarButtonItem(UIImage.FromBundle("threelines")
, UIBarButtonItemStyle.Plain, (sender, args) =>
{
if (xamarinSidebarMenu != null)
sidebarController.MenuWidth = xamarinSidebarMenu.MenuWidth;
sidebarController.ViewWillAppear(false);
sidebarController.ToggleMenu();
});
>>>>>>>
UIBarButtonItem barButtonItem;
var xamarinSidebarMenu = ViewController as IMvxSidebarMenu;
if (xamarinSidebarMenu != null)
{
sidebarController.HasShadowing = xamarinSidebarMenu.HasShadowing;
sidebarController.MenuWidth = xamarinSidebarMenu.MenuWidth;
barButtonItem = new UIBarButtonItem(xamarinSidebarMenu.MenuButtonImage
, UIBarButtonItemStyle.Plain
, (sender, args) => {
sidebarController.MenuWidth = xamarinSidebarMenu.MenuWidth;
sidebarController.ViewWillAppear(false);
sidebarController.ToggleMenu();
});
}
else
{
barButtonItem = new UIBarButtonItem("Menu"
, UIBarButtonItemStyle.Plain
, (sender, args) => {
sidebarController.ViewWillAppear(false);
sidebarController.ToggleMenu();
});
}
<<<<<<<
=======
>>>>>>> |
<<<<<<<
}
public abstract class MvxSearchSupportFragment<TViewModel>
: MvxSearchSupportFragment
, IMvxFragmentView<TViewModel> where TViewModel : class, IMvxViewModel
{
protected MvxSearchSupportFragment()
{
}
protected MvxSearchSupportFragment(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
{
}
public new TViewModel ViewModel
{
get { return (TViewModel)base.ViewModel; }
set { base.ViewModel = value; }
}
}
=======
public string UniqueImmutableCacheTag => Tag;
}
>>>>>>>
public string UniqueImmutableCacheTag => Tag;
}
public abstract class MvxSearchSupportFragment<TViewModel>
: MvxSearchSupportFragment
, IMvxFragmentView<TViewModel> where TViewModel : class, IMvxViewModel
{
protected MvxSearchSupportFragment()
{
}
protected MvxSearchSupportFragment(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
{
}
public new TViewModel ViewModel
{
get { return (TViewModel)base.ViewModel; }
set { base.ViewModel = value; }
}
} |
<<<<<<<
using Cirrious.MvvmCross.Interfaces.IoC;
using Cirrious.MvvmCross.Interfaces.Platform;
using Cirrious.MvvmCross.Interfaces.Plugins;
=======
using Cirrious.MvvmCross.Interfaces.Platform.Diagnostics;
>>>>>>>
using Cirrious.MvvmCross.Interfaces.IoC;
using Cirrious.MvvmCross.Interfaces.Platform;
using Cirrious.MvvmCross.Interfaces.Plugins;
<<<<<<<
=======
MvxTrace.Trace("Setup: Primary end");
State = MvxSetupState.InitializedPrimary;
}
public virtual void InitializeSecondary()
{
if (State != MvxSetupState.InitializedPrimary)
{
throw new MvxException("Cannot start seconday - as state is currently {0}", State);
}
State = MvxSetupState.InitializingSecondary;
>>>>>>>
State = MvxSetupState.InitializedPrimary;
if (State != MvxSetupState.InitializedPrimary)
{
throw new MvxException("Cannot start seconday - as state is currently {0}", State);
}
State = MvxSetupState.InitializingSecondary; |
<<<<<<<
using System.Windows.Input;
=======
using Cirrious.MvvmCross.Interfaces.Commands;
using System;
>>>>>>>
using System.Windows.Input;
using System;
<<<<<<<
public ICommand Command { get; private set; }
=======
public IMvxCommand Command { get; private set; }
#region IDisposable implementation
public void Dispose ()
{
this.Dispose(true);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
var disposableCommand = Command as IDisposable;
if (disposableCommand != null)
{
disposableCommand.Dispose();
}
Command = null;
}
}
#endregion
>>>>>>>
public ICommand Command { get; private set; }
#region IDisposable implementation
public void Dispose ()
{
this.Dispose(true);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
var disposableCommand = Command as IDisposable;
if (disposableCommand != null)
{
disposableCommand.Dispose();
}
Command = null;
}
}
#endregion |
<<<<<<<
using Foundation;
using MvvmCross.Binding.ExtensionMethods;
using MvvmCross.Binding.iOS.Views;
using MvvmCross.Platform.Core;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using UIKit;
namespace MvvmCross.iOS.Support.Views
{
public abstract class MvxExpandableTableViewSource<TItemSource, TItem> : MvxTableViewSource where TItemSource : List<TItem>
{
/// <summary>
/// Indicates which sections are expanded.
/// </summary>
private bool[] _isCollapsed;
private IEnumerable<TItemSource> _itemsSource;
new public IEnumerable<TItemSource> ItemsSource
{
get
{
return _itemsSource;
}
set
{
_itemsSource = value;
_isCollapsed = new bool[ItemsSource.Count()];
for (var i = 0; i < _isCollapsed.Length; i++)
_isCollapsed[i] = true;
ReloadTableData();
}
}
public MvxExpandableTableViewSource(UITableView tableView) : base(tableView)
{
}
protected override void CollectionChangedOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs args)
{
// When the collection is changed collapse all sections
_isCollapsed = new bool[ItemsSource.Count()];
for (var i = 0; i < _isCollapsed.Length; i++)
_isCollapsed[i] = true;
base.CollectionChangedOnCollectionChanged(sender, args);
}
public override nint RowsInSection(UITableView tableview, nint section)
{
// If the section is not colapsed return the rows in that section otherwise return 0
if ((ItemsSource?.ElementAt((int)section)).Any() && !_isCollapsed[(int)section])
return (ItemsSource.ElementAt((int)section)).Count();
return 0;
}
public override nint NumberOfSections(UITableView tableView)
{
return ItemsSource?.Count() ?? 0;
}
protected override object GetItemAt(NSIndexPath indexPath)
{
return ((IEnumerable<object>)ItemsSource?.ElementAt(indexPath.Section)).ElementAt(indexPath.Row);
}
protected object GetHeaderItemAt(nint section)
{
return ItemsSource?.ElementAt((int)section);
}
public override UIView GetViewForHeader(UITableView tableView, nint section)
{
var header = GetOrCreateHeaderCellFor(tableView, section);
// Create a button to make the header clickable
UIButton hiddenButton = new UIButton(header.Frame);
hiddenButton.TouchUpInside += EventHandler(tableView, section);
header.AddSubview(hiddenButton);
// Set the header data context
var bindable = header as IMvxDataConsumer;
if (bindable != null)
bindable.DataContext = GetHeaderItemAt(section);
return header;
}
private EventHandler EventHandler(UITableView tableView, nint section)
{
return (sender, e) =>
{
// Toggle the is collapsed
_isCollapsed[(int)section] = !_isCollapsed[(int)section];
tableView.ReloadData();
// Animate the section cells
var paths = new NSIndexPath[RowsInSection(tableView, section)];
for (int i = 0; i < paths.Length; i++)
{
paths[i] = NSIndexPath.FromItemSection(i, section);
}
tableView.ReloadRows(paths, UITableViewRowAnimation.Automatic);
};
}
public override void HeaderViewDisplayingEnded(UITableView tableView, UIView headerView, nint section)
{
var bindable = headerView as IMvxDataConsumer;
if (bindable != null)
bindable.DataContext = null;
}
/// <summary>
/// This is needed to show the header view. Should be overriden by sources that inherit from this.
/// </summary>
/// <param name="tableView"></param>
/// <param name="section"></param>
/// <returns></returns>
public override nfloat GetHeightForHeader(UITableView tableView, nint section)
{
return 44; // Default value.
}
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
{
return base.GetCell(tableView, indexPath);
}
/// <summary>
/// Gets the cell used for the header
/// </summary>
/// <param name="tableView"></param>
/// <param name="section"></param>
/// <returns></returns>
=======
namespace MvvmCross.iOS.Support.Views
{
using Foundation;
using Binding.ExtensionMethods;
using Binding.iOS.Views;
using MvvmCross.Platform.Core;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using UIKit;
public abstract class MvxExpandableTableViewSource : MvxTableViewSource
{
/// <summary>
/// Indicates which sections are expanded.
/// </summary>
private bool[] _isCollapsed;
public MvxExpandableTableViewSource(UITableView tableView) : base(tableView)
{
}
protected override void CollectionChangedOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs args)
{
// When the collection is changed collapse all sections
_isCollapsed = new bool[ItemsSource.Count()];
for (var i = 0; i < _isCollapsed.Length; i++)
_isCollapsed[i] = true;
base.CollectionChangedOnCollectionChanged(sender, args);
}
public override nint RowsInSection(UITableView tableview, nint section)
{
// If the section is not colapsed return the rows in that section otherwise return 0
if (((IEnumerable<object>)ItemsSource?.ElementAt((int)section)).Any() == true && !_isCollapsed[(int)section])
return ((IEnumerable<object>)ItemsSource.ElementAt((int)section)).Count();
return 0;
}
public override nint NumberOfSections(UITableView tableView)
{
return ItemsSource.Count();
}
protected override object GetItemAt(NSIndexPath indexPath)
{
if (ItemsSource == null)
return null;
return ((IEnumerable<object>)ItemsSource.ElementAt(indexPath.Section)).ElementAt(indexPath.Row);
}
protected object GetHeaderItemAt(nint section)
{
if (ItemsSource == null)
return null;
return ItemsSource.ElementAt((int)section);
}
public override UIView GetViewForHeader(UITableView tableView, nint section)
{
var header = GetOrCreateHeaderCellFor(tableView, section);
// Create a button to make the header clickable
UIButton hiddenButton = new UIButton(header.Frame);
hiddenButton.TouchUpInside += EventHandler(tableView, section);
header.AddSubview(hiddenButton);
// Set the header data context
var bindable = header as IMvxDataConsumer;
if (bindable != null)
bindable.DataContext = GetHeaderItemAt(section);
return header;
}
private EventHandler EventHandler(UITableView tableView, nint section)
{
return (sender, e) =>
{
// Toggle the is collapsed
_isCollapsed[(int)section] = !_isCollapsed[(int)section];
tableView.ReloadData();
// Animate the section cells
var paths = new NSIndexPath[RowsInSection(tableView, section)];
for (int i = 0; i < paths.Length; i++)
{
paths[i] = NSIndexPath.FromItemSection(i, section);
}
tableView.ReloadRows(paths, UITableViewRowAnimation.Automatic);
};
}
public override void HeaderViewDisplayingEnded(UITableView tableView, UIView headerView, nint section)
{
var bindable = headerView as IMvxDataConsumer;
if (bindable != null)
bindable.DataContext = null;
}
/// <summary>
/// This is needed to show the header view. Should be overriden by sources that inherit from this.
/// </summary>
/// <param name="tableView"></param>
/// <param name="section"></param>
/// <returns></returns>
public override nfloat GetHeightForHeader(UITableView tableView, nint section)
{
return 40; // Default value.
}
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
{
return base.GetCell(tableView, indexPath);
}
/// <summary>
/// Gets the cell used for the header
/// </summary>
/// <param name="tableView"></param>
/// <param name="section"></param>
/// <returns></returns>
>>>>>>>
namespace MvvmCross.iOS.Support.Views
{
using Foundation;
using Binding.ExtensionMethods;
using Binding.iOS.Views;
using MvvmCross.Platform.Core;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using UIKit;
public abstract class MvxExpandableTableViewSource<TItemSource, TItem> : MvxTableViewSource where TItemSource : List<TItem>
{
{
/// <summary>
/// Indicates which sections are expanded.
/// </summary>
private bool[] _isCollapsed;
private IEnumerable<TItemSource> _itemsSource;
new public IEnumerable<TItemSource> ItemsSource
{
get
{
return _itemsSource;
}
set
{
_itemsSource = value;
_isCollapsed = new bool[ItemsSource.Count()];
for (var i = 0; i < _isCollapsed.Length; i++)
_isCollapsed[i] = true;
ReloadTableData();
}
}
public MvxExpandableTableViewSource(UITableView tableView) : base(tableView)
{
}
protected override void CollectionChangedOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs args)
{
// When the collection is changed collapse all sections
_isCollapsed = new bool[ItemsSource.Count()];
for (var i = 0; i < _isCollapsed.Length; i++)
_isCollapsed[i] = true;
base.CollectionChangedOnCollectionChanged(sender, args);
}
public override nint RowsInSection(UITableView tableview, nint section)
{
// If the section is not colapsed return the rows in that section otherwise return 0
if ((ItemsSource?.ElementAt((int)section)).Any() && !_isCollapsed[(int)section])
return (ItemsSource.ElementAt((int)section)).Count();
return 0;
}
public override nint NumberOfSections(UITableView tableView)
{
return ItemsSource?.Count() ?? 0;
}
protected override object GetItemAt(NSIndexPath indexPath)
{
return ((IEnumerable<object>)ItemsSource?.ElementAt(indexPath.Section)).ElementAt(indexPath.Row);
}
protected object GetHeaderItemAt(nint section)
{
return ItemsSource?.ElementAt((int)section);
}
public override UIView GetViewForHeader(UITableView tableView, nint section)
{
var header = GetOrCreateHeaderCellFor(tableView, section);
// Create a button to make the header clickable
UIButton hiddenButton = new UIButton(header.Frame);
hiddenButton.TouchUpInside += EventHandler(tableView, section);
header.AddSubview(hiddenButton);
// Set the header data context
var bindable = header as IMvxDataConsumer;
if (bindable != null)
bindable.DataContext = GetHeaderItemAt(section);
return header;
}
private EventHandler EventHandler(UITableView tableView, nint section)
{
return (sender, e) =>
{
// Toggle the is collapsed
_isCollapsed[(int)section] = !_isCollapsed[(int)section];
tableView.ReloadData();
// Animate the section cells
var paths = new NSIndexPath[RowsInSection(tableView, section)];
for (int i = 0; i < paths.Length; i++)
{
paths[i] = NSIndexPath.FromItemSection(i, section);
}
tableView.ReloadRows(paths, UITableViewRowAnimation.Automatic);
};
}
public override void HeaderViewDisplayingEnded(UITableView tableView, UIView headerView, nint section)
{
var bindable = headerView as IMvxDataConsumer;
if (bindable != null)
bindable.DataContext = null;
}
/// <summary>
/// This is needed to show the header view. Should be overriden by sources that inherit from this.
/// </summary>
/// <param name="tableView"></param>
/// <param name="section"></param>
/// <returns></returns>
public override nfloat GetHeightForHeader(UITableView tableView, nint section)
{
return 44; // Default value.
}
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
{
return base.GetCell(tableView, indexPath);
}
/// <summary>
/// Gets the cell used for the header
/// </summary>
/// <param name="tableView"></param>
/// <param name="section"></param>
/// <returns></returns> |
<<<<<<<
GetSemiStaticInlineSerializerForCache[key] = ret = (Action<TextWriter, ForType, int>)builder.Invoke(null, new object[] { cacheType, opts.ShouldPrettyPrint, opts.ShouldExcludeNulls, opts.IsJSONP, opts.UseDateTimeFormat, opts.ShouldIncludeInherited, opts.UseUnspecifiedDateTimeKindBehavior, opts.SerializationNameFormat });
=======
GetSemiStaticInlineSerializerForCache[key] = ret = (Action<TextWriter, ForType, int>)builder.Invoke(null, new object[] { dynamicMember, cacheType, opts.ShouldPrettyPrint, opts.ShouldExcludeNulls, opts.IsJSONP, opts.UseDateTimeFormat, opts.ShouldIncludeInherited, opts.UseUnspecifiedDateTimeKindBehavior });
>>>>>>>
GetSemiStaticInlineSerializerForCache[key] = ret = (Action<TextWriter, ForType, int>)builder.Invoke(null, new object[] { dynamicMember, cacheType, opts.ShouldPrettyPrint, opts.ShouldExcludeNulls, opts.IsJSONP, opts.UseDateTimeFormat, opts.ShouldIncludeInherited, opts.UseUnspecifiedDateTimeKindBehavior, opts.SerializationNameFormat }); |
<<<<<<<
internal InlineSerializer(Type recusionLookupType, bool pretty, bool excludeNulls, bool jsonp, DateTimeFormat dateFormat, bool includeInherited, bool callOutOnPossibleDynamic, bool buildToString)
=======
internal InlineSerializer(Type recusionLookupOptionsType, bool pretty, bool excludeNulls, bool jsonp, DateTimeFormat dateFormat, bool includeInherited, bool callOutOnPossibleDynamic)
>>>>>>>
internal InlineSerializer(Type recusionLookupOptionsType, bool pretty, bool excludeNulls, bool jsonp, DateTimeFormat dateFormat, bool includeInherited, bool callOutOnPossibleDynamic, bool buildToString)
<<<<<<<
var cacheType = RecusionLookupType.MakeGenericType(type);
FieldInfo thunk;
if (BuildingToString)
{
thunk = cacheType.GetField("StringThunk", BindingFlags.Public | BindingFlags.Static);
}
else
{
thunk = cacheType.GetField("Thunk", BindingFlags.Public | BindingFlags.Static);
}
=======
var cacheType = typeof(TypeCache<,>).MakeGenericType(RecusionLookupOptionsType, type);
var thunk = cacheType.GetField("Thunk", BindingFlags.Public | BindingFlags.Static);
>>>>>>>
var cacheType = typeof(TypeCache<,>).MakeGenericType(RecusionLookupOptionsType, type);
FieldInfo thunk;
if (BuildingToString)
{
thunk = cacheType.GetField("StringThunk", BindingFlags.Public | BindingFlags.Static);
}
else
{
thunk = cacheType.GetField("Thunk", BindingFlags.Public | BindingFlags.Static);
}
<<<<<<<
MethodInfo loadMtd;
if (BuildingToString)
{
loadMtd = RecusionLookupType.MakeGenericType(primeType).GetMethod("LoadToString", BindingFlags.Public | BindingFlags.Static);
}
else
{
loadMtd = RecusionLookupType.MakeGenericType(primeType).GetMethod("Load", BindingFlags.Public | BindingFlags.Static);
}
=======
var loadMtd = typeof(TypeCache<,>).MakeGenericType(RecusionLookupOptionsType, primeType).GetMethod("Load", BindingFlags.Public | BindingFlags.Static);
>>>>>>>
MethodInfo loadMtd;
if (BuildingToString)
{
loadMtd = typeof(TypeCache<,>).MakeGenericType(RecusionLookupOptionsType, primeType).GetMethod("LoadToString", BindingFlags.Public | BindingFlags.Static);
}
else
{
loadMtd = typeof(TypeCache<,>).MakeGenericType(RecusionLookupOptionsType, primeType).GetMethod("Load", BindingFlags.Public | BindingFlags.Static);
}
<<<<<<<
{
static Action<TextWriter, BuildForType, int> BuildAlwaysFailsWith<BuildForType>(Type typeCacheType)
{
var specificTypeCache = typeCacheType.MakeGenericType(typeof(BuildForType));
var stashField = specificTypeCache.GetField("ThunkExceptionDuringBuild", BindingFlags.Static | BindingFlags.Public);
=======
{
static Action<TextWriter, BuildForType, int> BuildAlwaysFailsWith<BuildForType>(Type optionsType)
{
var specificTypeCache = typeof(TypeCache<,>).MakeGenericType(optionsType, typeof(BuildForType));
var stashField = specificTypeCache.GetField("ExceptionDuringBuild", BindingFlags.Static | BindingFlags.Public);
>>>>>>>
{
static Action<TextWriter, BuildForType, int> BuildAlwaysFailsWith<BuildForType>(Type optionsType)
{
var specificTypeCache = typeof(TypeCache<,>).MakeGenericType(optionsType, typeof(BuildForType));
var stashField = specificTypeCache.GetField("ThunkExceptionDuringBuild", BindingFlags.Static | BindingFlags.Public);
<<<<<<<
{
var obj = new InlineSerializer<BuildForType>(typeCacheType, pretty, excludeNulls, jsonp, dateFormat, includeInherited, false, false);
=======
{
var obj = new InlineSerializer<BuildForType>(optionsType, pretty, excludeNulls, jsonp, dateFormat, includeInherited, false);
>>>>>>>
{
var obj = new InlineSerializer<BuildForType>(optionsType, pretty, excludeNulls, jsonp, dateFormat, includeInherited, false, false);
<<<<<<<
var obj = new InlineSerializer<BuildForType>(typeCacheType, pretty, excludeNulls, jsonp, dateFormat, includeInherited, true, false);
=======
var obj = new InlineSerializer<BuildForType>(optionsType, pretty, excludeNulls, jsonp, dateFormat, includeInherited, true);
>>>>>>>
var obj = new InlineSerializer<BuildForType>(optionsType, pretty, excludeNulls, jsonp, dateFormat, includeInherited, true, false); |
<<<<<<<
if (marginsCollapsingEnabled && result.GetStatus() != LayoutResult.NOTHING) {
marginsCollapseHandler.EndChildMarginsHandling(layoutBox);
}
if (FloatingHelper.IsRendererFloating(childRenderer)) {
waitingFloatsSplitRenderers.Put(childPos, result.GetStatus() == LayoutResult.PARTIAL ? result.GetSplitRenderer
() : null);
waitingOverflowFloatRenderers.Add(result.GetOverflowRenderer());
break;
}
if (marginsCollapsingEnabled && !isCellRenderer) {
marginsCollapseHandler.EndMarginsCollapse(layoutBox);
=======
if (marginsCollapsingEnabled) {
if (result.GetStatus() != LayoutResult.NOTHING) {
marginsCollapseHandler.EndChildMarginsHandling(layoutBox);
}
marginsCollapseHandler.EndMarginsCollapse(layoutBox);
>>>>>>>
if (marginsCollapsingEnabled && result.GetStatus() != LayoutResult.NOTHING) {
marginsCollapseHandler.EndChildMarginsHandling(layoutBox);
}
if (FloatingHelper.IsRendererFloating(childRenderer)) {
waitingFloatsSplitRenderers.Put(childPos, result.GetStatus() == LayoutResult.PARTIAL ? result.GetSplitRenderer
() : null);
waitingOverflowFloatRenderers.Add(result.GetOverflowRenderer());
break;
}
if (marginsCollapsingEnabled) {
marginsCollapseHandler.EndMarginsCollapse(layoutBox); |
<<<<<<<
ApplyLayoutAttributes(role, renderer, doc.GetTagStructureContext().GetAutoTaggingPointer());
}
public static void ApplyLayoutAttributes(PdfName role, AbstractRenderer renderer, TagTreePointer taggingPointer
) {
=======
PdfDictionary layoutAttributes = GetLayoutAttributes(role, renderer, doc.GetTagStructureContext().GetAutoTaggingPointer
());
if (layoutAttributes != null) {
AccessibilityProperties properties = ((IAccessibleElement)renderer.GetModelElement()).GetAccessibilityProperties
();
RemoveSameAttributesTypeIfPresent(properties, PdfName.Layout);
properties.AddAttributes(layoutAttributes);
}
}
public static PdfDictionary GetLayoutAttributes(PdfName role, AbstractRenderer renderer, TagTreePointer taggingPointer
) {
// TODO taggingPointer is needed here and in other methods for the future changes which are currently in the separate branch
PdfDocument doc = taggingPointer.GetDocument();
>>>>>>>
PdfDictionary layoutAttributes = GetLayoutAttributes(role, renderer, doc.GetTagStructureContext().GetAutoTaggingPointer
());
if (layoutAttributes != null) {
AccessibilityProperties properties = ((IAccessibleElement)renderer.GetModelElement()).GetAccessibilityProperties
();
RemoveSameAttributesTypeIfPresent(properties, PdfName.Layout);
properties.AddAttributes(layoutAttributes);
}
}
public static PdfDictionary GetLayoutAttributes(PdfName role, AbstractRenderer renderer, TagTreePointer taggingPointer
) {
// TODO taggingPointer is needed here and in other methods for the future changes which are currently in the separate branch
PdfDocument doc = taggingPointer.GetDocument();
<<<<<<<
PdfName attributesType = PdfName.Layout;
attributes.Put(PdfName.O, attributesType);
=======
attributes.Put(PdfName.O, PdfName.Layout);
PdfDictionary roleMap = doc.GetStructTreeRoot().GetRoleMap();
if (roleMap.ContainsKey(role)) {
role = roleMap.GetAsName(role);
}
>>>>>>>
attributes.Put(PdfName.O, PdfName.Layout);
<<<<<<<
public static void ApplyTableAttributes(AbstractRenderer renderer) {
ApplyTableAttributes(renderer, null);
}
public static void ApplyTableAttributes(AbstractRenderer renderer, TagTreePointer taggingPointer) {
=======
public static PdfDictionary GetTableAttributes(AbstractRenderer renderer, TagTreePointer taggingPointer) {
>>>>>>>
public static PdfDictionary GetTableAttributes(AbstractRenderer renderer, TagTreePointer taggingPointer) {
<<<<<<<
if (attributes.Size() > 1) {
AccessibilityProperties properties = modelElement.GetAccessibilityProperties();
RemoveSameAttributesTypeIfPresent(properties, attributesType);
properties.AddAttributes(attributes);
}
=======
return attributes.Size() > 1 ? attributes : null;
>>>>>>>
return attributes.Size() > 1 ? attributes : null; |
<<<<<<<
MinMaxWidth minMaxWidth = new MinMaxWidth(0, layoutBox.GetWidth());
AbstractWidthHandler widthHandler = new MaxSumWidthHandler(minMaxWidth);
BaseDirection? baseDirection = this.GetProperty<BaseDirection?>(Property.BASE_DIRECTION);
foreach (IRenderer renderer in childRenderers) {
if (renderer is TextRenderer) {
renderer.SetParent(this);
((TextRenderer)renderer).ApplyOtf();
renderer.SetParent(null);
if (baseDirection == null || baseDirection == BaseDirection.NO_BIDI) {
baseDirection = renderer.GetOwnProperty<BaseDirection?>(Property.BASE_DIRECTION);
}
}
}
IList<int> unicodeIdsReorderingList = null;
if (levels == null && baseDirection != null && baseDirection != BaseDirection.NO_BIDI) {
unicodeIdsReorderingList = new List<int>();
bool newLineFound = false;
foreach (IRenderer child in childRenderers) {
if (newLineFound) {
break;
}
if (child is TextRenderer) {
GlyphLine text = ((TextRenderer)child).GetText();
for (int i = text.start; i < text.end; i++) {
if (TextRenderer.IsNewLine(text, i)) {
newLineFound = true;
break;
}
// we assume all the chars will have the same bidi group
// we also assume pairing symbols won't get merged with other ones
unicodeIdsReorderingList.Add(text.Get(i).GetUnicode());
}
}
}
levels = unicodeIdsReorderingList.Count > 0 ? TypographyUtils.GetBidiLevels(baseDirection, ArrayUtil.ToArray
(unicodeIdsReorderingList)) : null;
}
=======
UpdateChildrenParent();
ResolveChildrenFonts();
int totalNumberOfTrimmedGlyphs = TrimFirst();
BaseDirection? baseDirection = ApplyOtf();
UpdateBidiLevels(totalNumberOfTrimmedGlyphs, baseDirection);
>>>>>>>
MinMaxWidth minMaxWidth = new MinMaxWidth(0, layoutBox.GetWidth());
AbstractWidthHandler widthHandler = new MaxSumWidthHandler(minMaxWidth);
UpdateChildrenParent();
ResolveChildrenFonts();
int totalNumberOfTrimmedGlyphs = TrimFirst();
BaseDirection? baseDirection = ApplyOtf();
UpdateBidiLevels(totalNumberOfTrimmedGlyphs, baseDirection);
<<<<<<<
childResult = childRenderer.SetParent(this).Layout(new LayoutContext(new LayoutArea(layoutContext.GetArea(
).GetPageNumber(), bbox)));
float minChildWidth = 0;
float maxChildWidth = 0;
if (childResult is MinMaxWidthLayoutResult) {
minChildWidth = ((MinMaxWidthLayoutResult)childResult).GetNotNullMinMaxWidth(bbox.GetWidth()).GetMinWidth(
);
maxChildWidth = ((MinMaxWidthLayoutResult)childResult).GetNotNullMinMaxWidth(bbox.GetWidth()).GetMaxWidth(
);
}
=======
childResult = childRenderer.Layout(new LayoutContext(new LayoutArea(layoutContext.GetArea().GetPageNumber(
), bbox)));
>>>>>>>
childResult = childRenderer.Layout(new LayoutContext(new LayoutArea(layoutContext.GetArea().GetPageNumber(
), bbox)));
float minChildWidth = 0;
float maxChildWidth = 0;
if (childResult is MinMaxWidthLayoutResult) {
minChildWidth = ((MinMaxWidthLayoutResult)childResult).GetNotNullMinMaxWidth(bbox.GetWidth()).GetMinWidth(
);
maxChildWidth = ((MinMaxWidthLayoutResult)childResult).GetNotNullMinMaxWidth(bbox.GetWidth()).GetMaxWidth(
);
}
<<<<<<<
IRenderer renderer = lineGlyphs[pos].renderer;
TextRenderer newRenderer = new TextRenderer((TextRenderer)renderer);
newRenderer.DeleteOwnProperty(Property.REVERSED);
=======
IRenderer renderer = lineGlyphs[pos].renderer;
TextRenderer newRenderer = new TextRenderer((TextRenderer)renderer).RemoveReversedRanges();
>>>>>>>
IRenderer renderer = lineGlyphs[pos].renderer;
TextRenderer newRenderer = new TextRenderer((TextRenderer)renderer).RemoveReversedRanges();
<<<<<<<
foreach (IRenderer child in children) {
float currentWidth = ((TextRenderer)child).CalculateLineWidth();
((TextRenderer)child).occupiedArea.GetBBox().SetX(currentXPos).SetWidth(currentWidth);
=======
foreach (IRenderer child in children) {
float currentWidth = ((TextRenderer)child).CalculateLineWidth();
float[] margins = ((TextRenderer)child).GetMargins();
currentWidth += margins[1] + margins[3];
((TextRenderer)child).occupiedArea.GetBBox().SetX(currentXPos).SetWidth(currentWidth);
>>>>>>>
foreach (IRenderer child in children) {
float currentWidth = ((TextRenderer)child).CalculateLineWidth();
float[] margins = ((TextRenderer)child).GetMargins();
currentWidth += margins[1] + margins[3];
((TextRenderer)child).occupiedArea.GetBBox().SetX(currentXPos).SetWidth(currentWidth);
<<<<<<<
internal override MinMaxWidth GetMinMaxWidth(float availableWidth) {
LineLayoutResult result = (LineLayoutResult)((LineLayoutResult)Layout(new LayoutContext(new LayoutArea(1,
new Rectangle(availableWidth, AbstractRenderer.INF)))));
return result.GetNotNullMinMaxWidth(availableWidth);
}
private IList<int[]> CreateOrGetReversedProperty(TextRenderer newRenderer) {
if (!newRenderer.HasOwnProperty(Property.REVERSED)) {
newRenderer.SetProperty(Property.REVERSED, new List<int[]>());
}
return newRenderer.GetOwnProperty<IList<int[]>>(Property.REVERSED);
}
=======
>>>>>>>
internal override MinMaxWidth GetMinMaxWidth(float availableWidth) {
LineLayoutResult result = (LineLayoutResult)((LineLayoutResult)Layout(new LayoutContext(new LayoutArea(1,
new Rectangle(availableWidth, AbstractRenderer.INF)))));
return result.GetNotNullMinMaxWidth(availableWidth);
} |
<<<<<<<
ttfBytes = ttf.GetSubset(new HashSet<int>(longTag), true);
=======
try {
ttfBytes = ttf.GetSubset(new LinkedHashSet<int>(longTag.Keys), true);
}
catch (iText.IO.IOException) {
ILogger logger = LoggerFactory.GetLogger(typeof(iText.Kernel.Font.PdfType0Font));
logger.Warn(iText.IO.LogMessageConstant.FONT_SUBSET_ISSUE);
ttfBytes = null;
}
>>>>>>>
try {
ttfBytes = ttf.GetSubset(new HashSet<int>(longTag), true);
}
catch (iText.IO.IOException) {
ILogger logger = LoggerFactory.GetLogger(typeof(iText.Kernel.Font.PdfType0Font));
logger.Warn(iText.IO.LogMessageConstant.FONT_SUBSET_ISSUE);
ttfBytes = null;
} |
<<<<<<<
OverflowPropertyValue? overflowX = this.GetProperty<OverflowPropertyValue?>(Property.OVERFLOW_X);
float? blockMaxHeight = RetrieveMaxHeight();
OverflowPropertyValue? overflowY = (null == blockMaxHeight || blockMaxHeight > parentBBox.GetHeight()) &&
!wasParentsHeightClipped ? null : this.GetProperty<OverflowPropertyValue?>(Property.OVERFLOW_Y);
if (rotation != null) {
=======
if (rotation != null || IsFixedLayout()) {
>>>>>>>
OverflowPropertyValue? overflowX = this.GetProperty<OverflowPropertyValue?>(Property.OVERFLOW_X);
float? blockMaxHeight = RetrieveMaxHeight();
OverflowPropertyValue? overflowY = (null == blockMaxHeight || blockMaxHeight > parentBBox.GetHeight()) &&
!wasParentsHeightClipped ? null : this.GetProperty<OverflowPropertyValue?>(Property.OVERFLOW_Y);
if (rotation != null || IsFixedLayout()) {
<<<<<<<
if (blockWidth != null && (blockWidth < parentBBox.GetWidth() || isPositioned || rotation != null || (null
!= overflowX && OverflowPropertyValue.FIT != overflowX))) {
parentBBox.SetWidth((float)blockWidth);
}
=======
ApplyWidth(parentBBox, blockWidth);
float? blockMaxHeight = RetrieveMaxHeight();
wasHeightClipped = ApplyHeight(parentBBox, blockMaxHeight, marginsCollapseHandler, false);
>>>>>>>
ApplyWidth(parentBBox, blockWidth, overflowX);
wasHeightClipped = ApplyHeight(parentBBox, blockMaxHeight, marginsCollapseHandler, false, wasParentsHeightClipped
, overflowY);
<<<<<<<
if (!IsFixedLayout() && null != blockMaxHeight && (blockMaxHeight < parentBBox.GetHeight() || (null != overflowY
&& !OverflowPropertyValue.FIT.Equals(overflowY))) && !true.Equals(GetPropertyAsBoolean(Property.FORCED_PLACEMENT
))) {
if (blockMaxHeight < parentBBox.GetHeight()) {
wasHeightClipped = true;
}
float heightDelta = parentBBox.GetHeight() - (float)blockMaxHeight;
if (marginsCollapsingEnabled) {
marginsCollapseHandler.ProcessFixedHeightAdjustment(heightDelta);
}
parentBBox.MoveUp(heightDelta).SetHeight((float)blockMaxHeight);
}
=======
>>>>>>>
<<<<<<<
IRenderer overflowRenderer = null;
=======
float moveDown = Math.Min(lastLineBottomLeadingIndent, occupiedArea.GetBBox().GetY() - layoutBox.GetY());
occupiedArea.GetBBox().MoveDown(moveDown);
occupiedArea.GetBBox().SetHeight(occupiedArea.GetBBox().GetHeight() + moveDown);
iText.Layout.Renderer.ParagraphRenderer overflowRenderer = null;
>>>>>>>
iText.Layout.Renderer.ParagraphRenderer overflowRenderer = null; |
<<<<<<<
GetBackingElem().SetLang(new PdfString(language));
=======
backingElem.SetLang(new PdfString(language, PdfEncodings.UNICODE_BIG));
>>>>>>>
GetBackingElem().SetLang(new PdfString(language, PdfEncodings.UNICODE_BIG));
<<<<<<<
GetBackingElem().SetActualText(new PdfString(actualText));
=======
backingElem.SetActualText(new PdfString(actualText, PdfEncodings.UNICODE_BIG));
>>>>>>>
GetBackingElem().SetActualText(new PdfString(actualText, PdfEncodings.UNICODE_BIG));
<<<<<<<
GetBackingElem().SetAlt(new PdfString(alternateDescription));
=======
backingElem.SetAlt(new PdfString(alternateDescription, PdfEncodings.UNICODE_BIG));
>>>>>>>
GetBackingElem().SetAlt(new PdfString(alternateDescription, PdfEncodings.UNICODE_BIG));
<<<<<<<
GetBackingElem().SetE(new PdfString(expansion));
=======
backingElem.SetE(new PdfString(expansion, PdfEncodings.UNICODE_BIG));
>>>>>>>
GetBackingElem().SetE(new PdfString(expansion, PdfEncodings.UNICODE_BIG)); |
<<<<<<<
// CompareResult.cs
// Script#/Libraries/Knockout
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//
using System;
using System.Runtime.CompilerServices;
namespace KnockoutApi {
[ScriptImport]
[ScriptIgnoreNamespace]
public class CompareResult<T> {
[ScriptProperty]
public string Status {
get;
set;
}
[ScriptProperty]
public T Value {
get;
set;
}
}
}
=======
// CompareResult.cs
// Script#/Libraries/Knockout
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//
using System;
using System.Runtime.CompilerServices;
namespace KnockoutApi {
[Imported]
[IgnoreNamespace]
public class CompareResult<T> {
[IntrinsicProperty]
public CompareResultStatus Status {
get;
set;
}
[IntrinsicProperty]
public T Value {
get;
set;
}
}
}
>>>>>>>
// CompareResult.cs
// Script#/Libraries/Knockout
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//
using System;
using System.Runtime.CompilerServices;
namespace KnockoutApi {
[ScriptImport]
[ScriptIgnoreNamespace]
public class CompareResult<T> {
[ScriptProperty]
public CompareResultStatus Status {
get;
set;
}
[ScriptProperty]
public T Value {
get;
set;
}
}
} |
<<<<<<<
return CreateGoToR(fileSpec, destination).Put(PdfName.NewWindow, new PdfBoolean(newWindow));
=======
return new iText.Kernel.Pdf.Action.PdfAction().Put(PdfName.S, PdfName.GoToR).Put(PdfName.F, fileSpec.GetPdfObject
()).Put(PdfName.D, destination.GetPdfObject()).Put(PdfName.NewWindow, PdfBoolean.ValueOf(newWindow));
>>>>>>>
return CreateGoToR(fileSpec, destination).Put(PdfName.NewWindow, PdfBoolean.ValueOf(newWindow));
<<<<<<<
iText.Kernel.Pdf.Action.PdfAction action = CreateLaunch(fileSpec, newWindow);
=======
iText.Kernel.Pdf.Action.PdfAction action = new iText.Kernel.Pdf.Action.PdfAction().Put(PdfName.S, PdfName.
Launch).Put(PdfName.NewWindow, PdfBoolean.ValueOf(newWindow));
if (fileSpec != null) {
action.Put(PdfName.F, fileSpec.GetPdfObject());
}
>>>>>>>
iText.Kernel.Pdf.Action.PdfAction action = CreateLaunch(fileSpec, newWindow); |
<<<<<<<
UpdateHeightsOnSplit(wasHeightClipped, overflowRenderer);
CorrectFixedLayout(layoutBox);
=======
UpdateHeightsOnSplit(wasHeightClipped, splitRenderer, overflowRenderer);
CorrectPositionedLayout(layoutBox);
>>>>>>>
UpdateHeightsOnSplit(wasHeightClipped, splitRenderer, overflowRenderer);
CorrectFixedLayout(layoutBox); |
<<<<<<<
IIngestManifest ingestManifest = CreateManifestWithAssetsAndVerifyIt(_mediaContext);
VerifyAssetStateAndDelete(IngestManifestState.Activating, ingestManifest.Id);
=======
IIngestManifest ingestManifest = CreateManifestWithAssetsAndVerifyIt(_context);
VerifyAssetStateAndDelete(IngestManifestState.Active, ingestManifest.Id);
>>>>>>>
IIngestManifest ingestManifest = CreateManifestWithAssetsAndVerifyIt(_mediaContext);
VerifyAssetStateAndDelete(IngestManifestState.Active, ingestManifest.Id); |
<<<<<<<
accessibleElement = (IAccessibleElement)GetModelElement();
PdfName role = accessibleElement.GetRole();
if (role != null && !PdfName.Artifact.Equals(role)) {
tagPointer = document.GetTagStructureContext().GetAutoTaggingPointer();
if (!tagPointer.IsElementConnectedToTag(accessibleElement)) {
AccessibleAttributesApplier.ApplyLayoutAttributes(accessibleElement.GetRole(), this, tagPointer);
=======
tagPointer = document.GetTagStructureContext().GetAutoTaggingPointer();
if (modelElementIsAccessible) {
accessibleElement = (IAccessibleElement)GetModelElement();
PdfName role = accessibleElement.GetRole();
if (role != null && !PdfName.Artifact.Equals(role)) {
if (!tagPointer.IsElementConnectedToTag(accessibleElement)) {
AccessibleAttributesApplier.ApplyLayoutAttributes(accessibleElement.GetRole(), this, document);
}
tagPointer.AddTag(accessibleElement, true);
>>>>>>>
tagPointer = document.GetTagStructureContext().GetAutoTaggingPointer();
if (modelElementIsAccessible) {
accessibleElement = (IAccessibleElement)GetModelElement();
PdfName role = accessibleElement.GetRole();
if (role != null && !PdfName.Artifact.Equals(role)) {
if (!tagPointer.IsElementConnectedToTag(accessibleElement)) {
AccessibleAttributesApplier.ApplyLayoutAttributes(accessibleElement.GetRole(), this, tagPointer);
}
tagPointer.AddTag(accessibleElement, true); |
<<<<<<<
/// NeedAppearances has been deprecated in PDF 2.0.
/// <p>
=======
/// <br />
>>>>>>>
/// NeedAppearances has been deprecated in PDF 2.0.
/// <br />
<<<<<<<
/// NeedAppearances has been deprecated in PDF 2.0.
/// <p>
=======
/// <br />
>>>>>>>
/// NeedAppearances has been deprecated in PDF 2.0.
/// <br /> |
<<<<<<<
var types = new List<Type>();
Array.ForEach(
assemblies,
a =>
{
try
{
types.AddRange(a.GetTypes()
.Where(t => !t.IsValueType &&
(t.FullName == null ||
!defaultTypeExclusions.Union(defaultAssemblyExclusions).Any(exclusion => t.FullName.ToLower().StartsWith(exclusion)))));
}
catch (ReflectionTypeLoadException e)
{
var sb = new StringBuilder();
sb.Append(string.Format("Could not scan assembly: {0}. Exception message {1}.", a.FullName, e));
if (e.LoaderExceptions.Any())
{
sb.Append(Environment.NewLine + "Scanned type errors: ");
foreach (var ex in e.LoaderExceptions)
sb.Append(Environment.NewLine + ex.Message);
}
LogManager.GetLogger(typeof (Configure)).Warn(sb.ToString());
return;//intentionally swallow exception
}
});
=======
var types = GetAllowedTypes(assemblies);
>>>>>>>
var types = GetAllowedTypes(assemblies);
<<<<<<<
=======
>>>>>>>
<<<<<<<
private static IEnumerable<Assembly> GetAssembliesInDirectoryWithExtension(string path, string extension, Predicate<string> includeAssemblyNames, Predicate<string> excludeAssemblyNames)
=======
private static IEnumerable<Type> GetAllowedTypes(params Assembly[] assemblies)
{
var types = new List<Type>();
Array.ForEach(
assemblies,
a =>
{
try
{
types.AddRange(a.GetTypes()
.Where(t => !t.IsValueType &&
(t.FullName == null ||
!defaultTypeExclusions.Any(
exclusion => t.FullName.ToLower().StartsWith(exclusion)))));
}
catch (ReflectionTypeLoadException e)
{
var sb = new StringBuilder();
sb.Append(string.Format("Could not scan assembly: {0}. Exception message {1}.", a.FullName, e));
if (e.LoaderExceptions.Any())
{
sb.Append(Environment.NewLine + "Scanned type errors: ");
foreach (var ex in e.LoaderExceptions)
sb.Append(Environment.NewLine + ex.Message);
}
LogManager.GetLogger(typeof(Configure)).Warn(sb.ToString());
//intentionally swallow exception
}
});
return types;
}
private static IEnumerable<Assembly> GetAssembliesInDirectoryWithExtension(string path, string extension, params string[] assembliesToSkip)
>>>>>>>
private static IEnumerable<Assembly> GetAssembliesInDirectoryWithExtension(string path, string extension, Predicate<string> includeAssemblyNames, Predicate<string> excludeAssemblyNames)
{
var types = new List<Type>();
Array.ForEach(
assemblies,
a =>
{
try
{
types.AddRange(a.GetTypes()
.Where(t => !t.IsValueType &&
(t.FullName == null ||
!defaultTypeExclusions.Any(
exclusion => t.FullName.ToLower().StartsWith(exclusion)))));
}
catch (ReflectionTypeLoadException e)
{
var sb = new StringBuilder();
sb.Append(string.Format("Could not scan assembly: {0}. Exception message {1}.", a.FullName, e));
if (e.LoaderExceptions.Any())
{
sb.Append(Environment.NewLine + "Scanned type errors: ");
foreach (var ex in e.LoaderExceptions)
sb.Append(Environment.NewLine + ex.Message);
}
LogManager.GetLogger(typeof(Configure)).Warn(sb.ToString());
//intentionally swallow exception
}
});
return types;
} |
<<<<<<<
var section = Configure.ConfigurationSource.GetConfiguration<GatewayConfig>();
if (section != null)
{
sites = section.SitesAsDictionary();
}
=======
var section = Configure.GetConfigSection<GatewayConfig>();
if(section != null)
sites = section.SitesAsDictionary();
>>>>>>>
var section = Configure.GetConfigSection<GatewayConfig>();
if (section != null)
{
sites = section.SitesAsDictionary();
} |
<<<<<<<
using System;
using NServiceBus.Configuration.AdvancedExtensibility;
using NServiceBus.Settings;
using NServiceBus.Transport;
=======
>>>>>>>
using NServiceBus.Configuration.AdvancedExtensibility;
using NServiceBus.Settings;
using NServiceBus.Transport; |
<<<<<<<
using Config;
=======
using Unicast.Transport;
>>>>>>>
using Config;
using Unicast.Transport;
<<<<<<<
InMemoryFaultManager = new Faults.InMemory.FaultManager();
TransportBuilder = new FakeTransportBuilder();
=======
InMemoryFaultManager = new NServiceBus.Faults.InMemory.FaultManager();
Transport = new FakeTransport();
>>>>>>>
InMemoryFaultManager = new Faults.InMemory.FaultManager();
Transport = new FakeTransport(); |
<<<<<<<
Log.DebugFormat("Started {0}.", name);
}
catch (Exception ex)
{
ConfigureCriticalErrorAction.RaiseCriticalError(String.Format("{0} could not be started.", name), ex);
}
}, TaskCreationOptions.LongRunning)).ToArray();
=======
thingsRanAtStartup.Add(toRun);
Log.DebugFormat("Started {0}.", toRun.GetType().AssemblyQualifiedName);
},
ex => Configure.Instance.RaiseCriticalError("Startup task failed to complete.", ex),
startCompletedEvent);
>>>>>>>
thingsRanAtStartup.Add(toRun);
Log.DebugFormat("Started {0}.", toRun.GetType().AssemblyQualifiedName);
},
ex => ConfigureCriticalErrorAction.RaiseCriticalError("Startup task failed to complete.", ex),
startCompletedEvent);
<<<<<<<
try
{
toRun.Stop();
Log.DebugFormat("Stopped {0}.", name);
}
catch (Exception ex)
{
ConfigureCriticalErrorAction.RaiseCriticalError(String.Format("{0} could not be stopped.", name), ex);
}
}, TaskCreationOptions.LongRunning);
mapTaskToThingsToRunAtStartup.TryAdd(task.Id, name);
task.Start();
return task;
=======
toRun.Stop();
Log.DebugFormat("Stopped {0}.", toRun.GetType().AssemblyQualifiedName);
},
ex => Log.Fatal("Startup task failed to stop.", ex),
stopCompletedEvent);
>>>>>>>
toRun.Stop();
Log.DebugFormat("Stopped {0}.", toRun.GetType().AssemblyQualifiedName);
},
ex => Log.Fatal("Startup task failed to stop.", ex),
stopCompletedEvent);
<<<<<<<
=======
static void ProcessStartupItems<T>(IEnumerable<T> items, Action<T> iteration, Action<Exception> inCaseOfFault, EventWaitHandle eventToSet)
{
eventToSet.Reset();
Task.Factory.StartNew(() =>
{
Parallel.ForEach(items, iteration);
eventToSet.Set();
}, TaskCreationOptions.LongRunning | TaskCreationOptions.PreferFairness)
.ContinueWith(task =>
{
eventToSet.Set();
inCaseOfFault(task.Exception);
}, TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.LongRunning);
}
>>>>>>>
static void ProcessStartupItems<T>(IEnumerable<T> items, Action<T> iteration, Action<Exception> inCaseOfFault, EventWaitHandle eventToSet)
{
eventToSet.Reset();
Task.Factory.StartNew(() =>
{
Parallel.ForEach(items, iteration);
eventToSet.Set();
}, TaskCreationOptions.LongRunning | TaskCreationOptions.PreferFairness)
.ContinueWith(task =>
{
eventToSet.Set();
inCaseOfFault(task.Exception);
}, TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.LongRunning);
} |
<<<<<<<
internal static readonly Dictionary<Type, Dictionary<Type, SagaToMessageMap>> SagaEntityToMessageToPropertyLookup = new Dictionary<Type, Dictionary<Type, SagaToMessageMap>>();
=======
internal static readonly Dictionary<Type, Dictionary<Type, KeyValuePair<PropertyInfo, PropertyInfo>>> SagaEntityToMessageToPropertyLookup = new Dictionary<Type, Dictionary<Type, KeyValuePair<PropertyInfo, PropertyInfo>>>();
>>>>>>>
internal static readonly Dictionary<Type, Dictionary<Type, SagaToMessageMap>> SagaEntityToMessageToPropertyLookup = new Dictionary<Type, Dictionary<Type, SagaToMessageMap>>();
<<<<<<<
var sagaToMessageMap = sagaEntityPair.Value[messageType];
CreatePropertyFinder(sagaEntityPair.Key, messageType, sagaToMessageMap);
=======
var pair = sagaEntityPair.Value[messageType];
CreatePropertyFinder(context,sagaEntityPair.Key, messageType, pair.Key, pair.Value);
>>>>>>>
var sagaToMessageMap = sagaEntityPair.Value[messageType];
CreatePropertyFinder(context, sagaEntityPair.Key, messageType, sagaToMessageMap);
<<<<<<<
void CreatePropertyFinder(Type sagaEntityType, Type messageType, SagaToMessageMap sagaToMessageMap)
=======
void CreatePropertyFinder(FeatureConfigurationContext context, Type sagaEntityType, Type messageType, PropertyInfo sagaProperty, PropertyInfo messageProperty)
>>>>>>>
void CreatePropertyFinder(FeatureConfigurationContext context, Type sagaEntityType, Type messageType, SagaToMessageMap sagaToMessageMap)
<<<<<<<
Configure.Component(finderType, DependencyLifecycle.InstancePerCall)
.ConfigureProperty("SagaToMessageMap", sagaToMessageMap);
=======
context.Container.ConfigureComponent(finderType, DependencyLifecycle.InstancePerCall)
.ConfigureProperty("SagaProperty", sagaProperty)
.ConfigureProperty("MessageProperty", messageProperty);
>>>>>>>
context.Container.ConfigureComponent(finderType, DependencyLifecycle.InstancePerCall)
.ConfigureProperty("SagaToMessageMap", sagaToMessageMap); |
<<<<<<<
static ILog Logger = LogManager.GetLogger<RecoverabilityComponent>();
private TransportSeam transportSeam;
=======
>>>>>>>
private TransportSeam transportSeam; |
<<<<<<<
namespace NServiceBus.Timeout.Tests
{
using System.Transactions;
using Core;
using NUnit.Framework;
[TestFixture]
public class When_removing_timeouts_from_the_storage : WithRavenTimeoutPersister
{
[Test]
public void Should_remove_timeouts_by_id()
{
var t1 = new TimeoutData
{
OwningTimeoutManager = Configure.EndpointName
};
persister.Add(t1);
var t2 = new TimeoutData
{
OwningTimeoutManager = Configure.EndpointName
};
persister.Add(t2);
var t = persister.GetAll();
foreach (var timeoutData in t)
{
using (var tx = new TransactionScope())
{
//other tx stuff like pop a message from MSMQ
persister.Remove(timeoutData.Id);
tx.Complete();
}
}
using (var session = store.OpenSession())
{
session.Advanced.AllowNonAuthoritativeInformation = false;
Assert.Null(session.Load<TimeoutData>(t1.Id));
Assert.Null(session.Load<TimeoutData>(t2.Id));
}
}
}
=======
namespace NServiceBus.Timeout.Tests
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Transactions;
using Core;
using Hosting.Windows.Persistence;
using NUnit.Framework;
using Raven.Client;
using Raven.Client.Document;
using Raven.Client.Embedded;
[TestFixture]
public class When_removing_timeouts_from_the_storage_with_raven : When_removing_timeouts_from_the_storage
{
private IDocumentStore store;
protected override IPersistTimeouts CreateTimeoutPersister()
{
store = new EmbeddableDocumentStore {RunInMemory = true};
//store = new DocumentStore { Url = "http://localhost:8080", DefaultDatabase = "TempTest" };
store.Conventions.DefaultQueryingConsistency = ConsistencyOptions.MonotonicRead;
store.Conventions.MaxNumberOfRequestsPerSession = 10;
store.Initialize();
return new RavenTimeoutPersistence(store);
}
[TearDown]
public void Cleanup()
{
store.Dispose();
}
}
[TestFixture]
public class When_removing_timeouts_from_the_storage_with_inmemory : When_removing_timeouts_from_the_storage
{
protected override IPersistTimeouts CreateTimeoutPersister()
{
return new InMemoryTimeoutPersistence();
}
}
public abstract class When_removing_timeouts_from_the_storage
{
protected IPersistTimeouts persister;
protected abstract IPersistTimeouts CreateTimeoutPersister();
[SetUp]
public void Setup()
{
Address.InitializeLocalAddress("MyEndpoint");
Configure.GetEndpointNameAction = () => "MyEndpoint";
persister = CreateTimeoutPersister();
}
[Test]
public void Should_remove_timeouts_by_id()
{
var t1 = new TimeoutData {Time = DateTime.UtcNow.AddHours(-1)};
persister.Add(t1);
var t2 = new TimeoutData {Time = DateTime.UtcNow.AddHours(-1)};
persister.Add(t2);
var timeouts = GetNextChunk();
foreach (var timeout in timeouts)
{
TimeoutData timeoutData;
persister.TryRemove(timeout.Item1, out timeoutData);
}
Assert.AreEqual(0, GetNextChunk().Count);
}
protected List<Tuple<string, DateTime>> GetNextChunk()
{
DateTime nextTimeToRunQuery;
return persister.GetNextChunk(DateTime.UtcNow.AddYears(-3), out nextTimeToRunQuery);
}
}
>>>>>>>
namespace NServiceBus.Timeout.Tests
{
using System;
using System.Collections.Generic;
using Core;
using Hosting.Windows.Persistence;
using NUnit.Framework;
using Raven.Client;
using Raven.Client.Document;
using Raven.Client.Embedded;
[TestFixture]
public class When_removing_timeouts_from_the_storage_with_raven : When_removing_timeouts_from_the_storage
{
private IDocumentStore store;
protected override IPersistTimeouts CreateTimeoutPersister()
{
store = new EmbeddableDocumentStore {RunInMemory = true};
//store = new DocumentStore { Url = "http://localhost:8080", DefaultDatabase = "TempTest" };
store.Conventions.DefaultQueryingConsistency = ConsistencyOptions.MonotonicRead;
store.Conventions.MaxNumberOfRequestsPerSession = 10;
store.Initialize();
return new RavenTimeoutPersistence(store);
}
[TearDown]
public void Cleanup()
{
store.Dispose();
}
}
[TestFixture]
public class When_removing_timeouts_from_the_storage_with_inmemory : When_removing_timeouts_from_the_storage
{
protected override IPersistTimeouts CreateTimeoutPersister()
{
return new InMemoryTimeoutPersistence();
}
}
public abstract class When_removing_timeouts_from_the_storage
{
protected IPersistTimeouts persister;
protected abstract IPersistTimeouts CreateTimeoutPersister();
[SetUp]
public void Setup()
{
Address.InitializeLocalAddress("MyEndpoint");
Configure.GetEndpointNameAction = () => "MyEndpoint";
persister = CreateTimeoutPersister();
}
[Test]
public void Should_remove_timeouts_by_id()
{
var t1 = new TimeoutData {Time = DateTime.UtcNow.AddHours(-1)};
persister.Add(t1);
var t2 = new TimeoutData {Time = DateTime.UtcNow.AddHours(-1)};
persister.Add(t2);
var timeouts = GetNextChunk();
foreach (var timeout in timeouts)
{
TimeoutData timeoutData;
persister.TryRemove(timeout.Item1, out timeoutData);
}
Assert.AreEqual(0, GetNextChunk().Count);
}
protected List<Tuple<string, DateTime>> GetNextChunk()
{
DateTime nextTimeToRunQuery;
return persister.GetNextChunk(DateTime.UtcNow.AddYears(-3), out nextTimeToRunQuery);
}
} |
<<<<<<<
config = Configure.With(o => o.EndpointName(endpointName)
.EnableInstallers())
=======
config = Configure.With(o => o.EndpointName(endpointName).DiscardFailedMessagesInsteadOfSendingToErrorQueue())
>>>>>>>
config = Configure.With(o => o.EndpointName(endpointName)
.EnableInstallers()
.DiscardFailedMessagesInsteadOfSendingToErrorQueue())
<<<<<<<
using (var startableBus = config.InMemoryFaultManagement().CreateBus())
=======
config.EnableInstallers();
using (var startableBus = config.CreateBus())
>>>>>>>
using (var startableBus = config.CreateBus()) |
<<<<<<<
AssetFileData data = (AssetFileData)t.AsyncState;
return data;
=======
AssetFileData data = (AssetFileData)t.Result.AsyncState;
IAssetFile file = this._cloudMediaContext.Files.Where(c => c.Id == data.Id).First();
return file;
>>>>>>>
AssetFileData data = (AssetFileData)t.Result.AsyncState;
return data; |
<<<<<<<
{
var message = new TransportMessage();
foreach (var header in from)
{
message.Headers[header.Key] = header.Value;
}
return message;
}
=======
{
return new TransportMessage();
}
>>>>>>>
{
return new TransportMessage();
}
foreach (var header in from)
{
message.Headers[header.Key] = header.Value;
}
return message;
}
<<<<<<<
if (to.TimeToBeReceived < TimeSpan.FromSeconds(1))
{
to.TimeToBeReceived = TimeSpan.FromSeconds(1);
}
=======
if (to.TimeToBeReceived < MinimumTimeToBeReceived)
{
to.TimeToBeReceived = MinimumTimeToBeReceived;
}
>>>>>>>
if (to.TimeToBeReceived < MinimumTimeToBeReceived)
{
to.TimeToBeReceived = MinimumTimeToBeReceived;
}
}
<<<<<<<
correlationIdToStore = message.CorrelationId + "\\0";
//msmq required the id's to be in the {guid}\{incrementing number} format so we need to fake a \0 at the end to make it compatible
=======
correlationIdToStore = message.CorrelationId + "\\0";
//msmq required the id's to be in the {guid}\{incrementing number} format so we need to fake a \0 at the end to make it compatible
>>>>>>>
correlationIdToStore = message.CorrelationId + "\\0";
//msmq required the id's to be in the {guid}\{incrementing number} format so we need to fake a \0 at the end to make it compatible |
<<<<<<<
using MessageMutator;
public class GatewayHeaderManager : IMutateTransportMessages, INeedInitialization
{
public void MutateIncoming(TransportMessage transportMessage)
{
returnInfo = null;
if (!transportMessage.Headers.ContainsKey(Headers.HttpFrom) &&
!transportMessage.Headers.ContainsKey(Headers.OriginatingSite))
return;
returnInfo = new HttpReturnInfo
{
//we preserve the httfrom to be backwards compatible with NServiceBus 2.X
HttpFrom = transportMessage.Headers.ContainsKey(Headers.HttpFrom) ? transportMessage.Headers[Headers.HttpFrom] : null,
OriginatingSite = transportMessage.Headers.ContainsKey(Headers.OriginatingSite) ? transportMessage.Headers[Headers.OriginatingSite] : null,
ReplyToAddress = transportMessage.ReplyToAddress
};
}
public void MutateOutgoing(object[] messages, TransportMessage transportMessage)
{
if (returnInfo == null)
return;
if (string.IsNullOrEmpty(transportMessage.CorrelationId))
return;
if (transportMessage.Headers.ContainsKey(Headers.HttpTo) || transportMessage.Headers.ContainsKey(Headers.DestinationSites))
return;
transportMessage.Headers[Headers.HttpTo] = returnInfo.HttpFrom;
transportMessage.Headers[Headers.DestinationSites] = returnInfo.OriginatingSite;
if (!transportMessage.Headers.ContainsKey(Headers.RouteTo))
transportMessage.Headers[Headers.RouteTo] = returnInfo.ReplyToAddress.ToString();
}
public void Init()
{
Configure.Instance.Configurer.ConfigureComponent<GatewayHeaderManager>(
DependencyLifecycle.InstancePerCall);
}
[ThreadStatic]
static HttpReturnInfo returnInfo;
class HttpReturnInfo
{
public string HttpFrom { get; set; }
public string OriginatingSite { get; set; }
public Address ReplyToAddress { get; set; }
=======
using MessageMutator;
using NServiceBus.Config;
using Unicast.Transport;
public class GatewayHeaderManager : IMutateTransportMessages,INeedInitialization
{
public void MutateIncoming(TransportMessage transportMessage)
{
returnInfo = null;
if (!transportMessage.Headers.ContainsKey(Headers.HttpFrom) &&
!transportMessage.Headers.ContainsKey(Headers.OriginatingSite))
return;
returnInfo = new HttpReturnInfo
{
//we preserve the httfrom to be backwards compatible with NServiceBus 2.X
HttpFrom = transportMessage.Headers.ContainsKey(Headers.HttpFrom) ? transportMessage.Headers[Headers.HttpFrom] : null,
OriginatingSite = transportMessage.Headers.ContainsKey(Headers.OriginatingSite) ? transportMessage.Headers[Headers.OriginatingSite] : null,
ReplyToAddress = transportMessage.ReplyToAddress
};
}
public void MutateOutgoing(object[] messages, TransportMessage transportMessage)
{
if (returnInfo == null)
return;
if (string.IsNullOrEmpty(transportMessage.CorrelationId))
return;
if (transportMessage.Headers.ContainsKey(Headers.HttpTo) || transportMessage.Headers.ContainsKey(Headers.DestinationSites))
return;
transportMessage.Headers[Headers.HttpTo] = returnInfo.HttpFrom;
transportMessage.Headers[Headers.OriginatingSite] = returnInfo.OriginatingSite;
if (!transportMessage.Headers.ContainsKey(Headers.RouteTo))
transportMessage.Headers[Headers.RouteTo] = returnInfo.ReplyToAddress.ToString();
}
public void Init()
{
Configure.Instance.Configurer.ConfigureComponent<GatewayHeaderManager>(
DependencyLifecycle.InstancePerCall);
}
[ThreadStatic]
static HttpReturnInfo returnInfo;
class HttpReturnInfo
{
public string HttpFrom { get; set; }
public string OriginatingSite { get; set; }
public Address ReplyToAddress { get; set; }
>>>>>>>
using MessageMutator;
public class GatewayHeaderManager : IMutateTransportMessages, INeedInitialization
{
public void MutateIncoming(TransportMessage transportMessage)
{
returnInfo = null;
if (!transportMessage.Headers.ContainsKey(Headers.HttpFrom) &&
!transportMessage.Headers.ContainsKey(Headers.OriginatingSite))
return;
returnInfo = new HttpReturnInfo
{
//we preserve the httfrom to be backwards compatible with NServiceBus 2.X
HttpFrom = transportMessage.Headers.ContainsKey(Headers.HttpFrom) ? transportMessage.Headers[Headers.HttpFrom] : null,
OriginatingSite = transportMessage.Headers.ContainsKey(Headers.OriginatingSite) ? transportMessage.Headers[Headers.OriginatingSite] : null,
ReplyToAddress = transportMessage.ReplyToAddress
};
}
public void MutateOutgoing(object[] messages, TransportMessage transportMessage)
{
if (returnInfo == null)
return;
if (string.IsNullOrEmpty(transportMessage.CorrelationId))
return;
if (transportMessage.Headers.ContainsKey(Headers.HttpTo) || transportMessage.Headers.ContainsKey(Headers.DestinationSites))
return;
transportMessage.Headers[Headers.HttpTo] = returnInfo.HttpFrom;
transportMessage.Headers[Headers.OriginatingSite] = returnInfo.OriginatingSite;
if (!transportMessage.Headers.ContainsKey(Headers.RouteTo))
transportMessage.Headers[Headers.RouteTo] = returnInfo.ReplyToAddress.ToString();
}
public void Init()
{
Configure.Instance.Configurer.ConfigureComponent<GatewayHeaderManager>(
DependencyLifecycle.InstancePerCall);
}
[ThreadStatic]
static HttpReturnInfo returnInfo;
class HttpReturnInfo
{
public string HttpFrom { get; set; }
public string OriginatingSite { get; set; }
public Address ReplyToAddress { get; set; } |
<<<<<<<
using System.Transactions;
=======
>>>>>>>
using System.Transactions;
<<<<<<<
using NServiceBus.Unicast.Transport;
using NServiceBus.Unicast.Transport.Transactional;
using NServiceBus.Utils;
=======
using Unicast.Transport;
>>>>>>>
using NServiceBus.Unicast.Transport.Transactional;
<<<<<<<
var transportMessage = this.activeMqMessageMapper.CreateTransportMessage(message);
if (this.transactionSettings.IsTransactional)
{
using (var scope = new TransactionScope(TransactionScopeOption.Required, transactionOptions))
{
try
{
this.sessionFactory.SetSessionForCurrentTransaction(this.session);
this.MessageReceived(this, new TransportMessageReceivedEventArgs(transportMessage));
}
finally
{
this.sessionFactory.RemoveSessionForCurrentTransaction();
}
scope.Complete();
}
}
else
{
try
{
this.MessageReceived(this, new TransportMessageReceivedEventArgs(transportMessage));
}
catch (Exception)
{
// Swallow exception so that the message is not retried.
}
}
=======
TransportMessage transportMessage = activeMqMessageMapper.CreateTransportMessage(message);
MessageReceived(this, new TransportMessageReceivedEventArgs(transportMessage));
>>>>>>>
var transportMessage = this.activeMqMessageMapper.CreateTransportMessage(message);
if (this.transactionSettings.IsTransactional)
{
if (!this.transactionSettings.SuppressDTC)
{
this.ProcessInDTCTransaction(transportMessage);
}
else
{
this.ProcessInActiveMqTransaction(transportMessage);
}
}
else
{
this.TryProcessMessage(transportMessage);
}
}
private void ProcessInActiveMqTransaction(TransportMessage transportMessage)
{
if (!this.TryProcessMessage(transportMessage))
{
this.session.Rollback();
}
}
private void ProcessInDTCTransaction(TransportMessage transportMessage)
{
using (var scope = new TransactionScope(TransactionScopeOption.Required, this.transactionOptions))
{
this.sessionFactory.SetSessionForCurrentTransaction(this.session);
var success = this.TryProcessMessage(transportMessage);
this.sessionFactory.RemoveSessionForCurrentTransaction();
if (success)
{
scope.Complete();
}
}
<<<<<<<
public void Dispose()
{
foreach (var messageConsumer in this.topicConsumers)
{
messageConsumer.Value.Close();
messageConsumer.Value.Dispose();
}
this.defaultConsumer.Close();
this.defaultConsumer.Dispose();
this.sessionFactory.Release(this.session);
}
=======
>>>>>>> |
<<<<<<<
namespace NServiceBus.Timeout.Hosting.Windows
{
using System;
using Core;
using Faults;
using ObjectBuilder;
using Unicast.Queuing;
using Unicast.Queuing.Msmq;
using Unicast.Transport;
using Unicast.Transport.Transactional;
public class TimeoutMessageProcessor : IWantToRunWhenBusStartsAndStops
{
const string TimeoutDestinationHeader = "NServiceBus.Timeout.Destination";
const string TimeoutIdToDispatchHeader = "NServiceBus.Timeout.TimeoutIdToDispatch";
ITransport inputTransport;
static readonly Address TimeoutManagerAddress;
public ISendMessages MessageSender { get; set; }
public TransactionalTransport MainTransport { get; set; }
public IBuilder Builder { get; set; }
public IManageTimeouts TimeoutManager { get; set; }
public static Func<IReceiveMessages> MessageReceiverFactory { get; set; }
static TimeoutMessageProcessor()
{
TimeoutManagerAddress = Address.Parse(Configure.EndpointName).SubScope("Timeouts");
}
public void Start()
{
var messageReceiver = MessageReceiverFactory != null ? MessageReceiverFactory() : new MsmqMessageReceiver();
inputTransport = new TransactionalTransport
{
MessageReceiver = messageReceiver,
IsTransactional = true,
NumberOfWorkerThreads = MainTransport.NumberOfWorkerThreads == 0 ? 1 : MainTransport.NumberOfWorkerThreads,
MaxRetries = MainTransport.MaxRetries,
FailureManager = Builder.Build(MainTransport.FailureManager.GetType())as IManageMessageFailures
};
inputTransport.TransportMessageReceived += OnTransportMessageReceived;
inputTransport.Start(TimeoutManagerAddress);
}
public void Stop()
{
if (inputTransport != null)
{
inputTransport.Dispose();
}
}
void OnTransportMessageReceived(object sender, TransportMessageReceivedEventArgs e)
{
//dispatch request will arrive at the same input so we need to make sure to call the correct handler
if (e.Message.Headers.ContainsKey(TimeoutIdToDispatchHeader))
HandleBackwardsCompatibility(e.Message);
else
Handle(e.Message);
}
void HandleBackwardsCompatibility(TransportMessage message)
{
var timeoutId = message.Headers[TimeoutIdToDispatchHeader];
var destination = Address.Parse(message.Headers[TimeoutDestinationHeader]);
//clear headers
message.Headers.Remove(TimeoutIdToDispatchHeader);
message.Headers.Remove(TimeoutDestinationHeader);
if (message.Headers.ContainsKey(Headers.RouteExpiredTimeoutTo))
{
destination = Address.Parse(message.Headers[Headers.RouteExpiredTimeoutTo]);
}
TimeoutManager.RemoveTimeout(timeoutId);
MessageSender.Send(message, destination);
}
void Handle(TransportMessage message)
{
var sagaId = Guid.Empty;
if (message.Headers.ContainsKey(Headers.SagaId))
{
sagaId = Guid.Parse(message.Headers[Headers.SagaId]);
}
if (message.Headers.ContainsKey(Headers.ClearTimeouts))
{
if (sagaId == Guid.Empty)
throw new InvalidOperationException("Invalid saga id specified, clear timeouts is only supported for saga instances");
TimeoutManager.RemoveTimeoutBy(sagaId);
}
else
{
if (!message.Headers.ContainsKey(Headers.Expire))
throw new InvalidOperationException("Non timeout message arrived at the timeout manager, id:" + message.Id);
var data = new TimeoutData
{
Destination = message.ReplyToAddress,
SagaId = sagaId,
State = message.Body,
Time = message.Headers[Headers.Expire].ToUtcDateTime(),
CorrelationId = message.CorrelationId,
Headers = message.Headers,
OwningTimeoutManager = Configure.EndpointName
};
//add a temp header so that we can make sure to restore the ReplyToAddress
if (message.ReplyToAddress != null)
{
data.Headers[TimeoutData.OriginalReplyToAddress] = message.ReplyToAddress.ToString();
}
TimeoutManager.PushTimeout(data);
}
}
}
=======
namespace NServiceBus.Timeout.Hosting.Windows
{
using System;
using Core;
using Faults;
using ObjectBuilder;
using Unicast;
using Unicast.Queuing;
using Unicast.Queuing.Msmq;
using Unicast.Transport;
using Unicast.Transport.Transactional;
public class TimeoutMessageProcessor : IWantToRunWhenTheBusStarts, IDisposable
{
const string TimeoutDestinationHeader = "NServiceBus.Timeout.Destination";
const string TimeoutIdToDispatchHeader = "NServiceBus.Timeout.TimeoutIdToDispatch";
ITransport inputTransport;
public ISendMessages MessageSender { get; set; }
public TransactionalTransport MainTransport { get; set; }
public IBuilder Builder { get; set; }
public IManageTimeouts TimeoutManager { get; set; }
public static Func<IReceiveMessages> MessageReceiverFactory { get; set; }
public void Run()
{
if (!Configure.Instance.IsTimeoutManagerEnabled())
{
return;
}
var messageReceiver = MessageReceiverFactory != null ? MessageReceiverFactory() : new MsmqMessageReceiver();
inputTransport = new TransactionalTransport
{
MessageReceiver = messageReceiver,
IsTransactional = true,
NumberOfWorkerThreads = MainTransport.NumberOfWorkerThreads == 0 ? 1 : MainTransport.NumberOfWorkerThreads,
MaxRetries = MainTransport.MaxRetries,
FailureManager = new ManageMessageFailuresWithoutSlr(MainTransport.FailureManager),
};
inputTransport.TransportMessageReceived += OnTransportMessageReceived;
inputTransport.Start(ConfigureTimeoutManager.TimeoutManagerAddress);
}
public void Dispose()
{
if (inputTransport != null)
{
inputTransport.Dispose();
}
}
void OnTransportMessageReceived(object sender, TransportMessageReceivedEventArgs e)
{
//dispatch request will arrive at the same input so we need to make sure to call the correct handler
if (e.Message.Headers.ContainsKey(TimeoutIdToDispatchHeader))
HandleBackwardsCompatibility(e.Message);
else
Handle(e.Message);
}
void HandleBackwardsCompatibility(TransportMessage message)
{
var timeoutId = message.Headers[TimeoutIdToDispatchHeader];
var destination = Address.Parse(message.Headers[TimeoutDestinationHeader]);
//clear headers
message.Headers.Remove(TimeoutIdToDispatchHeader);
message.Headers.Remove(TimeoutDestinationHeader);
if (message.Headers.ContainsKey(Headers.RouteExpiredTimeoutTo))
{
destination = Address.Parse(message.Headers[Headers.RouteExpiredTimeoutTo]);
}
TimeoutManager.RemoveTimeout(timeoutId);
MessageSender.Send(message, destination);
}
void Handle(TransportMessage message)
{
var sagaId = Guid.Empty;
if (message.Headers.ContainsKey(Headers.SagaId))
{
sagaId = Guid.Parse(message.Headers[Headers.SagaId]);
}
if (message.Headers.ContainsKey(Headers.ClearTimeouts))
{
if (sagaId == Guid.Empty)
throw new InvalidOperationException("Invalid saga id specified, clear timeouts is only supported for saga instances");
TimeoutManager.RemoveTimeoutBy(sagaId);
}
else
{
if (!message.Headers.ContainsKey(Headers.Expire))
throw new InvalidOperationException("Non timeout message arrived at the timeout manager, id:" + message.Id);
var destination = message.ReplyToAddress;
if (message.Headers.ContainsKey(Headers.RouteExpiredTimeoutTo))
{
destination = Address.Parse(message.Headers[Headers.RouteExpiredTimeoutTo]);
}
var data = new TimeoutData
{
Destination = destination,
SagaId = sagaId,
State = message.Body,
Time = message.Headers[Headers.Expire].ToUtcDateTime(),
CorrelationId = message.CorrelationId,
Headers = message.Headers,
OwningTimeoutManager = Configure.EndpointName
};
//add a temp header so that we can make sure to restore the ReplyToAddress
if (message.ReplyToAddress != null)
{
data.Headers[TimeoutData.OriginalReplyToAddress] = message.ReplyToAddress.ToString();
}
TimeoutManager.PushTimeout(data);
}
}
}
>>>>>>>
namespace NServiceBus.Timeout.Hosting.Windows
{
using System;
using Core;
using Faults;
using ObjectBuilder;
using Unicast.Queuing;
using Unicast.Queuing.Msmq;
using Unicast.Transport;
using Unicast.Transport.Transactional;
public class TimeoutMessageProcessor : IWantToRunWhenBusStartsAndStops
{
const string TimeoutDestinationHeader = "NServiceBus.Timeout.Destination";
const string TimeoutIdToDispatchHeader = "NServiceBus.Timeout.TimeoutIdToDispatch";
ITransport inputTransport;
static readonly Address TimeoutManagerAddress;
public ISendMessages MessageSender { get; set; }
public TransactionalTransport MainTransport { get; set; }
public IBuilder Builder { get; set; }
public IManageTimeouts TimeoutManager { get; set; }
public static Func<IReceiveMessages> MessageReceiverFactory { get; set; }
static TimeoutMessageProcessor()
{
TimeoutManagerAddress = Address.Parse(Configure.EndpointName).SubScope("Timeouts");
}
public void Start()
{
var messageReceiver = MessageReceiverFactory != null ? MessageReceiverFactory() : new MsmqMessageReceiver();
inputTransport = new TransactionalTransport
{
MessageReceiver = messageReceiver,
IsTransactional = true,
NumberOfWorkerThreads = MainTransport.NumberOfWorkerThreads == 0 ? 1 : MainTransport.NumberOfWorkerThreads,
MaxRetries = MainTransport.MaxRetries,
FailureManager = new ManageMessageFailuresWithoutSlr(MainTransport.FailureManager),
};
inputTransport.TransportMessageReceived += OnTransportMessageReceived;
inputTransport.Start(TimeoutManagerAddress);
}
public void Stop()
{
if (inputTransport != null)
{
inputTransport.Dispose();
}
}
void OnTransportMessageReceived(object sender, TransportMessageReceivedEventArgs e)
{
//dispatch request will arrive at the same input so we need to make sure to call the correct handler
if (e.Message.Headers.ContainsKey(TimeoutIdToDispatchHeader))
HandleBackwardsCompatibility(e.Message);
else
Handle(e.Message);
}
void HandleBackwardsCompatibility(TransportMessage message)
{
var timeoutId = message.Headers[TimeoutIdToDispatchHeader];
var destination = Address.Parse(message.Headers[TimeoutDestinationHeader]);
//clear headers
message.Headers.Remove(TimeoutIdToDispatchHeader);
message.Headers.Remove(TimeoutDestinationHeader);
if (message.Headers.ContainsKey(Headers.RouteExpiredTimeoutTo))
{
destination = Address.Parse(message.Headers[Headers.RouteExpiredTimeoutTo]);
}
TimeoutManager.RemoveTimeout(timeoutId);
MessageSender.Send(message, destination);
}
void Handle(TransportMessage message)
{
var sagaId = Guid.Empty;
if (message.Headers.ContainsKey(Headers.SagaId))
{
sagaId = Guid.Parse(message.Headers[Headers.SagaId]);
}
if (message.Headers.ContainsKey(Headers.ClearTimeouts))
{
if (sagaId == Guid.Empty)
throw new InvalidOperationException("Invalid saga id specified, clear timeouts is only supported for saga instances");
TimeoutManager.RemoveTimeoutBy(sagaId);
}
else
{
if (!message.Headers.ContainsKey(Headers.Expire))
throw new InvalidOperationException("Non timeout message arrived at the timeout manager, id:" + message.Id);
var destination = message.ReplyToAddress;
if (message.Headers.ContainsKey(Headers.RouteExpiredTimeoutTo))
{
destination = Address.Parse(message.Headers[Headers.RouteExpiredTimeoutTo]);
}
var data = new TimeoutData
{
Destination = destination,
SagaId = sagaId,
State = message.Body,
Time = message.Headers[Headers.Expire].ToUtcDateTime(),
CorrelationId = message.CorrelationId,
Headers = message.Headers,
OwningTimeoutManager = Configure.EndpointName
};
//add a temp header so that we can make sure to restore the ReplyToAddress
if (message.ReplyToAddress != null)
{
data.Headers[TimeoutData.OriginalReplyToAddress] = message.ReplyToAddress.ToString();
}
TimeoutManager.PushTimeout(data);
}
}
} |
<<<<<<<
Directory.CreateDirectory(Path.Combine(path, ".committed"));
bodyDir = Path.Combine(path, BodyDirName);
=======
>>>>>>>
Directory.CreateDirectory(Path.Combine(path, ".committed"));
bodyDir = Path.Combine(path, BodyDirName); |
<<<<<<<
#region Tests that are producing diagnostics
[TestCategory("Detect")]
[TestMethod]
public async Task XssFromCSharpExpressionBody()
{
const string cSharpTest = @"
using System.Web;
class Vulnerable
{
public static HttpResponse Response = null;
public static HttpRequest Request = null;
public static void Run()
=> Response.Write(Request.Params[0]);
}
";
await VerifyCSharpDiagnostic(cSharpTest, Expected.WithLocation(10, 23)).ConfigureAwait(false);
}
=======
>>>>>>>
[TestCategory("Detect")]
[TestMethod]
public async Task XssFromCSharpExpressionBody()
{
const string cSharpTest = @"
using System.Web;
class Vulnerable
{
public static HttpResponse Response = null;
public static HttpRequest Request = null;
public static void Run()
=> Response.Write(Request.Params[0]);
}
";
await VerifyCSharpDiagnostic(cSharpTest, Expected.WithLocation(10, 23)).ConfigureAwait(false);
}
<<<<<<<
#endregion
#region Tests that are not producing diagnostics
=======
>>>>>>> |
<<<<<<<
using System;
using System.Collections.Concurrent;
=======
using System.Collections.Concurrent;
using Servicecomb.Saga.Omega.Abstractions.Transaction;
>>>>>>>
using System;
using System.Collections.Concurrent;
using Servicecomb.Saga.Omega.Abstractions.Transaction; |
<<<<<<<
typeMapper[typeof(ConvolutionFilterNode)] = typeof(ConvolutionFilterNodePresenter);
=======
typeMapper[typeof(Matrix2Node)] = typeof(Matrix2NodePresenter);
typeMapper[typeof(Matrix3Node)] = typeof(Matrix3NodePresenter);
typeMapper[typeof(Matrix4Node)] = typeof(Matrix4NodePresenter);
typeMapper[typeof(MatrixCommonNode)] = typeof(MatrixCommonNodePresenter);
typeMapper[typeof(TransformNode)] = typeof(TransformNodePresenter);
}
public override List<NodeAnchorPresenter> GetCompatibleAnchors(NodeAnchorPresenter startAnchor, NodeAdapter nodeAdapter)
{
return allChildren.OfType<NodeAnchorPresenter>()
.Where(nap => nap.IsConnectable() &&
nap.orientation == startAnchor.orientation &&
nap.direction != startAnchor.direction &&
nodeAdapter.GetAdapter(nap.source, startAnchor.source) != null &&
(startAnchor is GraphAnchorPresenter && ((GraphAnchorPresenter)nap).slot is MaterialSlot &&
((MaterialSlot)((GraphAnchorPresenter)startAnchor).slot).IsCompatibleWithInputSlotType(((MaterialSlot)((GraphAnchorPresenter)nap).slot).valueType)))
.ToList();
>>>>>>>
typeMapper[typeof(Matrix2Node)] = typeof(Matrix2NodePresenter);
typeMapper[typeof(Matrix3Node)] = typeof(Matrix3NodePresenter);
typeMapper[typeof(Matrix4Node)] = typeof(Matrix4NodePresenter);
typeMapper[typeof(MatrixCommonNode)] = typeof(MatrixCommonNodePresenter);
typeMapper[typeof(TransformNode)] = typeof(TransformNodePresenter);
typeMapper[typeof(ConvolutionFilterNode)] = typeof(ConvolutionFilterNodePresenter);
}
public override List<NodeAnchorPresenter> GetCompatibleAnchors(NodeAnchorPresenter startAnchor, NodeAdapter nodeAdapter)
{
return allChildren.OfType<NodeAnchorPresenter>()
.Where(nap => nap.IsConnectable() &&
nap.orientation == startAnchor.orientation &&
nap.direction != startAnchor.direction &&
nodeAdapter.GetAdapter(nap.source, startAnchor.source) != null &&
(startAnchor is GraphAnchorPresenter && ((GraphAnchorPresenter)nap).slot is MaterialSlot &&
((MaterialSlot)((GraphAnchorPresenter)startAnchor).slot).IsCompatibleWithInputSlotType(((MaterialSlot)((GraphAnchorPresenter)nap).slot).valueType)))
.ToList(); |
<<<<<<<
var graph = graphObject.graph as UnityEngine.MaterialGraph.MaterialGraph;
=======
var graph = inMemoryAsset as IShaderGraph;
>>>>>>>
var graph = graphObject.graph as IShaderGraph; |
<<<<<<<
else if (property is IntegerShaderProperty)
m_ValueAction = IntegerField;
else if (property is SliderShaderProperty)
m_ValueAction = SliderField;
=======
else if (property is BooleanShaderProperty)
m_ValueAction = BooleanField;
>>>>>>>
else if (property is IntegerShaderProperty)
m_ValueAction = IntegerField;
else if (property is SliderShaderProperty)
m_ValueAction = SliderField;
else if (property is BooleanShaderProperty)
m_ValueAction = BooleanField;
<<<<<<<
void IntegerField()
{
var fProp = (IntegerShaderProperty)property;
fProp.value = EditorGUILayout.IntField(fProp.value);
}
void SliderField()
{
var fProp = (SliderShaderProperty)property;
var value = fProp.value;
GUILayoutOption[] sliderOptions = { GUILayout.ExpandWidth(true) };
GUILayoutOption[] options = { GUILayout.MaxWidth(30.0f) };
value.x = EditorGUILayout.Slider(fProp.value.x, fProp.value.y, fProp.value.z, sliderOptions);
EditorGUILayout.BeginHorizontal();
float previousLabelWidth = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = 30f;
Rect minMaxRect = EditorGUILayout.GetControlRect(new GUILayoutOption[]{ GUILayout.ExpandWidth(true) } );
Rect minRect = new Rect(minMaxRect.x, minMaxRect.y, minMaxRect.width / 2, minMaxRect.height);
Rect maxRect = new Rect(minMaxRect.x + minMaxRect.width / 2, minMaxRect.y, minMaxRect.width / 2, minMaxRect.height);
value.y = EditorGUI.FloatField(minRect, "Min", fProp.value.y);
value.z = EditorGUI.FloatField(maxRect, "Max", fProp.value.z);
EditorGUIUtility.labelWidth = previousLabelWidth;
EditorGUILayout.EndHorizontal();
fProp.value = value;
}
=======
void BooleanField()
{
var fProp = (BooleanShaderProperty)property;
fProp.value = EditorGUILayout.Toggle(fProp.value);
}
>>>>>>>
void IntegerField()
{
var fProp = (IntegerShaderProperty)property;
fProp.value = EditorGUILayout.IntField(fProp.value);
}
void SliderField()
{
var fProp = (SliderShaderProperty)property;
var value = fProp.value;
GUILayoutOption[] sliderOptions = { GUILayout.ExpandWidth(true) };
GUILayoutOption[] options = { GUILayout.MaxWidth(30.0f) };
value.x = EditorGUILayout.Slider(fProp.value.x, fProp.value.y, fProp.value.z, sliderOptions);
EditorGUILayout.BeginHorizontal();
float previousLabelWidth = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = 30f;
Rect minMaxRect = EditorGUILayout.GetControlRect(new GUILayoutOption[]{ GUILayout.ExpandWidth(true) } );
Rect minRect = new Rect(minMaxRect.x, minMaxRect.y, minMaxRect.width / 2, minMaxRect.height);
Rect maxRect = new Rect(minMaxRect.x + minMaxRect.width / 2, minMaxRect.y, minMaxRect.width / 2, minMaxRect.height);
value.y = EditorGUI.FloatField(minRect, "Min", fProp.value.y);
value.z = EditorGUI.FloatField(maxRect, "Max", fProp.value.z);
EditorGUIUtility.labelWidth = previousLabelWidth;
EditorGUILayout.EndHorizontal();
fProp.value = value;
}
void BooleanField()
{
var fProp = (BooleanShaderProperty)property;
fProp.value = EditorGUILayout.Toggle(fProp.value);
} |
<<<<<<<
using System.Linq;
=======
using UnityEngine;
>>>>>>>
using System.Linq;
using UnityEngine; |
<<<<<<<
gm.AddItem(new GUIContent("HDR Color"), false, () => AddProperty(new ColorShaderProperty(true)));
gm.AddItem(new GUIContent("Integer"), false, () => AddProperty(new IntegerShaderProperty()));
gm.AddItem(new GUIContent("Slider"), false, () => AddProperty(new SliderShaderProperty()));
=======
gm.AddItem(new GUIContent("Boolean"), false, () => AddProperty(new BooleanShaderProperty()));
>>>>>>>
gm.AddItem(new GUIContent("HDR Color"), false, () => AddProperty(new ColorShaderProperty(true)));
gm.AddItem(new GUIContent("Integer"), false, () => AddProperty(new IntegerShaderProperty()));
gm.AddItem(new GUIContent("Slider"), false, () => AddProperty(new SliderShaderProperty()));
gm.AddItem(new GUIContent("Boolean"), false, () => AddProperty(new BooleanShaderProperty())); |
<<<<<<<
return string.Format("inline void {0} ({1} {2}, {3} {4}, out {5} {6})", GetFunctionName(),
ConvertConcreteSlotValueTypeToString(precision, FindInputSlot<MaterialSlot>(InputSlot1Id).concreteValueType), argIn1,
ConvertConcreteSlotValueTypeToString(precision, FindInputSlot<MaterialSlot>(InputSlot2Id).concreteValueType), argIn2,
ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlotId).concreteValueType), argOut);
=======
return string.Format("inline {0} {1} ({2} {3}, {4} {5})", NodeUtils.ConvertConcreteSlotValueTypeToString(precision, FindInputSlot<MaterialSlot>(InputSlot2Id).concreteValueType), GetFunctionName(), NodeUtils.ConvertConcreteSlotValueTypeToString(precision, FindInputSlot<MaterialSlot>(InputSlot1Id).concreteValueType), arg1Name, NodeUtils.ConvertConcreteSlotValueTypeToString(precision, FindInputSlot<MaterialSlot>(InputSlot2Id).concreteValueType), arg2Name);
>>>>>>>
return string.Format("inline void {0} ({1} {2}, {3} {4}, out {5} {6})", GetFunctionName(),
NodeUtils.ConvertConcreteSlotValueTypeToString(precision, FindInputSlot<MaterialSlot>(InputSlot1Id).concreteValueType), argIn1,
NodeUtils.ConvertConcreteSlotValueTypeToString(precision, FindInputSlot<MaterialSlot>(InputSlot2Id).concreteValueType), argIn2,
NodeUtils.ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlotId).concreteValueType), argOut);
<<<<<<<
string outputValue = GetSlotValue(OutputSlotId, generationMode);
visitor.AddShaderChunk(string.Format("{0} {1};", ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlotId).concreteValueType), GetVariableNameForSlot(OutputSlotId)), true);
visitor.AddShaderChunk(GetFunctionCallBody(input1Value, input2Value, outputValue), true);
=======
visitor.AddShaderChunk(string.Format("{0} {1} = {2};", NodeUtils.ConvertConcreteSlotValueTypeToString(precision, FindInputSlot<MaterialSlot>(InputSlot2Id).concreteValueType), GetVariableNameForSlot(OutputSlotId), GetFunctionCallBody(input1Value, input2Value)), true);
>>>>>>>
string outputValue = GetSlotValue(OutputSlotId, generationMode);
visitor.AddShaderChunk(string.Format("{0} {1};", NodeUtils.ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlotId).concreteValueType), GetVariableNameForSlot(OutputSlotId)), true);
visitor.AddShaderChunk(GetFunctionCallBody(input1Value, input2Value, outputValue), true);
<<<<<<<
string vectorString = "Vector";
int inputChannelCount = (int)SlotValueHelper.GetChannelCount(FindSlot<MaterialSlot>(InputSlot1Id).concreteValueType);
if (inputChannelCount == 1)
{
int outputChannelCount = (int)SlotValueHelper.GetChannelCount(FindSlot<MaterialSlot>(OutputSlotId).concreteValueType);
vectorString += ".";
for(int i = 0; i < outputChannelCount; i++)
vectorString += "x";
}
var outputString = new ShaderGenerator();
outputString.AddShaderChunk(GetFunctionPrototype("Vector", "Matrix", "Out"), false);
outputString.AddShaderChunk("{", false);
outputString.Indent();
outputString.AddShaderChunk(string.Format("Out = mul({0}, Matrix);", vectorString), false);
outputString.Deindent();
outputString.AddShaderChunk("}", false);
visitor.AddShaderChunk(outputString.GetShaderString(0), true);
=======
registry.ProvideFunction(GetFunctionName(), s =>
{
s.AppendLine(GetFunctionPrototype("arg1", "arg2"));
using (s.BlockScope())
{
s.AppendLine("return mul(arg1, arg2);");
}
});
>>>>>>>
string vectorString = "Vector";
int inputChannelCount = (int)SlotValueHelper.GetChannelCount(FindSlot<MaterialSlot>(InputSlot1Id).concreteValueType);
if (inputChannelCount == 1)
{
int outputChannelCount = (int)SlotValueHelper.GetChannelCount(FindSlot<MaterialSlot>(OutputSlotId).concreteValueType);
vectorString += ".";
for(int i = 0; i < outputChannelCount; i++)
vectorString += "x";
}
registry.ProvideFunction(GetFunctionName(), s =>
{
s.AppendLine("void {0} ({1} Vector, {2} Matrix, out {3} Out)",
GetFunctionName(),
NodeUtils.ConvertConcreteSlotValueTypeToString(precision, FindInputSlot<MaterialSlot>(InputSlot1Id).concreteValueType),
NodeUtils.ConvertConcreteSlotValueTypeToString(precision, FindInputSlot<MaterialSlot>(InputSlot2Id).concreteValueType),
NodeUtils.ConvertConcreteSlotValueTypeToString(precision, FindOutputSlot<MaterialSlot>(OutputSlotId).concreteValueType));
using (s.BlockScope())
{
s.AppendLine("Out = mul({0}, Matrix);", vectorString);
}
}); |
<<<<<<<
Label m_PathLabel;
TextField m_PathLabelTextField;
bool m_EditPathCancelled = false;
public Action onDragFinished
{
get { return m_WindowDraggable.OnDragFinished; }
set { m_WindowDraggable.OnDragFinished = value; }
}
=======
//public Action onDragFinished
//{
// get { return m_WindowDraggable.OnDragFinished; }
// set { m_WindowDraggable.OnDragFinished = value; }
//}
>>>>>>>
Label m_PathLabel;
TextField m_PathLabelTextField;
bool m_EditPathCancelled = false;
//public Action onDragFinished
//{
// get { return m_WindowDraggable.OnDragFinished; }
// set { m_WindowDraggable.OnDragFinished = value; }
//}
<<<<<<<
m_PathLabel = blackboard.shadow.ElementAt(0).Q<Label>("subTitleLabel");
m_PathLabel.RegisterCallback<MouseDownEvent>(OnMouseDownEvent);
m_PathLabelTextField = new TextField { visible = false };
m_PathLabelTextField.RegisterCallback<FocusOutEvent>(e => { OnEditPathTextFinished();});
m_PathLabelTextField.RegisterCallback<KeyDownEvent>(OnPathTextFieldKeyPressed);
blackboard.shadow.Add(m_PathLabelTextField);
m_WindowDraggable = new WindowDraggable(blackboard.shadow.Children().First().Q("header"));
blackboard.AddManipulator(m_WindowDraggable);
=======
// m_WindowDraggable = new WindowDraggable(blackboard.shadow.Children().First().Q("header"));
// blackboard.AddManipulator(m_WindowDraggable);
>>>>>>>
m_PathLabel = blackboard.shadow.ElementAt(0).Q<Label>("subTitleLabel");
m_PathLabel.RegisterCallback<MouseDownEvent>(OnMouseDownEvent);
m_PathLabelTextField = new TextField { visible = false };
m_PathLabelTextField.RegisterCallback<FocusOutEvent>(e => { OnEditPathTextFinished();});
m_PathLabelTextField.RegisterCallback<KeyDownEvent>(OnPathTextFieldKeyPressed);
blackboard.shadow.Add(m_PathLabelTextField);
// m_WindowDraggable = new WindowDraggable(blackboard.shadow.Children().First().Q("header"));
// blackboard.AddManipulator(m_WindowDraggable); |
<<<<<<<
MasterNodeView m_MasterNodeView;
=======
private EditorWindow m_EditorWindow;
>>>>>>>
MasterNodeView m_MasterNodeView;
private EditorWindow m_EditorWindow;
<<<<<<<
=======
m_GraphInspectorView.AddManipulator(new Draggable(OnMouseDrag, true));
m_GraphView.RegisterCallback<PostLayoutEvent>(OnPostLayout);
m_GraphInspectorView.RegisterCallback<PostLayoutEvent>(OnPostLayout);
m_GraphView.RegisterCallback<KeyDownEvent>(OnSpaceDown);
>>>>>>>
m_GraphView.RegisterCallback<PostLayoutEvent>(OnPostLayout);
m_GraphView.RegisterCallback<KeyDownEvent>(OnSpaceDown);
<<<<<<<
=======
void OnPostLayout(PostLayoutEvent evt)
{
const float minimumVisibility = 60f;
Rect inspectorViewRect = m_GraphInspectorView.layout;
float minimumXPosition = minimumVisibility - inspectorViewRect.width;
float maximumXPosition = m_GraphView.layout.width - minimumVisibility;
float minimumYPosition = minimumVisibility - inspectorViewRect.height;
float maximumYPosition = m_GraphView.layout.height - minimumVisibility;
inspectorViewRect.x = Mathf.Clamp(inspectorViewRect.x, minimumXPosition, maximumXPosition);
inspectorViewRect.y = Mathf.Clamp(inspectorViewRect.y, minimumYPosition, maximumYPosition);
inspectorViewRect.width = Mathf.Min(inspectorViewRect.width, layout.width);
inspectorViewRect.height = Mathf.Min(inspectorViewRect.height, layout.height);
m_GraphInspectorView.layout = inspectorViewRect;
}
void OnSpaceDown(KeyDownEvent evt)
{
if( evt.keyCode == KeyCode.Space)
{
if (graphView.nodeCreationRequest == null)
return;
Vector2 referencePosition;
referencePosition = evt.imguiEvent.mousePosition;
Vector2 screenPoint = m_EditorWindow.position.position + referencePosition;
graphView.nodeCreationRequest(new NodeCreationContext() { screenMousePosition = screenPoint });
}
}
void OnMouseDrag(Vector2 mouseDelta)
{
Vector2 normalizedDelta = mouseDelta / 2f;
Rect inspectorWindowRect = m_GraphInspectorView.layout;
inspectorWindowRect.x += normalizedDelta.x;
inspectorWindowRect.y += normalizedDelta.y;
m_GraphInspectorView.layout = inspectorWindowRect;
}
>>>>>>>
void OnPostLayout(PostLayoutEvent evt)
{
const float minimumVisibility = 60f;
Rect inspectorViewRect = m_GraphInspectorView.layout;
float minimumXPosition = minimumVisibility - inspectorViewRect.width;
float maximumXPosition = m_GraphView.layout.width - minimumVisibility;
float minimumYPosition = minimumVisibility - inspectorViewRect.height;
float maximumYPosition = m_GraphView.layout.height - minimumVisibility;
inspectorViewRect.x = Mathf.Clamp(inspectorViewRect.x, minimumXPosition, maximumXPosition);
inspectorViewRect.y = Mathf.Clamp(inspectorViewRect.y, minimumYPosition, maximumYPosition);
inspectorViewRect.width = Mathf.Min(inspectorViewRect.width, layout.width);
inspectorViewRect.height = Mathf.Min(inspectorViewRect.height, layout.height);
m_GraphInspectorView.layout = inspectorViewRect;
}
void OnSpaceDown(KeyDownEvent evt)
{
if( evt.keyCode == KeyCode.Space)
{
if (graphView.nodeCreationRequest == null)
return;
Vector2 referencePosition;
referencePosition = evt.imguiEvent.mousePosition;
Vector2 screenPoint = m_EditorWindow.position.position + referencePosition;
graphView.nodeCreationRequest(new NodeCreationContext() { screenMousePosition = screenPoint });
}
} |
<<<<<<<
[CategoryResources(nameof(SchemaFolderOptions) + "Active")]
[DisplayNameResources(nameof(SchemaFolderOptions) + nameof(Enabled))]
[DescriptionResources(nameof(SchemaFolderOptions) + nameof(Enabled))]
=======
[Category("Active")]
[DisplayName("Enabled")]
[Description("Group sql objects in Object Explorer (tables, views, etc.) into schema folders.")]
[DefaultValue(true)]
>>>>>>>
[CategoryResources(nameof(SchemaFolderOptions) + "Active")]
[DisplayNameResources(nameof(SchemaFolderOptions) + nameof(Enabled))]
[DescriptionResources(nameof(SchemaFolderOptions) + nameof(Enabled))]
[DefaultValue(true)]
<<<<<<<
[CategoryResources(nameof(SchemaFolderOptions) + "FolderDisplayOptions")]
[DisplayNameResources(nameof(SchemaFolderOptions) + nameof(AppendDot))]
[DescriptionResources(nameof(SchemaFolderOptions) + nameof(AppendDot))]
=======
[Category("Folder Display Options")]
[DisplayName("Append Dot")]
[Description("Add a dot after the schema name on the folder label. ")]
[DefaultValue(true)]
>>>>>>>
[CategoryResources(nameof(SchemaFolderOptions) + "FolderDisplayOptions")]
[DisplayNameResources(nameof(SchemaFolderOptions) + nameof(AppendDot))]
[DescriptionResources(nameof(SchemaFolderOptions) + nameof(AppendDot))]
[DefaultValue(true)]
<<<<<<<
[CategoryResources(nameof(SchemaFolderOptions) + "FolderDisplayOptions")]
[DisplayNameResources(nameof(SchemaFolderOptions) + nameof(CloneParentNode))]
[DescriptionResources(nameof(SchemaFolderOptions) + nameof(CloneParentNode))]
=======
[Category("Folder Display Options")]
[DisplayName("Clone Parent Node")]
[Description("Add the right click and connection properties of the parent node to the schema folder node.")]
[DefaultValue(true)]
>>>>>>>
[CategoryResources(nameof(SchemaFolderOptions) + "FolderDisplayOptions")]
[DisplayNameResources(nameof(SchemaFolderOptions) + nameof(CloneParentNode))]
[DescriptionResources(nameof(SchemaFolderOptions) + nameof(CloneParentNode))]
[DefaultValue(true)]
<<<<<<<
[CategoryResources(nameof(SchemaFolderOptions) + "FolderDisplayOptions")]
[DisplayNameResources(nameof(SchemaFolderOptions) + nameof(UseObjectIcon))]
[DescriptionResources(nameof(SchemaFolderOptions) + nameof(UseObjectIcon))]
=======
[Category("Folder Display Options")]
[DisplayName("Use Object Icon")]
[Description("Use the icon of the last child node as the folder icon. If false then use the parent node (i.e. folder) icon.")]
[DefaultValue(true)]
>>>>>>>
[CategoryResources(nameof(SchemaFolderOptions) + "FolderDisplayOptions")]
[DisplayNameResources(nameof(SchemaFolderOptions) + nameof(UseObjectIcon))]
[DescriptionResources(nameof(SchemaFolderOptions) + nameof(UseObjectIcon))]
[DefaultValue(true)]
<<<<<<<
[CategoryResources(nameof(SchemaFolderOptions) + "ObjectDisplayOptions")]
[DisplayNameResources(nameof(SchemaFolderOptions) + nameof(RenameNode))]
[DescriptionResources(nameof(SchemaFolderOptions) + nameof(RenameNode))]
=======
[Category("Object Display Options")]
[DisplayName("Rename Node")]
[Description("Remove the schema name from the object node.")]
[DefaultValue(false)]
>>>>>>>
[CategoryResources(nameof(SchemaFolderOptions) + "ObjectDisplayOptions")]
[DisplayNameResources(nameof(SchemaFolderOptions) + nameof(RenameNode))]
[DescriptionResources(nameof(SchemaFolderOptions) + nameof(RenameNode))]
[DefaultValue(false)] |
<<<<<<<
var assignment = SyntaxFactory.IdentifierName(variable.Identifier.ToString()).Assign(variable.Initializer.Value);
currentState.Add(Cs.Express(assignment));
=======
var assignment = Syntax.IdentifierName(variable.Identifier.ToString()).Assign(variable.Initializer.Value);
currentState.Add(Cs.Express(YieldThisFixer.Fix(assignment)));
>>>>>>>
var assignment = SyntaxFactory.IdentifierName(variable.Identifier.ToString()).Assign(variable.Initializer.Value);
currentState.Add(Cs.Express(YieldThisFixer.Fix(assignment)));
<<<<<<<
currentState.Add(Cs.Express(SyntaxFactory.IdentifierName(enumerator).Assign(SyntaxFactory.InvocationExpression(SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, node.Expression, SyntaxFactory.IdentifierName("GetEnumerator"))))));
=======
currentState.Add(Cs.Express(Syntax.IdentifierName(enumerator).Assign(Syntax.InvocationExpression(Syntax.MemberAccessExpression(SyntaxKind.MemberAccessExpression, YieldThisFixer.Fix(node.Expression), Syntax.IdentifierName("GetEnumerator"))))));
>>>>>>>
currentState.Add(Cs.Express(SyntaxFactory.IdentifierName(enumerator).Assign(SyntaxFactory.InvocationExpression(SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, YieldThisFixer.Fix(node.Expression), SyntaxFactory.IdentifierName("GetEnumerator")))))); |
<<<<<<<
"ALTROGUEASSASSINATION" => new RogueAssassination2(ObjectManager, CharacterManager, HookManager, PathfindingHandler, MovemenEngine),
"SHAMANELEMENTAL" => new ShamanElemental(ObjectManager, CharacterManager, HookManager),
=======
"SHAMANELEMENTAL" => new ShamanElemental(ObjectManager, CharacterManager, HookManager),
"SHAMANRESTORATION" => new ShamanRestoration(ObjectManager, CharacterManager, HookManager),
>>>>>>>
"ALTROGUEASSASSINATION" => new RogueAssassination2(ObjectManager, CharacterManager, HookManager, PathfindingHandler, MovemenEngine),
"SHAMANELEMENTAL" => new ShamanElemental(ObjectManager, CharacterManager, HookManager),
"SHAMANRESTORATION" => new ShamanRestoration(ObjectManager, CharacterManager, HookManager), |
<<<<<<<
TaskExecutor.ExecuteLater(scheduledTaskManager.GetTask(scheduledTask));
TaskExecutor.StartExecuting();
=======
TaskExecutor.ExecuteTask(scheduledTaskManager.GetTask(scheduledTask));
>>>>>>>
TaskExecutor.ExecuteTask(scheduledTaskManager.GetTask(scheduledTask));
TaskExecutor.StartExecuting(); |
<<<<<<<
this._updateScrollInput();
=======
if (this._textInput != null) {
this._textInput.keyboardManager.Update();
}
>>>>>>>
this._updateScrollInput();
if (this._textInput != null) {
this._textInput.keyboardManager.Update();
} |
<<<<<<<
}
=======
public override int GetHashCode() {
unchecked {
var hashCode = (this.top != null ? this.top.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.right != null ? this.right.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.bottom != null ? this.bottom.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.left != null ? this.left.GetHashCode() : 0);
return hashCode;
}
}
}
public class ImageConfiguration {
public ImageConfiguration(Size size = null) {
this.size = size;
}
public static readonly ImageConfiguration empty = new ImageConfiguration();
public ImageConfiguration copyWith(
Size size = null) {
return new ImageConfiguration(
size: size ?? this.size
);
}
public readonly Size size;
}
>>>>>>>
public override int GetHashCode() {
unchecked {
var hashCode = (this.top != null ? this.top.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.right != null ? this.right.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.bottom != null ? this.bottom.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (this.left != null ? this.left.GetHashCode() : 0);
return hashCode;
}
}
} |
<<<<<<<
CardTheme cardTheme = null,
=======
ChipThemeData chipTheme = null,
>>>>>>>
CardTheme cardTheme = null,
ChipThemeData chipTheme = null,
<<<<<<<
cardTheme = cardTheme ?? new CardTheme();
=======
chipTheme = chipTheme ?? ChipThemeData.fromDefaults(
secondaryColor: primaryColor,
brightness: brightness,
labelStyle: textTheme.body2
);
>>>>>>>
cardTheme = cardTheme ?? new CardTheme();
chipTheme = chipTheme ?? ChipThemeData.fromDefaults(
secondaryColor: primaryColor,
brightness: brightness,
labelStyle: textTheme.body2
);
<<<<<<<
D.assert(cardTheme != null);
=======
D.assert(chipTheme != null);
>>>>>>>
D.assert(cardTheme != null);
D.assert(chipTheme != null);
<<<<<<<
this.cardTheme = cardTheme;
=======
this.chipTheme = chipTheme;
>>>>>>>
this.cardTheme = cardTheme;
this.chipTheme = chipTheme;
<<<<<<<
CardTheme cardTheme = null,
=======
ChipThemeData chipTheme = null,
>>>>>>>
CardTheme cardTheme = null,
ChipThemeData chipTheme = null,
<<<<<<<
D.assert(cardTheme != null);
=======
D.assert(chipTheme != null);
>>>>>>>
D.assert(cardTheme != null);
D.assert(chipTheme != null);
<<<<<<<
cardTheme: cardTheme,
=======
chipTheme: chipTheme,
>>>>>>>
cardTheme: cardTheme,
chipTheme: chipTheme,
<<<<<<<
public readonly CardTheme cardTheme;
=======
public readonly ChipThemeData chipTheme;
>>>>>>>
public readonly CardTheme cardTheme;
public readonly ChipThemeData chipTheme;
<<<<<<<
CardTheme cardTheme = null,
=======
ChipThemeData chipTheme = null,
>>>>>>>
CardTheme cardTheme = null,
ChipThemeData chipTheme = null,
<<<<<<<
cardTheme: cardTheme ?? this.cardTheme,
=======
chipTheme: chipTheme ?? this.chipTheme,
>>>>>>>
cardTheme: cardTheme ?? this.cardTheme,
chipTheme: chipTheme ?? this.chipTheme,
<<<<<<<
cardTheme: CardTheme.lerp(a.cardTheme, b.cardTheme, t),
=======
chipTheme: ChipThemeData.lerp(a.chipTheme, b.chipTheme, t),
>>>>>>>
cardTheme: CardTheme.lerp(a.cardTheme, b.cardTheme, t),
chipTheme: ChipThemeData.lerp(a.chipTheme, b.chipTheme, t),
<<<<<<<
other.cardTheme == this.cardTheme &&
=======
other.chipTheme == this.chipTheme &&
>>>>>>>
other.cardTheme == this.cardTheme &&
other.chipTheme == this.chipTheme &&
<<<<<<<
hashCode = (hashCode * 397) ^ this.cardTheme.GetHashCode();
=======
hashCode = (hashCode * 397) ^ this.chipTheme.GetHashCode();
>>>>>>>
hashCode = (hashCode * 397) ^ this.cardTheme.GetHashCode();
hashCode = (hashCode * 397) ^ this.chipTheme.GetHashCode();
<<<<<<<
properties.add(new DiagnosticsProperty<CardTheme>("cardTheme", this.cardTheme));
=======
properties.add(new DiagnosticsProperty<ChipThemeData>("chipTheme", this.chipTheme));
>>>>>>>
properties.add(new DiagnosticsProperty<CardTheme>("cardTheme", this.cardTheme));
properties.add(new DiagnosticsProperty<ChipThemeData>("chipTheme", this.chipTheme)); |
<<<<<<<
VerifyAndDownloadAsset(refreshedAsset,1,_smallWmv,true,false);
=======
VerifyAndDownloadAsset(refreshedAsset, 1, false);
>>>>>>>
VerifyAndDownloadAsset(refreshedAsset,1,_smallWmv,true,false);
<<<<<<<
VerifyAndDownloadAsset(asset, 1,_smallWmv,true,false);
=======
VerifyAndDownloadAsset(asset, 1, false);
>>>>>>>
VerifyAndDownloadAsset(asset, 1,_smallWmv,true,false);
<<<<<<<
[DeploymentItem(@".\Media\SmallMP41.mp4", "Content")]
public void ShouldCreateAssetWithSingleFile()
=======
[TestCategory("ClientSDK")]
[Owner("ClientSDK")]
[DeploymentItem(@".\Resources\interview.wmv", "Content")]
public void ShouldCreateAssetWithSingleFile()
>>>>>>>
[DeploymentItem(@".\Media\SmallMP41.mp4", "Content")]
[TestCategory("ClientSDK")]
[Owner("ClientSDK")]
[DeploymentItem(@".\Resources\interview.wmv", "Content")]
public void ShouldCreateAssetWithSingleFile()
<<<<<<<
private void VerifyAndDownloadAsset(IAsset asset, int expectedFileCount,string inputFile,bool inputFileValidation, bool performStorageSdkDownloadVerification = true)
=======
private void VerifyAndDownloadAsset(IAsset asset, int expectedFileCount, bool performStorageSdkDownloadVerification = true)
>>>>>>>
private void VerifyAndDownloadAsset(IAsset asset, int expectedFileCount,string inputFile,bool inputFileValidation, bool performStorageSdkDownloadVerification = true)
<<<<<<<
public static string CreateNewFileFromOriginal(DirectoryInfo info, string sourceFileName, out string fileName)
=======
private string CreateNewFileFromOriginal(DirectoryInfo info, out string fileName)
>>>>>>>
public static string CreateNewFileFromOriginal(DirectoryInfo info, string sourceFileName, out string fileName)
<<<<<<<
BlobTransferClient blobTransferClient = mediaContext.MediaServicesClassFactory.GetBlobTransferClient();
IAccessPolicy policy = mediaContext.AccessPolicies.Create("Write", TimeSpan.FromMinutes(20), AccessPermissions.Write);
ILocator locator = mediaContext.Locators.CreateSasLocator(asset, policy);
=======
BlobTransferClient blobTransferClient = _mediaContext.MediaServicesClassFactory.GetBlobTransferClient();
IAccessPolicy policy = _mediaContext.AccessPolicies.Create("Write", TimeSpan.FromMinutes(20), AccessPermissions.Write);
ILocator locator = _mediaContext.Locators.CreateSasLocator(asset, policy);
>>>>>>>
BlobTransferClient blobTransferClient = mediaContext.MediaServicesClassFactory.GetBlobTransferClient();
IAccessPolicy policy = mediaContext.AccessPolicies.Create("Write", TimeSpan.FromMinutes(20), AccessPermissions.Write);
ILocator locator = mediaContext.Locators.CreateSasLocator(asset, policy); |
<<<<<<<
return texAlpha(layer, paint, mesh, null, tex);
}
public static PictureFlusher.RenderDraw texAlpha(PictureFlusher.RenderLayer layer, Paint paint,
TextBlobMesh textMesh, Texture tex) {
return texAlpha(layer, paint, null, textMesh, tex);
}
public static PictureFlusher.RenderDraw texAlpha(PictureFlusher.RenderLayer layer, Paint paint,
MeshMesh mesh, TextBlobMesh textMesh, Texture tex) {
Vector4 viewport = layer.viewport;
Matrix3 ctm = layer.states[layer.states.Count - 1].matrix;
=======
>>>>>>>
return texAlpha(layer, paint, mesh, null, tex);
}
public static PictureFlusher.RenderDraw texAlpha(PictureFlusher.RenderLayer layer, Paint paint,
TextBlobMesh textMesh, Texture tex) {
return texAlpha(layer, paint, null, textMesh, tex);
}
public static PictureFlusher.RenderDraw texAlpha(PictureFlusher.RenderLayer layer, Paint paint,
MeshMesh mesh, TextBlobMesh textMesh, Texture tex) { |
<<<<<<<
using UIWidgets.service;
=======
using UIWidgets.rendering;
>>>>>>>
using UIWidgets.service;
using UIWidgets.rendering;
<<<<<<<
public override TextInput textInput
{
get { return _textInput; }
}
=======
public void attachRootRenderBox(RenderBox root) {
Window.instance = this;
WidgetsBinding.instance = this._binding;
try {
this._binding.renderView.child = root;
}
finally {
Window.instance = null;
WidgetsBinding.instance = null;
}
}
public void attachRootWidget(Widget root) {
Window.instance = this;
WidgetsBinding.instance = this._binding;
try {
this._binding.attachRootWidget(root);
}
finally {
Window.instance = null;
WidgetsBinding.instance = null;
}
}
>>>>>>>
public void attachRootRenderBox(RenderBox root) {
Window.instance = this;
WidgetsBinding.instance = this._binding;
try {
this._binding.renderView.child = root;
}
finally {
Window.instance = null;
WidgetsBinding.instance = null;
}
}
public void attachRootWidget(Widget root) {
Window.instance = this;
WidgetsBinding.instance = this._binding;
try {
this._binding.attachRootWidget(root);
}
finally {
Window.instance = null;
WidgetsBinding.instance = null;
}
}
public override TextInput textInput
{
get { return _textInput; }
} |
<<<<<<<
public WindowPadding viewPadding {
get { return this._displayMetrics.viewPadding; }
}
public WindowPadding viewInsets {
get { return this._displayMetrics.viewInsets; }
}
protected override void OnDisable() {
D.assert(this._windowAdapter != null);
this._windowAdapter.OnDisable();
this._windowAdapter = null;
base.OnDisable();
}
=======
>>>>>>>
public WindowPadding viewPadding {
get { return this._displayMetrics.viewPadding; }
}
public WindowPadding viewInsets {
get { return this._displayMetrics.viewInsets; }
} |
<<<<<<<
[Theory]
[DisplayTestMethodName]
[InlineData(null)]
[InlineData("123")]
[InlineData("jøbber-nå")]
public void Should_return_string_representation_of_message(string id)
{
var message = new Message();
if (id != null)
{
message.MessageId = id;
}
var result = message.ToString();
Assert.Equal($"{{MessageId:{id}}}", result);
}
[Fact]
public async void LargeMessageShouldThrowMessageSizeExceededException()
{
var queueClient = new QueueClient(TestUtility.NamespaceConnectionString, TestConstants.NonPartitionedQueueName, ReceiveMode.PeekLock);
try
{
// 2 MB message.
var message = new Message(new byte[1024 * 1024 * 2]);
await Assert.ThrowsAsync<MessageSizeExceededException>(async () => await queueClient.SendAsync(message));
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
finally
{
await queueClient.CloseAsync();
}
}
=======
[Theory]
[DisplayTestMethodName]
[InlineData(null)]
[InlineData("123")]
[InlineData("jøbber-nå")]
public void Should_return_string_representation_of_message(string id)
{
var message = new Message();
if (id != null)
{
message.MessageId = id;
}
var result = message.ToString();
Assert.Equal($"{{MessageId:{id}}}", result);
}
[Fact]
[DisplayTestMethodName]
public async void LargeMessageShouldThrowMessageSizeExceededException()
{
var queueClient = new QueueClient(TestUtility.NamespaceConnectionString, TestConstants.NonPartitionedQueueName, ReceiveMode.PeekLock);
try
{
// 2 MB message.
var message = new Message(new byte[1024 * 1024 * 2]);
await Assert.ThrowsAsync<MessageSizeExceededException>(async () => await queueClient.SendAsync(message));
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
finally
{
await queueClient.CloseAsync();
}
}
>>>>>>>
[Theory]
[DisplayTestMethodName]
[InlineData(null)]
[InlineData("123")]
[InlineData("jøbber-nå")]
public void Should_return_string_representation_of_message(string id)
{
var message = new Message();
if (id != null)
{
message.MessageId = id;
}
var result = message.ToString();
Assert.Equal($"{{MessageId:{id}}}", result);
}
[Fact]
[DisplayTestMethodName]
public async void LargeMessageShouldThrowMessageSizeExceededException()
{
var queueClient = new QueueClient(TestUtility.NamespaceConnectionString, TestConstants.NonPartitionedQueueName, ReceiveMode.PeekLock);
try
{
// 2 MB message.
var message = new Message(new byte[1024 * 1024 * 2]);
await Assert.ThrowsAsync<MessageSizeExceededException>(async () => await queueClient.SendAsync(message));
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
finally
{
await queueClient.CloseAsync();
}
}
[Theory]
[DisplayTestMethodName]
[InlineData(null)]
[InlineData("123")]
[InlineData("jøbber-nå")]
public void Should_return_string_representation_of_message(string id)
{
var message = new Message();
if (id != null)
{
message.MessageId = id;
}
var result = message.ToString();
Assert.Equal($"{{MessageId:{id}}}", result);
}
[Fact]
public async void LargeMessageShouldThrowMessageSizeExceededException()
{
var queueClient = new QueueClient(TestUtility.NamespaceConnectionString, TestConstants.NonPartitionedQueueName, ReceiveMode.PeekLock);
try
{
// 2 MB message.
var message = new Message(new byte[1024 * 1024 * 2]);
await Assert.ThrowsAsync<MessageSizeExceededException>(async () => await queueClient.SendAsync(message));
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
finally
{
await queueClient.CloseAsync();
}
} |
<<<<<<<
#endif
=======
using Microsoft.Azure.Devices.Client.Exceptions;
using Microsoft.Azure.Devices.Client.Extensions;
>>>>>>>
using Microsoft.Azure.Devices.Client.Exceptions;
using Microsoft.Azure.Devices.Client.Extensions;
<<<<<<<
#if !WINDOWS_UWP
readonly string hostName;
readonly int port;
=======
internal static readonly TimeSpan DefaultOperationTimeout = TimeSpan.FromMinutes(1);
internal static readonly TimeSpan DefaultOpenTimeout = TimeSpan.FromMinutes(1);
static readonly TimeSpan RefreshTokenBuffer = TimeSpan.FromMinutes(2);
static readonly TimeSpan RefreshTokenRetryInterval = TimeSpan.FromSeconds(30);
>>>>>>>
readonly string hostName;
readonly int port;
<<<<<<<
static readonly Lazy<bool> DisableServerCertificateValidation = new Lazy<bool>(InitializeDisableServerCertificateValidation);
=======
readonly static Lazy<bool> DisableServerCertificateValidation = new Lazy<bool>(InitializeDisableServerCertificateValidation);
readonly IotHubConnectionString connectionString;
readonly AccessRights accessRights;
readonly FaultTolerantAmqpObject<AmqpSession> faultTolerantSession;
#if WINDOWS_UWP
readonly IOThreadTimerSlim refreshTokenTimer;
#else
readonly IOThreadTimer refreshTokenTimer;
#endif
readonly AmqpTransportSettings amqpTransportSettings;
public IotHubConnection(IotHubConnectionString connectionString, AccessRights accessRights, AmqpTransportSettings amqpTransportSettings)
{
this.connectionString = connectionString;
this.accessRights = accessRights;
this.faultTolerantSession = new FaultTolerantAmqpObject<AmqpSession>(this.CreateSessionAsync, this.CloseConnection);
#if WINDOWS_UWP
this.refreshTokenTimer = new IOThreadTimerSlim(s => ((IotHubConnection)s).OnRefreshToken(), this, false);
#else
this.refreshTokenTimer = new IOThreadTimer(s => ((IotHubConnection)s).OnRefreshToken(), this, false);
#endif
this.amqpTransportSettings = amqpTransportSettings;
}
>>>>>>>
static readonly Lazy<bool> DisableServerCertificateValidation = new Lazy<bool>(InitializeDisableServerCertificateValidation);
<<<<<<<
TargetHost = this.hostName,
=======
TargetHost = this.connectionString.HostName,
#if !WINDOWS_UWP // Not supported in UWP
>>>>>>>
TargetHost = this.hostName,
#if !WINDOWS_UWP // Not supported in UWP
<<<<<<<
CertificateValidationCallback = OnRemoteCertificateValidation
=======
CertificateValidationCallback = this.OnRemoteCertificateValidation
#endif
>>>>>>>
CertificateValidationCallback = OnRemoteCertificateValidation
#endif
<<<<<<<
static bool OnRemoteCertificateValidation(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
=======
async Task SendCbsTokenAsync(AmqpCbsLink cbsLink, TimeSpan timeout)
{
string audience = this.ConnectionString.AmqpEndpoint.AbsoluteUri;
string resource = this.ConnectionString.AmqpEndpoint.AbsoluteUri;
var expiresAtUtc = await cbsLink.SendTokenAsync(
this.ConnectionString,
this.ConnectionString.AmqpEndpoint,
audience,
resource,
AccessRightsHelper.AccessRightsToStringArray(this.accessRights),
timeout);
this.ScheduleTokenRefresh(expiresAtUtc);
}
async void OnRefreshToken()
{
AmqpSession amqpSession = this.faultTolerantSession.Value;
if (amqpSession != null && !amqpSession.IsClosing())
{
var cbsLink = amqpSession.Connection.Extensions.Find<AmqpCbsLink>();
if (cbsLink != null)
{
try
{
await this.SendCbsTokenAsync(cbsLink, DefaultOperationTimeout);
}
catch (Exception exception)
{
if (Fx.IsFatal(exception))
{
throw;
}
this.refreshTokenTimer.Set(RefreshTokenRetryInterval);
}
}
}
}
#if !WINDOWS_UWP // Not supported in UWP
bool OnRemoteCertificateValidation(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
>>>>>>>
#if !WINDOWS_UWP // Not supported in UWP
static bool OnRemoteCertificateValidation(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
<<<<<<<
#endif
=======
void ScheduleTokenRefresh(DateTime expiresAtUtc)
{
if (expiresAtUtc == DateTime.MaxValue)
{
return;
}
TimeSpan timeFromNow = expiresAtUtc.Subtract(RefreshTokenBuffer).Subtract(DateTime.UtcNow);
if (timeFromNow > TimeSpan.Zero)
{
this.refreshTokenTimer.Set(timeFromNow);
}
}
>>>>>>> |
<<<<<<<
this.hubScopeRefreshTokenTimer = new IOThreadTimer(s => ((IotHubConnection)s).OnRefreshTokenAsync(), this, false);
this.iotHubLinkRefreshTokenTimers = new ConcurrentDictionary<string, IotHubLinkRefreshTokenTimer>();
this.useWebSocketOnly = useWebSocketOnly;
=======
this.refreshTokenTimer = new IOThreadTimer(s => ((IotHubConnection)s).OnRefreshToken(), this, false);
this.amqpTransportSettings = amqpTransportSettings;
>>>>>>>
this.hubScopeRefreshTokenTimer = new IOThreadTimer(s => ((IotHubConnection)s).OnRefreshTokenAsync(), this, false);
this.iotHubLinkRefreshTokenTimers = new ConcurrentDictionary<string, IotHubLinkRefreshTokenTimer>();
this.amqpTransportSettings = amqpTransportSettings;
<<<<<<<
// Try only Amqp transport over WebSocket
transport = await this.CreateClientWebSocketTransportAsync(timeoutHelper.RemainingTime());
}
else
{
try
{
=======
case TransportType.Amqp_WebSocket_Only:
transport = await this.CreateClientWebSocketTransport(timeoutHelper.RemainingTime());
break;
case TransportType.Amqp_Tcp_Only:
>>>>>>>
case TransportType.Amqp_WebSocket_Only:
transport = await this.CreateClientWebSocketTransportAsync(timeoutHelper.RemainingTime());
break;
case TransportType.Amqp_Tcp_Only:
<<<<<<<
}
catch (Exception e)
{
if (Fx.IsFatal(e))
{
throw;
}
// Amqp transport over TCP failed. Retry Amqp transport over WebSocket
if (timeoutHelper.RemainingTime() != TimeSpan.Zero)
{
transport = await this.CreateClientWebSocketTransportAsync(timeoutHelper.RemainingTime());
}
else
{
throw;
}
}
=======
break;
default:
throw new InvalidOperationException("AmqpTransportSettings must specify WebSocketOnly or TcpOnly");
>>>>>>>
break;
default:
throw new InvalidOperationException("AmqpTransportSettings must specify WebSocketOnly or TcpOnly");
<<<<<<<
}
void CancelRefreshTokenTimers()
{
foreach (var iotHubLinkRefreshTokenTimer in this.iotHubLinkRefreshTokenTimers.Values)
{
iotHubLinkRefreshTokenTimer.Cancel();
}
this.iotHubLinkRefreshTokenTimers.Clear();
=======
>>>>>>>
}
void CancelRefreshTokenTimers()
{
foreach (var iotHubLinkRefreshTokenTimer in this.iotHubLinkRefreshTokenTimers.Values)
{
iotHubLinkRefreshTokenTimer.Cancel();
}
this.iotHubLinkRefreshTokenTimers.Clear(); |
<<<<<<<
volatile bool closeCalled;
#if !WINDOWS_UWP
=======
#if !PCL
>>>>>>>
volatile bool closeCalled;
#if !PCL
<<<<<<<
#if WINDOWS_UWP
return Create(hostname, authenticationMethod, TransportType.Http1);
#else
=======
#if WINDOWS_UWP || PCL
return Create(hostname, authenticationMethod, TransportType.Http1);
#else
>>>>>>>
#if WINDOWS_UWP || PCL
return Create(hostname, authenticationMethod, TransportType.Http1);
#else
<<<<<<<
this.ThrowIfDisposed();
#if WINDOWS_UWP
=======
#if PCL
>>>>>>>
this.ThrowIfDisposed();
#if PCL
<<<<<<<
this.closeCalled = true;
#if !WINDOWS_UWP
=======
#if !PCL
>>>>>>>
this.closeCalled = true;
#if !PCL
<<<<<<<
#if !WINDOWS_UWP
}
return TaskHelpers.CompletedTask;
=======
#if !PCL
}
>>>>>>>
#if !PCL
}
<<<<<<<
});
}
=======
}).AsTaskOrAsyncOp();
}
>>>>>>>
}).AsTaskOrAsyncOp();
}
<<<<<<<
#if !WINDOWS_UWP
}
=======
#if !PCL
}
>>>>>>>
#if !PCL
}
<<<<<<<
await this.impl.CompleteAsync(message).AsTaskOrAsyncOp();
});
}
=======
await this.impl.CompleteAsync(message);
}).AsTaskOrAsyncOp();
}
>>>>>>>
await this.impl.CompleteAsync(message);
}).AsTaskOrAsyncOp();
}
<<<<<<<
await this.impl.AbandonAsync(lockToken).AsTaskOrAsyncOp();
});
}
=======
await this.impl.AbandonAsync(lockToken);
}).AsTaskOrAsyncOp();
}
>>>>>>>
await this.impl.AbandonAsync(lockToken);
}).AsTaskOrAsyncOp();
}
<<<<<<<
await this.impl.AbandonAsync(message).AsTaskOrAsyncOp();
});
}
=======
await this.impl.AbandonAsync(message);
}).AsTaskOrAsyncOp();
}
>>>>>>>
await this.impl.AbandonAsync(message);
}).AsTaskOrAsyncOp();
}
<<<<<<<
#if !WINDOWS_UWP
}
=======
#if !PCL
}
>>>>>>>
#if !PCL
}
<<<<<<<
await this.impl.RejectAsync(message).AsTaskOrAsyncOp();
});
}
=======
await this.impl.RejectAsync(message);
}).AsTaskOrAsyncOp();
}
>>>>>>>
await this.impl.RejectAsync(message);
}).AsTaskOrAsyncOp();
}
<<<<<<<
#if !WINDOWS_UWP
}
=======
#if !PCL
}
>>>>>>>
#if !PCL
} |
<<<<<<<
});
=======
},
pipelineBuilder);
#endif
>>>>>>>
},
pipelineBuilder);
<<<<<<<
return CreateFromConnectionString(connectionString, new ITransportSettings[] { new Http1TransportSettings() });
=======
#if PCL
IotHubConnectionString iotHubConnectionString = IotHubConnectionString.Parse(connectionString);
return new DeviceClient(iotHubConnectionString);
#else
return CreateFromConnectionString(connectionString, new ITransportSettings[] { new Http1TransportSettings() }, pipelineBuilder);
#endif
>>>>>>>
return CreateFromConnectionString(connectionString, new ITransportSettings[] { new Http1TransportSettings() }, pipelineBuilder);
<<<<<<<
=======
#if !PCL
/// <summary>
/// Create DeviceClient from the specified connection string using a prioritized list of transports
/// </summary>
/// <param name="connectionString">Connection string for the IoT hub (with DeviceId)</param>
/// <param name="transportSettings">Prioritized list of transports and their settings</param>
/// <returns>DeviceClient</returns>
public static DeviceClient CreateFromConnectionString(string connectionString, [System.Runtime.InteropServices.WindowsRuntime.ReadOnlyArray] ITransportSettings[] transportSettings)
{
return CreateFromConnectionString(connectionString, transportSettings, null);
}
>>>>>>>
/// <summary>
/// Create DeviceClient from the specified connection string using a prioritized list of transports
/// </summary>
/// <param name="connectionString">Connection string for the IoT hub (with DeviceId)</param>
/// <param name="transportSettings">Prioritized list of transports and their settings</param>
/// <returns>DeviceClient</returns>
public static DeviceClient CreateFromConnectionString(string connectionString, [System.Runtime.InteropServices.WindowsRuntime.ReadOnlyArray] ITransportSettings[] transportSettings)
{
return CreateFromConnectionString(connectionString, transportSettings, null);
} |
<<<<<<<
#if !WINDOWS_UWP
public X509Certificate2 ClientCertificate { get; set; }
#endif
=======
public AmqpConnectionPoolSettings AmqpConnectionPoolSettings { get; set; }
void SetOperationTimeout(TimeSpan operationTimeout)
{
if (operationTimeout > TimeSpan.Zero)
{
this.operationTimeout = operationTimeout;
}
else
{
throw new ArgumentOutOfRangeException("operationTimeout");
}
}
void SetOpenTimeout(TimeSpan openTimeout)
{
if (openTimeout > TimeSpan.Zero)
{
this.openTimeout = openTimeout;
}
else
{
throw new ArgumentOutOfRangeException("openTimeout");
}
}
>>>>>>>
#if !WINDOWS_UWP
public X509Certificate2 ClientCertificate { get; set; }
#endif
public AmqpConnectionPoolSettings AmqpConnectionPoolSettings { get; set; }
void SetOperationTimeout(TimeSpan operationTimeout)
{
if (operationTimeout > TimeSpan.Zero)
{
this.operationTimeout = operationTimeout;
}
else
{
throw new ArgumentOutOfRangeException("operationTimeout");
}
}
void SetOpenTimeout(TimeSpan openTimeout)
{
if (openTimeout > TimeSpan.Zero)
{
this.openTimeout = openTimeout;
}
else
{
throw new ArgumentOutOfRangeException("openTimeout");
}
} |
<<<<<<<
#if !WINDOWS_UWP
=======
#if !PCL
>>>>>>>
this.serializedAmqpMessage = null;
}
/// <summary>
/// Default constructor with no requestId and status data
/// </summary>
internal MethodResponseInternal(string requestId, int status)
{
#if !NETMF
this.InitializeWithStream(Stream.Null, true);
#endif
this.serializedAmqpMessage = null;
this.RequestId = requestId;
this.Status = status;
}
/// <summary>
/// Constructor which uses the argument stream as the body stream.
/// </summary>
/// <param name="stream">a stream which will be used as body stream.</param>
/// <remarks>User is expected to own the disposing of the stream when using this constructor.</remarks>
// UWP cannot expose a method with System.IO.Stream in signature. TODO: consider adding an IRandomAccessStream overload
internal MethodResponseInternal(Stream stream)
: this()
{
if (stream != null)
{
this.InitializeWithStream(stream, false);
}
}
/// <summary>
/// Constructor which uses the input byte array as the body
/// </summary>
/// <param name="byteArray">a byte array which will be used to form the body stream</param>
/// <param name="requestId">the method request id corresponding to this respond</param>
/// <param name="status">the status code of the method call</param>
#if NETMF
internal MethodResponse(byte[] byteArray)
: this(new MemoryStream(byteArray))
#else
internal MethodResponseInternal([System.Runtime.InteropServices.WindowsRuntime.ReadOnlyArrayAttribute] byte[] byteArray, string requestId, int status)
: this(new MemoryStream(byteArray))
#endif
{
// reset the owning of the steams
this.ownsBodyStream = true;
this.RequestId = requestId;
this.Status = status;
}
/// <summary>
/// contains the response of the device client application method handler.
/// </summary>
internal int Status
{
get; set;
}
/// <summary>
/// the request Id for the transport layer
/// </summary>
internal string RequestId
{
get; set;
}
internal Stream BodyStream
{
get
{
return this.bodyStream;
}
}
#if !NETMF
internal AmqpMessage SerializedAmqpMessage
{
get
{
lock (this.messageLock)
{
return this.serializedAmqpMessage;
}
}
}
#endif
/// <summary>
/// Dispose the current method data instance
/// </summary>
public void Dispose()
{
this.Dispose(true);
}
/// <summary>
/// Return the body stream of the current method data instance
/// </summary>
/// <returns></returns>
/// <exception cref="InvalidOperationException">throws if the method has been called.</exception>
/// <exception cref="ObjectDisposedException">throws if the method data has already been disposed.</exception>
/// <remarks>This method can only be called once and afterwards method will throw <see cref="InvalidOperationException"/>.</remarks>
internal Stream GetBodyStream()
{
this.ThrowIfDisposed();
this.SetGetBodyCalled();
if (this.bodyStream != null)
{
return this.bodyStream;
}
#if NETMF
return null;
#else
return Stream.Null;
#endif
}
/// <summary>
/// This methods return the body stream as a byte array
/// </summary>
/// <returns></returns>
/// <exception cref="InvalidOperationException">throws if the method has been called.</exception>
/// <exception cref="ObjectDisposedException">throws if the method data has already been disposed.</exception>
internal byte[] GetBytes()
{
this.ThrowIfDisposed();
this.SetGetBodyCalled();
if (this.bodyStream == null)
{
return new byte[] { };
}
#if !NETMF
BufferListStream listStream;
if ((listStream = this.bodyStream as BufferListStream) != null)
{
// We can trust Amqp bufferListStream.Length;
byte[] bytes = new byte[listStream.Length];
listStream.Read(bytes, 0, bytes.Length);
return bytes;
}
#endif
// This is just fail safe code in case we are not using the Amqp protocol.
return ReadFullStream(this.bodyStream);
}
#if !NETMF
internal AmqpMessage ToAmqpMessage(bool setBodyCalled = true)
{
this.ThrowIfDisposed();
if (this.serializedAmqpMessage == null)
{
lock (this.messageLock)
{
if (this.serializedAmqpMessage == null)
{
// Interlocked exchange two variable does allow for a small period
// where one is set while the other is not. Not sure if it is worth
// correct this gap. The intention of setting this two variable is
// so that GetBody should not be called and all Properties are
// readonly because the amqpMessage has been serialized.
this.SetSizeInBytesCalled();
if (this.bodyStream == null)
{
this.serializedAmqpMessage = AmqpMessage.Create();
}
else
{
this.serializedAmqpMessage = AmqpMessage.Create(this.bodyStream, false);
this.SetGetBodyCalled();
}
this.serializedAmqpMessage = this.PopulateAmqpMessageForSend(this.serializedAmqpMessage);
}
}
}
return this.serializedAmqpMessage;
}
#endif
// Test hook only
internal void ResetGetBodyCalled()
{
Interlocked.Exchange(ref this.getBodyCalled, 0);
if (this.bodyStream != null && this.bodyStream.CanSeek)
{
this.bodyStream.Seek(0, SeekOrigin.Begin);
}
}
internal bool TryResetBody(long position)
{
if (this.bodyStream != null && this.bodyStream.CanSeek)
{
this.bodyStream.Seek(position, SeekOrigin.Begin);
Interlocked.Exchange(ref this.getBodyCalled, 0);
#if !NETMF
<<<<<<<
#if !WINDOWS_UWP
=======
#if !PCL
>>>>>>>
this.serializedAmqpMessage = null;
this.RequestId = requestId;
this.Status = status;
}
/// <summary>
/// Constructor which uses the argument stream as the body stream.
/// </summary>
/// <param name="stream">a stream which will be used as body stream.</param>
/// <remarks>User is expected to own the disposing of the stream when using this constructor.</remarks>
// UWP cannot expose a method with System.IO.Stream in signature. TODO: consider adding an IRandomAccessStream overload
internal MethodResponseInternal(Stream stream)
: this()
{
if (stream != null)
{
this.InitializeWithStream(stream, false);
}
}
/// <summary>
/// Constructor which uses the input byte array as the body
/// </summary>
/// <param name="byteArray">a byte array which will be used to form the body stream</param>
/// <param name="requestId">the method request id corresponding to this respond</param>
/// <param name="status">the status code of the method call</param>
#if NETMF
internal MethodResponse(byte[] byteArray)
: this(new MemoryStream(byteArray))
#else
internal MethodResponseInternal([System.Runtime.InteropServices.WindowsRuntime.ReadOnlyArrayAttribute] byte[] byteArray, string requestId, int status)
: this(new MemoryStream(byteArray))
#endif
{
// reset the owning of the steams
this.ownsBodyStream = true;
this.RequestId = requestId;
this.Status = status;
}
/// <summary>
/// contains the response of the device client application method handler.
/// </summary>
internal int Status
{
get; set;
}
/// <summary>
/// the request Id for the transport layer
/// </summary>
internal string RequestId
{
get; set;
}
internal Stream BodyStream
{
get
{
return this.bodyStream;
}
}
#if !NETMF
internal AmqpMessage SerializedAmqpMessage
{
get
{
lock (this.messageLock)
{
return this.serializedAmqpMessage;
}
}
}
#endif
/// <summary>
/// Dispose the current method data instance
/// </summary>
public void Dispose()
{
this.Dispose(true);
}
/// <summary>
/// Return the body stream of the current method data instance
/// </summary>
/// <returns></returns>
/// <exception cref="InvalidOperationException">throws if the method has been called.</exception>
/// <exception cref="ObjectDisposedException">throws if the method data has already been disposed.</exception>
/// <remarks>This method can only be called once and afterwards method will throw <see cref="InvalidOperationException"/>.</remarks>
internal Stream GetBodyStream()
{
this.ThrowIfDisposed();
this.SetGetBodyCalled();
if (this.bodyStream != null)
{
return this.bodyStream;
}
#if NETMF
return null;
#else
return Stream.Null;
#endif
}
/// <summary>
/// This methods return the body stream as a byte array
/// </summary>
/// <returns></returns>
/// <exception cref="InvalidOperationException">throws if the method has been called.</exception>
/// <exception cref="ObjectDisposedException">throws if the method data has already been disposed.</exception>
internal byte[] GetBytes()
{
this.ThrowIfDisposed();
this.SetGetBodyCalled();
if (this.bodyStream == null)
{
return new byte[] { };
}
#if !NETMF
BufferListStream listStream;
if ((listStream = this.bodyStream as BufferListStream) != null)
{
// We can trust Amqp bufferListStream.Length;
byte[] bytes = new byte[listStream.Length];
listStream.Read(bytes, 0, bytes.Length);
return bytes;
}
#endif
// This is just fail safe code in case we are not using the Amqp protocol.
return ReadFullStream(this.bodyStream);
}
#if !NETMF
internal AmqpMessage ToAmqpMessage(bool setBodyCalled = true)
{
this.ThrowIfDisposed();
if (this.serializedAmqpMessage == null)
{
lock (this.messageLock)
{
if (this.serializedAmqpMessage == null)
{
// Interlocked exchange two variable does allow for a small period
// where one is set while the other is not. Not sure if it is worth
// correct this gap. The intention of setting this two variable is
// so that GetBody should not be called and all Properties are
// readonly because the amqpMessage has been serialized.
this.SetSizeInBytesCalled();
if (this.bodyStream == null)
{
this.serializedAmqpMessage = AmqpMessage.Create();
}
else
{
this.serializedAmqpMessage = AmqpMessage.Create(this.bodyStream, false);
this.SetGetBodyCalled();
}
this.serializedAmqpMessage = this.PopulateAmqpMessageForSend(this.serializedAmqpMessage);
}
}
}
return this.serializedAmqpMessage;
}
#endif
// Test hook only
internal void ResetGetBodyCalled()
{
Interlocked.Exchange(ref this.getBodyCalled, 0);
if (this.bodyStream != null && this.bodyStream.CanSeek)
{
this.bodyStream.Seek(0, SeekOrigin.Begin);
}
}
internal bool TryResetBody(long position)
{
if (this.bodyStream != null && this.bodyStream.CanSeek)
{
this.bodyStream.Seek(position, SeekOrigin.Begin);
Interlocked.Exchange(ref this.getBodyCalled, 0);
#if !NETMF
<<<<<<<
#if !WINDOWS_UWP && !NETMF
=======
#if !PCL && !NETMF
>>>>>>>
#if !NETMF
<<<<<<<
#if !WINDOWS_UWP
=======
#if !PCL
>>>>>>>
<<<<<<<
#if !WINDOWS_UWP && !NETMF
=======
#if !PCL && !NETMF
>>>>>>>
#if !NETMF
<<<<<<<
#if !WINDOWS_UWP && !NETMF
=======
#if !PCL && !NETMF
>>>>>>>
#if !NETMF |
<<<<<<<
/// <summary>
/// Checks if the part and its children can be grabbed and reports the errors.
/// </summary>
/// <remarks>Also, collects <seealso cref="grabbedMass"/> and
/// <seealso cref="grabbedPartsCount"/> of the attempted hierarchy.</remarks>
/// <param name="part">A hierarchy root being grabbed.</param>
/// <returns><c>true</c> when the hierarchy can be grabbed.</returns>
private bool CheckCanGrab(Part part) {
// Don't grab kerbals. It's weird, and they don't have attachment nodes anyways.
if (part.name == "kerbalEVA" || part.name == "kerbalEVAfemale") {
KISAddonCursor.CursorEnable(
ForbiddenIcon, CannotGrabStatus, CannotMoveKerbonautText);
return false;
}
// Check there are kerbals in range.
if (!HasActivePickupInRange(part)) {
KISAddonCursor.CursorEnable(TooFarIcon, TooFarStatus, TooFarText);
return false;
}
// Check part mass.
grabbedMass = KIS_Shared.GetAssemblyMass(part, out grabbedPartsCount);
float pickupMaxMass = GetAllPickupMaxMassInRange(part);
if (grabbedMass > pickupMaxMass) {
KISAddonCursor.CursorEnable(
TooHeavyIcon, TooHeavyStatus,
String.Format(TooHeavyTextFmt, grabbedMass, pickupMaxMass));
return false;
}
// Check if attached part can be detached.
return CheckCanDetach(part);
}
/// <summary>Checks if an attached part can be detached and reports the errors.</summary>
/// <remarks>If part has a parent it's attached. In order to detach the part there should be
/// a kerbonaut in range with a tool equipped.</remarks>
/// <param name="part">A hierarchy root being detached.</param>
/// <returns><c>true</c> when the hierarchy can be detached.</returns>
private bool CheckCanDetach(Part part) {
// If part is attached then check if the right tool is equipped to detach it.
if (part.parent != null
&& !GetActivePickupNearest(part, canPartAttachOnly: true)) {
KISAddonCursor.CursorEnable(NeedToolIcon, NeedToolStatus, NeedToolToDetachText);
return false;
}
return true;
}
=======
/// <summary>
/// Finds and returns all docking ports that are allowed for the re-docking operation.
/// </summary>
/// <remarks>
/// Re-docking must be started and <seealso cref="redockTarget"/> populated with the vessel
/// root part.
/// </remarks>
/// <returns>A complete set of allowed docking ports.</returns>
private static HashSet<Part> GetAllowedDockPorts() {
var result = new HashSet<Part>();
var compatiblePorts =
redockTarget.vessel.parts.FindAll(p => p.name == redockTarget.name);
foreach (var port in compatiblePorts) {
if (KIS_Shared.IsSameHierarchyChild(redockTarget, port)) {
// Skip ports of the moving vessel.
continue;
}
var usedNodes = 0;
if (port.attachRules.srfAttach && port.srfAttachNode.attachedPart != null) {
++usedNodes;
}
var nodesWithParts = port.attachNodes.FindAll(p => p.attachedPart != null);
usedNodes += nodesWithParts.Count();
if (usedNodes < 2) {
// Usual port has three nodes: one surface and two stacks. When any two of them
// are occupied the docking is not possible.
result.Add(port);
}
}
KSP_Dev.Logger.logInfo("Found {0} allowed docking ports", result.Count());
return result;
}
}
>>>>>>>
/// <summary>
/// Checks if the part and its children can be grabbed and reports the errors.
/// </summary>
/// <remarks>Also, collects <seealso cref="grabbedMass"/> and
/// <seealso cref="grabbedPartsCount"/> of the attempted hierarchy.</remarks>
/// <param name="part">A hierarchy root being grabbed.</param>
/// <returns><c>true</c> when the hierarchy can be grabbed.</returns>
private bool CheckCanGrab(Part part) {
// Don't grab kerbals. It's weird, and they don't have attachment nodes anyways.
if (part.name == "kerbalEVA" || part.name == "kerbalEVAfemale") {
KISAddonCursor.CursorEnable(
ForbiddenIcon, CannotGrabStatus, CannotMoveKerbonautText);
return false;
}
// Check there are kerbals in range.
if (!HasActivePickupInRange(part)) {
KISAddonCursor.CursorEnable(TooFarIcon, TooFarStatus, TooFarText);
return false;
}
// Check part mass.
grabbedMass = KIS_Shared.GetAssemblyMass(part, out grabbedPartsCount);
float pickupMaxMass = GetAllPickupMaxMassInRange(part);
if (grabbedMass > pickupMaxMass) {
KISAddonCursor.CursorEnable(
TooHeavyIcon, TooHeavyStatus,
String.Format(TooHeavyTextFmt, grabbedMass, pickupMaxMass));
return false;
}
// Check if attached part can be detached.
return CheckCanDetach(part);
}
/// <summary>Checks if an attached part can be detached and reports the errors.</summary>
/// <remarks>If part has a parent it's attached. In order to detach the part there should be
/// a kerbonaut in range with a tool equipped.</remarks>
/// <param name="part">A hierarchy root being detached.</param>
/// <returns><c>true</c> when the hierarchy can be detached.</returns>
private bool CheckCanDetach(Part part) {
// If part is attached then check if the right tool is equipped to detach it.
if (part.parent != null
&& !GetActivePickupNearest(part, canPartAttachOnly: true)) {
KISAddonCursor.CursorEnable(NeedToolIcon, NeedToolStatus, NeedToolToDetachText);
return false;
}
return true;
}
/// <summary>
/// Finds and returns all docking ports that are allowed for the re-docking operation.
/// </summary>
/// <remarks>
/// Re-docking must be started and <seealso cref="redockTarget"/> populated with the vessel
/// root part.
/// </remarks>
/// <returns>A complete set of allowed docking ports.</returns>
private static HashSet<Part> GetAllowedDockPorts() {
var result = new HashSet<Part>();
var compatiblePorts =
redockTarget.vessel.parts.FindAll(p => p.name == redockTarget.name);
foreach (var port in compatiblePorts) {
if (KIS_Shared.IsSameHierarchyChild(redockTarget, port)) {
// Skip ports of the moving vessel.
continue;
}
var usedNodes = 0;
if (port.attachRules.srfAttach && port.srfAttachNode.attachedPart != null) {
++usedNodes;
}
var nodesWithParts = port.attachNodes.FindAll(p => p.attachedPart != null);
usedNodes += nodesWithParts.Count();
if (usedNodes < 2) {
// Usual port has three nodes: one surface and two stacks. When any two of them
// are occupied the docking is not possible.
result.Add(port);
}
}
KSP_Dev.Logger.logInfo("Found {0} allowed docking ports", result.Count());
return result;
} |
<<<<<<<
//public bool isWaitMainTask = true;
private bool isSubAccountHokan = true;
private bool isRtmpMain = false;
=======
public bool isWaitMainTask = true;
>>>>>>> b77d287f700e628ca0b621134ab8ddd993dbb4fc
public RecordFromUrl(RecordingManager rm)
{
this.rm = rm;
//CookieContainer container = new CookieContainer();
//container.Add(cookie);
//this.container = container;
}
public int rec(string url, string lvid) {
//endcode 0-その他の理由 1-stop 2-最初に終了 3-始まった後に番組終了
util.debugWriteLine("RecordFromUrl rec");
util.debugWriteLine(url + " " + lvid);
this.lvid = lvid;
<<<<<<< /mnt/batch/tasks/workitems/adfv2-General_1/job-1/d0951de5-acc2-48e5-84be-d30ec294c0a9/wd/.temp/athenacommon/0fa0061c-7c0a-4b55-b43e-1307d31764ec.cs
isSubAccountHokan = false;
isRtmpMain = true;
=======
<<<<<<< HEAD
=======
<<<<<<< HEAD
>>>>>>>
//public bool isWaitMainTask = true;
private bool isSubAccountHokan = true;
private bool isRtmpMain = false;
public RecordFromUrl(RecordingManager rm)
{
this.rm = rm;
//CookieContainer container = new CookieContainer();
//container.Add(cookie);
//this.container = container;
}
public int rec(string url, string lvid) {
//endcode 0-その他の理由 1-stop 2-最初に終了 3-始まった後に番組終了
util.debugWriteLine("RecordFromUrl rec");
util.debugWriteLine(url + " " + lvid);
this.lvid = lvid; |
<<<<<<<
const string modelFace = "face-detection-adas-0001.bin";
const string modelFaceTxt = "face-detection-adas-0001.xml";
=======
const string modelFace = "face-detection-adas-0001.bin";
const string modelFaceTxt = "face-detection-adas-0001.xml";
>>>>>>>
const string modelFace = "face-detection-adas-0001.bin";
const string modelFaceTxt = "face-detection-adas-0001.xml";
<<<<<<<
OpenCvSharp.Rect roi = new OpenCvSharp.Rect(x1, y1, (x2 - x1), (y2 - y1));
roi = AdjustBoundingBox(roi);
Cv2.Rectangle(frame, roi, new Scalar(0, 255, 0), 2, LineTypes.Link4);
}
}
}
=======
OpenCvSharp.Rect roi = new OpenCvSharp.Rect(x1, y1, (x2 - x1), (y2 - y1));
roi = AdjustBoundingBox(roi);
Cv2.Rectangle(frame, roi, new Scalar(0, 255, 0), 2, LineTypes.Link4);
}
}
}
>>>>>>>
OpenCvSharp.Rect roi = new OpenCvSharp.Rect(x1, y1, (x2 - x1), (y2 - y1));
roi = AdjustBoundingBox(roi);
Cv2.Rectangle(frame, roi, new Scalar(0, 255, 0), 2, LineTypes.Link4);
}
}
}
<<<<<<<
=======
>>>>>>> |
<<<<<<<
public static void ApplyCustomAttributes(this OpenApiSchema schema, IEnumerable<object> customAttributes) => ApplyCustomAttributes(schema, null, customAttributes);
public static void ApplyCustomAttributes(this OpenApiSchema schema, SchemaRepository schemaRepository, IEnumerable<object> customAttributes)
=======
public static void ApplyCustomAttributes(this OpenApiSchema schema, IEnumerable<object> customAttributes) => ApplyCustomAttributes(schema, null, customAttributes);
public static void ApplyCustomAttributes(this OpenApiSchema schema, DataContract dataContract, IEnumerable<object> customAttributes)
>>>>>>>
public static void ApplyCustomAttributes(this OpenApiSchema schema, IEnumerable<object> customAttributes) => ApplyCustomAttributes(schema, null, null, customAttributes);
public static void ApplyCustomAttributes(this OpenApiSchema schema, SchemaRepository schemaRepository, DataContract dataContract, IEnumerable<object> customAttributes)
<<<<<<<
ApplyDefaultValueAttribute(schema, schemaRepository, defaultValueAttribute);
=======
ApplyDefaultValueAttribute(schema, dataContract, defaultValueAttribute);
>>>>>>>
ApplyDefaultValueAttribute(schema, schemaRepository, dataContract, defaultValueAttribute); |
<<<<<<<
using System.Collections.Generic;
using System.Linq;
=======
using System.Linq;
>>>>>>>
using System.Collections.Generic;
using System.Linq;
<<<<<<<
using Microsoft.AspNetCore.Mvc.Controllers;
using Newtonsoft.Json;
using Swashbuckle.AspNetCore.Swagger;
=======
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.OpenApi.Models;
using Newtonsoft.Json;
using Xunit;
>>>>>>>
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.OpenApi.Models;
using Newtonsoft.Json;
using Xunit;
<<<<<<<
var operation = new Operation { OperationId = "foobar" };
var filterContext = FilterContextFor(nameof(TestControllerBase.ActionWithNoAttributesInBaseClass));
=======
var operation = new OpenApiOperation { OperationId = "foobar" };
var filterContext = FilterContextFor(nameof(TestController.ActionWithSwaggerOperationFilterAttribute));
>>>>>>>
var operation = new OpenApiOperation { OperationId = "foobar" };
var filterContext = FilterContextFor(nameof(TestControllerBase.ActionWithNoAttributesInBaseClass)); |
<<<<<<<
//this should happen when Dismiss is called, but it happens AFTER the animation ends
// so sometimes, the cancel button is left on :(
if (CancelHudButton != null)
{
CancelHudButton.RemoveFromSuperview ();
CancelHudButton = null;
}
if (!BTProgressHUD.IsVisible)
BTProgressHUD.Show ();
=======
if (!IsVisible)
Show ();
>>>>>>>
//this should happen when Dismiss is called, but it happens AFTER the animation ends
// so sometimes, the cancel button is left on :(
if (CancelHudButton != null)
{
CancelHudButton.RemoveFromSuperview ();
CancelHudButton = null;
}
if (!IsVisible)
Show (); |
<<<<<<<
Text,
Interface
=======
Text,
Int64
>>>>>>>
Text,
Interface,
Int64
<<<<<<<
case AddTypeEnum.Interface:
return new InterfaceProperty(name);
=======
case AddTypeEnum.Int64:
return new Int64Property(name);
>>>>>>>
case AddTypeEnum.Interface:
return new InterfaceProperty(name);
case AddTypeEnum.Int64:
return new Int64Property(name);
<<<<<<<
case AddTypeEnum.Interface:
return "InterfaceProperty";
=======
case AddTypeEnum.Int64:
return "Int64Property";
>>>>>>>
case AddTypeEnum.Interface:
return "InterfaceProperty";
case AddTypeEnum.Int64:
return "Int64Property";
<<<<<<<
case "InterfaceProperty":
return AddTypeEnum.Interface;
=======
case "Int64Property":
return AddTypeEnum.Int64;
>>>>>>>
case "InterfaceProperty":
return AddTypeEnum.Interface;
case "Int64Property":
return AddTypeEnum.Int64; |
<<<<<<<
public RelayCommand CopyPropertyNameCommand { get; }
=======
/// <summary>
/// Gets or sets the index of this property in an array
/// Leave null for properties outside arrays
/// </summary>
public string Index { get; set; }
>>>>>>>
public RelayCommand CopyPropertyNameCommand { get; }
/// <summary>
/// Gets or sets the index of this property in an array
/// Leave null for properties outside arrays
/// </summary>
public string Index { get; set; } |
<<<<<<<
using System.Globalization;
using PogoLocationFeeder.Repository;
=======
using static PogoLocationFeeder.DiscordWebReader;
>>>>>>>
using System.Globalization;
using PogoLocationFeeder.Repository;
using static PogoLocationFeeder.DiscordWebReader;
<<<<<<<
=======
private DiscordChannelParser channel_parser = new DiscordChannelParser();
private PokeSniperReader pokeSniperReader = new PokeSniperReader();
>>>>>>>
private DiscordChannelParser channel_parser = new DiscordChannelParser();
<<<<<<<
Log.Plain("PogoLocationFeeder is brought to you via https://github.com/5andr0/PogoLocationFeeder");
Log.Plain("This software is 100% free and open-source.\n");
Log.Info("Starting server ...");
Log.Info("Listening...");
StartAccept();
=======
Console.WriteLine("PogoLocationFeeder is brought to you via https://github.com/5andr0/PogoLocationFeeder/wiki");
Console.WriteLine("This software is 100% free and open-source.\n");
Console.WriteLine("Connecting to feeder service pogo-feed.mmoex.com");
StartAccept();
>>>>>>>
Log.Plain("PogoLocationFeeder is brought to you via https://github.com/5andr0/PogoLocationFeeder");
Log.Plain("This software is 100% free and open-source.\n");
Log.Info("Connecting to feeder service pogo-feed.mmoex.com");
StartAccept();
<<<<<<<
String timeFormat = "HH:mm:ss";
Log.Pokemon($"{channel}: {target.id} at {target.latitude},{target.longitude}"
+ " with " + (target.iv != default(double) ? "{target.iv}%IV": "unknown IV")
+ (target.timeStamp != default(DateTime) ? $" until {target.timeStamp.ToString(timeFormat)}" : ""));
=======
Console.WriteLine($"{source} ID: {target.Id}, Lat:{target.Latitude}, Lng:{target.Longitude}, IV:{target.IV}");
if (target.ExpirationTimestamp != default(DateTime))
Console.WriteLine($"Expires: {target.ExpirationTimestamp}");
>>>>>>>
String timeFormat = "HH:mm:ss";
Log.Pokemon($"{source}: {target.Id} at {target.Latitude.ToString(CultureInfo.InvariantCulture)},{target.Longitude.ToString(CultureInfo.InvariantCulture)}"
+ " with " + (target.IV != default(double) ? "{target.IV}% IV" : "unknown IV")
+ (target.ExpirationTimestamp != default(DateTime) ? $" until {target.ExpirationTimestamp.ToString(timeFormat)}" : ""));
<<<<<<<
pollRarePokemonRepositories(settings);
_client.MessageReceived += async (s, e) =>
=======
if (settings.usePokeSnipers)
{
pollPokesniperFeed();
}
var discordWebReader = new DiscordWebReader();
while(true)
>>>>>>>
PollRarePokemonRepositories(settings);
var discordWebReader = new DiscordWebReader();
while (true)
<<<<<<<
var pokeSniperList = rarePokemonRepository.FindAll();
if (pokeSniperList != null)
=======
if (pokeSniperList.Any())
{
await feedToClients(pokeSniperList, "PokeSnipers");
}
else
>>>>>>>
var pokeSniperList = rarePokemonRepository.FindAll();
if (pokeSniperList != null) |
<<<<<<<
/// <summary>
/// Updates on your current account balance and margin requirements
/// </summary>
/// <param name="act">Your Action when socket get data</param>
/// <returns>Margin Subscription info</returns>
public static BitmexApiSubscriptionInfo<IEnumerable<MarginDto>> CreateMarginSubscription(Action<BitmexSocketDataMessage<IEnumerable<MarginDto>>> act)
{
return BitmexApiSubscriptionInfo<IEnumerable<MarginDto>>.Create(SubscriptionType.margin, act);
}
/// <summary>
/// Bitcoin address balance data, including total deposits & withdrawals
/// </summary>
/// <param name="act">Your Action when socket get data</param>
/// <returns>Wallet Subscription info</returns>
public static BitmexApiSubscriptionInfo<IEnumerable<WalletDto>> CreateWalletSubscription(Action<BitmexSocketDataMessage<IEnumerable<WalletDto>>> act)
{
return BitmexApiSubscriptionInfo<IEnumerable<WalletDto>>.Create(SubscriptionType.wallet, act);
}
/// <summary>
/// Bitcoin address balance data, including total deposits & withdrawals
/// </summary>
/// <param name="act">Your Action when socket get data</param>
/// <returns>Funding Subscription info</returns>
public static BitmexApiSubscriptionInfo<IEnumerable<FundingDto>> CreateFundingSubscription(Action<BitmexSocketDataMessage<IEnumerable<FundingDto>>> act)
{
return BitmexApiSubscriptionInfo<IEnumerable<FundingDto>>.Create(SubscriptionType.funding, act);
}
/// <summary>
/// Site announcements
/// </summary>
/// <param name="act">Your Action when socket get data</param>
/// <returns>Announcement Subscription info</returns>
public static BitmexApiSubscriptionInfo<IEnumerable<AnnouncementDto>> CreateAnnouncementSubscription(Action<BitmexSocketDataMessage<IEnumerable<AnnouncementDto>>> act)
{
return BitmexApiSubscriptionInfo<IEnumerable<AnnouncementDto>>.Create(SubscriptionType.announcement, act);
}
/// <summary>
/// Trollbox chat
/// </summary>
/// <param name="act">Your Action when socket get data</param>
/// <returns>Chat Subscription info</returns>
public static BitmexApiSubscriptionInfo<IEnumerable<ChatDto>> CreateChatSubscription(Action<BitmexSocketDataMessage<IEnumerable<ChatDto>>> act)
{
return BitmexApiSubscriptionInfo<IEnumerable<ChatDto>>.Create(SubscriptionType.chat, act);
}
=======
public static BitmexApiSubscriptionInfo<IEnumerable<LiquidationDto>> CreateLiquidationSubsription(Action<BitmexSocketDataMessage<IEnumerable<LiquidationDto>>> act)
{
return BitmexApiSubscriptionInfo<IEnumerable<LiquidationDto>>.Create(SubscriptionType.liquidation, act);
}
public static BitmexApiSubscriptionInfo<IEnumerable<ExecutionDto>> CreateExecutionSubsription(Action<BitmexSocketDataMessage<IEnumerable<ExecutionDto>>> act)
{
return BitmexApiSubscriptionInfo<IEnumerable<ExecutionDto>>.Create(SubscriptionType.execution, act);
}
>>>>>>>
public static BitmexApiSubscriptionInfo<IEnumerable<LiquidationDto>> CreateLiquidationSubsription(Action<BitmexSocketDataMessage<IEnumerable<LiquidationDto>>> act)
{
return BitmexApiSubscriptionInfo<IEnumerable<LiquidationDto>>.Create(SubscriptionType.liquidation, act);
}
public static BitmexApiSubscriptionInfo<IEnumerable<ExecutionDto>> CreateExecutionSubsription(Action<BitmexSocketDataMessage<IEnumerable<ExecutionDto>>> act)
{
return BitmexApiSubscriptionInfo<IEnumerable<ExecutionDto>>.Create(SubscriptionType.execution, act);
}
/// <summary>
/// Updates on your current account balance and margin requirements
/// </summary>
/// <param name="act">Your Action when socket get data</param>
/// <returns>Margin Subscription info</returns>
public static BitmexApiSubscriptionInfo<IEnumerable<MarginDto>> CreateMarginSubscription(Action<BitmexSocketDataMessage<IEnumerable<MarginDto>>> act)
{
return BitmexApiSubscriptionInfo<IEnumerable<MarginDto>>.Create(SubscriptionType.margin, act);
}
/// <summary>
/// Bitcoin address balance data, including total deposits & withdrawals
/// </summary>
/// <param name="act">Your Action when socket get data</param>
/// <returns>Wallet Subscription info</returns>
public static BitmexApiSubscriptionInfo<IEnumerable<WalletDto>> CreateWalletSubscription(Action<BitmexSocketDataMessage<IEnumerable<WalletDto>>> act)
{
return BitmexApiSubscriptionInfo<IEnumerable<WalletDto>>.Create(SubscriptionType.wallet, act);
}
/// <summary>
/// Bitcoin address balance data, including total deposits & withdrawals
/// </summary>
/// <param name="act">Your Action when socket get data</param>
/// <returns>Funding Subscription info</returns>
public static BitmexApiSubscriptionInfo<IEnumerable<FundingDto>> CreateFundingSubscription(Action<BitmexSocketDataMessage<IEnumerable<FundingDto>>> act)
{
return BitmexApiSubscriptionInfo<IEnumerable<FundingDto>>.Create(SubscriptionType.funding, act);
}
/// <summary>
/// Site announcements
/// </summary>
/// <param name="act">Your Action when socket get data</param>
/// <returns>Announcement Subscription info</returns>
public static BitmexApiSubscriptionInfo<IEnumerable<AnnouncementDto>> CreateAnnouncementSubscription(Action<BitmexSocketDataMessage<IEnumerable<AnnouncementDto>>> act)
{
return BitmexApiSubscriptionInfo<IEnumerable<AnnouncementDto>>.Create(SubscriptionType.announcement, act);
}
/// <summary>
/// Trollbox chat
/// </summary>
/// <param name="act">Your Action when socket get data</param>
/// <returns>Chat Subscription info</returns>
public static BitmexApiSubscriptionInfo<IEnumerable<ChatDto>> CreateChatSubscription(Action<BitmexSocketDataMessage<IEnumerable<ChatDto>>> act)
{
return BitmexApiSubscriptionInfo<IEnumerable<ChatDto>>.Create(SubscriptionType.chat, act);
} |
<<<<<<<
using Microsoft.Health.Fhir.Shared.Api.UnitTests;
=======
using Microsoft.Health.Fhir.Core.Features.Security;
>>>>>>>
using Microsoft.Health.Fhir.Core.Features.Security;
using Microsoft.Health.Fhir.Shared.Api.UnitTests; |
<<<<<<<
private readonly IPasvAddressResolver _addressResolver;
=======
[CanBeNull]
>>>>>>>
private readonly IPasvAddressResolver _addressResolver;
[CanBeNull]
<<<<<<<
public PasvListenerFactory(IPasvAddressResolver addressResolver, ILogger<PasvListenerFactory> logger)
=======
public PasvListenerFactory(IOptions<FtpServerOptions> serverOptions, ILogger<PasvListenerFactory> logger = null)
>>>>>>>
public PasvListenerFactory(IPasvAddressResolver addressResolver, ILogger<PasvListenerFactory> logger = null)
<<<<<<<
=======
if (serverOptions.Value.PasvMinPort > 1023 &&
serverOptions.Value.PasvMaxPort >= serverOptions.Value.PasvMinPort)
{
_pasvMinPort = serverOptions.Value.PasvMinPort;
_pasvMaxPort = serverOptions.Value.PasvMaxPort;
_log?.LogInformation($"PASV port range set to {_pasvMinPort}:{_pasvMaxPort}");
_pasvPorts = Enumerable.Range(_pasvMinPort, _pasvMaxPort - _pasvMinPort + 1).ToArray();
}
PasvExternalAddress = !string.IsNullOrWhiteSpace(serverOptions.Value.PasvAddress)
? IPAddress.Parse(serverOptions.Value.PasvAddress)
: null;
>>>>>>> |
<<<<<<<
[Fact]
public void ShouldUseLocalTimeZoneOverride()
{
//var all = TimeZoneInfo.GetSystemTimeZones();
//var skip = new[]
//{
// "Dateline Standard Time",
// "UTC-11",
// "Hawaiian Standard Time"
//};
//foreach (var localTimeZone in all)
//{
// if (skip.Contains(localTimeZone.Id))
// {
// continue;
// }
// //var localTimeZone = TimeZoneInfo.Local;
// var customHoursOffsetFromLocal = 1;
// var expectedToStringValue = "Mon Feb 02 1990 15:00:00 GMT";
// var expectedGetHoursValue = 15d;
// if (localTimeZone.BaseUtcOffset.Hours > 11)
// {
// customHoursOffsetFromLocal = -1;
// expectedToStringValue = "Mon Feb 02 1990 13:00:00 GMT";
// expectedGetHoursValue = 13d;
// }
const string customName = "Custom Time";
//var customUtcOffset = localTimeZone.BaseUtcOffset.Add(new TimeSpan(customHoursOffsetFromLocal, 0, 0));
var customTimeZone = TimeZoneInfo.CreateCustomTimeZone(customName, new TimeSpan(0, 11, 0), customName,
customName, customName, null, false);
//var d = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Unspecified);
//var u = TimeZoneInfo.ConvertTime(d, localTimeZone, TimeZoneInfo.Utc);
//var l = TimeZoneInfo.ConvertTime(u, customTimeZone);
var engine = new Engine(cfg => cfg.LocalTimeZone(customTimeZone));
var d1 = engine.Execute("var d = new Date(0); d.getTime();").GetCompletionValue().AsNumber();
var d2 = engine.Execute("var d = new Date(Date.UTC(1970,0,1)); d.getTime();").GetCompletionValue().AsNumber();
var result = engine.Execute("var d1 = new Date(0); var d2 = new Date(Date.UTC(1970,0,1)); d1.getTime() === d2.getTime();").GetCompletionValue().AsBoolean();
Assert.Equal(true, result);
var toStringResult = engine.Execute("var d = new Date(946684800000); d.toString();").GetCompletionValue().AsString();
Assert.Equal("Sat Jan 01 2000 00:11:00 GMT", toStringResult);
var getMinutesResult = engine.Execute("var d = new Date(946684800000); d.getMinutes();").GetCompletionValue().AsNumber();
Assert.Equal(11, getMinutesResult);
//}
}
=======
[Fact]
public void ParseShouldReturnNumber()
{
var engine = new Engine();
var result = engine.Execute("Date.parse('1970-01-01');").GetCompletionValue().AsNumber();
Assert.Equal(0, result);
}
[Fact]
public void UtcShouldUseUtc()
{
if (TimeZoneInfo.Local.BaseUtcOffset.Equals(new TimeSpan(0)))
{
throw new Exception("Test is not valid if the Local timezone offset is the same as UTC.");
}
var engine = new Engine();
var result = engine.Execute("Date.UTC(1970,0,1)").GetCompletionValue().AsNumber();
Assert.Equal(0, result);
}
>>>>>>>
[Fact]
public void ParseShouldReturnNumber()
{
var engine = new Engine();
var result = engine.Execute("Date.parse('1970-01-01');").GetCompletionValue().AsNumber();
Assert.Equal(0, result);
}
[Fact]
public void UtcShouldUseUtc()
{
if (TimeZoneInfo.Local.BaseUtcOffset.Equals(new TimeSpan(0)))
{
throw new Exception("Test is not valid if the Local timezone offset is the same as UTC.");
}
var engine = new Engine();
var result = engine.Execute("Date.UTC(1970,0,1)").GetCompletionValue().AsNumber();
Assert.Equal(0, result);
}
[Fact]
public void ShouldUseLocalTimeZoneOverride()
{
//var all = TimeZoneInfo.GetSystemTimeZones();
//var skip = new[]
//{
// "Dateline Standard Time",
// "UTC-11",
// "Hawaiian Standard Time"
//};
//foreach (var localTimeZone in all)
//{
// if (skip.Contains(localTimeZone.Id))
// {
// continue;
// }
// //var localTimeZone = TimeZoneInfo.Local;
// var customHoursOffsetFromLocal = 1;
// var expectedToStringValue = "Mon Feb 02 1990 15:00:00 GMT";
// var expectedGetHoursValue = 15d;
// if (localTimeZone.BaseUtcOffset.Hours > 11)
// {
// customHoursOffsetFromLocal = -1;
// expectedToStringValue = "Mon Feb 02 1990 13:00:00 GMT";
// expectedGetHoursValue = 13d;
// }
const string customName = "Custom Time";
//var customUtcOffset = localTimeZone.BaseUtcOffset.Add(new TimeSpan(customHoursOffsetFromLocal, 0, 0));
var customTimeZone = TimeZoneInfo.CreateCustomTimeZone(customName, new TimeSpan(0, 11, 0), customName,
customName, customName, null, false);
//var d = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Unspecified);
//var u = TimeZoneInfo.ConvertTime(d, localTimeZone, TimeZoneInfo.Utc);
//var l = TimeZoneInfo.ConvertTime(u, customTimeZone);
var engine = new Engine(cfg => cfg.LocalTimeZone(customTimeZone));
var d1 = engine.Execute("var d = new Date(0); d.getTime();").GetCompletionValue().AsNumber();
var d2 = engine.Execute("var d = new Date(Date.UTC(1970,0,1)); d.getTime();").GetCompletionValue().AsNumber();
var result = engine.Execute("var d1 = new Date(0); var d2 = new Date(Date.UTC(1970,0,1)); d1.getTime() === d2.getTime();").GetCompletionValue().AsBoolean();
Assert.Equal(true, result);
var toStringResult = engine.Execute("var d = new Date(946684800000); d.toString();").GetCompletionValue().AsString();
Assert.Equal("Sat Jan 01 2000 00:11:00 GMT", toStringResult);
var getMinutesResult = engine.Execute("var d = new Date(946684800000); d.getMinutes();").GetCompletionValue().AsNumber();
Assert.Equal(11, getMinutesResult);
//}
} |
<<<<<<<
using Jint.Parser.Ast;
using Jint.Runtime.Descriptors;
=======
>>>>>>>
using Jint.Runtime.Descriptors; |
<<<<<<<
using Jint.Native.Object;
using Jint.Parser.Ast;
=======
>>>>>>>
using Jint.Native.Object;
<<<<<<<
return literal.CachedValue;
}
if (literal.Type == SyntaxNodes.RegularExpressionLiteral)
{
var regexp = _engine.RegExp.Construct(literal.Raw);
if (regexp.Global)
{
// A Global regexp literal can't be cached or its state would evolve
return regexp;
}
literal.CachedValue = regexp;
=======
return _engine.RegExp.Construct(literal.RegexValue, literal.Regex.Flags);
>>>>>>>
var regexp = _engine.RegExp.Construct(literal.RegexValue, literal.Regex.Flags);
if (regexp.Global)
{
// A Global regexp literal can't be cached or its state would evolve
return regexp;
}
literal.CachedValue = regexp; |
<<<<<<<
public virtual object Convert(object value, Type type, IFormatProvider formatProvider)
{
=======
public object Convert(object value, Type type, IFormatProvider formatProvider)
{
if (value == null)
{
if (TypeIsNullable(type))
{
return null;
}
throw new NotSupportedException(string.Format("Unable to convert null to '{0}'", type.FullName));
}
>>>>>>>
public virtual object Convert(object value, Type type, IFormatProvider formatProvider)
{
if (value == null)
{
if (TypeConverter.TypeIsNullable(type))
{
return null;
}
throw new NotSupportedException(string.Format("Unable to convert null to '{0}'", type.FullName));
}
<<<<<<<
}
public virtual bool TryConvert(object value, Type type, IFormatProvider formatProvider, out object converted)
{
bool canConvert;
var key = value == null ? String.Format("Null->{0}", type) : String.Format("{0}->{1}", value.GetType(), type);
if (!_knownConversions.TryGetValue(key, out canConvert))
{
lock (_lockObject)
{
if (!_knownConversions.TryGetValue(key, out canConvert))
{
try
{
converted = Convert(value, type, formatProvider);
_knownConversions.Add(key, true);
return true;
}
catch
{
converted = null;
_knownConversions.Add(key, false);
return false;
}
}
}
}
if (canConvert)
{
converted = Convert(value, type, formatProvider);
return true;
}
converted = null;
return false;
}
=======
}
private static bool TypeIsNullable(Type type)
{
return !type.IsValueType || Nullable.GetUnderlyingType(type) != null;
}
>>>>>>>
}
public virtual bool TryConvert(object value, Type type, IFormatProvider formatProvider, out object converted)
{
bool canConvert;
var key = value == null ? String.Format("Null->{0}", type) : String.Format("{0}->{1}", value.GetType(), type);
lock (_lockObject)
{
if (!_knownConversions.TryGetValue(key, out canConvert))
{
try
{
converted = Convert(value, type, formatProvider);
_knownConversions.Add(key, true);
return true;
}
catch
{
converted = null;
_knownConversions.Add(key, false);
return false;
}
}
}
if (canConvert)
{
converted = Convert(value, type, formatProvider);
return true;
}
converted = null;
return false;
} |
<<<<<<<
public abstract SqlProvider FormatSum(LambdaExpression sumExpression);
public abstract SqlProvider FormatUpdateSelect<T>(Expression<Func<T, T>> updator);
/// <summary>
/// 业务公共抽离模块
/// </summary>
[ThreadStatic]
public static AopProvider Aop = new AopProvider();
/// <summary>
/// 获取表名称
/// </summary>
/// <param name="isNeedFrom"></param>
/// <param name="isAsName"></param>
/// <param name="tableType">连接查询时会用到</param>
/// <returns></returns>
public string FormatTableName(bool isNeedFrom = true, bool isAsName = true, Type tableType = null)
{
var entity = EntityCache.QueryEntity(tableType == null ? Context.Set.TableType : tableType);
string schema = string.IsNullOrEmpty(entity.Schema) ? "" : ProviderOption.CombineFieldName(entity.Schema) + ".";
string fromName = entity.Name;
//函数AsTableName优先级大于一切
string asTableName;
if (AsTableNameDic.TryGetValue(entity.Type, out asTableName))
{
fromName = asTableName;
}
//是否存在实体特性中的AsName标记
if (isAsName)
fromName = entity.AsName.Equals(fromName) ? ProviderOption.CombineFieldName(fromName) : $"{ProviderOption.CombineFieldName(fromName)} {entity.AsName}";
SqlString = $" {schema}{fromName} ";
if (isNeedFrom)
SqlString = " FROM " + SqlString;
return SqlString;
}
protected string[] FormatInsertParamsAndValues<T>(T t, string[] excludeFields = null)
{
var paramSqlBuilder = new StringBuilder(64);
var valueSqlBuilder = new StringBuilder(64);
var entity = EntityCache.QueryEntity(t.GetType());
var properties = entity.Properties;
var isAppend = false;
foreach (var propertiy in properties)
{
//是否是排除字段
if (excludeFields != null && excludeFields.Contains(propertiy.Name))
{
continue;
}
//主键标识
var typeAttribute = propertiy.GetCustomAttributess(true).FirstOrDefault(x => x.GetType().Equals(typeof(Identity)));
if (typeAttribute != null)
{
var identity = typeAttribute as Identity;
//是否自增
if (identity.IsIncrease)
{
continue;
}
}
//排除掉时间格式为最小值的字段
if (propertiy.PropertyType == typeof(DateTime))
{
if (Convert.ToDateTime(propertiy.GetValue(t)) == DateTime.MinValue)
{
continue;
}
}
if (isAppend)
{
paramSqlBuilder.Append(",");
valueSqlBuilder.Append(",");
}
var name = propertiy.GetColumnAttributeName();
paramSqlBuilder.AppendFormat("{0}{1}{2}", ProviderOption.OpenQuote, entity.FieldPairs[name], ProviderOption.CloseQuote);
valueSqlBuilder.Append(ProviderOption.ParameterPrefix + name);
Params.Add(ProviderOption.ParameterPrefix + name, propertiy.GetValue(t));
isAppend = true;
}
return new[] { paramSqlBuilder.ToString(), valueSqlBuilder.ToString() };
}
protected DataBaseContext<T> DataBaseContext<T>()
{
return (DataBaseContext<T>)Context;
}
}
=======
public abstract SqlProvider FormatSum(LambdaExpression sumExpression);
public abstract SqlProvider FormatMin(LambdaExpression MinExpression);
public abstract SqlProvider FormatMax(LambdaExpression MaxExpression);
public abstract SqlProvider FormatUpdateSelect<T>(Expression<Func<T, T>> updator);
/// <summary>
/// 获取表名称
/// </summary>
/// <param name="isNeedFrom"></param>
/// <param name="isAsName"></param>
/// <param name="tableType">连接查询时会用到</param>
/// <returns></returns>
public string FormatTableName(bool isNeedFrom = true, bool isAsName = true, Type tableType = null)
{
var entity = EntityCache.QueryEntity(tableType == null ? Context.Set.TableType : tableType);
string schema = string.IsNullOrEmpty(entity.Schema) ? "" : ProviderOption.CombineFieldName(entity.Schema) + ".";
string fromName = entity.Name;
//函数AsTableName优先级大于一切
string asTableName;
if (AsTableNameDic.TryGetValue(entity.Type, out asTableName))
{
fromName = asTableName;
}
//是否存在实体特性中的AsName标记
if (isAsName)
fromName = entity.AsName.Equals(fromName) ? ProviderOption.CombineFieldName(fromName) : $"{ProviderOption.CombineFieldName(fromName)} {entity.AsName}";
SqlString = $" {schema}{fromName} ";
if (isNeedFrom)
SqlString = " FROM " + SqlString;
return SqlString;
}
protected string[] FormatInsertParamsAndValues<T>(T t)
{
var paramSqlBuilder = new StringBuilder(64);
var valueSqlBuilder = new StringBuilder(64);
var entity = EntityCache.QueryEntity(t.GetType());
var properties = entity.Properties;
var isAppend = false;
foreach (var propertiy in properties)
{
//主键标识
var typeAttribute = propertiy.GetCustomAttributess(true).FirstOrDefault(x => x.GetType().Equals(typeof(Identity)));
if (typeAttribute != null)
{
var identity = typeAttribute as Identity;
//是否自增
if (identity.IsIncrease)
{
continue;
}
}
if (isAppend)
{
paramSqlBuilder.Append(",");
valueSqlBuilder.Append(",");
}
var name = propertiy.GetColumnAttributeName();
paramSqlBuilder.AppendFormat("{0}{1}{2}", ProviderOption.OpenQuote, entity.FieldPairs[name], ProviderOption.CloseQuote);
valueSqlBuilder.Append(ProviderOption.ParameterPrefix + name);
Params.Add(ProviderOption.ParameterPrefix + name, propertiy.GetValue(t));
isAppend = true;
}
return new[] { paramSqlBuilder.ToString(), valueSqlBuilder.ToString() };
}
protected DataBaseContext<T> DataBaseContext<T>()
{
return (DataBaseContext<T>)Context;
}
}
>>>>>>>
public abstract SqlProvider FormatSum(LambdaExpression sumExpression);
public abstract SqlProvider FormatMin(LambdaExpression MinExpression);
public abstract SqlProvider FormatMax(LambdaExpression MaxExpression);
public abstract SqlProvider FormatUpdateSelect<T>(Expression<Func<T, T>> updator);
/// <summary>
/// 获取表名称
/// </summary>
/// <param name="isNeedFrom"></param>
/// <param name="isAsName"></param>
/// <param name="tableType">连接查询时会用到</param>
/// <returns></returns>
public string FormatTableName(bool isNeedFrom = true, bool isAsName = true, Type tableType = null)
{
var entity = EntityCache.QueryEntity(tableType == null ? Context.Set.TableType : tableType);
string schema = string.IsNullOrEmpty(entity.Schema) ? "" : ProviderOption.CombineFieldName(entity.Schema) + ".";
string fromName = entity.Name;
//函数AsTableName优先级大于一切
string asTableName;
if (AsTableNameDic.TryGetValue(entity.Type, out asTableName))
{
fromName = asTableName;
}
//是否存在实体特性中的AsName标记
if (isAsName)
fromName = entity.AsName.Equals(fromName) ? ProviderOption.CombineFieldName(fromName) : $"{ProviderOption.CombineFieldName(fromName)} {entity.AsName}";
SqlString = $" {schema}{fromName} ";
if (isNeedFrom)
SqlString = " FROM " + SqlString;
return SqlString;
}
protected string[] FormatInsertParamsAndValues<T>(T t, string[] excludeFields = null)
{
var paramSqlBuilder = new StringBuilder(64);
var valueSqlBuilder = new StringBuilder(64);
var entity = EntityCache.QueryEntity(t.GetType());
var properties = entity.Properties;
var isAppend = false;
foreach (var propertiy in properties)
{
//是否是排除字段
if (excludeFields != null && excludeFields.Contains(propertiy.Name))
{
continue;
}
//主键标识
var typeAttribute = propertiy.GetCustomAttributess(true).FirstOrDefault(x => x.GetType().Equals(typeof(Identity)));
if (typeAttribute != null)
{
var identity = typeAttribute as Identity;
//是否自增
if (identity.IsIncrease)
{
continue;
}
}
//排除掉时间格式为最小值的字段
if (propertiy.PropertyType == typeof(DateTime))
{
if (Convert.ToDateTime(propertiy.GetValue(t)) == DateTime.MinValue)
{
continue;
}
}
if (isAppend)
{
paramSqlBuilder.Append(",");
valueSqlBuilder.Append(",");
}
var name = propertiy.GetColumnAttributeName();
paramSqlBuilder.AppendFormat("{0}{1}{2}", ProviderOption.OpenQuote, entity.FieldPairs[name], ProviderOption.CloseQuote);
valueSqlBuilder.Append(ProviderOption.ParameterPrefix + name);
Params.Add(ProviderOption.ParameterPrefix + name, propertiy.GetValue(t));
isAppend = true;
}
return new[] { paramSqlBuilder.ToString(), valueSqlBuilder.ToString() };
}
protected DataBaseContext<T> DataBaseContext<T>()
{
return (DataBaseContext<T>)Context;
}
} |
<<<<<<<
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Wox")]
[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wox")]
[assembly: AssemblyCopyright("The MIT License (MIT)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请在
//<PropertyGroup> 中的 .csproj 文件中
//设置 <UICulture>CultureYouAreCodingWith</UICulture>。例如,如果您在源文件中
//使用的是美国英语,请将 <UICulture> 设置为 en-US。然后取消
//对以下 NeutralResourceLanguage 特性的注释。更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(在页面或应用程序资源词典中
// 未找到某个资源的情况下使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(在页面、应用程序或任何主题特定资源词典中
// 未找到某个资源的情况下使用)
)]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
=======
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
[assembly: AssemblyTitle("Wox")]
[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wox")]
[assembly: AssemblyCopyright("The MIT License (MIT)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly
)]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]
>>>>>>>
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
[assembly: AssemblyTitle("Wox")]
[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wox")]
[assembly: AssemblyCopyright("The MIT License (MIT)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly
)]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")] |
<<<<<<<
=======
using Wox.Core.UserSettings;
using Wox.Helper;
>>>>>>>
using Wox.Helper;
<<<<<<<
if (IsContextMenuVisible)
=======
if (ContextMenuVisibility.IsVisible())
>>>>>>>
if (ContextMenuVisibility.IsVisible())
<<<<<<<
if (IsContextMenuVisible)
=======
if (ContextMenuVisibility.IsVisible())
>>>>>>>
if (ContextMenuVisibility.IsVisible())
<<<<<<<
if (IsContextMenuVisible)
=======
if (ContextMenuVisibility.IsVisible())
>>>>>>>
if (ContextMenuVisibility.IsVisible())
<<<<<<<
if (IsContextMenuVisible)
=======
if (ContextMenuVisibility.IsVisible())
>>>>>>>
if (ContextMenuVisibility.IsVisible())
<<<<<<<
if (!IsContextMenuVisible && Results.SelectedResult != null)
=======
if (!ContextMenuVisibility.IsVisible() && null != Results.SelectedResult)
>>>>>>>
if (!ContextMenuVisibility.IsVisible() && null != Results.SelectedResult) |
<<<<<<<
private const string POWERTOYNAME = "Launcher";
=======
>>>>>>>
<<<<<<<
if (SettingsUtils.SettingsExists())
{
generalSettings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
}
else
{
generalSettings = new GeneralSettings();
SettingsUtils.SaveSettings(generalSettings.ToJsonString(), string.Empty);
}
=======
callback = (PowerLauncherSettings settings) =>
{
// Propagate changes to Power Launcher through IPC
var propertiesJson = JsonSerializer.Serialize(settings.properties);
ShellPage.DefaultSndMSGCallback(
string.Format("{{ \"{0}\": {1} }}", PowerLauncherSettings.POWERTOYNAME, JsonSerializer.Serialize(settings.properties)));
};
}
public PowerLauncherViewModel(PowerLauncherSettings settings, SendCallback callback)
{
this.settings = settings;
this.callback = callback;
>>>>>>>
if (SettingsUtils.SettingsExists())
{
generalSettings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
}
else
{
generalSettings = new GeneralSettings();
SettingsUtils.SaveSettings(generalSettings.ToJsonString(), string.Empty);
}
callback = (PowerLauncherSettings settings) =>
{
// Propagate changes to Power Launcher through IPC
var propertiesJson = JsonSerializer.Serialize(settings.properties);
ShellPage.DefaultSndMSGCallback(
string.Format("{{ \"{0}\": {1} }}", PowerLauncherSettings.POWERTOYNAME, JsonSerializer.Serialize(settings.properties)));
};
}
public PowerLauncherViewModel(PowerLauncherSettings settings, SendCallback callback)
{
this.settings = settings;
this.callback = callback;
<<<<<<<
// Save settings to file
var options = new JsonSerializerOptions
{
WriteIndented = true,
};
SettingsUtils.SaveSettings(JsonSerializer.Serialize(settings, options), POWERTOYNAME);
// Propagate changes to Power Launcher through IPC
=======
settings.Save();
callback(settings);
>>>>>>>
settings.Save();
callback(settings); |
<<<<<<<
=======
private bool _isVisible;
private bool _isResultListBoxVisible;
private bool _isContextMenuVisible;
private bool _isProgressBarVisible;
>>>>>>>
<<<<<<<
this.InitializeResultListBox();
this.InitializeContextMenu();
this.InitializeKeyCommands();
=======
InitializeResultListBox();
InitializeContextMenu();
InitializeKeyCommands();
>>>>>>>
InitializeResultListBox();
InitializeContextMenu();
InitializeKeyCommands();
<<<<<<<
this.Results.SelectNextPage();
=======
Results.SelectNextPage();
>>>>>>>
Results.SelectNextPage();
<<<<<<<
this.Results.SelectPrevPage();
=======
Results.SelectPrevPage();
>>>>>>>
Results.SelectPrevPage();
<<<<<<<
this.Results = new ResultsViewModel();
this.ResultListBoxVisibility = Visibility.Collapsed;
=======
Results = new ResultsViewModel();
IsResultListBoxVisible = false;
>>>>>>>
Results = new ResultsViewModel();
ResultListBoxVisibility = Visibility.Collapsed;
<<<<<<<
this.ShowContextMenu(result, PluginManager.GetContextMenusForPlugin(result));
=======
ShowContextMenu(result, PluginManager.GetContextMenusForPlugin(result));
>>>>>>>
ShowContextMenu(result, PluginManager.GetContextMenusForPlugin(result));
<<<<<<<
this.DisplayContextMenu(actions, result.PluginID);
=======
DisplayContextMenu(actions, result.PluginID);
>>>>>>>
DisplayContextMenu(actions, result.PluginID);
<<<<<<<
this.ContextMenu.Clear();
this.ContextMenu.AddResults(actions, pluginID);
=======
ContextMenu.Clear();
ContextMenu.AddResults(actions, pluginID);
>>>>>>>
ContextMenu.Clear();
ContextMenu.AddResults(actions, pluginID);
<<<<<<<
this.ContextMenuVisibility = Visibility.Visible;
this.ResultListBoxVisibility = Visibility.Collapsed;
=======
IsContextMenuVisible = true;
IsResultListBoxVisible = false;
>>>>>>>
ContextMenuVisibility = Visibility.Visible;
ResultListBoxVisibility = Visibility.Collapsed;
<<<<<<<
this.ContextMenu = new ResultsViewModel();
this.ContextMenuVisibility = Visibility.Collapsed;
=======
ContextMenu = new ResultsViewModel();
IsContextMenuVisible = false;
>>>>>>>
ContextMenu = new ResultsViewModel();
ContextMenuVisibility = Visibility.Collapsed;
<<<<<<<
this.IsProgressBarTooltipVisible = false;
if (this.ContextMenuVisibility.IsVisible())
=======
IsProgressBarTooltipVisible = false;
if (IsContextMenuVisible)
>>>>>>>
IsProgressBarTooltipVisible = false;
if (ContextMenuVisibility.IsVisible())
<<<<<<<
this.Results.Clear();
=======
Results.Clear();
>>>>>>>
Results.Clear();
<<<<<<<
this.ContextMenu.Clear();
var query = this.QueryText.ToLower();
=======
ContextMenu.Clear();
var query = QueryText.ToLower();
>>>>>>>
ContextMenu.Clear();
var query = QueryText.ToLower();
<<<<<<<
this.ContextMenu.AddResults(CurrentContextMenus, contextMenuId);
=======
ContextMenu.AddResults(CurrentContextMenus, contextMenuId);
>>>>>>>
ContextMenu.AddResults(CurrentContextMenus, contextMenuId);
<<<<<<<
this.ContextMenu.AddResults(filterResults, contextMenuId);
=======
ContextMenu.AddResults(filterResults, contextMenuId);
>>>>>>>
ContextMenu.AddResults(filterResults, contextMenuId);
<<<<<<<
this.Results.RemoveResultsExcept(PluginManager.NonGlobalPlugins[keyword].Metadata);
=======
Results.RemoveResultsExcept(PluginManager.NonGlobalPlugins[keyword].Metadata);
>>>>>>>
Results.RemoveResultsExcept(PluginManager.NonGlobalPlugins[keyword].Metadata);
<<<<<<<
this.Results.RemoveResultsFor(PluginManager.NonGlobalPlugins[lastKeyword].Metadata);
=======
Results.RemoveResultsFor(PluginManager.NonGlobalPlugins[lastKeyword].Metadata);
>>>>>>>
Results.RemoveResultsFor(PluginManager.NonGlobalPlugins[lastKeyword].Metadata);
<<<<<<<
this.Results.RemoveResultsExcept(PluginManager.NonGlobalPlugins[keyword].Metadata);
=======
Results.RemoveResultsExcept(PluginManager.NonGlobalPlugins[keyword].Metadata);
>>>>>>>
Results.RemoveResultsExcept(PluginManager.NonGlobalPlugins[keyword].Metadata);
<<<<<<<
this.Results.RemoveResultsFor(QueryHistoryStorage.MetaData);
=======
Results.RemoveResultsFor(QueryHistoryStorage.MetaData);
>>>>>>>
Results.RemoveResultsFor(QueryHistoryStorage.MetaData);
<<<<<<<
() => { this.Results.AddResults(list, metadata.ID); });
=======
() => { Results.AddResults(list, metadata.ID); });
>>>>>>>
() => { Results.AddResults(list, metadata.ID); });
<<<<<<<
this.QueryText = _textBeforeEnterContextMenuMode;
this.ContextMenuVisibility = Visibility.Collapsed;
this.ResultListBoxVisibility = Visibility.Visible;
this.CaretIndex = this.QueryText.Length;
=======
QueryText = _textBeforeEnterContextMenuMode;
IsContextMenuVisible = false;
IsResultListBoxVisible = true;
CaretIndex = QueryText.Length;
>>>>>>>
QueryText = _textBeforeEnterContextMenuMode;
ContextMenuVisibility = Visibility.Collapsed;
ResultListBoxVisibility = Visibility.Visible;
CaretIndex = QueryText.Length;
<<<<<<<
this.Results.RemoveResultsExcept(historyMetadata);
=======
Results.RemoveResultsExcept(historyMetadata);
>>>>>>>
Results.RemoveResultsExcept(historyMetadata);
<<<<<<<
this.ResultListBoxVisibility = Visibility.Visible;
=======
IsResultListBoxVisible = true;
>>>>>>>
ResultListBoxVisibility = Visibility.Visible;
<<<<<<<
this.DisplayContextMenu(actions, pluginID);
=======
DisplayContextMenu(actions, pluginID);
>>>>>>>
DisplayContextMenu(actions, pluginID); |
<<<<<<<
public void UpdateSettings(PowerLauncherSettings settings)
{
}
=======
void InitializeFileWatchers()
{
// Create a new FileSystemWatcher and set its properties.
_watcher = new FileSystemWatcher();
var resolvedPath = Environment.ExpandEnvironmentVariables("%ProgramFiles%");
_watcher.Path = resolvedPath;
//Filter to create and deletes of 'microsoft.system.package.metadata' directories.
_watcher.NotifyFilter = NotifyFilters.DirectoryName | NotifyFilters.FileName;
_watcher.IncludeSubdirectories = true;
// Add event handlers.
_watcher.Created += OnChanged;
_watcher.Deleted += OnChanged;
// Begin watching.
_watcher.EnableRaisingEvents = true;
}
void InitializeTimer()
{
//multiple file writes occur on install / unistall. Adding a delay before actually indexing.
var delayInterval = 5000;
_timer = new System.Timers.Timer(delayInterval);
_timer.Enabled = true;
_timer.AutoReset = false;
_timer.Elapsed += FileWatchElapsedTimer;
_timer.Stop();
}
//When a watched directory changes then reset the timer.
private void OnChanged(object source, FileSystemEventArgs e)
{
Log.Debug($"|Wox.Plugin.Program.Main|Directory Changed: {e.FullPath} {e.ChangeType} - Resetting timer.");
_timer.Stop();
_timer.Start();
}
private void FileWatchElapsedTimer(object sender, ElapsedEventArgs e)
{
Task.Run(() =>
{
Log.Debug($"|Wox.Plugin.Program.Main| ReIndexing UWP Programs");
IndexUWPPrograms();
Log.Debug($"|Wox.Plugin.Program.Main| Done ReIndexing");
});
}
>>>>>>>
public void UpdateSettings(PowerLauncherSettings settings)
{
}
void InitializeFileWatchers()
{
// Create a new FileSystemWatcher and set its properties.
_watcher = new FileSystemWatcher();
var resolvedPath = Environment.ExpandEnvironmentVariables("%ProgramFiles%");
_watcher.Path = resolvedPath;
//Filter to create and deletes of 'microsoft.system.package.metadata' directories.
_watcher.NotifyFilter = NotifyFilters.DirectoryName | NotifyFilters.FileName;
_watcher.IncludeSubdirectories = true;
// Add event handlers.
_watcher.Created += OnChanged;
_watcher.Deleted += OnChanged;
// Begin watching.
_watcher.EnableRaisingEvents = true;
}
void InitializeTimer()
{
//multiple file writes occur on install / unistall. Adding a delay before actually indexing.
var delayInterval = 5000;
_timer = new System.Timers.Timer(delayInterval);
_timer.Enabled = true;
_timer.AutoReset = false;
_timer.Elapsed += FileWatchElapsedTimer;
_timer.Stop();
}
//When a watched directory changes then reset the timer.
private void OnChanged(object source, FileSystemEventArgs e)
{
Log.Debug($"|Wox.Plugin.Program.Main|Directory Changed: {e.FullPath} {e.ChangeType} - Resetting timer.");
_timer.Stop();
_timer.Start();
}
private void FileWatchElapsedTimer(object sender, ElapsedEventArgs e)
{
Task.Run(() =>
{
Log.Debug($"|Wox.Plugin.Program.Main| ReIndexing UWP Programs");
IndexUWPPrograms();
Log.Debug($"|Wox.Plugin.Program.Main| Done ReIndexing");
});
} |
<<<<<<<
Output.ToHtml.WhenCallMatches(x => x.Method.HasAttribute<HtmlEndpointAttribute>());
Output.ToJson.WhenCallMatches(x => x.Method.HasAttribute<JsonEndpointAttribute>());
=======
Output.ToHtml.WhenCallMatches(x => x.Method.HasCustomAttribute<HtmlEndpointAttribute>());
Output.ToJson.WhenCallMatches(x => x.Method.HasCustomAttribute<JsonEndpointAttribute>());
Output.ToJson.WhenTheOutputModelIs<JsonMessage>();
>>>>>>>
Output.ToHtml.WhenCallMatches(x => x.Method.HasAttribute<HtmlEndpointAttribute>());
Output.ToJson.WhenCallMatches(x => x.Method.HasAttribute<JsonEndpointAttribute>());
Output.ToJson.WhenTheOutputModelIs<JsonMessage>(); |
<<<<<<<
=======
[Test]
public void request_history_cache_is_registered()
{
registeredTypeIs<IRequestHistoryCache, RequestHistoryCache>();
}
>>>>>>>
[Test]
public void request_history_cache_is_registered()
{
registeredTypeIs<IRequestHistoryCache, RequestHistoryCache>();
} |
<<<<<<<
=======
using FubuMVC.UI;
using FubuValidation;
using FubuValidation.Strategies;
>>>>>>>
using FubuValidation;
using FubuValidation.Strategies; |
<<<<<<<
public static T Create<T>(this Type type)
{
return (T) type.Create();
}
public static object Create(this Type type)
{
return Activator.CreateInstance(type);
}
=======
>>>>>>>
public static T Create<T>(this Type type)
{
return (T) type.Create();
}
public static object Create(this Type type)
{
return Activator.CreateInstance(type);
} |
<<<<<<<
var expression = new RenderPartialExpression<TInputModel>(page, page.Get<IPartialRenderer>(), page.Get<IFubuRequest>())
=======
return new RenderPartialExpression<TInputModel>(page.Model, page, page.Get<IPartialRenderer>())
>>>>>>>
var expression = new RenderPartialExpression<TInputModel>(page.Model, page, page.Get<IPartialRenderer>()) |
<<<<<<<
// Smoke test various options
{
var dbname = "test-options";
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
var optsTest = (DbOptions)new RocksDbSharp.DbOptions()
.SetCreateIfMissing(true)
.SetCreateMissingColumnFamilies(true)
.SetBlockBasedTableFactory(new BlockBasedTableOptions().SetBlockCache(Cache.CreateLru(1024 * 1024)));
GC.Collect();
using (var db = RocksDbSharp.RocksDb.Open(optsTest, dbname))
{
}
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
}
// Smoke test OpenWithTtl
{
var dbname = "test-with-ttl";
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
var optsTest = (DbOptions)new RocksDbSharp.DbOptions()
.SetCreateIfMissing(true)
.SetCreateMissingColumnFamilies(true);
using (var db = RocksDbSharp.RocksDb.OpenWithTtl(optsTest, dbname, 1))
{
}
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
}
// Smoke test MergeOperator
{
var dbname = "test-merge-operator";
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
var optsTest = (DbOptions)new RocksDbSharp.DbOptions()
.SetCreateIfMissing(true)
.SetMergeOperator(MergeOperators.Create(
name: "test-merge-operator",
partialMerge: (key, keyLength, operandsList, operandsListLength, numOperands, success, newValueLength) => IntPtr.Zero,
fullMerge: (key, keyLength, existingValue, existingValueLength, operandsList, operandsListLength, numOperands, success, newValueLength) => IntPtr.Zero,
deleteValue: (value, valueLength) => { }
));
GC.Collect();
using (var db = RocksDbSharp.RocksDb.Open(optsTest, dbname))
{
}
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
}
// Test that GC does not cause access violation on Comparers
{
var dbname = "test-av-error";
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
options = new RocksDbSharp.DbOptions()
.SetCreateIfMissing(true)
.SetCreateMissingColumnFamilies(true);
var sc = new RocksDbSharp.StringComparator(StringComparer.InvariantCultureIgnoreCase);
columnFamilies = new RocksDbSharp.ColumnFamilies
{
{ "cf1", new RocksDbSharp.ColumnFamilyOptions()
.SetComparator(sc)
},
};
GC.Collect();
using (var db = RocksDbSharp.RocksDb.Open(options, dbname, columnFamilies))
{
}
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
}
=======
// Test that GC does not cause access violation on Comparers
{
if (Directory.Exists("test-av-error"))
Directory.Delete("test-av-error", true);
options = new RocksDbSharp.DbOptions()
.SetCreateIfMissing(true)
.SetCreateMissingColumnFamilies(true);
var sc = new RocksDbSharp.StringComparator(StringComparer.InvariantCultureIgnoreCase);
columnFamilies = new RocksDbSharp.ColumnFamilies
{
{ "cf1", new RocksDbSharp.ColumnFamilyOptions()
.SetComparator(sc)
},
};
GC.Collect();
using (var db = RocksDbSharp.RocksDb.Open(options, "test-av-error", columnFamilies))
{
}
if (Directory.Exists("test-av-error"))
Directory.Delete("test-av-error", true);
}
>>>>>>>
// Test that GC does not cause access violation on Comparers
{
if (Directory.Exists("test-av-error"))
Directory.Delete("test-av-error", true);
options = new RocksDbSharp.DbOptions()
.SetCreateIfMissing(true)
.SetCreateMissingColumnFamilies(true);
var sc = new RocksDbSharp.StringComparator(StringComparer.InvariantCultureIgnoreCase);
columnFamilies = new RocksDbSharp.ColumnFamilies
{
{ "cf1", new RocksDbSharp.ColumnFamilyOptions()
.SetComparator(sc)
},
};
GC.Collect();
using (var db = RocksDbSharp.RocksDb.Open(options, "test-av-error", columnFamilies))
{
}
if (Directory.Exists("test-av-error"))
Directory.Delete("test-av-error", true);
}
// Smoke test various options
{
var dbname = "test-options";
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
var optsTest = (DbOptions)new RocksDbSharp.DbOptions()
.SetCreateIfMissing(true)
.SetCreateMissingColumnFamilies(true)
.SetBlockBasedTableFactory(new BlockBasedTableOptions().SetBlockCache(Cache.CreateLru(1024 * 1024)));
GC.Collect();
using (var db = RocksDbSharp.RocksDb.Open(optsTest, dbname))
{
}
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
}
// Smoke test OpenWithTtl
{
var dbname = "test-with-ttl";
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
var optsTest = (DbOptions)new RocksDbSharp.DbOptions()
.SetCreateIfMissing(true)
.SetCreateMissingColumnFamilies(true);
using (var db = RocksDbSharp.RocksDb.OpenWithTtl(optsTest, dbname, 1))
{
}
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
}
// Smoke test MergeOperator
{
var dbname = "test-merge-operator";
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
var optsTest = (DbOptions)new RocksDbSharp.DbOptions()
.SetCreateIfMissing(true)
.SetMergeOperator(MergeOperators.Create(
name: "test-merge-operator",
partialMerge: (key, keyLength, operandsList, operandsListLength, numOperands, success, newValueLength) => IntPtr.Zero,
fullMerge: (key, keyLength, existingValue, existingValueLength, operandsList, operandsListLength, numOperands, success, newValueLength) => IntPtr.Zero,
deleteValue: (value, valueLength) => { }
));
GC.Collect();
using (var db = RocksDbSharp.RocksDb.Open(optsTest, dbname))
{
}
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
}
// Test that GC does not cause access violation on Comparers
{
var dbname = "test-av-error";
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
options = new RocksDbSharp.DbOptions()
.SetCreateIfMissing(true)
.SetCreateMissingColumnFamilies(true);
var sc = new RocksDbSharp.StringComparator(StringComparer.InvariantCultureIgnoreCase);
columnFamilies = new RocksDbSharp.ColumnFamilies
{
{ "cf1", new RocksDbSharp.ColumnFamilyOptions()
.SetComparator(sc)
},
};
GC.Collect();
using (var db = RocksDbSharp.RocksDb.Open(options, dbname, columnFamilies))
{
}
if (Directory.Exists(dbname))
Directory.Delete(dbname, true);
} |
Subsets and Splits