Skip to content

Commit

Permalink
Added missing project
Browse files Browse the repository at this point in the history
  • Loading branch information
spaghettidba committed Jul 27, 2017
1 parent 77b9d2b commit f4be68b
Show file tree
Hide file tree
Showing 13 changed files with 1,355 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bin/
obj/
packages/
Binary file added ExtendedTSQLCollector/UpgradeLog.htm
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace Andora.UserControlLibrary.Converters
{
[ValueConversion(typeof(DateTime), typeof(double))]
public class DateTimeDoubleConverter : IValueConverter
{
/// <summary>
/// Converts a DateTime Value to a Double Value using the Ticks of the DateTime instance.
/// </summary>
/// <param name="value">Instance of the DateTime class.</param>
/// <param name="targetType">Target Type, which should be a Double.</param>
/// <param name="parameter">Parameter used in the conversion.</param>
/// <param name="culture">Globalization culture instance.</param>
/// <returns></returns>
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
DateTime dt = DateTime.Parse(value.ToString());
return dt.Ticks;
}

/// <summary>
/// Converts a Double Value to a DateTime Value assuming the Double represents the amount of Ticks for a DateTime instance.
/// </summary>
/// <param name="value">Instance of the Double Class.</param>
/// <param name="targetType">Target Type, which should be a DateTime</param>
/// <param name="parameter">Parameter used in the conversion.</param>
/// <param name="culture">Globalization culture instance.</param>
/// <returns></returns>
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
double d = double.Parse(value.ToString());
return new DateTime((long)d);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace Andora.UserControlLibrary.Converters
{
[ValueConversion(typeof(TimeSpan), typeof(double))]
public class TimeSpanToDoubleConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
TimeSpan givenValue = (TimeSpan)value;
return givenValue.Ticks;
}

public object ConvertBack(object value, Type targetType,
object parameter, System.Globalization.CultureInfo culture)
{
return new TimeSpan(((long)value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<UserControl x:Class="Andora.UserControlLibrary.DateRangeSlider"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Andora.UserControlLibrary"
xmlns:converters="clr-namespace:Andora.UserControlLibrary.Converters"
x:Name="root">
<!--
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
Sample Usage:
<userControls:DateRangeSlider x:Name="dateRangeSlider1"
LowerValue="02/01/2011 8:00 AM"
UpperValue="10/31/2011 8:30 PM"
Minimum="01/01/2011 12:00 AM"
Maximum="12/31/2011 11:59:59 PM"
Grid.ColumnSpan="2" Grid.Column="0"
Grid.Row="0"
IsUpperSliderEnabled="{Binding ElementName=chkDisableUpperSlider, Path=IsChecked, Converter={StaticResource ResourceKey=negationConverter}, Mode=TwoWay}"
IsLowerSliderEnabled="{Binding ElementName=chkDisableLowerSlider, Path=IsChecked, Converter={StaticResource ResourceKey=negationConverter}, Mode=TwoWay}"
IsUpperValueLockedToMax="{Binding ElementName=chkLockUpperSliderToMax, Path=IsChecked, Mode=TwoWay}"
IsLowerValueLockedToMin="{Binding ElementName=chkLockLowerSliderToMin, Path=IsChecked, Mode=TwoWay}"
SmallChange="0:0:30:0.000"
LargeChange="0:1:0:0.000"/>
-->
<UserControl.Resources>
<ResourceDictionary>
<converters:DateTimeDoubleConverter x:Key="dtdConverter" />
<converters:TimeSpanToDoubleConverter x:Key="timespanToDoubleConverter" />

<ControlTemplate x:Key="simpleSlider" TargetType="{x:Type Slider}">
<Border SnapsToDevicePixels="true" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<Rectangle x:Name="PART_SelectionRange"/>

<Track x:Name="PART_Track" Grid.Row="1">
<Track.Thumb>
<Thumb x:Name="Thumb" Style="{StaticResource ResourceKey=HorizontalSliderThumbStyle}" />
</Track.Thumb>
</Track>
</Grid>
</Border>
</ControlTemplate>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="SliderResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid VerticalAlignment="Center" Background="Transparent">
<Border BorderThickness="0,1,0,0" BorderBrush="DarkGray" VerticalAlignment="Bottom" Height="1" HorizontalAlignment="Stretch"
Margin="0,0,0,10"/>

<Slider x:Name="LowerSlider" VerticalAlignment="Top" IsEnabled="{Binding ElementName=root, Path=IsLowerSliderEnabled, Mode=TwoWay}"
Minimum="{Binding ElementName=root, Path=Minimum, Converter={StaticResource ResourceKey=dtdConverter}}"
Maximum="{Binding ElementName=root, Path=Maximum, Converter={StaticResource ResourceKey=dtdConverter}}"
Value="{Binding ElementName=root, Path=LowerValue, Mode=OneWay, Converter={StaticResource ResourceKey=dtdConverter}}"
Template="{StaticResource simpleSlider}"
Margin="0,0,10,0"
SmallChange="{Binding ElementName=root, Path=SmallChange, Converter={StaticResource ResourceKey=timespanToDoubleConverter}}"
LargeChange="{Binding ElementName=root, Path=LargeChange, Converter={StaticResource ResourceKey=timespanToDoubleConverter}}"
/>

<Slider x:Name="UpperSlider" IsEnabled="{Binding ElementName=root, Path=IsUpperSliderEnabled, Mode=TwoWay}"
Minimum="{Binding ElementName=root, Path=Minimum, Converter={StaticResource ResourceKey=dtdConverter}}"
Maximum="{Binding ElementName=root, Path=Maximum, Converter={StaticResource ResourceKey=dtdConverter}}"
Value="{Binding ElementName=root, Path=UpperValue, Mode=OneWay, Converter={StaticResource ResourceKey=dtdConverter}}"
Template="{StaticResource simpleSlider}"
Margin="10,0,0,0"
SmallChange="{Binding ElementName=root, Path=SmallChange, Converter={StaticResource ResourceKey=timespanToDoubleConverter}}"
LargeChange="{Binding ElementName=root, Path=LargeChange, Converter={StaticResource ResourceKey=timespanToDoubleConverter}}"
/>
</Grid>
</UserControl>
Loading

0 comments on commit f4be68b

Please sign in to comment.