示例#1
0
        public AllWords_Kinnect(int?ty)
        {
            //wordtyped = ty;
            uow      = ObjectFactory.GetInstance <IUnitOfWork>();
            user     = ObjectFactory.GetInstance <IUser>();
            language = ObjectFactory.GetInstance <ILanguages>();
            word     = ObjectFactory.GetInstance <IWords>();
            video    = ObjectFactory.GetInstance <IVideo>();

            registerMessenger();


            if (ty.HasValue)
            {
                wt          = UtilityClass.IntToWordType(ty.Value);
                wordData    = new Words_ViewModel(new WordsModel(), wt, 1, uow);
                wordData.wt = wt;

                ttt = 1;
            }
            else
            {
                wordData = new Words_ViewModel(new WordsModel(), 2, uow);
                ttt      = 2;
            }
            //MessageBox.Show(wordData.TT.ToString());

            InitializeComponent();


            DataContext = this;
        }
示例#2
0
        private void DataGrid_Sorting(object sender, DataGridSortingEventArgs e)
        {
            e.Handled = true;
            Words_ViewModel mainViewModel = (Words_ViewModel)DataContext;
            string          sortField     = String.Empty;

            switch (e.Column.SortMemberPath)
            {
            case ("pid"):
                sortField = "pid";
                break;

            case ("pdate"):
                sortField = "pdate";
                break;
            }

            ListSortDirection direction = (e.Column.SortDirection != ListSortDirection.Ascending) ?
                                          ListSortDirection.Ascending : ListSortDirection.Descending;

            bool sortAscending = direction == ListSortDirection.Ascending;

            mainViewModel.Sort(sortField, sortAscending);

            currentSortColumn.SortDirection = null;

            e.Column.SortDirection = direction;

            currentSortColumn    = e.Column;
            currentSortDirection = direction;
        }
示例#3
0
        public Kinnect()
        {
            uow      = ObjectFactory.GetInstance <IUnitOfWork>();
            user     = ObjectFactory.GetInstance <IUser>();
            language = ObjectFactory.GetInstance <ILanguages>();
            word     = ObjectFactory.GetInstance <IWords>();
            video    = ObjectFactory.GetInstance <IVideo>();

            wordData = new Words_ViewModel(new WordsModel(), 2, uow);
            registerMessenger();

            InitializeComponent();

            //ImageBrush myBrush = new ImageBrush();
            //myBrush.ImageSource =
            //    new BitmapImage(new Uri("pack://siteoforigin:,,,/back3.jpg", UriKind.Absolute));
            //this.Background = myBrush;

            //wordData.charttest = wordData.PerVideoPartCount();
            //MessageBox.Show(wordData.charttest[0].ToString());

            string[] datax = new string[] { "Cat1", "Cat2", "Cat3", "Cat4", "Cat5", "Cat6", "Cat7", "Cat8" };
            //double[] datay = new double[] { wordData.WordCount1(), wordData.WordCount2()
            //    , wordData.WordCount3(),wordData.WordCount4(),
            //    wordData.WordCount5(), wordData.WordCount6(),
            //    wordData.WordCount7(), wordData.WordCount8() };
            double[] datay = new double[] { wordData.VideoCount1(LeapKinnectType.Kinnect), wordData.VideoCount2(LeapKinnectType.Kinnect),
                                            wordData.VideoCount3(LeapKinnectType.Kinnect), wordData.VideoCount4(LeapKinnectType.Kinnect),
                                            wordData.VideoCount5(LeapKinnectType.Kinnect), wordData.VideoCount6(LeapKinnectType.Kinnect),
                                            wordData.VideoCount7(LeapKinnectType.Kinnect), wordData.VideoCount8(LeapKinnectType.Kinnect) };
            //double[] datay = new double[] { 32, 56, 35, 12, 35, 6, 23, 56 };
            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, datay);
            SeriesCollection.Add(ds);
            MsChart chm = new MsChart();

            wordData.charttest      = SeriesCollection;
            chart1.SeriesCollection = SeriesCollection;// nn.BarSeriesCollection;
            chart1.Title            = "Capturing Status by Kinect";
            MsChart.StartChart(chart1, new DependencyPropertyChangedEventArgs());



            DataContext = this;
        }
示例#4
0
        //private int tty;

        public NewWord(WordsModel word, WordType?wt /*, User user*/, int ty)
        {
            uow = ObjectFactory.GetInstance <IUnitOfWork>();
            registerMessenger();
            InitializeComponent();

            wrt = wt;
            //tty = ty;

            if (word != null)
            {
                ListItems listitem = new ListItems();
                if (wt.HasValue)
                {
                    wordData = new Words_ViewModel(word, wt, ty, uow);
                }
                else
                {
                    wordData = new Words_ViewModel(word, ty, uow);
                }

                DropDownItems wtl = listitem.GetWordType().FirstOrDefault(x => x.ID == UtilityClass.WordTypeToInt(wordData.wordType) /*(int)model.WordType*/);
                WordType.SelectedIndex = wtl.ID.Value;

                ObservableCollection <DropDownItems> lanlist = wordData.GetAllLanguages();
                DropDownItems ltl = lanlist.FirstOrDefault(x => x.ID == wordData.Langid);
                Language.ItemsSource = lanlist;
                for (int i = 0; i < lanlist.Count; i++)
                {
                    if (lanlist[i].ID == ltl.ID)
                    {
                        Language.SelectedIndex    = i;
                        wordData.SelectedLanguage = ltl;
                    }
                }
            }
            else
            {
                wordData = new Words_ViewModel(new WordsModel(), wt, 1, uow);
            }

            DataContext = this;
        }
示例#5
0
 public Words()
 {
     InitializeComponent();
     WordData    = new Words_ViewModel(new DbModel.ViewModel.WordsVM.WordsModel());
     DataContext = this;
 }
示例#6
0
        public Chart()
        {
            uow  = ObjectFactory.GetInstance <IUnitOfWork>();
            word = ObjectFactory.GetInstance <IWords>();
            InitializeComponent();


            /// for item categoris -----------
            ChartData = new ChartVM(uow);

            // Create some data
            this.Items = new Collection <Item>
            {
                new Item {
                    Label = "Cat1", Value1 = ChartData.wt1()
                },
                new Item {
                    Label = "Cat2", Value1 = ChartData.wt2()
                },
                new Item {
                    Label = "Cat3", Value1 = ChartData.wt3()
                },
                new Item {
                    Label = "Cat4", Value1 = ChartData.wt4()
                },
                new Item {
                    Label = "Cat5", Value1 = ChartData.wt5()
                },
                new Item {
                    Label = "Cat6", Value1 = ChartData.wt6()
                },
                new Item {
                    Label = "Cat7", Value1 = ChartData.wt7()
                },
                new Item {
                    Label = "Cat8", Value1 = ChartData.wt8()
                }
            };


            // Create the plot model
            var tmp = new PlotModel {
                LegendPlacement = LegendPlacement.Outside,
                LegendPosition  = LegendPosition.BottomCenter, LegendOrientation = LegendOrientation.Vertical
            };

            // Add the axes, note that MinimumPadding and AbsoluteMinimum should be set on the value axis.
            tmp.Axes.Add(new CategoryAxis {
                Position = AxisPosition.Left, ItemsSource = this.Items, LabelField = "Label"
            });
            tmp.Axes.Add(new LinearAxis {
                Position = AxisPosition.Bottom, MinimumPadding = 0, AbsoluteMinimum = 0
            });

            // Add the series, note that the BarSeries are using the same ItemsSource as the CategoryAxis.
            //tmp.Series.Add(new BarSeries { Title = "2009", ItemsSource = this.Items, ValueField = "Value1" });
            tmp.Series.Add(new ColumnSeries {
                ItemsSource = this.Items, ValueField = "Value1"
            });

            this.Model1      = tmp;
            this.DataContext = this;

            /// end for item captories  -----------
            /// for video capturing  -----------

            wordData = new Words_ViewModel(new WordsModel(), 2, uow);
            string[] datax = new string[] { "Cat1", "Cat2", "Cat3", "Cat4", "Cat5", "Cat6", "Cat7", "Cat8" };
            double[] datay = new double[] { wordData.VideoCount1(LeapKinnectType.Kinnect), wordData.VideoCount2(LeapKinnectType.Kinnect),
                                            wordData.VideoCount3(LeapKinnectType.Kinnect), wordData.VideoCount4(LeapKinnectType.Kinnect),
                                            wordData.VideoCount5(LeapKinnectType.Kinnect), wordData.VideoCount6(LeapKinnectType.Kinnect),
                                            wordData.VideoCount7(LeapKinnectType.Kinnect), wordData.VideoCount8(LeapKinnectType.Kinnect) };

            BindableCollection <System.Windows.Forms.DataVisualization.Charting.Series> SeriesCollection = new BindableCollection <System.Windows.Forms.DataVisualization.Charting.Series>();

            System.Windows.Forms.DataVisualization.Charting.Series ds = new System.Windows.Forms.DataVisualization.Charting.Series();
            ds.ChartType       = SeriesChartType.Column;
            ds["DrawingStyle"] = "Cylinder";
            //ds.Points.DataBindY(data1);
            ds.Points.DataBindXY(datax, datay);
            SeriesCollection.Add(ds);
            MsChart chm = new MsChart();

            chart1.SeriesCollection = SeriesCollection;// nn.BarSeriesCollection;
            chart1.Title            = "Capturing Status by Kinect";
            MsChart.StartChart(chart1, new DependencyPropertyChangedEventArgs());

            ///end for video capturing  -----------
        }