Exemplo n.º 1
0
        private void CreateInvalidVenue(VenueList venues, VenueService.Venue v)
        {
            eventLog.WriteEntry(string.Format("Invalid venue: {0}", v.Name),
                                EventLogEntryType.Warning, ConferenceEventLog.ID.Error);

            venues.Add(new ConferenceXP.Venue(v.Name, new IPEndPoint(IPAddress.Any, 0),
                                              VenueType.Invalid, Utilities.ByteToBitmap(v.Icon)));
        }
Exemplo n.º 2
0
        public object Clone()
        {
            VenueList venueListNew = new VenueList();

            foreach (Venue v in arrayList)
            {
                venueListNew.Add(v);
            }
            return(venueListNew);
        }
Exemplo n.º 3
0
        private void RefreshVenues()
        {
            venues = new VenueList();

            VenueService.Venue[] wsVenues = null;

            bool versionGood = false;

            try
            {
                string error          = null;
                string entryAssemFile = System.Reflection.Assembly.GetExecutingAssembly().Location;
                string fileVersion    = System.Diagnostics.FileVersionInfo.GetVersionInfo(entryAssemFile).ProductVersion;
                versionGood = service.CheckAssemblyVersion(fileVersion, out error);

                if (!versionGood)
                {
                    this.versionError = error;
                    return; // we aren't compatible with this venue service, so don't try to get the venues
                }

                wsVenues = service.GetVenues(Identity.Identifier);
            }
            catch (Exception e)
            {
                if (this.mediateTimeouts)
                {
                    this.venueServiceTimedOut = true;
                    eventLog.WriteEntry("Unable to connect to Venue Service.  Using a default Venue: " + e.ToString(), EventLogEntryType.Warning, 25);
                }
                else
                {
                    throw;
                }
            }

            if (wsVenues != null)
            {
                foreach (VenueService.Venue v in wsVenues)
                {
                    try
                    {
                        ConferenceXP.Venue cxpVenue = new ConferenceXP.Venue(v);

                        // If the venue is IPv4 or (the venue is IPv6 and IPv6
                        // is installed on the OS)
                        if (cxpVenue.EndPoint.AddressFamily == AddressFamily.InterNetwork ||
                            (cxpVenue.EndPoint.AddressFamily == AddressFamily.InterNetworkV6 &&
                             Socket.OSSupportsIPv6))
                        {
                            venues.Add(new ConferenceXP.Venue(v));
                        }
                        else // IPv6 not installed on OS
                        {
                            CreateInvalidVenue(venues, v);
                        }
                    }
                    catch (Exception e)
                    {
                        eventLog.WriteEntry(string.Format("Invalid venue: {0}", e.ToString()),
                                            EventLogEntryType.Error, ConferenceEventLog.ID.Error);

                        CreateInvalidVenue(venues, v);
                    }
                }
            }
        }
Exemplo n.º 4
0
        public object Clone()
        {
            VenueList venueListNew = new VenueList();

            foreach(Venue v in arrayList)
            {
                venueListNew.Add(v);
            }
            return venueListNew;
        }
Exemplo n.º 5
0
        private void CreateInvalidVenue(VenueList venues, VenueService.Venue v)
        {
            eventLog.WriteEntry(string.Format("Invalid venue: {0}", v.Name),
                EventLogEntryType.Warning, ConferenceEventLog.ID.Error);

            venues.Add(new ConferenceXP.Venue(v.Name, new IPEndPoint(IPAddress.Any, 0),
                VenueType.Invalid, Utilities.ByteToBitmap(v.Icon)));
        }
Exemplo n.º 6
0
        private void RefreshVenues()
        {
            venues = new VenueList();

            VenueService.Venue[] wsVenues = null;

            bool versionGood = false;

            try
            {
                string error = null;
                string entryAssemFile = System.Reflection.Assembly.GetExecutingAssembly().Location;
                string fileVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo(entryAssemFile).ProductVersion;
                versionGood = service.CheckAssemblyVersion(fileVersion, out error);

                if (!versionGood)
                {
                    this.versionError = error;
                    return; // we aren't compatible with this venue service, so don't try to get the venues
                }

                wsVenues = service.GetVenues(Identity.Identifier);
            }
            catch (Exception e)
            {
                if (this.mediateTimeouts)
                {
                    this.venueServiceTimedOut = true;
                    eventLog.WriteEntry("Unable to connect to Venue Service.  Using a default Venue: " + e.ToString(), EventLogEntryType.Warning, 25);
                }
                else
                {
                    throw;
                }
            }

            if (wsVenues != null)
            {
                foreach (VenueService.Venue v in wsVenues)
                {
                    try
                    {
                        ConferenceXP.Venue cxpVenue = new ConferenceXP.Venue(v);

                        // If the venue is IPv4 or (the venue is IPv6 and IPv6 
                        // is installed on the OS)
                        if (cxpVenue.EndPoint.AddressFamily == AddressFamily.InterNetwork ||
                           (cxpVenue.EndPoint.AddressFamily == AddressFamily.InterNetworkV6 &&
                           Socket.OSSupportsIPv6))
                        {
                            venues.Add(new ConferenceXP.Venue(v));
                        }
                        else // IPv6 not installed on OS
                        {
                            CreateInvalidVenue(venues, v);
                        }
                    }
                    catch (Exception e)
                    {
                        eventLog.WriteEntry(string.Format("Invalid venue: {0}", e.ToString()),
                            EventLogEntryType.Error, ConferenceEventLog.ID.Error);

                        CreateInvalidVenue(venues, v);
                    }
                }
            }
        }
Exemplo n.º 7
0
        private void RefreshVenues()
        {
            venues = new VenueList();

            VenueService.Venue[] wsVenues = null;

            bool versionGood = false;

            try
            {
                string minVersion = null;
                string maxVersion = null;
                string entryAssemFile = System.Reflection.Assembly.GetExecutingAssembly().Location;
                string fileVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo(entryAssemFile).ProductVersion;
                versionGood = service.CheckAssemblyVersion(fileVersion, out minVersion, out maxVersion);
                this.minVersion = this.maxVersion = null;

                if (!versionGood) {
                    this.minVersion = minVersion;
                    this.maxVersion = maxVersion;
                    return; // we aren't compatible with this venue service, so don't try to get the venues
                }

                wsVenues = service.GetVenues(Identity.Identifier);
            }
            catch (Exception e)
            {
                if (this.mediateTimeouts)
                {
                    this.venueServiceTimedOut = true;
                    eventLog.WriteEntry(string.Format(CultureInfo.CurrentCulture, 
                        Strings.UnableToConnectUsingDefaultVenue, e.ToString()), EventLogEntryType.Warning, 25);
                }
                else
                {
                    throw;
                }
            }

            if (wsVenues != null)
            {
                foreach (VenueService.Venue v in wsVenues)
                {
                    //We expect the future VenueService may return some types that this client version does not handle.
                    if (v.VenueType != MSR.LST.ConferenceXP.VenueService.VenueType.STATIC_SINGLE_GROUP) {
                        continue;
                    }

                    try
                    {
                        ConferenceXP.Venue cxpVenue = new ConferenceXP.Venue(v);

                        // If the venue is IPv4 or (the venue is IPv6 and IPv6 
                        // is installed on the OS)
                        if (cxpVenue.EndPoint.AddressFamily == AddressFamily.InterNetwork ||
                           (cxpVenue.EndPoint.AddressFamily == AddressFamily.InterNetworkV6 &&
                           Socket.OSSupportsIPv6))
                        {
                            venues.Add(new ConferenceXP.Venue(v));
                        }
                        else // IPv6 not installed on OS
                        {
                            CreateInvalidVenue(venues, v);
                        }
                    }
                    catch (Exception e)
                    {
                        eventLog.WriteEntry(string.Format(CultureInfo.CurrentCulture, Strings.InvalidVenue, e.ToString()),
                            EventLogEntryType.Error, ConferenceEventLog.ID.Error);

                        CreateInvalidVenue(venues, v);
                    }
                }
            }
        }
Exemplo n.º 8
0
        private void RefreshVenues()
        {
            venues = new VenueList();

            VenueService.Venue[] wsVenues = null;

            bool versionGood = false;

            try
            {
                string minVersion     = null;
                string maxVersion     = null;
                string entryAssemFile = System.Reflection.Assembly.GetExecutingAssembly().Location;
                string fileVersion    = System.Diagnostics.FileVersionInfo.GetVersionInfo(entryAssemFile).ProductVersion;
                versionGood     = service.CheckAssemblyVersion(fileVersion, out minVersion, out maxVersion);
                this.minVersion = this.maxVersion = null;

                if (!versionGood)
                {
                    this.minVersion = minVersion;
                    this.maxVersion = maxVersion;
                    return; // we aren't compatible with this venue service, so don't try to get the venues
                }

                wsVenues = service.GetVenues(Identity.Identifier);
            }
            catch (Exception e)
            {
                if (this.mediateTimeouts)
                {
                    this.venueServiceTimedOut = true;
                    eventLog.WriteEntry(string.Format(CultureInfo.CurrentCulture,
                                                      Strings.UnableToConnectUsingDefaultVenue, e.ToString()), EventLogEntryType.Warning, 25);
                }
                else
                {
                    throw;
                }
            }

            if (wsVenues != null)
            {
                foreach (VenueService.Venue v in wsVenues)
                {
                    //We expect the future VenueService may return some types that this client version does not handle.
                    if (v.VenueType != MSR.LST.ConferenceXP.VenueService.VenueType.STATIC_SINGLE_GROUP)
                    {
                        continue;
                    }

                    try
                    {
                        ConferenceXP.Venue cxpVenue = new ConferenceXP.Venue(v);

                        // If the venue is IPv4 or (the venue is IPv6 and IPv6
                        // is installed on the OS)
                        if (cxpVenue.EndPoint.AddressFamily == AddressFamily.InterNetwork ||
                            (cxpVenue.EndPoint.AddressFamily == AddressFamily.InterNetworkV6 &&
                             Socket.OSSupportsIPv6))
                        {
                            venues.Add(new ConferenceXP.Venue(v));
                        }
                        else // IPv6 not installed on OS
                        {
                            CreateInvalidVenue(venues, v);
                        }
                    }
                    catch (Exception e)
                    {
                        eventLog.WriteEntry(string.Format(CultureInfo.CurrentCulture, Strings.InvalidVenue, e.ToString()),
                                            EventLogEntryType.Error, ConferenceEventLog.ID.Error);

                        CreateInvalidVenue(venues, v);
                    }
                }
            }
        }