예제 #1
0
        public void AddLayer(string layerName, int layerid, int parentLayerId, byte[] colour, byte[] vbo, byte[] bbArray)
        {
            if (_transactedLayer == null)
            {
                Flush();
                string str = "INSERT INTO Layers (SceneName, LayerName, LayerId, ParentLayerId, Meshes, XbimTexture, BoundingBox) " +
                             "VALUES (@SceneName, @LayerName, @LayerId, @ParentLayerId, @Meshes, @XbimTexture, @BoundingBox) ";

                _transactedLayer = new transactedCommand(this, str);
                _transactedLayer.Command.Parameters.Add("@SceneName", DbType.String).Value = "MainScene";
                _transactedLayer.Command.Parameters.Add("@LayerName", DbType.String);
                _transactedLayer.Command.Parameters.Add("@LayerId", DbType.Int32);
                _transactedLayer.Command.Parameters.Add("@ParentLayerId", DbType.Int32);
                _transactedLayer.Command.Parameters.Add("@Meshes", DbType.Binary);
                _transactedLayer.Command.Parameters.Add("@XbimTexture", DbType.Binary);
                _transactedLayer.Command.Parameters.Add("@BoundingBox", DbType.Binary);
            }

            _transactedLayer.Command.Parameters["@LayerName"].Value     = layerName;
            _transactedLayer.Command.Parameters["@LayerId"].Value       = layerid;
            _transactedLayer.Command.Parameters["@ParentLayerId"].Value = parentLayerId;
            _transactedLayer.Command.Parameters["@Meshes"].Value        = vbo;
            _transactedLayer.Command.Parameters["@XbimTexture"].Value   = colour;
            _transactedLayer.Command.Parameters["@BoundingBox"].Value   = bbArray;
            _transactedLayer.Command.ExecuteNonQuery();
        }
예제 #2
0
        /// <summary>
        /// Adds a receord to the Meta table
        /// </summary>
        /// <param name="Type">Type of record (required)</param>
        /// <param name="EntityLabel">Allows for entitylabel lookup when appropriate</param>
        /// <param name="Identifier">Optional</param>
        /// <param name="Value">Any string persistence mechanism of choice (required).</param>
        public void AddMetaData(string Type, int EntityLabel, byte[] Value, string Identifier = null)
        {
            if (_transactedMetaByteArray == null)
            {
                Flush();
                string str = "INSERT INTO Meta (" +
                             "'Meta_type', 'Meta_Value', 'Meta_key', 'Meta_intkey' " +
                             ") values (" +
                             "@Meta_type, @Meta_Value, @Meta_key, @Meta_intkey  " +
                             ")";
                _transactedMetaByteArray = new transactedCommand(this, str);
                _transactedMetaByteArray.Command.Parameters.Add("@Meta_type", DbType.String);
                _transactedMetaByteArray.Command.Parameters.Add("@Meta_Value", DbType.Binary);
                _transactedMetaByteArray.Command.Parameters.Add("@Meta_key", DbType.String);
                _transactedMetaByteArray.Command.Parameters.Add("@Meta_intkey", DbType.Int32);
            }

            _transactedMetaByteArray.Command.Parameters["@Meta_type"].Value  = Type;
            _transactedMetaByteArray.Command.Parameters["@Meta_Value"].Value = Value;
            if (Identifier == null)
            {
                _transactedMetaByteArray.Command.Parameters["@Meta_key"].Value = DBNull.Value;
            }
            else
            {
                _transactedMetaByteArray.Command.Parameters["@Meta_key"].Value = Identifier;
            }
            _transactedMetaByteArray.Command.Parameters["@Meta_intkey"].Value = EntityLabel;
            _transactedMetaByteArray.Command.ExecuteNonQuery();
        }
예제 #3
0
 public void Flush()
 {
     if (_transactedMetaByteArray != null)
     {
         _transactedMetaByteArray.Dispose();
         _transactedMetaByteArray = null;
     }
     if (_transactedMetaString != null)
     {
         _transactedMetaString.Dispose();
         _transactedMetaString = null;
     }
     if (_transactedLayer != null)
     {
         _transactedLayer.Dispose();
         _transactedLayer = null;
     }
 }
예제 #4
0
        public void AddLayer(string layerName, int layerid, int parentLayerId, byte[] colour, byte[] vbo, byte[] bbArray)
        {
            if (_transactedLayer == null)
            {
                Flush();
                string str = "INSERT INTO Layers (SceneName, LayerName, LayerId, ParentLayerId, Meshes, XbimTexture, BoundingBox) " +
                         "VALUES (@SceneName, @LayerName, @LayerId, @ParentLayerId, @Meshes, @XbimTexture, @BoundingBox) ";

                _transactedLayer = new transactedCommand(this, str);
                _transactedLayer.Command.Parameters.Add("@SceneName", DbType.String).Value = "MainScene";
                _transactedLayer.Command.Parameters.Add("@LayerName", DbType.String);
                _transactedLayer.Command.Parameters.Add("@LayerId", DbType.Int32);
                _transactedLayer.Command.Parameters.Add("@ParentLayerId", DbType.Int32);
                _transactedLayer.Command.Parameters.Add("@Meshes", DbType.Binary);
                _transactedLayer.Command.Parameters.Add("@XbimTexture", DbType.Binary);
                _transactedLayer.Command.Parameters.Add("@BoundingBox", DbType.Binary);
            }

            _transactedLayer.Command.Parameters["@LayerName"].Value = layerName;
            _transactedLayer.Command.Parameters["@LayerId"].Value = layerid;
            _transactedLayer.Command.Parameters["@ParentLayerId"].Value = parentLayerId;
            _transactedLayer.Command.Parameters["@Meshes"].Value = vbo;
            _transactedLayer.Command.Parameters["@XbimTexture"].Value = colour;
            _transactedLayer.Command.Parameters["@BoundingBox"].Value = bbArray;
            _transactedLayer.Command.ExecuteNonQuery();
        }
예제 #5
0
 public void Flush()
 {
     if (_transactedMetaByteArray != null)
     {
         _transactedMetaByteArray.Dispose();
         _transactedMetaByteArray = null;
     }
     if (_transactedMetaString != null)
     {
         _transactedMetaString.Dispose();
         _transactedMetaString = null;
     }
     if (_transactedLayer != null)
     {
         _transactedLayer.Dispose();
         _transactedLayer = null;
     }
 }
예제 #6
0
        /// <summary>
        /// Adds a receord to the Meta table
        /// </summary>
        /// <param name="Type">Type of record (required)</param>
        /// <param name="EntityLabel">Allows for entitylabel lookup when appropriate</param>
        /// <param name="Identifier">Optional</param>
        /// <param name="Value">Any string persistence mechanism of choice (required).</param>
        public void AddMetaData(string Type, int EntityLabel, byte[] Value, string Identifier = null)
        {
            if (_transactedMetaByteArray == null)
            {
                Flush();
                string str = "INSERT INTO Meta (" +
                    "'Meta_type', 'Meta_Value', 'Meta_key', 'Meta_intkey' " +
                    ") values (" +
                    "@Meta_type, @Meta_Value, @Meta_key, @Meta_intkey  " +
                    ")";
                _transactedMetaByteArray = new transactedCommand(this, str);
                _transactedMetaByteArray.Command.Parameters.Add("@Meta_type", DbType.String);
                _transactedMetaByteArray.Command.Parameters.Add("@Meta_Value", DbType.Binary);
                _transactedMetaByteArray.Command.Parameters.Add("@Meta_key", DbType.String);
                _transactedMetaByteArray.Command.Parameters.Add("@Meta_intkey", DbType.Int32);
            }

            _transactedMetaByteArray.Command.Parameters["@Meta_type"].Value = Type;
            _transactedMetaByteArray.Command.Parameters["@Meta_Value"].Value = Value;
            if (Identifier == null)
                _transactedMetaByteArray.Command.Parameters["@Meta_key"].Value = DBNull.Value;
            else
                _transactedMetaByteArray.Command.Parameters["@Meta_key"].Value = Identifier;
            _transactedMetaByteArray.Command.Parameters["@Meta_intkey"].Value = EntityLabel;
            _transactedMetaByteArray.Command.ExecuteNonQuery();
        }