コード例 #1
0
 public HomeSecureServerInputsListener()
 {
     using (ServerDataAccess conf = new ServerDataAccess("HomeSecureData"))
     {
         bool dbCreated = conf.Database.CreateIfNotExists();
     }
 }
コード例 #2
0
 public void AddMotionSecurityEvent(MotionDetectionEvent motionEvent)
 {
     Logger.Debug("Security event detected");
     using (ServerDataAccess conf = new ServerDataAccess("HomeSecureData"))
     {
         conf.AddMotionDetectionEvent(motionEvent);
     }
 }
コード例 #3
0
        public List<MotionDetectionEvent> GetMotionSecurityEvents(int pageSize, int pageNumber, out int total)
        {
            List<MotionDetectionEvent> result;

            using (ServerDataAccess conf = new ServerDataAccess("HomeSecureData"))
            {
                result = conf.GetMotionDetectionEvents(pageSize,pageNumber,out total);
            }

            return result;
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: ShlomyShivek/HomeSecure
        static void Main(string[] args)
        {
            Logger.Init("Log.config", "DataAccessTestLogger");

            MotionDetectionEvent mde = new MotionDetectionEvent()
            {
                CameraDevice = new CameraDevice()
                {
                    ID = "123",
                    Name = "Name"
                },
                ID = 1,
                NumberOfPixelsDetected = 100,
                SecurityEventTime = DateTime.Now
            };

            ServerDataAccess conf = new ServerDataAccess("HomeSecureData");
            conf.AddMotionDetectionEvent(mde);

            int total = 0;
            List<MotionDetectionEvent> motionDetectionEvents = conf.GetMotionDetectionEvents(2, 1, out total);
        }