public static UserCollectionSingletone GetInstance()
 {
     // DoubleLock
     if (instance == null)
     {
         lock (m_lock)
         {
             if (instance == null)
             {
                 instance = new UserCollectionSingletone();
             }
         }
     }
     return instance;
 }
Пример #2
0
 public static UserCollectionSingletone GetInstance()
 {
     // DoubleLock
     if (instance == null)
     {
         lock (m_lock)
         {
             if (instance == null)
             {
                 instance = new UserCollectionSingletone();
             }
         }
     }
     return(instance);
 }
Пример #3
0
        public UserForm(MinecraftHandler mc)
        {
            InitializeComponent();
            dgvUsers.AutoGenerateColumns = false;
            GenerateColumns();
            this.mc         = mc;
            _userCollection = UserCollectionSingletone.GetInstance();

            try
            {
                List <String> playerlist = mc.Player;
                comboSelectedPlayer.DataSource = playerlist;
            }
            catch
            {
            }
            dgvUsers.DataSource = new BindingSource(_userCollection.Items, null);
            UpdateDataGrid(0);
            this.Dock = DockStyle.Fill;
            RefreshData();
        }
Пример #4
0
        public UserForm(MinecraftHandler mc)
        {
            InitializeComponent();
            dgvUsers.AutoGenerateColumns = false;
            GenerateColumns();
            this.mc = mc;
            _userCollection = UserCollectionSingletone.GetInstance();

            try
            {
                List<String> playerlist = mc.Player;
                comboSelectedPlayer.DataSource = playerlist;
            }
            catch
            {

            }
            dgvUsers.DataSource =  new BindingSource(_userCollection.Items,null);
            UpdateDataGrid(0);
            this.Dock = DockStyle.Fill;
            RefreshData();
        }
Пример #5
0
        public void OnPluginLoaded(ICommandManager CommandManager,IMinecraftHandler mc)
        {
            this.mc = mc;
            CommandManager.RegisterCommand("lotto", new CommandLotto(mc));
            CommandManager.RegisterCommand("jackpot", new CommandJackpot(mc));
            ConfigLotto.ConfigFolder = Path.GetDirectoryName(startupPath) + Path.DirectorySeparatorChar;

            LottoUserCollection.Load().Save();
            config = ConfigLotto.Load();
            config.Save();
            users = UserCollectionSingletone.GetInstance();
            lottoEnabled = true;
            lottoThread = new Thread(new ThreadStart(LottoThread));
            lottoThread.Start();
        }