init
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using DTS.Common.Base;
|
||||
using Prism.Regions;
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
namespace DTS.Common
|
||||
{
|
||||
public interface IDTSViewRegionManager : IRegionManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds View to the Main Region.
|
||||
/// </summary>
|
||||
/// <param name="viewDefinition">The View definition.</param>
|
||||
/// <param name="parameter">The parameter which uses to initialize the View.</param>
|
||||
void AddView(ViewDefinition viewDefinition, object parameter);
|
||||
|
||||
/// <summary>
|
||||
/// Adds View to the Main Region.
|
||||
/// </summary>
|
||||
/// <param name="viewDefinition">The View definition.</param>
|
||||
/// <param name="parameter">The parameter which uses to initialize the View.</param>
|
||||
/// <param name="allowMultipleInstances">A value indicating whether to allow to create the multiple views.</param>
|
||||
void AddView(ViewDefinition viewDefinition, object parameter, bool allowMultipleInstances);
|
||||
|
||||
/// <summary>
|
||||
/// Adds View to the Main Region asynchronously.
|
||||
/// </summary>
|
||||
/// <param name="viewDefinition">The View definition.</param>
|
||||
/// <param name="parameter">The parameter which uses to initialize the service.</param>
|
||||
Task AddViewAsync(ViewDefinition viewDefinition, object parameter);
|
||||
|
||||
/// <summary>
|
||||
/// Adds View to the Main Region asynchronously.
|
||||
/// </summary>
|
||||
/// <param name="viewDefinition">The View definition.</param>
|
||||
/// <param name="parameter">The parameter which uses to initialize the View.</param>
|
||||
/// <param name="allowMultipleInstances">A value indicating whether to allow to create the multiple views.</param>
|
||||
Task AddViewAsync(ViewDefinition viewDefinition, object parameter, bool allowMultipleInstances);
|
||||
|
||||
/// <summary>
|
||||
/// Removes View from the Main Region.
|
||||
/// </summary>
|
||||
/// <param name="viewModel">The View-model.</param>
|
||||
void RemoveView(IBaseViewModel viewModel);
|
||||
|
||||
/// <summary>
|
||||
/// Removes View from the specified region by name
|
||||
/// </summary>
|
||||
/// <param name="regionName"></param>
|
||||
void RemoveViewByRegionName(string regionName);
|
||||
|
||||
/// <summary>
|
||||
/// Reloads data for the specified View.
|
||||
/// </summary>
|
||||
/// <param name="interfaceForView">Type of the View's interface.</param>
|
||||
/// <param name="parameter">The parameter which uses to initialize the View.</param>
|
||||
void RefreshView(Type interfaceForView, object parameter);
|
||||
|
||||
/// <summary>
|
||||
/// Reloads data for the specified View asynchronously.
|
||||
/// </summary>
|
||||
/// <param name="interfaceForView">Type of the View's interface.</param>
|
||||
/// <param name="parameter">The parameter which uses to initialize the View.</param>
|
||||
Task RefreshViewAsync(Type interfaceForView, object parameter);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
using System.Windows;
|
||||
using Prism.Events;
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
namespace DTS.Common.Events
|
||||
{
|
||||
public class ViewerSettingsVisibilityChangedEvent : PubSubEvent<Visibility> { }
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using DTS.Common.Enums.GroupTemplates;
|
||||
|
||||
namespace DTS.Common.Interface.GroupTemplate
|
||||
{
|
||||
public interface IGroupTemplateChannel
|
||||
{
|
||||
bool Custom { get; }
|
||||
int DisplayOrder { get; set; }
|
||||
string NameOfTheChannel { get; set; }
|
||||
string Name { get; }
|
||||
bool Required { get; set; }
|
||||
bool Filter(string term);
|
||||
string ISOCode { get; }
|
||||
}
|
||||
|
||||
public class GroupTemplateChannelComparer : IComparer<IGroupTemplateChannel>
|
||||
{
|
||||
public GroupTemplateChannelFields SortField { get; set; }
|
||||
public bool Ascending { get; set; }
|
||||
public int Compare(IGroupTemplateChannel x, IGroupTemplateChannel y)
|
||||
{
|
||||
if (x == y)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (null == x)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (null == y)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
var left = x;
|
||||
var right = y;
|
||||
if (!Ascending) { left = y; right = x; }
|
||||
switch (SortField)
|
||||
{
|
||||
case GroupTemplateChannelFields.Required:
|
||||
return left.Required.CompareTo(right.Required);
|
||||
case GroupTemplateChannelFields.Name:
|
||||
return String.Compare(left.Name, right.Name, StringComparison.Ordinal);
|
||||
case GroupTemplateChannelFields.ISOCode:
|
||||
return String.Compare(left.ISOCode, right.ISOCode, StringComparison.Ordinal);
|
||||
case GroupTemplateChannelFields.Custom:
|
||||
return left.Custom.CompareTo(right.Custom);
|
||||
case GroupTemplateChannelFields.DisplayOrder:
|
||||
return left.DisplayOrder.CompareTo(right.DisplayOrder);
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Prism.Events;
|
||||
|
||||
namespace DTS.Common.Events.Diagnostics
|
||||
{
|
||||
public class CheckDataToDownloadEvent : PubSubEvent<CheckDataToDownloadEventArgs>
|
||||
{
|
||||
}
|
||||
|
||||
public class CheckDataToDownloadEventArgs
|
||||
{
|
||||
public bool BypassCheck { get; private set; }
|
||||
|
||||
public object Producer { get; private set; }
|
||||
public CheckDataToDownloadEventArgs(bool bypassCheck, object o)
|
||||
{
|
||||
BypassCheck = bypassCheck;
|
||||
Producer = o;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 537 B |
@@ -0,0 +1,10 @@
|
||||
// ReSharper disable CheckNamespace
|
||||
namespace DTS.Common.Base
|
||||
{
|
||||
public interface IViewModel
|
||||
{
|
||||
// Summary:
|
||||
// Gets or sets the Model property of the viewmodel object.
|
||||
object Model { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user