diff --git a/SparkleShare/SparkleIntro.cs b/SparkleShare/SparkleIntro.cs index bfdf350a..67662723 100644 --- a/SparkleShare/SparkleIntro.cs +++ b/SparkleShare/SparkleIntro.cs @@ -69,34 +69,37 @@ namespace SparkleShare { VBox layout_vertical = new VBox (false, 0); - Label introduction = new Label ("Welcome to SparkleShare!"); - introduction.UseMarkup = true; - introduction.Xalign = 0; + Label introduction = new Label ("Welcome to SparkleShare!") { + UseMarkup = true, + Xalign = 0 + }; Label information = new Label ("Before we can create a SparkleShare folder on this " + - "computer, we need a few bits of information from you."); - information.Xalign = 0; - information.Wrap = true; - + "computer, we need a few bits of information from you.") { + Xalign = 0, + Wrap = true + }; - Entry name_entry = new Entry (""); - Label name_label = new Label (_("Full Name:")); - UnixUserInfo unix_user_info = new UnixUserInfo (UnixEnvironment.UserName); - name_entry.Text = unix_user_info.RealName; - name_label.UseMarkup = true; - name_label.Xalign = 0; + Label name_label = new Label (_("Full Name:")) { + Text = unix_user_info.RealName, + UseMarkup = true, + Xalign = 0 + }; + Entry name_entry = new Entry (""); - Table table = new Table (6, 2, true); - table.RowSpacing = 6; + Table table = new Table (6, 2, true) { + RowSpacing = 6 + }; Entry email_entry = new Entry (""); - Label email_label = new Label (_("Email:")); - email_label.UseMarkup = true; - email_label.Xalign = 0; + Label email_label = new Label (_("Email:")) { + UseMarkup = true, + Xalign = 0 + }; Entry server_entry = new Entry ("ssh://gitorious.org/sparkleshare"); Label server_label = new Label (_("Folder Address:")); diff --git a/SparkleShare/SparkleRepo.cs b/SparkleShare/SparkleRepo.cs index 701b493b..b4598e3c 100644 --- a/SparkleShare/SparkleRepo.cs +++ b/SparkleShare/SparkleRepo.cs @@ -45,6 +45,11 @@ namespace SparkleShare { public string UserEmail; public string UserName; + + public delegate void AddedEventHandler (object o, SparkleEventArgs args); + public event AddedEventHandler Added; + + public static string _ (string s) { return Catalog.GetString (s); @@ -311,6 +316,10 @@ namespace SparkleShare { // SparkleUI.NotificationIcon.SetSyncingState (); // SparkleUI.NotificationIcon.SetIdleState (); + SparkleEventArgs args = new SparkleEventArgs ("add test"); + if (Added != null) + Added (this, args); + } @@ -637,4 +646,15 @@ namespace SparkleShare { } + + + + + + + } + + + + diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index 3293cfa5..f17d6434 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -24,13 +24,12 @@ using System.IO; namespace SparkleShare { - public class SparkleUI - { + public class SparkleUI { private Process Process; // Short alias for the translations - public static string _ (string s) + public static string _(string s) { return Catalog.GetString (s); } @@ -217,6 +216,10 @@ namespace SparkleShare { } + public void Test (object o, SparkleEventArgs args) { + Console.WriteLine ("AAAAAAAAAAAAAAAAAA"); + } + public void UpdateRepositories () { @@ -251,11 +254,31 @@ namespace SparkleShare { } + SparkleRepo a = TmpRepos [0]; + a.Added += new SparkleRepo.AddedEventHandler (Test); + + SparkleShare.Repositories = new SparkleRepo [FolderCount]; Array.Copy (TmpRepos, SparkleShare.Repositories, FolderCount); - } } +} + public class SparkleEventArgs : System.EventArgs { + + private string message; + + + public SparkleEventArgs (string s) + { + this.message = s; + } + + public string Message () + { + return message; + } + +} }