public void RaiseMoreInformation(DiscoveryArguments e)
 {
     if (MoreInformation != null)
     {
         MoreInformation(e);
     }
 }
        private void DiscoveryTimer_Tick(object sender, EventArgs e)
        {
            var a = new DiscoveryArguments();

            if (TimeToCheckForUnknownRecipients != null)
            {
                TimeToCheckForUnknownRecipients(a);
            }

            if (string.IsNullOrEmpty(a.Name))
            {
                return;
            }

            if (PreviousName != null)
            {
                if (PreviousName == a.Name)
                {
                    return;
                }
            }


            if (!ChangeDetector.Enabled)
            {
                PreviousName = a.Name;
                ChangeDetector.Start();
            }



            var NameFound = false;

            foreach (var k in a.Configuration)
            {
                if (k.Name == a.Name)
                {
                    NameFound = true;
                    break;
                }
            }
            if (NameFound)
            {
                return;
            }



            AskNameFromPeers(a);
        }
        public void GotMoreInformation(string Document)
        {
            var a = new DiscoveryArguments
            {
                Configuration = MyData.Parse(Document)
            };

            this.Sync.Queue.Enqueue(
                delegate
            {
                this.RaiseMoreInformation(a);
            }
                );
        }
		private void AskNameFromPeers(DiscoveryArguments a)
		{
			if (Searching != null)
				Searching();


			foreach (var k in a.Configuration)
			{
				this.Outgoing.SendCommand(k.Target,
					new asknames
					{

					},
					GotMoreInformation
				);
			}
		}
        private void AskNameFromPeers(DiscoveryArguments a)
        {
            if (Searching != null)
            {
                Searching();
            }


            foreach (var k in a.Configuration)
            {
                this.Outgoing.SendCommand(k.Target,
                                          new asknames
                {
                },
                                          GotMoreInformation
                                          );
            }
        }
		private void DiscoveryTimer_Tick(object sender, EventArgs e)
		{

			var a = new DiscoveryArguments();

			if (TimeToCheckForUnknownRecipients != null)
				TimeToCheckForUnknownRecipients(a);

			if (string.IsNullOrEmpty(a.Name))
				return;

			if (PreviousName != null)
				if (PreviousName == a.Name)
					return;


			if (!ChangeDetector.Enabled)
			{
				PreviousName = a.Name;
				ChangeDetector.Start();
			}



			var NameFound = false;
			foreach (var k in a.Configuration)
			{
				if (k.Name == a.Name)
				{
					NameFound = true;
					break;
				}

			}
			if (NameFound)
				return;



			AskNameFromPeers(a);
		}
		public void GotMoreInformation(string Document)
		{
			var a = new DiscoveryArguments
			{
				Configuration = MyData.Parse(Document)
			};

			this.Sync.Queue.Enqueue(
				delegate
				{
					this.RaiseMoreInformation(a);
				}
			);


		}
		public void RaiseMoreInformation(DiscoveryArguments e)
		{
			if (MoreInformation != null)
				MoreInformation(e);
		}