Example #1
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    public WebMapObjectBase CreateMapObject(OBJECT_TYPE type, CREATE_MODE mode, Localizable localizable)
    {
        GameObject mdl = Resources.Load <GameObject>(m_mapObjectModel[( int )type]);

        Quaternion q = Quaternion.AngleAxis(-90.0f, Vector3.right);

        GameObject Obj = (mdl != null) ? GameObject.Instantiate(mdl, Vector3.up * 32.0f, q, m_deposit.transform) as GameObject : null;

        if (Obj != null)
        {
            WebMapObjectBase mapObj = Obj.GetComponent <WebMapObjectBase>();

            if (mapObj != null)
            {
                mapObj.localizable = localizable;

                if (mode == CREATE_MODE.CREATE_DRAG)
                {
                    if (DragDropOperation.Begin(this, mapObj) == false)
                    {
                        DragDropOperation.Cancel();
                    }
                    else
                    {
                        UpdateDrag(mapObj);

                        return(mapObj);
                    }
                }
                else
                {
                    List <WebMapObjectBase> list = (type == OBJECT_TYPE.FLAG) ? m_flags : m_pins;

                    list.Add(mapObj);

                    return(mapObj);
                }
            }
        }

        return(null);
    }
Example #2
0
        //
        // Check_Table_Mode()
        //
        // Check if existing table has transaction processing flag enabled.
        // If a table is under transaction processing control, modify the
        // table mode to disable transaction processing
        //

        static void Check_Table_Mode(CTTable table)
        {
            try
            {
                // get table create mode
                CREATE_MODE mode = table.GetCreateMode();

                // check if table is under transaction processing control
                if ((mode & CREATE_MODE.TRNLOG_CREATE) != 0)
                {
                    // change file mode to disable transaction processing
                    mode ^= CREATE_MODE.TRNLOG_CREATE;
                    table.UpdateCreateMode(mode);
                }
            }
            catch (CTException E)
            {
                Handle_Exception(E);
            }
        }
Example #3
0
    //****************************************************************************************************
    //
    //****************************************************************************************************

    public WebMapObjectBase ReuseOrCreateMapObject(List <WebMapObjectBase> pool, List <WebMapObjectBase> list, OBJECT_TYPE type, CREATE_MODE mode, Localizable localizable)
    {
        WebMapObjectBase mapObj = null;

        if ((pool != null) && (pool.Count > 0))
        {
            mapObj = pool[pool.Count - 1];

            pool.RemoveAt(pool.Count - 1);

            if (mapObj != null)
            {
                mapObj.localizable = localizable;

                if (list != null)
                {
                    list.Add(mapObj);
                }
            }
        }
        else
        {
            mapObj = CreateMapObject(type, mode, localizable);
        }

        return(mapObj);
    }