Arreglos ventana marchando una de
parent
e6be0f2aa4
commit
bac4c6abf0
|
|
@ -90,6 +90,7 @@ namespace OliviaAddInPro.Helper
|
||||||
public MyCancelableProgressorSource(IprocessManager prodlg)
|
public MyCancelableProgressorSource(IprocessManager prodlg)
|
||||||
{
|
{
|
||||||
_ProgrSrc = prodlg;
|
_ProgrSrc = prodlg;
|
||||||
|
_ProgrSrc.Inicia();
|
||||||
}
|
}
|
||||||
public void Init(string stat)
|
public void Init(string stat)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,5 +14,6 @@ namespace OliviaAddInPro.Model.contract
|
||||||
double GetProgress();
|
double GetProgress();
|
||||||
bool Getcancelled();
|
bool Getcancelled();
|
||||||
void Setcancelled();
|
void Setcancelled();
|
||||||
|
void Inicia();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace OliviaAddInPro.Services
|
||||||
{
|
{
|
||||||
public void finEjecuta(Respuesta<TiposEjecucion> res)
|
public void finEjecuta(Respuesta<TiposEjecucion> res)
|
||||||
{
|
{
|
||||||
OliviaGlob.progrDialog.Hide();
|
|
||||||
String msg=string.Empty;
|
String msg=string.Empty;
|
||||||
//gestiona los flags, el estado de finok o finnok va en res.Vale
|
//gestiona los flags, el estado de finok o finnok va en res.Vale
|
||||||
if (res.HasError)
|
if (res.HasError)
|
||||||
|
|
@ -41,8 +41,9 @@ namespace OliviaAddInPro.Services
|
||||||
|
|
||||||
public void finEjecuta2()
|
public void finEjecuta2()
|
||||||
{
|
{
|
||||||
//muestra la ventana
|
OliviaGlob.progrDialog.Hide();
|
||||||
OliviaGlob.ShowHidePane(true);
|
//muestra la ventana
|
||||||
|
OliviaGlob.ShowHidePane(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//se le llama cuando ha terminado el proceso de ejecución en Olivia Tasks
|
//se le llama cuando ha terminado el proceso de ejecución en Olivia Tasks
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ namespace OliviaAddInPro.Services
|
||||||
bool fin = false;
|
bool fin = false;
|
||||||
int lastprog = 0;
|
int lastprog = 0;
|
||||||
var res = new Respuesta<TiposEjecucion>() { Value = TiposEjecucion.FinEjecNOk };
|
var res = new Respuesta<TiposEjecucion>() { Value = TiposEjecucion.FinEjecNOk };
|
||||||
|
cps.SetProceso("Procesando Datos");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,14 @@
|
||||||
xmlns:ui="clr-namespace:OliviaAddInPro"
|
xmlns:ui="clr-namespace:OliviaAddInPro"
|
||||||
xmlns:local="clr-namespace:OliviaAddInPro"
|
xmlns:local="clr-namespace:OliviaAddInPro"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="MarchandoUnaDe" Height="165" Width="462"
|
Title="MarchandoUnaDe" Height="168" Width="481"
|
||||||
d:DataContext="{Binding Path=ui.MarchandoUnaDeViewModel}">
|
d:DataContext="{Binding Path=ui.MarchandoUnaDeViewModel}"
|
||||||
|
ResizeMode="NoResize">
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Label Content="{Binding TextProceso}" HorizontalAlignment="Left" Margin="76,24,0,0" VerticalAlignment="Top" Width="303" Height="26"/>
|
<Label Content="{Binding TextProceso}" HorizontalAlignment="Left" Margin="76,10,0,0" VerticalAlignment="Top" Width="303" Height="26"/>
|
||||||
<ProgressBar Minimum="0" Maximum="100" HorizontalAlignment="Left" Value="{Binding Progreso, UpdateSourceTrigger=PropertyChanged}" Height="20" Margin="76,66,0,0" VerticalAlignment="Top" Width="303"/>
|
<ProgressBar Minimum="0" Maximum="100" HorizontalAlignment="Left" Value="{Binding Progreso, UpdateSourceTrigger=PropertyChanged}" Height="20" Margin="76,40,0,0" VerticalAlignment="Top" Width="303"/>
|
||||||
<Label Content="{Binding TextEstado}" HorizontalAlignment="Left" Margin="95,91,0,0" VerticalAlignment="Top" Width="265" Height="28"/>
|
<Label Content="{Binding TextEstado}" HorizontalAlignment="Left" Margin="76,70,0,0" VerticalAlignment="Top" Width="303" Height="28"/>
|
||||||
|
<Button Content="Cancelar" HorizontalAlignment="Left" Margin="304,103,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
@ -23,6 +24,7 @@ namespace OliviaAddInPro
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = new MarchandoUnaDeViewModel();
|
DataContext = new MarchandoUnaDeViewModel();
|
||||||
|
//WindowStyle = WindowStyle.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MarchandoUnaDeViewModel GetViewModel()
|
public MarchandoUnaDeViewModel GetViewModel()
|
||||||
|
|
@ -31,5 +33,17 @@ namespace OliviaAddInPro
|
||||||
return m;
|
return m;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnClosing(CancelEventArgs e)
|
||||||
|
{
|
||||||
|
GetViewModel().Cancelado = true;
|
||||||
|
base.OnClosing(e);
|
||||||
|
e.Cancel = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
GetViewModel().CancelaOperacion();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
using OliviaAddInPro.Model.contract;
|
using OliviaAddInPro.Model.contract;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
@ -10,6 +11,11 @@ namespace OliviaAddInPro
|
||||||
{
|
{
|
||||||
public class MarchandoUnaDeViewModel : PropertyChangedBase, IprocessManager
|
public class MarchandoUnaDeViewModel : PropertyChangedBase, IprocessManager
|
||||||
{
|
{
|
||||||
|
public MarchandoUnaDeViewModel()
|
||||||
|
{
|
||||||
|
Cancelado = false;
|
||||||
|
}
|
||||||
|
public bool Cancelado { get; set; }
|
||||||
|
|
||||||
private string textProceso;
|
private string textProceso;
|
||||||
public string TextProceso
|
public string TextProceso
|
||||||
|
|
@ -36,7 +42,10 @@ namespace OliviaAddInPro
|
||||||
{
|
{
|
||||||
TextProceso = proceso;
|
TextProceso = proceso;
|
||||||
}
|
}
|
||||||
|
void IprocessManager.Inicia()
|
||||||
|
{
|
||||||
|
Cancelado = false;
|
||||||
|
}
|
||||||
void IprocessManager.SetEstado(string estado)
|
void IprocessManager.SetEstado(string estado)
|
||||||
{
|
{
|
||||||
TextEstado = estado;
|
TextEstado = estado;
|
||||||
|
|
@ -54,12 +63,18 @@ namespace OliviaAddInPro
|
||||||
|
|
||||||
bool IprocessManager.Getcancelled()
|
bool IprocessManager.Getcancelled()
|
||||||
{
|
{
|
||||||
return false;
|
return Cancelado;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IprocessManager.Setcancelled()
|
void IprocessManager.Setcancelled()
|
||||||
{
|
{
|
||||||
|
CancelaOperacion();
|
||||||
}
|
}
|
||||||
|
public void CancelaOperacion()
|
||||||
|
{
|
||||||
|
TextProceso = "Cancelando proceso";
|
||||||
|
Cancelado = true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue