Exemplo n.º 1
0
 public bool equalsAnteType(Antetype antetype)
 {
     if (!equalsNameAndFolder(antetype))
     {
         return(false);
     }
     if (imgMappingList.getElementCount() != antetype.imgMappingList.getElementCount())
     {
         return(false);
     }
     for (int i = 0; i < imgMappingList.getElementCount(); i++)
     {
         ImageMappingElement imgMapElementLocal   = (ImageMappingElement)imgMappingList.getElement(i);
         ImageMappingElement imgMapElementCompare = (ImageMappingElement)antetype.imgMappingList.getElement(i);
         if (!imgMapElementLocal.ImgFrom.Equals(imgMapElementCompare.ImgFrom))
         {
             return(false);
         }
         if (!imgMapElementLocal.ImgTo.Equals(imgMapElementCompare.ImgTo))
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 2
0
 //获得映射图片
 public static MImgElement getMappedImage(ObjectVector imgMappingList, MImgElement imgElementFrom)
 {
     if (imgMappingList == null)
     {
         return(null);
     }
     for (int i = 0; i < imgMappingList.getElementCount(); i++)
     {
         Object obj = imgMappingList.getElement(i);
         if (!(obj is ImageMappingElement))
         {
             return(null);
         }
         ImageMappingElement imgMaElement = (ImageMappingElement)obj;
         if (imgMaElement.ImgFrom.Equals(imgElementFrom))
         {
             return(imgMaElement.ImgTo);
         }
     }
     return(null);
 }
Exemplo n.º 3
0
        private void setValueType(byte valueTypeT, Object defValue)
        {
            valueType                   = valueTypeT;
            textBox_value.Text          = "";
            textBox_value.Enabled       = false;
            numericUpDown_value.Value   = 0;
            numericUpDown_value.Enabled = false;
            comboBox_value.Items.Clear();
            comboBox_value.SelectedIndex = -1;
            comboBox_value.Enabled       = false;
            switch (valueType)
            {
            case Consts.PARAM_INT:
                numericUpDown_value.Enabled = true;
                if (defValue != null)
                {
                    try
                    {
                        int value = Convert.ToInt32(defValue);
                        numericUpDown_value.Value = value;
                    }
                    catch (System.Exception e)
                    {
                        Console.WriteLine(e.Message);
                    }
                }
                break;

            case Consts.PARAM_STR:
                textBox_value.Enabled = true;
                if (defValue != null)
                {
                    textBox_value.Text = (String)defValue;
                }
                break;

            case Consts.PARAM_PROP:
                comboBox_value.Enabled = true;
                if (vectorList != null)
                {
                    for (int i = 0; i < vectorList.getElementCount(); i++)
                    {
                        comboBox_value.Items.Add(((ObjectElement)vectorList.getElement(i)).name);
                    }
                    if (defValue != null && defValue is ObjectElement)
                    {
                        comboBox_value.SelectedIndex = ((ObjectElement)defValue).getID();
                    }
                }
                break;

            case Consts.PARAM_INT_ID:
                comboBox_value.Enabled = true;
                if (vectorList != null)
                {
                    for (int i = 0; i < vectorList.getElementCount(); i++)
                    {
                        comboBox_value.Items.Add(((ObjectElement)vectorList.getElement(i)).name);
                    }
                    if (defValue != null && defValue is ObjectElement)
                    {
                        comboBox_value.SelectedIndex = ((ObjectElement)defValue).getID();
                    }
                }
                break;
            }
        }