public UCSD_PORTAL_USER()
        {
            this.ServiceName = "UCSD_PORTAL_USER";
            this.AutoLog     = false;

            InitializeComponent();

            eventLog1 = new System.Diagnostics.EventLog();
            if (!System.Diagnostics.EventLog.SourceExists("UCSD_USER_PORTAL"))
            {
                System.Diagnostics.EventLog.CreateEventSource(
                    "UCSD_USER_PORTAL", "UCSD_USER_PORTAL_LOG");
            }
            eventLog1.Source = "UCSD_USER_PORTAL";
            eventLog1.Log    = "UCSD_USER_PORTAL_LOG";

            UCSDSettings t = new UCSDSettings();

            eventLog1.WriteEntry("Created UCSD Setting object");
            if (!File.Exists("C:\\MVPORTAL_plugin\\MVPortal_PlugIn_config.XML"))
            {
                t.Serialize("C:\\MVPORTAL_plugin\\MVPortal_PlugIn_config.XML", t);
            }
            UCSDSettings t2 = t.Deserialize("C:\\MVPORTAL_plugin\\MVPortal_PlugIn_config.XML");

            eventLog1.WriteEntry("Created UCSD Setting object - from file");
        }
        public UCSDSettings Deserialize(string file)
        {
            System.Xml.Serialization.XmlSerializer xs
                = new System.Xml.Serialization.XmlSerializer(
                      typeof(UCSDSettings));
            StreamReader reader = File.OpenText(file);
            UCSDSettings c      = (UCSDSettings)xs.Deserialize(reader);

            reader.Close();
            return(c);
        }
        public void Serialize(string file, UCSDSettings c)
        {
            System.Xml.Serialization.XmlSerializer xs
                = new System.Xml.Serialization.XmlSerializer(c.GetType());
            string path1 = Path.GetDirectoryName(file);

            if (!Directory.Exists(path1))
            {
                Directory.CreateDirectory(path1);
            }
            StreamWriter writer = File.CreateText(file);

            xs.Serialize(writer, c);
            writer.Flush();
            writer.Close();
        }