コード例 #1
0
        /// <summary>
        /// Remove a font from the compare view.
        /// </summary>
        /// <param name="sender"></param>
        private void RemoveCompareItem(string sender)
        {
            ComparedFontsList.Where(item => item.FontTypeName.Equals(sender)).Select
                (u => { u.IsSelected = false; return(u); }).ToList();

            ComparedFontsList.Remove(ComparedFontsList.Where(item => item.FontTypeName.Equals(sender)).Single());
        }
コード例 #2
0
        /// <summary>
        /// Add/Remove a font to/from the compare list.
        /// </summary>
        /// <param name="sender"></param>
        private void AddToCompare(string sender)
        {
            bool isDelete = false;

            var copyItem = SelectedFont.FontTypesList.Where(item => item.FontTypeName.Equals(sender)).Select
                               (u => { u.IsSelected = u.IsSelected.Equals(true) ? false : true; isDelete = u.IsSelected; return(u); }).ToList();

            if (isDelete == false)
            {
                ComparedFontsList.Remove(ComparedFontsList.Where(item => item.FontTypeName.Equals(sender)).Single());
            }
            else
            {
                ComparedFontsList.Add(copyItem.ElementAt(0));
            }
        }