Пример #1
0
 private static bool Load(UnityModManager.ModEntry modEntry)
 {
     modEntry.OnToggle = OnToggle;
     Assets.Init();
     _settings = new SettingsModule();
     Harmony   = new Harmony(modEntry.Info.Id);
     return(true);
 }
Пример #2
0
		protected ATCModule(ATCLogger l, SettingsModule s, string wd, string m)
		{
			logger = l;
			SettingsBase = s;
			Modulename = m;
			WorkingDirectory = Path.Combine(wd, Modulename);
			Directory.CreateDirectory(WorkingDirectory);
			StartTime = DateTime.Now;
		}
Пример #3
0
 private void settingsToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     if (settingsModule == null || settingsModule.IsDisposed)
     {
         settingsModule = new SettingsModule();
         settingsModule.Show();
     }
     else
     {
         if (settingsModule.WindowState == FormWindowState.Minimized)
         {
             settingsModule.WindowState = FormWindowState.Maximized;
         }
         settingsModule.Activate();
     }
 }
Пример #4
0
 public InternalModules(InternalAccessors accessors, InternalAdditionalLogics additionalLogics, LogicData data, IServerAPI api)
 {
     AchievementModule      = AchievementModule.CreateClient(accessors.AchievementAccessor, additionalLogics.ScorersLogic, additionalLogics.DropLogic, accessors.FormulaController, additionalLogics.ImpactController);
     ActivationModule       = ActivationModule.CreateClient(accessors.FormulaController, additionalLogics.ImpactController, accessors.ExplorerAccessor, accessors.ScorersAccessor, accessors.PlayerAccessor, accessors.UnitsAccessor, additionalLogics.ApplyChangeLogic);
     AutowinModule          = AutowinModule.CreateClient(additionalLogics.ImpactController, accessors.ExplorerAccessor, accessors.ScorersAccessor, additionalLogics.FormulaLogic, additionalLogics.ExplorerLogic);
     BattleModule           = BattleModule.CreateClient(accessors.BattleAccessor, accessors.ExplorerAccessor, accessors.UnitsAccessor, additionalLogics.ContextLogic, additionalLogics.ImpactController, additionalLogics.TriggerLogic, additionalLogics.BattleLogic, additionalLogics.BuffLogic);
     CheatModule            = CheatModule.CreateClient(accessors.UnitsAccessor, accessors.ScorersAccessor, accessors.BattleAccessor, accessors.InventoryAccessor, accessors.PlayerAccessor, accessors.ExplorerAccessor, accessors.LogAccessor, accessors.SettingsAccessor, additionalLogics.ExplorerLogic, additionalLogics.BattleLogic, additionalLogics.ContextLogic, additionalLogics.ImpactController, additionalLogics.DropLogic, additionalLogics.ScorersLogic);
     CutSceneModule         = CutSceneModule.CreateClient(accessors.CutSceneAccessor, additionalLogics.ImpactController, additionalLogics.ApplyChangeLogic);
     EquipmentModule        = EquipmentModule.CreateClient(accessors.InventoryAccessor, accessors.ScorersAccessor, accessors.UnitsAccessor, additionalLogics.ImpactController, additionalLogics.FormulaLogic);
     ExplorerProgressModule = ExplorerProgressModule.CreateClient(accessors.ExplorerAccessor, accessors.InventoryAccessor, accessors.UnitsAccessor, accessors.SettingsAccessor, accessors.ScorersAccessor, accessors.BattleAccessor, additionalLogics.ExplorerLogic, additionalLogics.FormulaLogic, additionalLogics.ImpactController);
     GachaModule            = GachaModule.CreateClient(additionalLogics.ImpactController, accessors.ScorersAccessor, accessors.InventoryAccessor, accessors.UnitsAccessor, accessors.ExplorerAccessor, additionalLogics.DropLogic, accessors.ConditionController, additionalLogics.FormulaLogic);
     SettingsModule         = SettingsModule.CreateClient(accessors.SettingsAccessor, accessors.ScorersAccessor, additionalLogics.ImpactController);
     ShopModule             = ShopModule.CreateClient(accessors.ScorersAccessor, accessors.ShopAccessor, additionalLogics.FormulaLogic, additionalLogics.ImpactController, additionalLogics.ShopLogic, additionalLogics.DropLogic);
     StartSessionModule     = StartSessionModule.CreateClient(accessors.UnitsAccessor, accessors.ScorersAccessor, accessors.BattleAccessor, accessors.InventoryAccessor, accessors.PlayerAccessor, accessors.ExplorerAccessor, accessors.LogAccessor, accessors.SettingsAccessor, accessors.ShopAccessor, accessors.LogAccessor, accessors.AchievementAccessor, additionalLogics.BattleLogic, additionalLogics.ShopLogic, additionalLogics.ExplorerLogic, accessors.FormulaController, additionalLogics.ImpactController);
     StorageModule          = StorageModule.CreateClient(accessors.ScorersAccessor, accessors.InventoryAccessor);
     UnitProgressModule     = UnitProgressModule.CreateClient(accessors.UnitsAccessor, accessors.ScorersAccessor, accessors.BattleAccessor, additionalLogics.FormulaLogic, accessors.PlayerAccessor, additionalLogics.ImpactController);
 }
        public void ShouldAddLibraryViewToToolsRegion()
        {
            var toolsRegion   = new MockRegion();
            var regionManager = new MockRegionManager();
            var container     = new MockUnityResolver();

            container.Bag.Add(typeof(ISettingsViewPresentationModel), new MockSettingsViewPresentationModel());

            regionManager.Regions.Add("ToolsRegion", toolsRegion);

            var module = new SettingsModule(container, regionManager);

            Assert.AreEqual(0, toolsRegion.AddedViews.Count);

            module.Initialize();

            Assert.AreEqual(1, toolsRegion.AddedViews.Count);
            Assert.IsInstanceOfType(toolsRegion.AddedViews[0], typeof(ISettingsView));
        }
        public void ShouldAddSettingsMenuButtonViewToMenuRegion()
        {
            var windowManager  = new MockWindowManager();
            var container      = new MockUnityResolver();
            var regionManager  = new MockRegionManager();
            var module         = new SettingsModule(container, regionManager, windowManager);
            var menuButtonView = new MockMenuButtonView();

            ISettingsViewPresentationModel settingsViewModel = new MockSettingsViewPresentationModel();

            container.Bag.Add(typeof(ISettingsViewPresentationModel), settingsViewModel);
            container.Bag.Add(typeof(IIncreasePersistenceQuotaViewModel), new MockIncreasePersistenceQuotaViewModel());

            MockSettingsMenuButtonViewModel menuViewModel = new MockSettingsMenuButtonViewModel();

            menuViewModel.View = menuButtonView;

            container.Bag[typeof(IMenuButtonViewModel)] = menuViewModel;

            MockRegion menuRegion = new MockRegion {
                Name = "MenuRegion"
            };
            MockRegion mainRegion = new MockRegion {
                Name = "MainRegion"
            };

            regionManager.Regions.Add(menuRegion);
            regionManager.Regions.Add(mainRegion);

            Assert.AreEqual(0, menuRegion.AddedViews.Count);

            module.Initialize();

            Assert.AreSame(settingsViewModel.View, menuViewModel.ViewToDisplay);
            Assert.IsTrue(menuViewModel.IsViewActive);
            Assert.AreEqual(1, menuRegion.AddedViews.Count);
            Assert.IsNotNull(menuViewModel.View);
            Assert.AreSame(menuViewModel.View, menuRegion.AddedViews[0]);
            Assert.AreEqual("Settings", menuViewModel.Text);
        }
Пример #7
0
 void IModuleDependency <SettingsModule> .ConnectDependency(SettingsModule dependency)
 {
     m_SettingsModule = dependency;
 }
Пример #8
0
 public IndexerModule(IDataService dataService, SettingsModule settings)
 {
     DataService = dataService;
     _Settings   = settings;
     AssembleLanguageSelections();
 }
Пример #9
0
 public virtual void SetUp()
 {
     _typeRegistryMock = new Mock <ITypeRegistry>();
     _settingsModule   = new SettingsModule(_typeRegistryMock.Object);
 }
Пример #10
0
        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                switch (e.Item.Caption)
                {
                case "地址配置":
                    SettingsModule set = new SettingsModule();
                    set.ShowDialog();
                    break;

                case "另存为":
                    this.saveFileDialog1.Filter   = "2010 Excel文件|*.xlsx|97-2003 Excel文件|*.xls";
                    this.saveFileDialog1.FileName = spreadsheetControl1.Document.Worksheets[0].Cells["A7"].Value.ToString();
                    if (DialogResult.OK == this.saveFileDialog1.ShowDialog())
                    {
                        string path = this.saveFileDialog1.FileName;
                        this.spreadsheetControl1.Document.SaveDocument(path);
                    }
                    break;

                case "打开”自动保存“目录":
                    System.Diagnostics.Process.Start("Explorer", "/select," + Application.StartupPath + "\\" + "AutoSave.xlsx");
                    break;

                case "驻波等-开始测试":
                    IsTest = true;
                    while (IsTest)
                    {
                        DialogResult res = XtraMessageBox.Show("即将进行驻波|幅度|相位测试  第" + barEditItem_驻波_索引号.EditValue + "行 \n 点击【YES】开始测试\n点击【No】,重新测试\n点击【Cancel】,停止测试", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information);
                        if (res == DialogResult.Yes)
                        {
                            驻波等测试();
                            barEditItem_驻波_索引号.EditValue = Convert.ToInt32(barEditItem_驻波_索引号.EditValue) + 1;
                        }
                        else if (res == DialogResult.No)
                        {
                            barEditItem_驻波_索引号.EditValue = Convert.ToInt32(barEditItem_驻波_索引号.EditValue) - 1;
                            驻波等测试();
                            barEditItem_驻波_索引号.EditValue = Convert.ToInt32(barEditItem_驻波_索引号.EditValue) + 1;
                        }
                        else
                        {
                            IsTest = false;
                        }
                    }
                    break;

                case "IN口-开始测试":
                    double zhubo2 = Test驻波.总口驻波测试();
                    spreadsheetControl1.Document.Worksheets[0].Cells["C" + 27].Value     = zhubo2.ToString("f2");
                    spreadsheetControl1.Document.Worksheets[0].Cells["C" + 27].FillColor = zhubo2 <= 1.5 ? Color.White : Color.Red;
                    break;

                case "隔离度-开始测试":
                    IsTest = true;
                    while (IsTest)
                    {
                        DialogResult res = XtraMessageBox.Show("即将进行隔离度测试  第" + barEditItem_隔离度_索引号.EditValue + "行 \n 点击【YES】开始测试\n点击【No】,重新测试\n点击【Cancel】,停止测试", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information);
                        if (res == DialogResult.Yes)
                        {
                            隔离度测试();
                            barEditItem_隔离度_索引号.EditValue = Convert.ToInt32(barEditItem_隔离度_索引号.EditValue) + 2;
                        }
                        else if (res == DialogResult.No)
                        {
                            barEditItem_隔离度_索引号.EditValue = Convert.ToInt32(barEditItem_隔离度_索引号.EditValue) - 2;
                            隔离度测试();
                            barEditItem_隔离度_索引号.EditValue = Convert.ToInt32(barEditItem_隔离度_索引号.EditValue) + 2;
                        }
                        else
                        {
                            IsTest = false;
                        }
                    }
                    IsTest = true;

                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.StackTrace, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }