예제 #1
0
    static void LoadInfo()
    {
        XmlSerializer ser = new XmlSerializer(typeof(ServiceCollection));

        string servicesFile = Path.Combine(basePath, "services.xml");

        if (!File.Exists(servicesFile))
        {
            services = new ServiceCollection();
        }
        else
        {
            StreamReader sr = new StreamReader(servicesFile);
            services = (ServiceCollection)ser.Deserialize(sr);
            sr.Close();
        }

        ser = new XmlSerializer(typeof(ServiceStatusCollection));

        servicesFile = Path.Combine(basePath, "serviceStatus.xml");
        if (!File.Exists(servicesFile))
        {
            serviceStatus = new ServiceStatusCollection();
        }
        else
        {
            StreamReader sr = new StreamReader(servicesFile);
            serviceStatus = (ServiceStatusCollection)ser.Deserialize(sr);
            sr.Close();
        }
    }
예제 #2
0
파일: wstest.cs 프로젝트: nobled/mono
	static void LoadInfo ()
	{
		XmlSerializer ser = new XmlSerializer (typeof(ServiceCollection));
		
		string servicesFile = Path.Combine (basePath, "services.xml");
		if (!File.Exists (servicesFile)) 
			services = new ServiceCollection ();
		else
		{
			StreamReader sr = new StreamReader (servicesFile);
			services = (ServiceCollection) ser.Deserialize (sr);
			sr.Close ();
		}
		
		ser = new XmlSerializer (typeof(ServiceStatusCollection));
		
		servicesFile = Path.Combine (basePath, "serviceStatus.xml");
		if (!File.Exists (servicesFile)) 
			serviceStatus = new ServiceStatusCollection ();
		else
		{
			StreamReader sr = new StreamReader (servicesFile);
			serviceStatus = (ServiceStatusCollection) ser.Deserialize (sr);
			sr.Close ();
		}
	}