Пример #1
0
        public int GetWidth()
        {
            switch (type)
            {
            case 0:
                try
                {
                    if (isBindSize)
                    {
                        if (methods != null)
                        {
                            if (methods[9] != null)
                            {
                                Object o = JavaRuntime.Invoke(methods[9], obj);
                                if (o is Single)
                                {
                                    return(System.Convert.ToInt32(((Single)o)));
                                }
                                else if (o is Int32)
                                {
                                    return((Int32)o);
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    Log.Exception(ex);
                }
                break;

            case 1:
                if (actorObject != null)
                {
                    return(actorObject.GetWidth());
                }
                break;

            case 2:
                if (shapeObject != null)
                {
                    return((int)shapeObject.GetWidth());
                }
                break;

            case 3:
                if (compObject != null)
                {
                    return(compObject.GetWidth());
                }
                break;

            case 4:
                if (lObject != null)
                {
                    return(lObject.GetWidth());
                }
                break;
            }
            return(0);
        }