QualisysExtensions 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package QualisysExtensions --version 1.0.0
NuGet\Install-Package QualisysExtensions -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="QualisysExtensions" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add QualisysExtensions --version 1.0.0
#r "nuget: QualisysExtensions, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install QualisysExtensions as a Cake Addin
#addin nuget:?package=QualisysExtensions&version=1.0.0

// Install QualisysExtensions as a Cake Tool
#tool nuget:?package=QualisysExtensions&version=1.0.0

Qualisys Extensions

Nuget installation:
Install-Package QualisysExtensions -Version 1.0.0
Basic use:
using QualisysExtensions.Controls;
using QualisysExtensions.Date;

public partial class frmLogViewer : Form
{
    public enum DateFilterEnum : int
    {
        [DescriptionAttribute("Hoy")]
        TODAY = 1,
        [DescriptionAttribute("Esta semana")]
        CURRENT_WEEK = 2,
        [DescriptionAttribute("Este mes")]
        CURRENT_MONTH = 3,
        [DescriptionAttribute("Este año")]
        CURRENT_YEAR = 4,
        [DescriptionAttribute("Última semana")]
        LAST_WEEK = 5,
        [DescriptionAttribute("Último mes")]
        LAST_MONTH = 6,
        [DescriptionAttribute("Último año")]
        LAST_YEAR = 7,
        [DescriptionAttribute("Rango")]
        RANGE = 8,
    }

    public frmLogViewer()
    {
        //Load combo from an enum
        cboDateFilter.LoadDataSource(ComboBoxExtension.GetComboItemListFromEnum<DateFilterEnum>("Seleccione"));
        cboDateFilter.SelectedIndex = 1;
    }

    private void ChangeDateFilter(ComboBox pObjComboBox)
    {
        dtmDateFrom.Enabled = false;
        dtmDateTo.Enabled = false;
        dtmDateFrom.Value = DateTime.Today;
        dtmDateTo.Value = DateTime.Today;

        if (pObjComboBox.SelectedIndex > 0)
        {
            switch ((DateFilterEnum)pObjComboBox.SelectedValue)
            {
                case DateFilterEnum.CURRENT_WEEK:
                    dtmDateFrom.Value = DateTime.Today.StartOfWeek(DayOfWeek.Monday);
                    dtmDateTo.Value = dtmDateFrom.Value.AddDays(6);
                    break;
                case DateFilterEnum.CURRENT_MONTH:
                    dtmDateFrom.Value = new DateTime(dtmDateFrom.Value.Year, dtmDateFrom.Value.Month, 1);
                    dtmDateTo.Value = dtmDateFrom.Value.AddMonths(1).AddDays(-1);
                    break;
                case DateFilterEnum.CURRENT_YEAR:
                    dtmDateFrom.Value = new DateTime(dtmDateFrom.Value.Year, 1, 1);
                    dtmDateTo.Value = dtmDateFrom.Value.AddYears(1).AddDays(-1);
                    break;
                case DateFilterEnum.LAST_WEEK:
                    dtmDateFrom.Value = DateTime.Today.AddDays(-(int)DateTime.Today.DayOfWeek - 6);
                    dtmDateTo.Value = dtmDateFrom.Value.AddDays(6);
                    break;
                case DateFilterEnum.LAST_MONTH:
                    dtmDateFrom.Value = DateTime.Today.AddMonths(-1);
                    dtmDateFrom.Value = new DateTime(dtmDateFrom.Value.Year, dtmDateFrom.Value.Month, 1);
                    dtmDateTo.Value = dtmDateFrom.Value.AddMonths(1).AddDays(-1);
                    break;
                case DateFilterEnum.LAST_YEAR:
                    dtmDateFrom.Value = DateTime.Today.AddYears(-1);
                    dtmDateFrom.Value = new DateTime(dtmDateFrom.Value.Year, 1, 1);
                    dtmDateTo.Value = dtmDateFrom.Value.AddYears(1).AddDays(-1);
                    break;
                case DateFilterEnum.RANGE:
                    dtmDateFrom.Enabled = true;
                    dtmDateTo.Enabled = true;
                    break;
            }
        }
    }
}

See code on GitHub

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 959 5/3/2018
1.0.1 828 4/12/2018
1.0.0 1,077 4/12/2018

Extensiones para combo box, base de datos, fecha, enum, object y string.