Permalink
Browse files

Updated to v5.1

  • Loading branch information...
Jaben committed Dec 6, 2017
1 parent 1d65709 commit 920f68ab90fbc4596b3d4a9f7f09d92e84fb8e94
Showing with 66 additions and 36 deletions.
  1. +17 −1 appveyor.yml
  2. +49 −35 src/Papercut.UI/ViewModels/MainViewModel.cs
View
@@ -1,9 +1,25 @@
os: Visual Studio 2017
version: 5.0.{build}
version: 5.1.{build}
configuration: Release
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: '{version}'
assembly_file_version: '{version}'
assembly_informational_version: '{version}'
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: '{version}'
package_version: '{version}'
assembly_version: '{version}'
file_version: '{version}'
informational_version: '{version}'
before_build:
- nuget restore
@@ -15,6 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
namespace Papercut.ViewModels
{
using System;
@@ -105,7 +106,10 @@ public class MainViewModel : Conductor<object>,
public string LogText
{
get { return _logText; }
get
{
return _logText;
}
set
{
_logText = value;
@@ -115,7 +119,10 @@ public string LogText
public bool IsDeactivated
{
get { return _isDeactivated; }
get
{
return _isDeactivated;
}
set
{
_isDeactivated = value;
@@ -125,7 +132,10 @@ public bool IsDeactivated
public string WindowTitle
{
get { return _windowTitle; }
get
{
return _windowTitle;
}
set
{
_windowTitle = value;
@@ -137,7 +147,10 @@ public string WindowTitle
public bool IsLogOpen
{
get { return _isLogOpen; }
get
{
return _isLogOpen;
}
set
{
_isLogOpen = value;
@@ -222,13 +235,13 @@ void SetupObservables()
.ObserveOnDispatcher()
.Subscribe(
m =>
MessageDetailViewModel.LoadMessageEntry(MessageListViewModel.SelectedMessage));
MessageDetailViewModel.LoadMessageEntry(MessageListViewModel.SelectedMessage));
Observable.FromEventPattern<EventHandler, EventArgs>(
h => new EventHandler(h),
h => _logClientSinkQueue.LogEvent += h,
h => _logClientSinkQueue.LogEvent -= h,
TaskPoolScheduler.Default)
h => new EventHandler(h),
h => _logClientSinkQueue.LogEvent += h,
h => _logClientSinkQueue.LogEvent -= h,
TaskPoolScheduler.Default)
.Buffer(TimeSpan.FromSeconds(1))
.Select(
s =>
@@ -249,11 +262,12 @@ void SetupObservables()
this.GetPropertyValues(m => m.IsLogOpen)
.ObserveOnDispatcher()
.Subscribe(m =>
{
MessageListViewModel.IsLoading = m;
MessageDetailViewModel.IsLoading = m;
});
.Subscribe(
m =>
{
MessageListViewModel.IsLoading = m;
MessageDetailViewModel.IsLoading = m;
});
}
public void GoToSite()
@@ -276,7 +290,7 @@ public void ToggleLog()
public void ShowOptions()
{
if (IsLogOpen) IsLogOpen = false;
_viewModelWindowManager.ShowDialogWithViewModel<OptionsViewModel>();
}
@@ -298,30 +312,30 @@ public void ForwardSelected()
_window.ShowProgressAsync("Forwarding Email...", "Please wait");
Observable.Start(
() =>
{
ProgressDialogController progressDialog = progressController.Result;
() =>
{
ProgressDialogController progressDialog = progressController.Result;
progressDialog.SetCancelable(false);
progressDialog.SetIndeterminate();
progressDialog.SetCancelable(false);
progressDialog.SetIndeterminate();
var forwardRule = new ForwardRule
{
SmtpServer = forwardViewModel.Server,
FromEmail = forwardViewModel.From,
ToEmail = forwardViewModel.To
};
var forwardRule = new ForwardRule
{
SmtpServer = forwardViewModel.Server,
FromEmail = forwardViewModel.From,
ToEmail = forwardViewModel.To
};
// send message using relay dispatcher...
_forwardRuleDispatch.Dispatch(
forwardRule,
MessageListViewModel.SelectedMessage);
// send message using relay dispatcher...
_forwardRuleDispatch.Dispatch(
forwardRule,
MessageListViewModel.SelectedMessage);
progressDialog.CloseAsync().Wait();
progressDialog.CloseAsync().Wait();
return true;
},
TaskPoolScheduler.Default)
return true;
},
TaskPoolScheduler.Default)
.ObserveOnDispatcher()
.Subscribe(b => { MessageDetailViewModel.IsLoading = false; });
}
@@ -375,4 +389,4 @@ protected override void OnViewAttached(object view, object context)
}
}
}
}
}

0 comments on commit 920f68a

Please sign in to comment.