/// <summary>
		/// Set Version Number of notfiere on frontend label.
		/// </summary>
		private void CheckServerVersions()
		{
			if (this.InvokeRequired)
			{
				DelegateCheckServerVersions inv = new DelegateCheckServerVersions(this.CheckServerVersions);
				this.Invoke(inv, new object[] { });
			}
			else
			{
				this.Cursor = Cursors.WaitCursor;
				
				bool sameVersion = true;

				IDictionary<string, string> result = CACHE.SharedCache.ServerNodeVersionSharedCache();
				string notifyVersion = new AssemblyInfo().Version;
				int number = 1;

				foreach (var item in CACHE.SharedCache.Servers)
				{
					if(result.ContainsKey(item))
					{
						string name = string.Format("{0}. Server Name: {1}; Shared Cache Version: {2}",
							number++,
							item,
							result[item]);

						this.LbServerNodes.Items.Add(new Common.ComboBoxItem(name, 0));

						if (!notifyVersion.Equals(result[item]))
						{
							sameVersion = false;
						}
					}
				}
				// sort all items
				this.LbServerNodes.Sorted = true;

				// only display OK / NOK in case we can connect to server
				if (result.Count > 0)
				{
					if (sameVersion)
					{
						this.pictureBox1.Image = new Bitmap(Resource.OK);
					}
					else
					{
						this.pictureBox1.Image = new Bitmap(Resource.NOK);
					}
					// 
					this.LblMessage.Text = string.Empty;
				}
				else
				{
					System.Drawing.Size s = new Size(50,50);
					this.pictureBox1.Image = new Bitmap(Resource.SanscastleDocLogo, s);
					this.LblMessage.Text = "Could not find any Server - check your 'notify config'!";
				}
				
				this.Cursor = Cursors.Default;
			}
		}
Example #2
0
        /// <summary>
        /// Set Version Number of notfiere on frontend label.
        /// </summary>
        private void CheckServerVersions()
        {
            if (this.InvokeRequired)
            {
                DelegateCheckServerVersions inv = new DelegateCheckServerVersions(this.CheckServerVersions);
                this.Invoke(inv, new object[] { });
            }
            else
            {
                this.Cursor = Cursors.WaitCursor;

                bool sameVersion = true;

                IDictionary <string, string> result = CACHE.SharedCache.ServerNodeVersionClr();
                string notifyVersion = Environment.Version.ToString();
                int    number        = 1;

                foreach (var item in CACHE.SharedCache.Servers)
                {
                    if (result.ContainsKey(item))
                    {
                        string name = string.Format("{0}. Server Name: {1}; Shared Cache Version: {2}",
                                                    number++,
                                                    item,
                                                    result[item]);

                        this.LbServerNodes.Items.Add(new Common.ComboBoxItem(name, 0));

                        if (!notifyVersion.Equals(result[item]))
                        {
                            sameVersion = false;
                        }
                    }
                }
                // sort all items
                this.LbServerNodes.Sorted = true;

                // only display OK / NOK in case we can connect to server
                if (result.Count > 0)
                {
                    if (sameVersion)
                    {
                        this.pictureBox1.Image = new Bitmap(Resource.OK);
                    }
                    else
                    {
                        this.pictureBox1.Image = new Bitmap(Resource.NOK);
                    }
                    //
                    this.LblMessage.Text = string.Empty;
                }
                else
                {
                    System.Drawing.Size s = new Size(50, 50);
                    this.pictureBox1.Image = new Bitmap(Resource.SanscastleDocLogo, s);
                    this.LblMessage.Text   = "Could not find any Server - check your 'notify config'!";
                }

                this.SetPossibleHashConfig(sameVersion);

                this.Cursor = Cursors.Default;
            }
        }