コード例 #1
0
        public List <PresentationSmell> detect()
        {
            List <PresentationSmell> smellList     = new List <PresentationSmell>();
            List <List <TextStyle> > CharAttrList  = dataModel.SlideDataModelList.Select(x => x.TextStlyeList).ToList();
            List <TextStyle>         AllCharObject = new List <TextStyle>();

            foreach (List <TextStyle> item in CharAttrList)
            {
                AllCharObject.AddRange(item);
            }

            List <CustumTextStyle> CustomList = AllCharObject.Select(x => new CustumTextStyle {
                Size = x.Size, Color = x.Color, FontNameofChar = x.FontName
            }).ToList();
            int Count = CustomList.GroupBy(x => new { x.Color, x.FontNameofChar, x.Size }).Select(x => x.FirstOrDefault()).Count();

            if (Count > Constants.CHAOTIC_STYLIST_THRESHOLD)
            {
                PresentationSmell smell = new PresentationSmell();
                smell.SmellName = Constants.CHAOTIC_STYLIST;
                string Cause = "The tool detected the smell since the slides contains " + Count + " different styles.";
                smell.Cause   = Cause;
                smell.SlideNo = 1;
                smellList.Add(smell);
            }
            return(smellList);
        }
コード例 #2
0
        private void Smells_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            var item = (sender as ListView).SelectedItem;

            if (item != null)
            {
                PresentationSmell data = item as PresentationSmell;
                Ribbon.Gotoslide(data.SlideNo);
            }
        }
コード例 #3
0
        public List <PresentationSmell> detect()
        {
            List <PresentationSmell> smellList = new List <PresentationSmell>();

            foreach (SlideDataModel slide in dataModel.SlideDataModelList)
            {
                if (slide.TotalTextCount > Constants.TEXTHELL_THRESHOLD)
                {
                    PresentationSmell smell = new PresentationSmell();
                    smell.SmellName = Constants.TEXTHELL;
                    smell.Cause     = "The tool detected the smell since the slide contains a lot of text (" + slide.TotalTextCount.ToString() + " characters).";
                    smell.SlideNo   = slide.SlideNo;
                    smellList.Add(smell);
                }
            }
            return(smellList);
        }
コード例 #4
0
        public List <PresentationSmell> detect()
        {
            List <PresentationSmell> smellList = new List <PresentationSmell>();

            foreach (SlideDataModel slide in dataModel.SlideDataModelList)
            {
                if (slide.TitleHavingUnderLine == true)
                {
                    PresentationSmell smell = new PresentationSmell();
                    smell.SmellName = Constants.SECRETARY_OF_HIPU;
                    string Cause = "The tool detected the smell because the slide title contains underlined text.";
                    smell.Cause   = Cause;
                    smell.SlideNo = slide.SlideNo;
                    smellList.Add(smell);
                }
            }
            return(smellList);
        }
コード例 #5
0
        public List <PresentationSmell> detect()
        {
            List <PresentationSmell> smellList = new List <PresentationSmell>();

            foreach (SlideDataModel slide in dataModel.SlideDataModelList)
            {
                if (slide.TotalSpellingMistake > Constants.STUNG_BY_SPELLBEE_THRESHOLD)
                {
                    PresentationSmell smell = new PresentationSmell();
                    smell.SmellName = Constants.STUNG_BY_SPELLBEE;
                    string Cause = "The tool detected the smell since the slide contains " + slide.TotalSpellingMistake + " spelling mistakes.";
                    smell.Cause   = Cause;
                    smell.SlideNo = slide.SlideNo;
                    smellList.Add(smell);
                }
            }
            return(smellList);
        }
コード例 #6
0
        public List <PresentationSmell> detect()
        {
            List <PresentationSmell> smellList = new List <PresentationSmell>();

            foreach (SlideDataModel slide in dataModel.SlideDataModelList)
            {
                if (slide.MaxIndentLevel > Constants.SUBSUB_BULLET_THRESHOLD)
                {
                    PresentationSmell smell = new PresentationSmell();
                    smell.SmellName = Constants.SUBSUB_BULLET;
                    string Cause = "The tool detected the smell since the slide contains " + slide.MaxIndentLevel + " indentation levels.";
                    smell.Cause   = Cause;
                    smell.SlideNo = slide.SlideNo;
                    smellList.Add(smell);
                }
            }
            return(smellList);
        }
コード例 #7
0
        public List <PresentationSmell> detect()
        {
            List <PresentationSmell> smellList = new List <PresentationSmell>();

            foreach (SlideDataModel slide in dataModel.SlideDataModelList)
            {
                if (slide.NoOfAnimationsInTheSlide > Constants.ITSLASVEGAS_ANIMATION_THRESHOLD)
                {
                    PresentationSmell smell = new PresentationSmell();
                    smell.SmellName = Constants.ITS_LAS_VEGAS;
                    string Cause = "The tool detected the smell since the slide contains " + slide.NoOfAnimationsInTheSlide + " animations.";
                    smell.Cause   = Cause;
                    smell.SlideNo = slide.SlideNo;
                    smellList.Add(smell);
                }
            }
            return(smellList);
        }
コード例 #8
0
        public List <PresentationSmell> detect()
        {
            List <PresentationSmell> smellList = new List <PresentationSmell>();

            foreach (SlideDataModel slide in dataModel.SlideDataModelList)
            {
                int ColorCount = slide.TextStlyeList.GroupBy(x => x.Color).Select(x => x.FirstOrDefault()).Count();
                if (ColorCount > Constants.COLOR_MANIA_THRESHOLD)
                {
                    PresentationSmell smell = new PresentationSmell();
                    smell.SmellName = Constants.COLORMANIA;
                    string Cause = "The tool detected the smell since the slide text is in " + ColorCount + " colors.";
                    smell.Cause   = Cause;
                    smell.SlideNo = slide.SlideNo;
                    smellList.Add(smell);
                }
            }
            return(smellList);
        }
コード例 #9
0
        public List <PresentationSmell> detect()
        {
            List <PresentationSmell> smellList = new List <PresentationSmell>();

            foreach (SlideDataModel slide in dataModel.SlideDataModelList)
            {
                List <TextStyle> SmallTextSmell = slide.TextStlyeList.Where(x => x.Size < Constants.BYOB_THRESHOLD_TEXT_SIZE && x.Size != 1 && x.Character != '-' && x.Character != '\r' && x.Character != '\t').ToList();
                if (SmallTextSmell.Count > 0)
                {
                    PresentationSmell smell = new PresentationSmell();
                    smell.SmellName = Constants.BYOB;
                    string Cause = "The tool detected the smell since the slide contains " + SmallTextSmell.Count + " small characters.";
                    smell.Cause   = Cause;
                    smell.SlideNo = slide.SlideNo;
                    smellList.Add(smell);
                }
            }
            return(smellList);
        }