Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="axPrinter"></param>
        /// <param name="objectName"></param>
        /// <param name="propertyName"></param>
        /// <returns></returns>
        public static string getRealPropertyName(AxTePrinter axPrinter, string objectName, string propertyName)
        {
            TeComPrinterLib.LAYOUT_TYPES objType;

            objType = axPrinter.getLayoutObjectType(objectName);
            switch (objType)
            {
            case TeComPrinterLib.LAYOUT_TYPES.LT_LINE: return(getRealPropertyNameFromLine(_lineType, propertyName));

            case TeComPrinterLib.LAYOUT_TYPES.LT_RECTANGLE: return(getRealPropertyNameFromLine(_rectangleType, propertyName));

            case TeComPrinterLib.LAYOUT_TYPES.LT_ELLIPSE: return(getRealPropertyNameFromLine(_ellipseType, propertyName));

            case TeComPrinterLib.LAYOUT_TYPES.LT_IMAGE: return(getRealPropertyNameFromLine(_imageType, propertyName));

            case TeComPrinterLib.LAYOUT_TYPES.LT_TEXT: return(getRealPropertyNameFromLine(_textType, propertyName));

            case TeComPrinterLib.LAYOUT_TYPES.LT_SCALE: return(getRealPropertyNameFromLine(_scaleType, propertyName));

            case TeComPrinterLib.LAYOUT_TYPES.LT_NORTH: return(getRealPropertyNameFromLine(_northType, propertyName));

            case TeComPrinterLib.LAYOUT_TYPES.LT_MAP: return(getRealPropertyNameFromLine(_mapType, propertyName));

            case TeComPrinterLib.LAYOUT_TYPES.LT_DATABASE: return(getRealPropertyNameFromLine(_databaseType, propertyName));
            }
            return("");
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="axPrinter"></param>
        /// <param name="objectName"></param>
        /// <param name="propertName"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        protected static object getAliasValue(AxTePrinter axPrinter, string objectName, string propertName, object value)
        {
            object result = null;

            TeComPrinterLib.LAYOUT_TYPES objType;
            objType = axPrinter.getLayoutObjectType(objectName);

            switch (objType)
            {
            case TeComPrinterLib.LAYOUT_TYPES.LT_DATABASE:
            {
                if (propertName == "Provider")
                {
                    switch (Convert.ToInt32(value))
                    {
                    case 1: result = "Sql Server";
                        break;

                    case 2: result = "Oracle";
                        break;

                    case 3: result = "FireBird";
                        break;

                    case 4: result = "Postgres";
                        break;
                    }
                }
            } break;
            }
            return(result);
        }
Example #3
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 #4
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 #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="objectName"></param>
        /// <param name="axPrinter"></param>
        /// <param name="propertyName"></param>
        /// <returns></returns>
        protected static string getAlias(string objectName, AxTePrinter axPrinter, string propertyName)
        {
            TeComPrinterLib.LAYOUT_TYPES objType;
            if (_lineType == null)
            {
                init();
            }
            objType = axPrinter.getLayoutObjectType(objectName);
            switch (objType)
            {
            case TeComPrinterLib.LAYOUT_TYPES.LT_LINE: return(_lineType[propertyName]);

            case TeComPrinterLib.LAYOUT_TYPES.LT_RECTANGLE: return(_rectangleType[propertyName]);

            case TeComPrinterLib.LAYOUT_TYPES.LT_ELLIPSE: return(_ellipseType[propertyName]);

            case TeComPrinterLib.LAYOUT_TYPES.LT_IMAGE: return(_imageType[propertyName]);

            case TeComPrinterLib.LAYOUT_TYPES.LT_TEXT: return(_textType[propertyName]);

            case TeComPrinterLib.LAYOUT_TYPES.LT_SCALE: return(_scaleType[propertyName]);

            case TeComPrinterLib.LAYOUT_TYPES.LT_NORTH: return(_northType[propertyName]);

            case TeComPrinterLib.LAYOUT_TYPES.LT_MAP: return(_mapType[propertyName]);

            case TeComPrinterLib.LAYOUT_TYPES.LT_DATABASE: return(_databaseType[propertyName]);
            }
            return("");
        }
Example #6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="axPrinter"></param>
 /// <param name="objectName"></param>
 public static void setSelectLayoutObjectItem(AxTePrinter axPrinter, string objectName)
 {
     if (axPrinter.selectObject(objectName))
     {
         axPrinter.execute();
     }
 }
Example #7
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;
            }
        }
Example #8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="axPrinter"></param>
        /// <param name="combo"></param>
        public static void insertObjectsName(AxTePrinter axPrinter, ComboBox combo)
        {
            int i;

            if (combo == null)
            {
                return;
            }
            combo.Items.Clear();

            for (i = 0; i < axPrinter.getLayoutObjectCount(); i++)
            {
                combo.Items.Add(axPrinter.getLayoutObjectName(i));
            }
        }
Example #9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="axPrinter"></param>
 public frmProperty(AxTePrinter axPrinter)
 {
     InitializeComponent();
     _axPrinter = axPrinter;
 }
Example #10
0
 /// <summary>
 ///
 /// </summary>
 public frmProperty()
 {
     InitializeComponent();
     _axPrinter = null;
 }