[WP] Refactoring so its in common to C#
This commit is contained in:
parent
8f27deca87
commit
c793466e5e
@ -31,7 +31,7 @@ namespace svnsync.Helpers
|
||||
public SvnLockedException(String message) : base(message) { }
|
||||
public SvnLockedException(String message, System.Exception inner) : base(message, inner) { }
|
||||
protected SvnLockedException(System.Runtime.Serialization.SerializationInfo info,
|
||||
System.Runtime.Serialization.StreamingContext context)
|
||||
System.Runtime.Serialization.StreamingContext context) : base(info, context)
|
||||
{ }
|
||||
}
|
||||
public class TreePart {
|
||||
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace svnsync.Libraries {
|
||||
class Svn {
|
||||
class Svn : IDisposable {
|
||||
private String dir;
|
||||
private Process p = new Process();
|
||||
private List<String> modified;
|
||||
@ -202,5 +202,16 @@ namespace svnsync.Libraries {
|
||||
internal void ClearError() {
|
||||
this.SvnError = "";
|
||||
}
|
||||
|
||||
protected virtual void Dispose(Boolean disposing) {
|
||||
if (disposing) {
|
||||
this.p.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,11 +65,12 @@ namespace svnsync
|
||||
}
|
||||
|
||||
private static void Update() {
|
||||
Updater.Instance.SetPath("https://svn.blubbfish.net:18082/");
|
||||
Updater.Instance.UpdateResult += Instance_UpdateResult;
|
||||
Updater.Instance.SetPath("https://svn.blubbfish.net:18082/", new String[] { typeof(Program).Assembly.GetName().Version.ToString(), typeof(Updater).Assembly.GetName().Version.ToString() });
|
||||
Updater.Instance.UpdateResult += HasUpdate;
|
||||
Updater.Instance.Check();
|
||||
}
|
||||
|
||||
private static void Instance_UpdateResult(Object sender, Updater.UpdaterEventArgs e) {
|
||||
private static void HasUpdate(Object sender, Updater.UpdaterEventArgs e) {
|
||||
if(e.HasUpdates) {
|
||||
((Updater)sender).Update("SvnSync.exe", "https://");
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace svnsync.Views
|
||||
/// View of a Tray
|
||||
/// </summary>
|
||||
public ViewsTray() {
|
||||
this.Init();
|
||||
|
||||
this.Model = ModelsTray.Instance;
|
||||
this.Model.SetObserver(this);
|
||||
}
|
||||
|
@ -9,11 +9,6 @@ namespace svnsync.Views
|
||||
{
|
||||
private IViewsWindowFormInterface form;
|
||||
public ModelsWindow Model { get; private set; }
|
||||
|
||||
public ViewsWindow()
|
||||
{
|
||||
this.Init();
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
|
@ -41,11 +41,8 @@ namespace svnsync.Views {
|
||||
this.model = window;
|
||||
}
|
||||
new public void Dispose() {
|
||||
this.BeginInvoke((Action)(() => {
|
||||
this.Visible = false;
|
||||
this.ShowInTaskbar = false;
|
||||
}));
|
||||
base.Dispose(true);
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,11 +46,8 @@ namespace svnsync.Views {
|
||||
this.model = window;
|
||||
}
|
||||
new public void Dispose() {
|
||||
this.BeginInvoke((Action)(() => {
|
||||
this.Visible = false;
|
||||
this.ShowInTaskbar = false;
|
||||
}));
|
||||
base.Dispose(true);
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user