コード例 #1
0
ファイル: MemoryAmie.cs プロジェクト: ymzsdu/PKHeX
        public MemoryAmie(PKM pk)
        {
            InitializeComponent();
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            pkm           = pk;
            MemStrings    = new MemoryStrings(GameInfo.Strings, pkm.Format);
            PrevCountries = new[] { CB_Country0, CB_Country1, CB_Country2, CB_Country3, CB_Country4 };
            PrevRegions   = new[] { CB_Region0, CB_Region1, CB_Region2, CB_Region3, CB_Region4, };
            string[] arguments = L_Arguments.Text.Split(new[] { " ; " }, StringSplitOptions.None);

            TextArgs = new TextMarkup(arguments);
            foreach (ComboBox comboBox in PrevCountries)
            {
                comboBox.InitializeBinding();
                Main.SetCountrySubRegion(comboBox, "countries");
            }
            foreach (var region in PrevRegions)
            {
                region.InitializeBinding();
            }
            GetLangStrings();
            LoadFields();

            if (!(pkm is IGeoTrack))
            {
                tabControl1.TabPages.Remove(Tab_Residence);
            }
        }
コード例 #2
0
        internal DatabaseInstanceData(IDatabase redisDb, IObjMemCache cache)
        {
            MemoryCache      = cache;
            MemoryStrings    = new MemoryStrings(MemoryCache);
            MemoryHashes     = new MemoryHashes(MemoryCache);
            MemorySets       = new MemorySets(MemoryCache);
            MemorySortedSets = new MemorySortedSet(MemoryCache);

            //If we have access to a redis instance, then listen to it for notifications
            if (redisDb != null)
            {
                Listener = new NotificationListener(redisDb.Multiplexer);

                //Connect the memory cache to the listener. Its data will be updated when keyspace events occur.
                Listener.HandleKeyspaceEvents(this);
            }
        }