Exemplo n.º 1
0
        /// <summary>
        /// Register this tokenizer to SQLite connection.
        /// </summary>
        /// <param name="connection">opened connection.</param>
        public void RegisterMe(SQLiteConnection connection)
        {
            internalArea = new InternalArea(this);
            IntPtr ppModule = internalArea.CreateModule();
            int    size     = Marshal.SizeOf(ppModule);

            byte[] bytes = new byte[size];
            if (size == 4)
            {
                bytes = BitConverter.GetBytes(ppModule.ToInt32());
            }
            else if (size == 8)
            {
                bytes = BitConverter.GetBytes(ppModule.ToInt64());
            }

            SQLiteCommand   command = new SQLiteCommand("SELECT fts3_tokenizer(?, ?)", connection);
            SQLiteParameter p0      = new SQLiteParameter();

            p0.DbType = DbType.String;
            p0.Value  = this.Name;
            command.Parameters.Add(p0);
            SQLiteParameter p1 = new SQLiteParameter();

            p1.DbType = DbType.Binary;
            p1.Size   = size;
            p1.Value  = bytes;
            command.Parameters.Add(p1);
            SQLiteDataReader dr = command.ExecuteReader();

            dr.Close();
            connection.Disposed += delegate { internalArea.DisposeModule(); };
        }
Exemplo n.º 2
0
 public void RemoveDevice(BasicTriListWithSmartObject device)
 {
     InternalArea.RemoveDevice(device);
     InternalScenes.RemoveDevice(device);
     InternalZones.RemoveDevice(device);
     InternalSch.RemoveDevice(device);
     InternalZonerename.RemoveDevice(device);
 }
Exemplo n.º 3
0
 public void AddDevice(BasicTriListWithSmartObject device)
 {
     InternalArea.AddDevice(device);
     InternalScenes.AddDevice(device);
     InternalZones.AddDevice(device);
     InternalSch.AddDevice(device);
     InternalZonerename.AddDevice(device);
 }
Exemplo n.º 4
0
        public void Dispose()
        {
            if (IsDisposed)
            {
                return;
            }

            IsDisposed = true;

            InternalArea.Dispose();
            InternalScenes.Dispose();
            InternalZones.Dispose();
            InternalSch.Dispose();
            InternalZonerename.Dispose();
            ComponentMediator.Dispose();
        }