private static void AddCapabilitySenderClass(string fileName, Type type, string capName,
                                              CapabilitySenderClassHashtable capabilitySenderClasses)
 {
     try
     {
         if (!capabilitySenderClasses.ContainsKey(capName))
         {
             capabilitySenderClasses.Add(capName, type);
         }
         else
         {
             string msg = string.Format(CultureInfo.CurrentCulture, Strings.FoundDuplicateCapabilitySender,
                                        capName, fileName);
             eventLog.WriteEntry(msg, EventLogEntryType.Error, 23);
             RtlAwareMessageBox.Show(null, msg, Strings.ErrorInitializingCapabilityClasses,
                                     MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                     (MessageBoxOptions)0);
         }
     }
     catch (Exception e)
     {
         eventLog.WriteEntry(string.Format(CultureInfo.CurrentCulture, Strings.AccessingFile, fileName,
                                           e.ToString()), EventLogEntryType.Error, 99);
         RtlAwareMessageBox.Show(null, string.Format(CultureInfo.CurrentCulture, Strings.AccessingFile,
                                                     fileName, e.ToString()), Strings.ErrorInitializingCapabilitySender, MessageBoxButtons.OK,
                                 MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
     }
 }
예제 #2
0
 private static void AddCapabilitySenderClass(string fileName, Type type, string capName,
                                              CapabilitySenderClassHashtable capabilitySenderClasses)
 {
     try
     {
         if (!capabilitySenderClasses.ContainsKey(capName))
         {
             capabilitySenderClasses.Add(capName, type);
         }
         else
         {
             string msg = "Found duplicate CapabilitySender " + capName + " in " + fileName;
             eventLog.WriteEntry(msg, EventLogEntryType.Error, 23);
             MessageBox.Show(msg, "Error Initializing Capability Classes", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception e)
     {
         eventLog.WriteEntry("Accessing file " + fileName + "\n" +
                             e.ToString(), EventLogEntryType.Error, 99);
         MessageBox.Show("Accessing file " + fileName + "\n" +
                         e.ToString(), "Error Initializing Capability Sender", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #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);
                    }
                }
            }
        }
예제 #4
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);
                    }
                }
            }
        }