/// <summary>
        /// Create a list o items in the AddressSpace
        /// </summary>
        /// <param name="parentFolder"></param>
        /// <param name="itemCount"></param>
        /// <param name="itemType"></param>
        /// <param name="itemSetName"></param>
        private EnumResultCode CreateItems(
            AddressSpaceElement parentFolder,
            DaAddressSpaceElement resultItem,
            uint itemCount,
            Type itemType,
            bool generateRandomValues,
            string guid,
            bool isAnalogItem)
        {
            // Create item folder
            MyDaAddressSpaceElement itemFolder = new MyDaAddressSpaceElement();

            itemFolder.Name         = String.Format("TestItems_{0}", m_createdFolders);
            itemFolder.HasChildren  = true;
            itemFolder.AccessRights = EnumAccessRights.READABLE;
            if (!parentFolder.AddChild(itemFolder))
            {
                return(EnumResultCode.E_FAIL);
            }

            m_createdFolders++;

            //add guid to ItemSetId node
            ValueQT cacheValue = null;

            resultItem.GetCacheValue(ref cacheValue);
            string[] currentValue = cacheValue.Data as string[];
            string[] newValue     = new string[currentValue.Length + 1];
            currentValue.CopyTo(newValue, 0);
            newValue[currentValue.Length] = itemFolder.ItemId + "#" + guid;
            resultItem.ValueChanged(new ValueQT(newValue, EnumQuality.GOOD, DateTime.Now));


            // Add Start/Stop simulation command
            DaStartStopSimulationCommand simulationCmd = new DaStartStopSimulationCommand();

            simulationCmd.Name        = "StartStopSimulationCommand";
            simulationCmd.HasChildren = true;
            if (!itemFolder.AddChild(simulationCmd))
            {
                return(EnumResultCode.E_FAIL);
            }
            simulationCmd.ValueChanged(new ValueQT(false, EnumQuality.GOOD, DateTime.Now));

            MyDaAddressSpaceElement param;

            // Add command parameters

            // item count parameter
            param = new MyDaAddressSpaceElement(DaStartStopSimulationCommand.ChangeIntervalParam, DaStartStopSimulationCommand.ChangeIntervalParamType);
            if (!simulationCmd.AddChild(param))
            {
                return(EnumResultCode.E_FAIL);
            }
            param.ValueChanged(new ValueQT((uint)0, EnumQuality.GOOD, DateTime.Now));

            // repeat count parameter
            param = new MyDaAddressSpaceElement(DaStartStopSimulationCommand.RepeatCountParam, DaStartStopSimulationCommand.RepeatCountParamType);
            if (!simulationCmd.AddChild(param))
            {
                return(EnumResultCode.E_FAIL);
            }
            param.ValueChanged(new ValueQT((uint)0, EnumQuality.GOOD, DateTime.Now));

            // incrementt parameter
            param = new MyDaAddressSpaceElement(DaStartStopSimulationCommand.IncrementParam, DaStartStopSimulationCommand.IncrementParamType);
            if (!simulationCmd.AddChild(param))
            {
                return(EnumResultCode.E_FAIL);
            }
            param.ValueChanged(new ValueQT((uint)0, EnumQuality.GOOD, DateTime.Now));

            // Add Delete Items command
            DaDeleteItemsCommand deleteItemsCmd = new DaDeleteItemsCommand();

            deleteItemsCmd.Name        = "DeleteItemsCommand";
            deleteItemsCmd.HasChildren = true;
            if (!itemFolder.AddChild(deleteItemsCmd))
            {
                return(EnumResultCode.E_FAIL);
            }
            deleteItemsCmd.ValueChanged(new ValueQT(false, EnumQuality.GOOD, DateTime.Now));

            // Add items to list
            for (uint i = 0; i < itemCount; i++)
            {
                MyDaAddressSpaceElement item = new MyDaAddressSpaceElement(String.Format("TV_{0}", i), itemType);
                if (!itemFolder.AddChild(item))
                {
                    return(EnumResultCode.E_FAIL);
                }

                if (isAnalogItem)
                {
                    DaConstantProperty euType = new DaConstantProperty(
                        (int)EnumPropertyId.ITEM_EU_TYPE,
                        "EUType",
                        "7",
                        new ValueQT(EnumEUType.ANALOG, EnumQuality.GOOD, DateTime.Now));
                    euType.AccessRights = EnumAccessRights.READABLE;
                    item.AddProperty(euType);

                    DaProperty euHigh = new DaProperty();
                    euHigh.Id           = (int)EnumPropertyId.HIGH_EU;
                    euHigh.Name         = "High EU";
                    euHigh.Description  = "High EU";
                    euHigh.ItemId       = euHigh.Id.ToString();
                    euHigh.Datatype     = typeof(System.Double);
                    euHigh.AccessRights = EnumAccessRights.READABLE;
                    item.AddProperty(euHigh);

                    DaProperty euLow = new DaProperty();
                    euLow.Id           = (int)EnumPropertyId.LOW_EU;
                    euLow.Name         = "Low EU";
                    euLow.Description  = "Low EU";
                    euLow.ItemId       = euLow.Id.ToString();
                    euLow.Datatype     = typeof(System.Double);
                    euLow.AccessRights = EnumAccessRights.READABLE;
                    item.AddProperty(euLow);
                }

                if (generateRandomValues)
                {
                    // item.ValueChanged(m_generator.GetRandomValueQT(item.Datatype));
                }
                else
                {
                    item.ValueChanged(new ValueQT(0, EnumQuality.GOOD, DateTime.Now));
                }
            }



            return(EnumResultCode.S_OK);
        }