init
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using DTS.Common.Base;
|
||||
using Prism.Events;
|
||||
|
||||
namespace DTS.Common.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// The BusyIndicator changed event.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The Busy Indicator changed event is used to ...
|
||||
/// </remarks>
|
||||
public class BusyIndicatorChangeNotification : PubSubEvent<bool> { }
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace DTS.Common.RibbonControl
|
||||
{
|
||||
public class CheckBoxData : ControlData
|
||||
{
|
||||
public bool IsChecked
|
||||
{
|
||||
get => _isChecked;
|
||||
|
||||
set
|
||||
{
|
||||
if (_isChecked == value) return;
|
||||
_isChecked = value;
|
||||
OnPropertyChanged(new PropertyChangedEventArgs("IsChecked"));
|
||||
}
|
||||
}
|
||||
private bool _isChecked;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using Prism.Events;
|
||||
namespace DTS.Common.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// The ShowStatus event.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>This event is used by the services to display the current status.</remarks>
|
||||
///
|
||||
public class ShowStatus : PubSubEvent<StatusInfo>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The StatusInfo is used by <see cref="ShowStatus">ShowStatus</see> event to display the current status.
|
||||
/// </summary>
|
||||
public class StatusInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// the current state of a process
|
||||
/// </summary>
|
||||
public enum StatusState
|
||||
{
|
||||
Idle, //Ready state, no longer doing anything
|
||||
Busy, //busy, currently doing something
|
||||
DoneNoError, //no longer working, done, no errors
|
||||
DoneFailed //no longer working, did not complete process
|
||||
}
|
||||
|
||||
public StatusState CurrentState
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this object is busy.
|
||||
/// </summary>
|
||||
public bool IsBusy => CurrentState == StatusState.Busy;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IsOk flag.
|
||||
/// </summary>
|
||||
public bool IsOk
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the progress bar percentage.
|
||||
/// </summary>
|
||||
public decimal Percentage
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the status information.
|
||||
/// </summary>
|
||||
public string Text
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the id of the process.
|
||||
/// </summary>
|
||||
public int ProcessId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// creates a new status info, sets the text to the default for the state
|
||||
/// note that consumers are free not to use the Text Property of the Status Info,
|
||||
/// but we set it anyhow.
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <param name="percentage"></param>
|
||||
/// <param name="processId"></param>
|
||||
/// <param name="text"></param>
|
||||
/// <param name="isOk"></param>
|
||||
public StatusInfo(StatusState state, string text = null, decimal percentage = -1, int processId = -1, bool isOk = true)
|
||||
{
|
||||
CurrentState = state;
|
||||
IsOk = isOk;
|
||||
Percentage = percentage;
|
||||
Text = text;
|
||||
ProcessId = processId;
|
||||
if (null == text)
|
||||
{
|
||||
Text = Strings.Strings.ResourceManager.GetString("StatusState_" + state) ?? state.ToString();
|
||||
}
|
||||
}
|
||||
public void Unsubscribe(ShowStatus showStatus)
|
||||
{
|
||||
Text = String.Empty;
|
||||
CurrentState = StatusState.Idle;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user