private void ViewCCTV(object sender, MouseButtonEventArgs e)
        {
            if (this.Mode != Camera_Final.Mode.CCTV)
            {
                this.count--;
                if (this.count < 0)
                {
                    //System.Diagnostics.Process p= System.Diagnostics.Process.Start(Application.ResourceAssembly.Location);
                    ProcessStartInfo startInfo = new ProcessStartInfo(Application.ResourceAssembly.Location);
                    startInfo.Arguments = string.Format("-u {0} -mode 2", App.User.Hash);
                    System.Diagnostics.Process.Start(startInfo);
                    Application.Current.Shutdown();
                }
                // if (!isLoadCCTV)
                this.LoadCCTVLayout();

                EasyTimer.SetTimeout(() =>
                {
                    if (App.setting.AutoRecord)
                    {
                        this.autoRecord();
                    }
                }, 3500);

                UIContent.Animation_Translate_Frame(double.NaN, double.NaN, -264, 0, 500, () =>
                {
                    isMenuShow = false;
                    this.UIMap.Animation_Translate_Frame(double.NaN, double.NaN, double.NaN, 768);
                    this.UICCTV.Animation_Translate_Frame(double.NaN, -768, double.NaN, 0);
                    this.Mode = Camera_Final.Mode.CCTV;
                });
            }
        }
 private void UIMenuClick(object sender, MouseButtonEventArgs e)
 {
     if (isMenuShow)
     {
         UIContent.Animation_Translate_Frame(double.NaN, double.NaN, -264, 0, 500, () => { isMenuShow = false; });
     }
     else
     {
         UIContent.Animation_Translate_Frame(double.NaN, double.NaN, 0, 0, 500, () => { isMenuShow = true; });
     }
 }
 private void AddAlarm(object sender, MouseButtonEventArgs e)
 {
     UIContent.Animation_Translate_Frame(double.NaN, double.NaN, -264, 0, 500, () =>
     {
         isMenuShow         = false;
         UIAddAlarm uiAlarm = new UIAddAlarm();
         uiAlarm.setLeft(0);
         uiAlarm.setTop(0);
         uiAlarm.Width       = 1366;
         uiAlarm.Height      = 768;
         uiAlarm.CloseEvent += uiAlarm_CloseEvent;
         this.UIMapContent.Children.Add(uiAlarm);
     });
 }
 private void UserInfo(object sender, MouseButtonEventArgs e)
 {
     UIContent.Animation_Translate_Frame(double.NaN, double.NaN, -264, 0, 500, () =>
     {
         isMenuShow       = false;
         AddUser View     = new AddUser();
         View.User        = App.User;
         View.CloseEvent += View_CloseEvent;
         View.setLeft(0);
         View.setTop(0);
         View.Width  = 1366;
         View.Height = 768;
         this.UIMapContent.Children.Add(View);
     });
 }
        private void ViewMap(object sender, MouseButtonEventArgs e)
        {
            foreach (Code.Camera Camera in App.DataCamera.Datas)
            {
                CHCNetSDK.NET_DVR_StopRealPlay(Camera.m_lRealHandle);
            }

            if (this.Mode != Camera_Final.Mode.MAP)
            {
                UIContent.Animation_Translate_Frame(double.NaN, double.NaN, -264, 0, 500, () =>
                {
                    isMenuShow = false;
                    this.UIMap.Animation_Translate_Frame(double.NaN, -768, double.NaN, 0);
                    this.UICCTV.Animation_Translate_Frame(double.NaN, double.NaN, double.NaN, 768);
                    this.Mode = Camera_Final.Mode.MAP;
                });
            }
        }
Пример #6
0
        void tmpItem_BrowserMediaEvent(object sender, UserData e)
        {
            GridMedia tmpMediaItem = new GridMedia();

            tmpMediaItem.BackEvent += tmpMediaItem_BackEvent;
            tmpMediaItem.Width      = 1366;
            tmpMediaItem.Height     = 668;
            double itemPostion = 0;

            if (UIContent.Children.Count > 0)
            {
                itemPostion = UIContent.Children[UIContent.Children.Count - 1].getLeft();
            }
            tmpMediaItem.setLeft(itemPostion - 1366);
            tmpMediaItem.setTop(0);
            tmpMediaItem.User = e;
            this.UIContent.Children.Add(tmpMediaItem);
            UIContent.Animation_Translate_Frame(double.NaN, double.NaN, -itemPostion + 1366, double.NaN, 500);
        }
Пример #7
0
        void tmpMediaItem_BackEvent(object sender, EventArgs e)
        {
            double itemPostion = UIContent.getLeft();

            UIContent.Animation_Translate_Frame(double.NaN, double.NaN, itemPostion - 1366, double.NaN, 500, () => { this.UIContent.Children.RemoveAt(1); });
        }
Пример #8
0
        private void MenuItem_ClickEvent(object sender, EventArgs e)
        {
            UIView.MenuItem item = sender as UIView.MenuItem;
            this.disableMenu(item);
            double time        = 100;
            double position    = this.UIContent.getLeft();
            double itemPostion = 0;

            if (UIContent.Children.Count > 0)
            {
                itemPostion = UIContent.Children[UIContent.Children.Count - 1].getLeft();
            }

            UIContent.Animation_Translate_Frame(double.NaN, double.NaN, position, double.NaN, time, () =>
            {
                if (UIContent.Children.Count > 1)
                {
                    this.UIContent.Children.RemoveAt(0);
                }
                switch (item.Code)
                {
                case "User":
                    // this.UIContent.Children.Clear();
                    GridViewUser tmpItem        = new GridViewUser();
                    tmpItem.BrowserMediaEvent  += tmpItem_BrowserMediaEvent;
                    tmpItem.BrowserCameraEvent += tmpItem_BrowserCameraEvent;
                    tmpItem.Width  = 1366;
                    tmpItem.Height = 668;
                    tmpItem.setLeft(itemPostion + 1366);
                    tmpItem.setTop(0);
                    this.UIContent.Children.Add(tmpItem);
                    break;

                case "Media":
                    // this.UIContent.Children.Clear();
                    GridMedia tmpMediaItem = new GridMedia();
                    tmpMediaItem.Width     = 1366;
                    tmpMediaItem.Height    = 668;
                    tmpMediaItem.setLeft(itemPostion + 1366);
                    tmpMediaItem.setTop(0);
                    tmpMediaItem.User = null;
                    this.UIContent.Children.Add(tmpMediaItem);
                    break;

                case "Camera":
                    // this.UIContent.Children.Clear();
                    GridMedia tmpCameraItem = new GridMedia();
                    tmpCameraItem.Width     = 1366;
                    tmpCameraItem.Height    = 668;
                    tmpCameraItem.setLeft(itemPostion + 1366);
                    tmpCameraItem.setTop(0);
                    tmpCameraItem.TypeMedia = 2;
                    this.UIContent.Children.Add(tmpCameraItem);
                    break;

                case "Device":
                    // this.UIContent.Children.Clear();
                    GridViewDevice tmpDeviceItem = new GridViewDevice();
                    tmpDeviceItem.Width          = 1366;
                    tmpDeviceItem.Height         = 668;
                    tmpDeviceItem.setLeft(itemPostion + 1366);
                    tmpDeviceItem.setTop(0);
                    this.UIContent.Children.Add(tmpDeviceItem);
                    break;

                case "Schedule":
                    // this.UIContent.Children.Clear();
                    MTC_Server.UIView.Schedule.UISchedule tmpCalendar = new UIView.Schedule.UISchedule();
                    tmpCalendar.Width  = 1366;
                    tmpCalendar.Height = 668;
                    tmpCalendar.setLeft(itemPostion + 1366);
                    tmpCalendar.setTop(0);
                    this.UIContent.Children.Add(tmpCalendar);
                    break;

                case "Playlist":
                    // this.UIContent.Children.Clear();
                    MTC_Server.UIView.Playlist.GridPlaylist tmpPlaylist = new MTC_Server.UIView.Playlist.GridPlaylist();
                    tmpPlaylist.Width  = 1366;
                    tmpPlaylist.Height = 668;
                    tmpPlaylist.setLeft(itemPostion + 1366);
                    tmpPlaylist.setTop(0);
                    this.UIContent.Children.Add(tmpPlaylist);
                    break;

                case "About":
                    About window = new About();
                    window.Show();
                    return;
                }
                this.UIContent.Animation_Translate_Frame(double.NaN, double.NaN, -itemPostion - 1366, double.NaN, 600,
                                                         () =>
                {
                    if (UIContent.Children.Count != 0)
                    {
                        this.UIContent.Children.RemoveAt(0);
                    }
                });
            });
        }