Example #1
0
        /// <summary>
        /// Get ResourceTypes
        /// </summary>
        /// <returns>DKCoinResourceTypeList object</returns>
        public virtual DKCoinResourceTypeList GetResourceTypes()
        {
            try
            {
                if (webservice == null) return DKCoinResourceTypeList.New();
                int typesCount = webservice.getResourceTypes().Length;
                dkCOIN.typeResourceType[] resourceTypes = new dkCOIN.typeResourceType[typesCount];
                resourceTypes = webservice.getResourceTypes();

                DKCoinResourceTypeList resourceTypeList = DKCoinResourceTypeList.New();

                for (int i = 0; i < typesCount; i++)
                {
                    DKCoinResourceType resourceType = DKCoinResourceType.New();
                    resourceType.DisplayName = resourceTypes[i].display_name;
                    resourceType.Name = resourceTypes[i].name;

                    resourceTypeList.Add(resourceType);
                }

                return resourceTypeList;
            }
            catch (Exception e)
            {
                EmailErrorNotification(e.Message, "Attempting to execute GetResourceTypes()");
                return null;
            }
        }
Example #2
0
        /// <summary>
        /// Get ResourceTypes
        /// </summary>
        /// <returns>StringList object</returns>
        public virtual StringList GetResourceTypesAsStringList()
        {
            try
            {
                if (webservice == null)
                    return new StringList();
                int typesCount = webservice.getResourceTypes().Length;
                dkCOIN.typeResourceType[] resourceTypes = new dkCOIN.typeResourceType[typesCount];
                resourceTypes = webservice.getResourceTypes();

                StringList resourceTypeList = new StringList();

                for (int i = 0; i < typesCount; i++)
                {
                    string resourceType = "";
                    resourceType = resourceTypes[i].name;

                    resourceTypeList.Add(resourceType);
                }

                return resourceTypeList;
            }
            catch (Exception e)
            {
                EmailErrorNotification(e.Message, "Attempting to execute StringList GetResourceTypes()");
                return null;
            }
        }