コード例 #1
0
        public NewVideo_Kinect(VideoModel video, User user, DbModel.DomainClasses.Entities.Words thword /*, int ty*/)
        {
            uow = ObjectFactory.GetInstance <IUnitOfWork>();
            registerMessenger();
            InitializeComponent();
            if (video != null && user == null)
            {
                VideoData = new WordVideoVM(video, 1, thword.word_id, LeapKinnectType.Kinnect, uow);
                VideoData.leapkinnecttype = LeapKinnectType.Kinnect;
                VideoData.eword           = thword;

                if (VideoData.euser != null)
                {
                    User_id.Content = "userient ID = " + VideoData.euser.User_id.ToString() + ", Name = " + VideoData.euser.Name;
                    userId          = VideoData.euser.User_id.ToString();
                }
            }
            if (video == null && user != null)
            {
                VideoModel f = new VideoModel();
                //f.userient = user;
                f.User_id                 = user.User_id;
                User_id.Content           = "user ID = " + user.User_id.ToString() + ", Name = " + user.Name;
                userId                    = user.User_id.ToString();
                VideoData                 = new WordVideoVM(f, 1, thword.word_id, LeapKinnectType.Kinnect, uow);
                VideoData.leapkinnecttype = LeapKinnectType.Kinnect;
                VideoData.eword           = thword;
                VideoData.User_id         = user.User_id;
                VideoData.euser           = user;
            }
            if (video != null && user != null)
            {
                video.User                = user;
                video.User_id             = user.User_id;
                User_id.Content           = "user ID = " + user.User_id.ToString() + ", Name = " + user.Name;
                userId                    = user.User_id.ToString();
                VideoData                 = new WordVideoVM(video, 1, thword.word_id, LeapKinnectType.Kinnect, uow);
                VideoData.leapkinnecttype = LeapKinnectType.Kinnect;
                VideoData.eword           = thword;
                VideoData.User_id         = user.User_id;
                VideoData.euser           = user;
            }
            else if (video == null && user == null)
            {
                VideoData = new WordVideoVM(new VideoModel(), 1, thword.word_id, LeapKinnectType.Kinnect, uow);
                VideoData.leapkinnecttype = LeapKinnectType.Kinnect;
                VideoData.eword           = thword;
            }



            DataContext = this;
        }
コード例 #2
0
 public Video()
 {
     InitializeComponent();
     VideoData   = new WordVideoVM(new VideoModel());
     DataContext = this;
 }
コード例 #3
0
        public AllVideo_SpecialKinnect(/*VideoModel vm, */ int wordid, int ty)
        {
            word_id = wordid;
            ttt     = ty;

            uow      = ObjectFactory.GetInstance <IUnitOfWork>();
            user     = ObjectFactory.GetInstance <IUser>();
            language = ObjectFactory.GetInstance <ILanguages>();
            word     = ObjectFactory.GetInstance <IWords>();
            video    = ObjectFactory.GetInstance <IVideo>();

            videoData = new WordVideoVM(new VideoModel(), 2, wordid, LeapKinnectType.Kinnect, uow);
            registerMessenger();

            InitializeComponent();


            Collection <rItem> ch    = new Collection <rItem>();
            List <string>      datax = new List <string>();
            List <double>      datay = new List <double>();

            switch (ty)
            {
            case 0:
            {
                tyn.Content = "Number < 10";
                List <listcustomechart> chlst = videoData.PerVideoPartCount1(LeapKinnectType.Kinnect);
                foreach (var item in chlst)
                {
                    //ch.Add(new rItem { Label = item.wordname, Value1 = item.count });
                    datax.Add(item.wordname);
                    datay.Add(item.count);
                }
            }
            break;

            case 1:
            {
                tyn.Content = "Number > 10";
                List <listcustomechart> chlst = videoData.PerVideoPartCount2(LeapKinnectType.Kinnect);
                foreach (var item in chlst)
                {
                    //ch.Add(new rItem { Label = item.wordname, Value1 = item.count });
                    datax.Add(item.wordname);
                    datay.Add(item.count);
                }
            }
            break;

            case 2:
            {
                tyn.Content = "Letter";
                List <listcustomechart> chlst = videoData.PerVideoPartCount3(LeapKinnectType.Kinnect);
                foreach (var item in chlst)
                {
                    //ch.Add(new rItem { Label = item.wordname, Value1 = item.count });
                    datax.Add(item.wordname);
                    datay.Add(item.count);
                }
            }
            break;

            case 3:
            {
                tyn.Content = "Word by Sign";
                List <listcustomechart> chlst = videoData.PerVideoPartCount4(LeapKinnectType.Kinnect);
                foreach (var item in chlst)
                {
                    //ch.Add(new rItem { Label = item.wordname, Value1 = item.count });
                    datax.Add(item.wordname);
                    datay.Add(item.count);
                }
            }
            break;

            case 4:
            {
                tyn.Content = "Word by letters";
                List <listcustomechart> chlst = videoData.PerVideoPartCount5(LeapKinnectType.Kinnect);
                foreach (var item in chlst)
                {
                    //ch.Add(new rItem { Label = item.wordname, Value1 = item.count });
                    datax.Add(item.wordname);
                    datay.Add(item.count);
                }
            }
            break;

            case 5:
            {
                tyn.Content = "Sentence by Words";
                List <listcustomechart> chlst = videoData.PerVideoPartCount6(LeapKinnectType.Kinnect);
                foreach (var item in chlst)
                {
                    //ch.Add(new rItem { Label = item.wordname, Value1 = item.count });
                    datax.Add(item.wordname);
                    datay.Add(item.count);
                }
            }
            break;

            case 6:
            {
                tyn.Content = "Sentence by Signs";
                List <listcustomechart> chlst = videoData.PerVideoPartCount7(LeapKinnectType.Kinnect);
                foreach (var item in chlst)
                {
                    //ch.Add(new rItem { Label = item.wordname, Value1 = item.count });
                    datax.Add(item.wordname);
                    datay.Add(item.count);
                }
            }
            break;

            case 7:
            {
                tyn.Content = "Arbitrary Sentence";
                List <listcustomechart> chlst = videoData.PerVideoPartCount8(LeapKinnectType.Kinnect);
                foreach (var item in chlst)
                {
                    //ch.Add(new rItem { Label = item.wordname, Value1 = item.count });
                    datax.Add(item.wordname);
                    datay.Add(item.count);
                }
            }
            break;
            }

            BindableCollection <Series> SeriesCollection = new BindableCollection <Series>();
            Series ds = new Series();

            ds.ChartType       = SeriesChartType.Column;
            ds["DrawingStyle"] = "Cylinder";
            //ds.Points.DataBindY(data1);
            ds.Points.DataBindXY(datax.ToArray(), datay.ToArray());
            //ds.Points.DataBindXY(datax2, datay2);
            SeriesCollection.Add(ds);
            MsChart chm = new MsChart();

            videoData.charttest = SeriesCollection;


            DataContext = this;
        }