Esempio n. 1
0
        private void LoadLibrary()
        {
            int index = 0;

            viewModel.NoLocalMotionVisibility = false;
            string[] listLocalFile  = Directory.GetFiles(GlobalFunction.GetSavedDir(), "*.mrb");
            var      listMotionInfo = listLocalFile.Select(file => new MotionInfo(file)).ToList();

            listMotionInfo.Sort((x, y) => String.CompareOrdinal(x.Title, y.Title)); // Sort title
            foreach (var motionInfo in listMotionInfo)
            {
                var motionItem = new MotionFullInfoItem();
                motionItem.SetMotionInfo(motionInfo);
                motionItem.ViewModel.HitTestVisible = false;
                motionItem.ViewModel.Index          = ++index;
                motionItem.CopyMotion    += Library_CopyMotion;
                motionItem.DelteMotion   += Library_DeleteMotion;
                motionItem.MotionClicked += Library_MotionClick;
                viewModel.LibraryItemsList.Add(motionItem);
                DownloadImage(motionInfo.MotionID, motionItem.ViewModel);
            }
            if (index == 0)
            {
                viewModel.NoLocalMotionVisibility = true;
            }

            GetUpdateList(listMotionInfo);
        }
Esempio n. 2
0
        private void ReorderLibrary(List <MotionInfo> updateList, List <MotionInfo> normalList)
        {
            viewModel.LibraryItemsList.Clear();
            int index = 0;

            viewModel.NoLocalMotionVisibility = false;
            foreach (var motionInfo in updateList)
            {
                var motionItem = new MotionFullInfoItem();
                motionItem.SetMotionInfo(motionInfo);
                motionItem.ViewModel.HitTestVisible = false;
                motionItem.ViewModel.NeedUpdate     = true;
                motionItem.ViewModel.Index          = ++index;
                motionItem.CopyMotion    += Library_CopyMotion;
                motionItem.DelteMotion   += Library_DeleteMotion;
                motionItem.MotionClicked += Library_MotionClick;
                viewModel.LibraryItemsList.Add(motionItem);
                DownloadImage(motionInfo.MotionID, motionItem.ViewModel);
            }
            foreach (var motionInfo in normalList)
            {
                var motionItem = new MotionFullInfoItem();
                motionItem.SetMotionInfo(motionInfo);
                motionItem.ViewModel.HitTestVisible = false;
                motionItem.ViewModel.Index          = ++index;
                motionItem.CopyMotion    += Library_CopyMotion;
                motionItem.DelteMotion   += Library_DeleteMotion;
                motionItem.MotionClicked += Library_MotionClick;
                viewModel.LibraryItemsList.Add(motionItem);
                DownloadImage(motionInfo.MotionID, motionItem.ViewModel);
            }
        }
Esempio n. 3
0
 private void ReorderLibrary(List<MotionInfo> updateList, List<MotionInfo> normalList)
 {
     viewModel.LibraryItemsList.Clear();
     int index = 0;
     viewModel.NoLocalMotionVisibility = false;
     foreach (var motionInfo in updateList)
     {
         var motionItem = new MotionFullInfoItem();
         motionItem.SetMotionInfo(motionInfo);
         motionItem.ViewModel.HitTestVisible = false;
         motionItem.ViewModel.NeedUpdate = true;
         motionItem.ViewModel.Index = ++index;
         motionItem.CopyMotion += Library_CopyMotion;
         motionItem.DelteMotion += Library_DeleteMotion;
         motionItem.MotionClicked += Library_MotionClick;
         viewModel.LibraryItemsList.Add(motionItem);
         DownloadImage(motionInfo.MotionID, motionItem.ViewModel);
     }
     foreach (var motionInfo in normalList)
     {
         var motionItem = new MotionFullInfoItem();
         motionItem.SetMotionInfo(motionInfo);
         motionItem.ViewModel.HitTestVisible = false;
         motionItem.ViewModel.Index = ++index;
         motionItem.CopyMotion += Library_CopyMotion;
         motionItem.DelteMotion += Library_DeleteMotion;
         motionItem.MotionClicked += Library_MotionClick;
         viewModel.LibraryItemsList.Add(motionItem);
         DownloadImage(motionInfo.MotionID, motionItem.ViewModel);
     }
 }
Esempio n. 4
0
        private void LoadLibrary()
        {
            int index = 0;
            viewModel.NoLocalMotionVisibility = false;
            string[] listLocalFile = Directory.GetFiles(GlobalFunction.GetSavedDir(), "*.mrb");
            var listMotionInfo = listLocalFile.Select(file => new MotionInfo(file)).ToList();
            listMotionInfo.Sort((x, y) => String.CompareOrdinal(x.Title, y.Title)); // Sort title
            foreach (var motionInfo in listMotionInfo)
            {
                var motionItem = new MotionFullInfoItem();
                motionItem.SetMotionInfo(motionInfo);
                motionItem.ViewModel.HitTestVisible = false;
                motionItem.ViewModel.Index = ++index;
                motionItem.CopyMotion += Library_CopyMotion;
                motionItem.DelteMotion += Library_DeleteMotion;
                motionItem.MotionClicked += Library_MotionClick;
                viewModel.LibraryItemsList.Add(motionItem);
                DownloadImage(motionInfo.MotionID, motionItem.ViewModel);
            }
            if (index == 0) viewModel.NoLocalMotionVisibility = true;

            GetUpdateList(listMotionInfo);
        }