Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Dragablz.Test/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Dragablz.Test")]
Expand All @@ -14,8 +14,8 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

Expand All @@ -25,11 +25,11 @@
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
Expand Down
8 changes: 4 additions & 4 deletions Dragablz/CanvasOrganiser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class CanvasOrganiser : IItemsOrganiser
{
public virtual void Organise(DragablzItemsControl requestor, Size measureBounds, IEnumerable<DragablzItem> items)
{

}

public virtual void Organise(DragablzItemsControl requestor, Size measureBounds, IOrderedEnumerable<DragablzItem> items)
Expand All @@ -31,17 +31,17 @@ public virtual void OrganiseOnMouseDownWithin(DragablzItemsControl requestor, Si

public virtual void OrganiseOnDragStarted(DragablzItemsControl requestor, Size measureBounds, IEnumerable<DragablzItem> siblingItems, DragablzItem dragItem)
{

}

public virtual void OrganiseOnDrag(DragablzItemsControl requestor, Size measureBounds, IEnumerable<DragablzItem> siblingItems, DragablzItem dragItem)
{

}

public virtual void OrganiseOnDragCompleted(DragablzItemsControl requestor, Size measureBounds, IEnumerable<DragablzItem> siblingItems, DragablzItem dragItem)
{

}

public virtual Point ConstrainLocation(DragablzItemsControl requestor, Size measureBounds, Point itemCurrentLocation, Size itemCurrentSize, Point itemDesiredLocation, Size itemDesiredSize)
Expand Down
6 changes: 3 additions & 3 deletions Dragablz/Converters/BooleanAndToVisibilityConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
{
if (values == null)
return Visibility.Collapsed;
return values.Select(GetBool).All(b => b)

return values.Select(GetBool).All(b => b)
? Visibility.Visible
: Visibility.Collapsed;
}
Expand All @@ -29,7 +29,7 @@ private static bool GetBool(object value)
{
return (bool)value;
}

return false;
}
}
Expand Down
6 changes: 3 additions & 3 deletions Dragablz/Converters/ShowDefaultCloseButtonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ public class ShowDefaultCloseButtonConverter : IMultiValueConverter
/// <returns></returns>
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
return ((values[0] == DependencyProperty.UnsetValue ? false : (bool)values[0]) &&
(values[2] == DependencyProperty.UnsetValue ? 0 : (int)values[2]) >=
return ((values[0] == DependencyProperty.UnsetValue ? false : (bool)values[0]) &&
(values[2] == DependencyProperty.UnsetValue ? 0 : (int)values[2]) >=
(values[1] == DependencyProperty.UnsetValue ? 0 : (int)values[1])) ? Visibility.Visible : Visibility.Collapsed;
}

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
return null;
return null;
}
}
}
6 changes: 3 additions & 3 deletions Dragablz/Core/CollectionTeaser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal class CollectionTeaser
private readonly Action<object> _removeMethod;

private CollectionTeaser(Action<object> addMethod, Action<object> removeMethod)
{
{
_addMethod = addMethod;
_removeMethod = removeMethod;
}
Expand All @@ -23,7 +23,7 @@ public static bool TryCreate(object items, out CollectionTeaser collectionTeaser
var list = items as IList;
if (list != null)
{
collectionTeaser = new CollectionTeaser(i => list.Add(i), list.Remove);
collectionTeaser = new CollectionTeaser(i => list.Add(i), list.Remove);
}
else if (items != null)
{
Expand All @@ -48,7 +48,7 @@ public static bool TryCreate(object items, out CollectionTeaser collectionTeaser
i => removeMethodInfo.Invoke(items, new[] {i}));
}
}

return collectionTeaser != null;
}

Expand Down
10 changes: 5 additions & 5 deletions Dragablz/Core/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ public static IEnumerable<TContainer> Containers<TContainer>(this ItemsControl i
#endif
#if NET40
var fieldInfo = typeof(ItemContainerGenerator).GetField("_items", BindingFlags.NonPublic | BindingFlags.Instance);
var list = (IList)fieldInfo.GetValue(itemsControl.ItemContainerGenerator);
var list = (IList)fieldInfo.GetValue(itemsControl.ItemContainerGenerator);
for (var i = 0; i < list.Count; i++)
#endif
{
var container = itemsControl.ItemContainerGenerator.ContainerFromIndex(i) as TContainer;
if (container != null)
yield return container;
}
}
}

public static IEnumerable<TObject> Except<TObject>(this IEnumerable<TObject> first, params TObject[] second)
Expand All @@ -41,7 +41,7 @@ public static IEnumerable<object> LogicalTreeDepthFirstTraversal(this Dependency
yield return node;

foreach (var child in LogicalTreeHelper.GetChildren(node).OfType<DependencyObject>()
.SelectMany(depObj => depObj.LogicalTreeDepthFirstTraversal()))
.SelectMany(depObj => depObj.LogicalTreeDepthFirstTraversal()))
yield return child;
}

Expand Down Expand Up @@ -73,7 +73,7 @@ public static IEnumerable<DependencyObject> VisualTreeAncestory(this DependencyO
{
yield return dependencyObject;
dependencyObject = VisualTreeHelper.GetParent(dependencyObject);
}
}
}

/// <summary>
Expand All @@ -91,7 +91,7 @@ public static IEnumerable<DependencyObject> LogicalTreeAncestory(this Dependency
dependencyObject = LogicalTreeHelper.GetParent(dependencyObject);
}
}

/// <summary>
/// Returns the actual Left of the Window independently from the WindowState
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Dragablz/Core/FuncComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal class FuncComparer<TObject> : IComparer<TObject>
public FuncComparer(Func<TObject, TObject, int> comparer)
{
if (comparer == null) throw new ArgumentNullException("comparer");

_comparer = comparer;
}

Expand Down
2 changes: 1 addition & 1 deletion Dragablz/Core/InterTabTransfer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal class InterTabTransfer
private readonly Size _itemSize;
private readonly IList<FloatingItemSnapShot> _floatingItemSnapShots;
private readonly bool _isTransposing;
private readonly InterTabTransferReason _transferReason;
private readonly InterTabTransferReason _transferReason;

public InterTabTransfer(object item, DragablzItem originatorContainer, Orientation breachOrientation, Point dragStartWindowOffset, Point dragStartItemOffset, Point itemPositionWithinHeader, Size itemSize, IList<FloatingItemSnapShot> floatingItemSnapShots, bool isTransposing)
{
Expand Down
10 changes: 5 additions & 5 deletions Dragablz/Core/MultiComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ internal class MultiComparer<TObject> : IComparer<TObject>
{
private readonly IList<FuncComparer<TObject>> _attributeComparers;

private MultiComparer(FuncComparer<TObject> firstComparer)
private MultiComparer(FuncComparer<TObject> firstComparer)
{
_attributeComparers = new List<FuncComparer<TObject>>
{
firstComparer
};
}

public static MultiComparer<TObject> Ascending<TAttribute>(Func<TObject, TAttribute> accessor)
public static MultiComparer<TObject> Ascending<TAttribute>(Func<TObject, TAttribute> accessor)
where TAttribute : IComparable
{
if (accessor == null) throw new ArgumentNullException("accessor");
if (accessor == null) throw new ArgumentNullException("accessor");

return new MultiComparer<TObject>(BuildAscendingComparer(accessor));
}

public static MultiComparer<TObject> Descending<TAttribute>(Func<TObject, TAttribute> accessor)
public static MultiComparer<TObject> Descending<TAttribute>(Func<TObject, TAttribute> accessor)
where TAttribute : IComparable
{
if (accessor == null) throw new ArgumentNullException("accessor");
Expand Down Expand Up @@ -64,7 +64,7 @@ private static FuncComparer<TObject> BuildAscendingComparer<TAttribute>(Func<TOb
{
//TODO handle ref types better
return new FuncComparer<TObject>((x, y) => accessor(x).CompareTo(accessor(y)));

}

private static FuncComparer<TObject> BuildDescendingComparer<TAttribute>(Func<TObject, TAttribute> accessor)
Expand Down
6 changes: 3 additions & 3 deletions Dragablz/Core/Native.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public struct RECT
public int top;
public int right;
public int bottom;
}
}

[DllImport("user32.dll")]
private static extern bool GetCursorPos(out POINT lpPoint);
Expand Down Expand Up @@ -58,7 +58,7 @@ public static Point GetCursorPos()

public static Point ToWpf(this Point pixelPoint)
{
var desktop = GetDC(IntPtr.Zero);
var desktop = GetDC(IntPtr.Zero);
var dpi = GetDeviceCaps(desktop, 88);
ReleaseDC(IntPtr.Zero, desktop);

Expand Down Expand Up @@ -104,7 +104,7 @@ public struct WINDOWPLACEMENT
public POINT minPosition;
public POINT maxPosition;
public RECT normalPosition;
}
}

[DllImport("user32.dll", CharSet = CharSet.Auto)]
internal static extern IntPtr SendMessage(IntPtr hWnd, WindowMessage msg, IntPtr wParam, IntPtr lParam);
Expand Down
2 changes: 1 addition & 1 deletion Dragablz/Core/TabHeaderDragStartInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ internal class TabHeaderDragStartInformation
{
private readonly DragablzItem _dragItem;
private readonly double _dragablzItemsControlHorizontalOffset;
private readonly double _dragablzItemControlVerticalOffset;
private readonly double _dragablzItemControlVerticalOffset;
private readonly double _dragablzItemHorizontalOffset;
private readonly double _dragablzItemVerticalOffset;

Expand Down
10 changes: 5 additions & 5 deletions Dragablz/DefaultInterLayoutClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Dragablz
{
/// <summary>
/// Provides a simple implementation of <see cref="IInterLayoutClient"/>, but only really useful if
/// Provides a simple implementation of <see cref="IInterLayoutClient"/>, but only really useful if
/// <see cref="TabItem"/> instances are specified in XAML. If you are binding via ItemsSource then
/// you most likely want to create your own implementation of <see cref="IInterLayoutClient"/>.
/// </summary>
Expand All @@ -27,7 +27,7 @@ public INewTabHost<UIElement> GetNewHost(object partition, TabablzControl source
Partition = source.InterTabController.Partition
};
Clone(source.InterTabController, newInterTabController);
tabablzControl.SetCurrentValue(TabablzControl.InterTabControllerProperty, newInterTabController);
tabablzControl.SetCurrentValue(TabablzControl.InterTabControllerProperty, newInterTabController);

return new NewTabHost<UIElement>(tabablzControl, tabablzControl);
}
Expand All @@ -39,10 +39,10 @@ private static void Clone(DependencyObject from, DependencyObject to)
{
if (localValueEnumerator.Current.Property.ReadOnly ||
localValueEnumerator.Current.Value is FrameworkElement) continue;

if (!(localValueEnumerator.Current.Value is BindingExpressionBase))
to.SetCurrentValue(localValueEnumerator.Current.Property, localValueEnumerator.Current.Value);
}
to.SetCurrentValue(localValueEnumerator.Current.Property, localValueEnumerator.Current.Value);
}
}
}
}
4 changes: 2 additions & 2 deletions Dragablz/DefaultInterTabClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Dragablz
{
public class DefaultInterTabClient : IInterTabClient
{
{
public virtual INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source)
{
if (source == null) throw new ArgumentNullException("source");
Expand All @@ -23,7 +23,7 @@ public virtual INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, ob
if (newTabablzControl.ItemsSource == null)
newTabablzControl.Items.Clear();

return new NewTabHost<Window>(newWindow, newTabablzControl);
return new NewTabHost<Window>(newWindow, newTabablzControl);
}

public virtual TabEmptiedResponse TabEmptiedHandler(TabablzControl tabControl, Window window)
Expand Down
2 changes: 1 addition & 1 deletion Dragablz/Dockablz/Branch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public GridLength SecondItemLength
{
get { return (GridLength) GetValue(SecondItemLengthProperty); }
set { SetValue(SecondItemLengthProperty, value); }
}
}

/// <summary>
/// Gets the proportional size of the first item, between 0 and 1, where 1 would represent the entire size of the branch.
Expand Down
10 changes: 5 additions & 5 deletions Dragablz/Dockablz/BranchAccessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Dragablz.Core;

namespace Dragablz.Dockablz
{
{
public class BranchAccessor
{
private readonly Branch _branch;
Expand All @@ -28,7 +28,7 @@ public BranchAccessor(Branch branch)
else
_firstItemTabablzControl = FindTabablzControl(branch.FirstItem, branch.FirstContentPresenter);

var secondChildBranch = branch.SecondItem as Branch;
var secondChildBranch = branch.SecondItem as Branch;
if (secondChildBranch != null)
_secondItemBranchAccessor = new BranchAccessor(secondChildBranch);
else
Expand Down Expand Up @@ -68,7 +68,7 @@ public TabablzControl SecondItemTabablzControl

/// <summary>
/// Visits the content of the first or second side of a branch, according to its content type. No more than one of the provided <see cref="Action"/>
/// callbacks will be called.
/// callbacks will be called.
/// </summary>
/// <param name="childItem"></param>
/// <param name="childBranchVisitor"></param>
Expand Down Expand Up @@ -107,7 +107,7 @@ public BranchAccessor Visit(BranchItem childItem,
childBranchVisitor(branchDescription);
return this;
}

var tabablzControl = tabGetter();
if (tabablzControl != null)
{
Expand All @@ -125,5 +125,5 @@ public BranchAccessor Visit(BranchItem childItem,

return this;
}
}
}
}
2 changes: 1 addition & 1 deletion Dragablz/Dockablz/BranchResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public BranchResult(Branch branch, TabablzControl tabablzControl)
{
if (branch == null) throw new ArgumentNullException("branch");
if (tabablzControl == null) throw new ArgumentNullException("tabablzControl");

_branch = branch;
_tabablzControl = tabablzControl;
}
Expand Down
2 changes: 1 addition & 1 deletion Dragablz/Dockablz/DropZone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class DropZone : Control
{
static DropZone()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(DropZone), new FrameworkPropertyMetadata(typeof(DropZone)));
DefaultStyleKeyProperty.OverrideMetadata(typeof(DropZone), new FrameworkPropertyMetadata(typeof(DropZone)));
}

public static readonly DependencyProperty LocationProperty = DependencyProperty.Register(
Expand Down
4 changes: 2 additions & 2 deletions Dragablz/Dockablz/DropZoneLocation.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace Dragablz.Dockablz
{
public enum DropZoneLocation
{
{
Top,
Right,
Bottom,
Left,
Left,
Floating
}
}
Loading