Exemple #1
0
 public ClientModule(string name)
 {
     this.name = name;
     this.enabled = true;
     this.client = Client.getInstance();
     this.globalStorage = GlobalStorage.getInstance();
     this.log = Log.getInstance();
 }
Exemple #2
0
        public static GlobalStorage getInstance()
        {
            if (instance == null)
            {
                if (File.Exists("globals.xml"))
                {
                    serializer = new XmlSerializer(typeof(GlobalStorage));
                    StreamReader file = new StreamReader(@"globals.xml");
                    instance = (GlobalStorage)serializer.Deserialize(file);
                    file.Close();
                }
                else
                {
                    instance = new GlobalStorage();
                    instance.IgnoredUsers = new List<string>();
                    instance.lifetimePoints = new SerializableDictionary<string, int>();
                    instance.quotes = new List<string>();
                    instance.karmaDatabase = new SerializableDictionary<string, int>();
                }
            }

            return instance;
        }