/// <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(); }; }
public void RemoveDevice(BasicTriListWithSmartObject device) { InternalArea.RemoveDevice(device); InternalScenes.RemoveDevice(device); InternalZones.RemoveDevice(device); InternalSch.RemoveDevice(device); InternalZonerename.RemoveDevice(device); }
public void AddDevice(BasicTriListWithSmartObject device) { InternalArea.AddDevice(device); InternalScenes.AddDevice(device); InternalZones.AddDevice(device); InternalSch.AddDevice(device); InternalZonerename.AddDevice(device); }
public void Dispose() { if (IsDisposed) { return; } IsDisposed = true; InternalArea.Dispose(); InternalScenes.Dispose(); InternalZones.Dispose(); InternalSch.Dispose(); InternalZonerename.Dispose(); ComponentMediator.Dispose(); }