|
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows;
using System.Windows.Media;
using ReputationLib;
namespace RepWPF
{
//////////////////////////////////////////////////////////////////////////////////////
public static class WpfGlobals
{
private static RepScraper m_scraper = null;
private static RepChartCollection m_charts = null;
private static CurrentPointsCollection m_currentPointsCollection = null;
private static EarnedPointsCollection m_earnedPointsCollection = null;
private static CLBCategoryList m_clbCategories = null;
//private static ColorDictionary m_categoryColors = null;
public static RepScraper Scraper
{
get { return m_scraper; }
private set { m_scraper = value; }
}
public static RepChartCollection Charts
{
get { return m_charts; }
private set { m_charts = value; }
}
public static CurrentPointsCollection CurrentPoints
{
get { return m_currentPointsCollection; }
private set { m_currentPointsCollection = value; }
}
public static EarnedPointsCollection EarnedPoints
{
get { return m_earnedPointsCollection; }
private set { m_earnedPointsCollection = value; }
}
public static CLBCategoryList CLBCategories
{
get { return m_clbCategories; }
private set { m_clbCategories = value; }
}
//public static ColorDictionary CategoryColors
//{
// get { return m_categoryColors; }
// private set { m_categoryColors = value; }
//}
//--------------------------------------------------------------------------------
static WpfGlobals()
{
Scraper = new RepScraper(false);
Charts = new RepChartCollection();
CurrentPoints = new CurrentPointsCollection();
EarnedPoints = new EarnedPointsCollection();
CLBCategories = new CLBCategoryList();
foreach (RepCategory category in Enum.GetValues(typeof(RepCategory)))
{
if (category != RepCategory.Unknown)
{
CLBCategories.Add(new CLBCategoryItem()
{
EnumValue = category,
IsChecked = true,
Name = category.ToString()
});
}
}
//CategoryColors = new ColorDictionary();
//CategoryColors.Add(RepCategory.Author, Application.Current.Resources["AuthorColor"] as SolidColorBrush);
//CategoryColors.Add(RepCategory.Authority, Application.Current.Resources["AuthorityColor"] as SolidColorBrush);
//CategoryColors.Add(RepCategory.Debator, Application.Current.Resources["DebatorColor"] as SolidColorBrush);
//CategoryColors.Add(RepCategory.Editor, Application.Current.Resources["EditorColor"] as SolidColorBrush);
//CategoryColors.Add(RepCategory.Enquirer, Application.Current.Resources["EnquirerColor"] as SolidColorBrush);
//CategoryColors.Add(RepCategory.Organiser, Application.Current.Resources["OrganiserColor"] as SolidColorBrush);
//CategoryColors.Add(RepCategory.Participant, Application.Current.Resources["ParticipantColor"] as SolidColorBrush);
//CategoryColors.Add(RepCategory.Total, Application.Current.Resources["TotalColor"] as SolidColorBrush);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I've been paid as a programmer since 1982 with experience in Pascal, and C++ (both self-taught), and began writing Windows programs in 1991 using Visual C++ and MFC. In the 2nd half of 2007, I started writing C# Windows Forms and ASP.Net applications, and have since done WPF, Silverlight, WCF, web services, and Windows services.
My weakest point is that my moments of clarity are too brief to hold a meaningful conversation that requires more than 30 seconds to complete. Thankfully, grunts of agreement are all that is required to conduct most discussions without committing to any particular belief system.