Exemple #1
0
        public void AddResourceType(ResourceType resourceType)
        {
            ResourceTypeList resourceTypeList = ResourceTypeList.getInstance();
            MethodInfo       method           = resourceTypeList.GetType().GetMethod("addResource", BindingFlags.NonPublic | BindingFlags.Instance);

            method.Invoke(resourceTypeList, new object[] { resourceType });
        }
        public XmlDocument GetResourceTypes()
        {
            XmlDocument           doc           = new XmlDocument();
            HydroSecurityInternal hydroInternal = new HydroSecurityInternal();
            ResourceTypeList      resTypeList   = new ResourceTypeList();

            resTypeList = hydroInternal.GetResourceTypes();
            XmlSerializer ser = new XmlSerializer(resTypeList.GetType());

            System.Text.StringBuilder sb     = new System.Text.StringBuilder();
            System.IO.StringWriter    writer = new System.IO.StringWriter(sb);
            ser.Serialize(writer, resTypeList);
            doc.LoadXml(sb.ToString());
            return(doc);
        }