Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="objectName"></param>
        /// <param name="axPrinter"></param>
        /// <param name="listEx"></param>
        public static void setListItemsValue(string objectName, AxTePrinter axPrinter, ListViewEx listEx)
        {
            int            i;
            int            row;
            string         propertyName;
            property_types type;
            object         aliasValue;

            for (i = 0; i < axPrinter.getLayoutObjectPropertiesCount(objectName); i++)
            {
                propertyName = axPrinter.getLayoutObjectPropertyName(objectName, i);
                propertyName = getAlias(objectName, axPrinter, propertyName.Replace("_Property", ""));
                row          = getRowPropertyIndex(propertyName, listEx);
                if (row != -1)
                {
                    type = getType(propertyName);
                    setListType(row, type, listEx, getList(propertyName));
                    aliasValue = getAliasValue(axPrinter, objectName, propertyName, axPrinter.getLayoutObjectPropertyValue(objectName, i));
                    if (aliasValue != null)
                    {
                        setListValue(row, type, listEx, aliasValue);
                    }
                    else
                    {
                        setListValue(row, type, listEx, axPrinter.getLayoutObjectPropertyValue(objectName, i));
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="objectName"></param>
        /// <param name="axPrinter"></param>
        /// <param name="listEx"></param>
        public static void setListItemsCount(string objectName, AxTePrinter axPrinter, ListViewEx listEx)
        {
            int          objCount;
            int          listCount;
            ListViewItem listItem;

            listEx.clearCell();
            objCount  = axPrinter.getLayoutObjectPropertiesCount(objectName);
            listCount = listEx.Items.Count;
            if (objCount > listCount)
            {
                while (listEx.Items.Count < objCount)
                {
                    listItem = listEx.Items.Add("Undefined");
                    listItem.SubItems.Add("");
                }
            }
            else if (objCount < listCount)
            {
                while (objCount < listEx.Items.Count)
                {
                    listEx.Items.Remove(listEx.Items[listEx.Items.Count - 1]);
                }
            }
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="objectName"></param>
        /// <param name="axPrinter"></param>
        /// <param name="listEx"></param>
        public static void setListItemsName(string objectName, AxTePrinter axPrinter, ListView listEx)
        {
            int    i;
            string propertyName;

            for (i = 0; i < axPrinter.getLayoutObjectPropertiesCount(objectName); i++)
            {
                propertyName         = axPrinter.getLayoutObjectPropertyName(objectName, i);
                propertyName         = getAlias(objectName, axPrinter, propertyName.Replace("_Property", ""));//  propertyName.Replace("_Property", "");//
                listEx.Items[i].Text = propertyName;
            }
        }