public Display(ApplicationConfig config) { this.background = (Field)FieldFactory.MakeField(config.BackgroundField); this.numberField = (FieldString)FieldFactory.MakeField(config.NumberField); this.trialField = (FieldString)FieldFactory.MakeField(config.TrialField); this.recordField = (FieldString)FieldFactory.MakeField(config.RecordField); this.resultField = (FieldImage)FieldFactory.MakeField(config.ResultField); }
private void DownloadConfigXMLCompleted(object sender, DownloadStringCompletedEventArgs e) { try { string xmlConfig = e.Result; appConfig = ApplicationConfig.Deserialize(xmlConfig); gisApplication = appConfig.ApplicationTitle; configurationCompleted(); } catch (Exception ex) { messageBoxCustom.Show(ex.Message, "Error message"); } }
public Envelope Sign(ApplicationConfig applicationConfig) { var envelope = new Envelope(); envelope.Message = this.ToJson(); var hashBytes = new HMACSHA256(Encoding.UTF8.GetBytes(applicationConfig.SignatureKey)).ComputeHash(Encoding.UTF8.GetBytes(envelope.Message)); var hexString = new StringBuilder(); for (var i = 0; i < hashBytes.Length; i++) { hexString.Append(hashBytes[i].ToString("X2")); } envelope.Auth = hexString.ToString(); return envelope; }
/// <summary> /// Initializes a new instance of the <see cref="EditPlayerForm"/> class. /// </summary> /// <param name="editMode">The <see cref="EditMode"/> to be used.</param> /// <param name="teamDescriptor">The team descriptor.</param> /// <param name="playerId">The player database ID.</param> internal EditPlayerForm(EditMode editMode, string teamDescriptor, long playerId) : base() { this.editMode = editMode; this.teamDescriptor = teamDescriptor; this.playerId = playerId; database = Database.Instance; appConfig = ApplicationConfig.Instance; InitializeComponent(); cbxCountries.DataSource = appConfig.Countries; PreloadDatabaseInfo(); UpdateControls(); DefineHeaderText(); }
/// <summary> /// Initializes a new instance of the <see cref="MainForm"/> class. /// </summary> internal MainForm(ApplicationConfig appConfig, Database database, string teamDescriptor) : base() { this.appConfig = appConfig; this.database = database; this.teamDescriptor = teamDescriptor; InitializeComponent(); Width = appConfig.GuiWidth; Height = appConfig.GuiHeight; SetText("Erfassung, Verwaltung & Analyse von Leistungsdaten"); lblTitle.Text = AppInfo.AssemblyTitle; playerEntries = new BindingList<PlayerRowEntry>(); playerDataRowEntries = new BindingList<PlayerDataRowEntry>(); playerMeasurementEntries = new BindingList<PlayerMeasurementRowEntry>(); InitializeTeamCombobox(); }
public static void Send(ApplicationConfig applicationConfig, Message message) { var templateRestUrl = "{0}://{1}.{2}.eventsockets.com/?applicationKey={3}&version=" + applicationConfig.Version; var envelopeString = message.Sign(applicationConfig).ToJson(); HttpWebRequest httpWebRequest = null; HttpWebResponse httpWebResponse = null; Stream httpWebRequestStream = null; try { System.Net.ServicePointManager.Expect100Continue = false; var buffer = Encoding.UTF8.GetBytes(envelopeString); httpWebRequest = (HttpWebRequest)WebRequest.Create(String.Format(templateRestUrl, (!applicationConfig.Secure ? "http" : "https"), (!applicationConfig.Secure ? "api" : "apis"), applicationConfig.ClusterKey, applicationConfig.ApplicationKey)); httpWebRequest.Method = "POST"; httpWebRequest.ContentType = "application/json"; httpWebRequest.ContentLength = buffer.Length; httpWebRequestStream = httpWebRequest.GetRequestStream(); httpWebRequestStream.Write(buffer, 0, buffer.Length); httpWebRequestStream.Close(); httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse(); } finally { if (httpWebRequestStream != null) { httpWebRequestStream.Dispose(); } if (httpWebResponse != null) { httpWebResponse.Close(); } } }
public TCPHelper(ILogger <TCPHelper> logger) { _logger = logger; config = ApplicationConfig.Instance; }
public void Configuration(IAppBuilder app) { ApplicationConfig.RegisterConfig("development"); ConfigureAuth(app); }
public virtual Task OnMainConfigChanged(ApplicationContext context, ApplicationConfig newConfig) { return(Task.CompletedTask); }
public void GetConfigurationXML(ConfigurationCompleted configurationCompleted) { appConfig = new ApplicationConfig(); this.configurationCompleted = configurationCompleted; LoadConfigXML(); }
static void AssertApplicationConfigIsIdentical(ApplicationConfig firstAppConfig, string firstEnvFile, ApplicationConfig secondAppConfig, string secondEnvFile) { Assert.AreEqual(firstAppConfig.uses_mono_llvm, secondAppConfig.uses_mono_llvm, $"Field 'uses_mono_llvm' has different value in environment file '{secondEnvFile}' than in environment file '{firstEnvFile}'"); Assert.AreEqual(firstAppConfig.uses_mono_aot, secondAppConfig.uses_mono_aot, $"Field 'uses_mono_aot' has different value in environment file '{secondEnvFile}' than in environment file '{firstEnvFile}'"); Assert.AreEqual(firstAppConfig.is_a_bundled_app, secondAppConfig.is_a_bundled_app, $"Field 'is_a_bundled_app' has different value in environment file '{secondEnvFile}' than in environment file '{firstEnvFile}'"); Assert.AreEqual(firstAppConfig.environment_variable_count, secondAppConfig.environment_variable_count, $"Field 'environment_variable_count' has different value in environment file '{secondEnvFile}' than in environment file '{firstEnvFile}'"); Assert.AreEqual(firstAppConfig.system_property_count, secondAppConfig.system_property_count, $"Field 'system_property_count' has different value in environment file '{secondEnvFile}' than in environment file '{firstEnvFile}'"); Assert.AreEqual(firstAppConfig.android_package_name, secondAppConfig.android_package_name, $"Field 'android_package_name' has different value in environment file '{secondEnvFile}' than in environment file '{firstEnvFile}'"); }
public void Initialize() { appConfig = database.Get <ApplicationConfig>(Constants.DB_KEY_APP_CONFIG); SetupTransitions(); SetupGestureEventDispatcher(); }
public PurchaseCall(ApplicationConfig config, Dictionary <String, String> inputParams) : base(config, inputParams) { }
public ClientDownloadsController(IWebHostEnvironment hostEnv, ApplicationConfig appConfig) { HostEnv = hostEnv; AppConfig = appConfig; }
public bool IsInstalled(ApplicationConfig application) { var installDirectory = application.Environment.InstallDirectoryOrDefault; return(File.Exists(GetProcessStartInfo(installDirectory).FileName)); }
public void Configure(IApplicationBuilder app) { //ignore the webhook url from antiforgery validation ApplicationConfig.IgnoreAntiforgeryValidation("/square/webhook"); }
public static void ClassInitialize(TestContext cont) { _appIdentity = new AppIdentity("id", new Version("1.0.0")); _appConfig = new ApplicationConfig(_appIdentity, ExeName, TestExeArgs); }
/// <summary> /// Creates an <see cref="ApplicationLauncher"/> from an application config. /// </summary> public static ApplicationLauncher FromApplicationConfig(ApplicationConfig config) { return(FromLocationAndArguments($"{config.AppLocation}", $"{config.AppArguments}")); }
/// <summary> /// Cria uma nova instância do provider /// </summary> /// <param name="configuration">Coleção de configurações</param> public MongoDatabaseProvider(IOptions <ApplicationConfig> appConfig) { _appConfig = appConfig.Value; }
public StatusCheckCall(ApplicationConfig config, Dictionary <String, String> inputParams) : base(config, inputParams) { }
protected virtual void init() { // 必须先初始化配置文件 int count = mFrameComponentInit.Count; for (int i = 0; i < count; ++i) { try { DateTime start = DateTime.Now; mFrameComponentInit[i].init(); UnityUtility.logInfo(mFrameComponentInit[i].getName() + "初始化消耗时间:" + (DateTime.Now - start).TotalMilliseconds); } catch (Exception e) { UnityUtility.logError("init failed! :" + mFrameComponentInit[i].getName() + ", info:" + e.Message + ", stack:" + e.StackTrace); } } System.Net.ServicePointManager.DefaultConnectionLimit = 200; mEnableKeyboard = (int)FrameBase.mFrameConfig.getFloat(GAME_FLOAT.ENABLE_KEYBOARD) > 0; ApplicationConfig appConfig = FrameBase.mApplicationConfig; QualitySettings.vSyncCount = (int)appConfig.getFloat(GAME_FLOAT.VSYNC); int width = (int)appConfig.getFloat(GAME_FLOAT.SCREEN_WIDTH); int height = (int)appConfig.getFloat(GAME_FLOAT.SCREEN_HEIGHT); int fullScreen = (int)appConfig.getFloat(GAME_FLOAT.FULL_SCREEN); #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS) // 移动平台下固定为全屏 fullScreen = 1; #endif Vector2 screenSize = UnityUtility.getScreenSize(); if (fullScreen == 1) { width = (int)screenSize.x; height = (int)screenSize.y; } Screen.SetResolution(width, height, fullScreen == 1 || fullScreen == 3); #if !UNITY_EDITOR && UNITY_STANDALONE_WIN // 设置为无边框窗口,只在Windows平台使用 if (fullScreen == 2) { // 无边框的设置有时候会失效,并且同样的设置,如果上一次设置失效后,即便恢复设置也同样会失效,也就是说本次的是否生效与上一次的结果有关 // 当设置失效后,可以使用添加启动参数-popupwindow来实现无边框 long curStyle = User32.GetWindowLong(User32.GetForegroundWindow(), CommonDefine.GWL_STYLE); curStyle &= ~CommonDefine.WS_BORDER; curStyle &= ~CommonDefine.WS_DLGFRAME; User32.SetWindowLong(User32.GetForegroundWindow(), CommonDefine.GWL_STYLE, curStyle); } #endif // NGUI #if USE_NGUI GameObject nguiRootObj = UnityUtility.getGameObject(null, CommonDefine.NGUI_ROOT); UIRoot nguiRoot = nguiRootObj.GetComponent <UIRoot>(); nguiRoot.scalingStyle = UIRoot.Scaling.Constrained; nguiRoot.manualWidth = width; nguiRoot.manualHeight = height; GameCamera camera = FrameBase.mCameraManager.getUICamera(false); OT.MOVE(camera, new Vector3(0.0f, 0.0f, -height * 0.5f / MathUtility.tan(camera.getFOVY(true) * 0.5f))); GameCamera blurCamera = FrameBase.mCameraManager.getUIBlurCamera(false); OT.MOVE(blurCamera, new Vector3(0.0f, 0.0f, -height * 0.5f / MathUtility.tan(blurCamera.getFOVY(true) * 0.5f))); #endif // UGUI GameObject uguiRootObj = UnityUtility.getGameObject(null, CommonDefine.UGUI_ROOT); RectTransform uguiRectTransform = uguiRootObj.GetComponent <RectTransform>(); uguiRectTransform.offsetMin = -screenSize * 0.5f; uguiRectTransform.offsetMax = screenSize * 0.5f; uguiRectTransform.anchorMax = Vector2.zero; uguiRectTransform.anchorMin = Vector2.zero; GameCamera camera = FrameBase.mCameraManager.getUICamera(false); if (camera != null) { OT.MOVE(camera, new Vector3(0.0f, 0.0f, -height * 0.5f / MathUtility.tan(camera.getFOVY(true) * 0.5f))); } GameCamera blurCamera = FrameBase.mCameraManager.getUIBlurCamera(false); if (blurCamera != null) { OT.MOVE(blurCamera, new Vector3(0.0f, 0.0f, -height * 0.5f / MathUtility.tan(blurCamera.getFOVY(true) * 0.5f))); } // 设置默认的日志等级 #if UNITY_EDITOR UnityUtility.setLogLevel(LOG_LEVEL.LL_NORMAL); #else UnityUtility.setLogLevel((LOG_LEVEL)(int)FrameBase.mFrameConfig.getFloat(GAME_FLOAT.LOG_LEVEL)); #endif }
public CalendarReadingJob() { // TODO DI _applicationConfig = ApplicationConfigHelper.GetApplicationConfig(); }
public EscritorArquivo(ApplicationConfig applicationConfig) { this.applicationConfig = applicationConfig; }
/// <summary> /// 构造方法 /// </summary> public SubSystemController(ISubSystemService subSystemService, IMapper mapper, ApplicationConfig applicationConfig) : base(applicationConfig) { _subSystemService = subSystemService; _mapper = mapper; }
public frmLogs() { InitializeComponent(); config = ApplicationConfig.Load <ApplicationConfig>(); maxLog = config.MaxLogs; }
static ApplicationConfig ReadApplicationConfig(string envFile) { string[] lines = File.ReadAllLines(envFile, Encoding.UTF8); var strings = new Dictionary <string, string> (StringComparer.Ordinal); var pointers = new List <string> (); var ret = new ApplicationConfig(); bool gatherFields = false; uint fieldCount = 0; for (int i = 0; i < lines.Length; i++) { string line = lines [i]; if (IsCommentLine(line)) { continue; } string[] field; if (stringLabelRegex.IsMatch(line)) { string label = line.Substring(0, line.Length - 1); line = lines [++i]; field = GetField(envFile, line, i); AssertFieldType(envFile, ".asciz", field [0], i); strings [label] = AssertIsAssemblerString(envFile, field [1], i); continue; } if (String.Compare("application_config:", line.Trim(), StringComparison.Ordinal) == 0) { gatherFields = true; continue; } if (!gatherFields) { continue; } field = GetField(envFile, line, i); if (String.Compare(".zero", field [0], StringComparison.Ordinal) == 0) { continue; // structure padding } switch (fieldCount) { case 0: // uses_mono_llvm: bool / .byte AssertFieldType(envFile, ".byte", field [0], i); ret.uses_mono_llvm = ConvertFieldToBool("uses_mono_llvm", envFile, i, field [1]); break; case 1: // uses_mono_aot: bool / .byte AssertFieldType(envFile, ".byte", field [0], i); ret.uses_mono_aot = ConvertFieldToBool("uses_mono_aot", envFile, i, field [1]); break; case 2: // uses_assembly_preload: bool / .byte AssertFieldType(envFile, ".byte", field [0], i); ret.uses_assembly_preload = ConvertFieldToBool("uses_assembly_preload", envFile, i, field [1]); break; case 3: // is_a_bundled_app: bool / .byte AssertFieldType(envFile, ".byte", field [0], i); ret.is_a_bundled_app = ConvertFieldToBool("is_a_bundled_app", envFile, i, field [1]); break; case 4: // environment_variable_count: uint32_t / .word | .long Assert.IsTrue(expectedUInt32Types.Contains(field [0]), $"Unexpected uint32_t field type in '{envFile}:{i}': {field [0]}"); ret.environment_variable_count = ConvertFieldToUInt32("environment_variable_count", envFile, i, field [1]); break; case 5: // system_property_count: uint32_t / .word | .long Assert.IsTrue(expectedUInt32Types.Contains(field [0]), $"Unexpected uint32_t field type in '{envFile}:{i}': {field [0]}"); ret.system_property_count = ConvertFieldToUInt32("system_property_count", envFile, i, field [1]); break; case 6: // android_package_name: string / [pointer type] Assert.IsTrue(expectedPointerTypes.Contains(field [0]), $"Unexpected pointer field type in '{envFile}:{i}': {field [0]}"); pointers.Add(field [1].Trim()); break; } fieldCount++; if (String.Compare(".size", field [0], StringComparison.Ordinal) == 0) { fieldCount--; Assert.IsTrue(field [1].StartsWith("application_config", StringComparison.Ordinal), $"Mismatched .size directive in '{envFile}:{i}'"); break; // We've reached the end of the application_config structure } } Assert.AreEqual(ApplicationConfigFieldCount, fieldCount, $"Invalid 'application_config' field count in environment file '{envFile}'"); Assert.AreEqual(1, pointers.Count, $"Invalid number of string pointers in 'application_config' structure in environment file '{envFile}'"); Assert.IsTrue(strings.TryGetValue(pointers [0], out ret.android_package_name), $"Invalid package name string pointer in 'application_config' structure in environment file '{envFile}'"); Assert.IsFalse(String.IsNullOrEmpty(ret.android_package_name), $"Package name field in 'application_config' in environment file '{envFile}' must not be null or empty"); return(ret); }
public ApplicationConfigEventArgs(ApplicationConfig config) { Config = config; }
protected override void UpdateConfig(ApplicationConfig config) { realFrwIas = config.DisplayRealFrwIas; BackColor = config.ColorBackground; var margin = new Padding(2); foreach (KeyValuePair <string, Def> pair in def) { var x = pair.Value.settings(config); var visible = x.Item1; if (visible) { var color = x.Item2; var font = new Font(config.FontName, x.Item3); foreach (Label l in pair.Value.labels) { l.Visible = visible; l.Margin = margin; l.ForeColor = color; l.Font = font; var teststr = pair.Value.defaults[l].Replace("{}", pair.Value.maxString); l.Size = MeasureText(teststr, l); } } else { foreach (Label l in pair.Value.labels) { l.Visible = visible; } } } panelResistances.Visible = config.DisplayResistances; panelBaseStats.Visible = config.DisplayBaseStats; panelAdvancedStats.Visible = config.DisplayAdvancedStats; int count = 0; if (panelResistances.Visible) { count++; } if (panelBaseStats.Visible) { count++; } if (panelAdvancedStats.Visible) { count++; } panelDiffPercentages.Visible = count < 3 && config.DisplayDifficultyPercentages; panelDiffPercentages2.Visible = count >= 3 && config.DisplayDifficultyPercentages; panelStats.Visible = config.DisplayResistances || config.DisplayBaseStats || config.DisplayAdvancedStats || config.DisplayDifficultyPercentages; FlowLayoutPanel nextRuneLayoutPanel = null; if (config.DisplayRunes) { nextRuneLayoutPanel = config.DisplayRunesHorizontal ? panelRuneDisplayHorizontal : panelRuneDisplayVertical; } // Only hide panels when the panels were changed. if (activeRuneLayoutPanel != nextRuneLayoutPanel) { activeRuneLayoutPanel?.Hide(); activeRuneLayoutPanel = nextRuneLayoutPanel; } // TODO: automatically size the rune panel... int statsWidth = (panelResistances.Visible ? panelResistances.Width : 0) + (panelBaseStats.Visible ? panelBaseStats.Width : 0) + (panelAdvancedStats.Visible ? panelAdvancedStats.Width : 0) + ((count < 3 && panelDiffPercentages.Visible) ? panelDiffPercentages.Width : 0) ; panelRuneDisplayHorizontal.MaximumSize = new Size(Math.Max(def["name"].labels[0].Width, statsWidth), 0); }
public LoginController(SignInManager <RemotelyUser> signInManager, DataService dataService, ApplicationConfig appConfig) { SignInManager = signInManager; DataService = dataService; AppConfig = appConfig; }
public LoadPaymentFormCall(ApplicationConfig config, Dictionary <String, String> inputParams) : base(config, inputParams) { }
public DataService(ApplicationDbContext context, ApplicationConfig appConfig) { RemotelyContext = context; AppConfig = appConfig; }
abstract protected void UpdateConfig(ApplicationConfig config);
public void Setup() { _repository = new Mock <IRepository>(); IEnumerable <VolunteerForCacheDto> helperPostcodeRadiusDtos1 = new List <VolunteerForCacheDto>() { new VolunteerForCacheDto() { UserId = 1, Postcode = "NG1 1AA", SupportRadiusMiles = 1.2, VolunteerType = VolunteerType.StreetChampion, IsVerifiedType = IsVerifiedType.IsVerified, Latitude = 1, Longitude = 2, } }; IEnumerable <VolunteerForCacheDto> helperPostcodeRadiusDtos2 = new List <VolunteerForCacheDto>() { new VolunteerForCacheDto() { UserId = 2, Postcode = "NG1 1AB", SupportRadiusMiles = 2.4, VolunteerType = VolunteerType.Helper, IsVerifiedType = IsVerifiedType.IsVerified, Latitude = 3, Longitude = 4, } }; _repository.SetupSequence(x => x.GetVolunteersForCacheAsync(It.IsAny <int>(), It.IsAny <int>())) .ReturnsAsync(helperPostcodeRadiusDtos1) .ReturnsAsync(helperPostcodeRadiusDtos2); _repository.Setup(x => x.GetMinUserIdAsync()).ReturnsAsync(100); _repository.Setup(x => x.GetMaxUserIdAsync()).ReturnsAsync(250); _repository.Setup(x => x.GetDistinctVolunteerUserCount()).Returns(150); _repository.Setup(x => x.GetAllDistinctVolunteerUserCount()).Returns(150); IEnumerable <User> users = new List <User>() { new User() { ID = 1 } }; _repository.Setup(x => x.GetVolunteersByIdsAsync(It.IsAny <IEnumerable <int> >())).ReturnsAsync(users); _addressService = new Mock <IAddressService>(); ApplicationConfig applicationConfig = new ApplicationConfig() { GetVolunteersForCacheBatchSize = 100 }; _applicationConfig = new Mock <IOptionsSnapshot <ApplicationConfig> >(); _applicationConfig.SetupGet(x => x.Value).Returns(applicationConfig); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); ApplicationConfig.RegisterConfig("development"); }
public LightsProxy(ApplicationConfig applicationConfig) { _applicationConfig = applicationConfig ?? throw new ArgumentNullException(nameof(applicationConfig)); _lightsApi = RestService.For <ILightsApi>(_applicationConfig.BridgeConfig.HueBridgeUri); }
public RemoteControlController(DataService dataService, IHubContext <DeviceSocketHub> deviceHub, ApplicationConfig appConfig, SignInManager <RemotelyUser> signInManager) { DataService = dataService; DeviceHub = deviceHub; AppConfig = appConfig; SignInManager = signInManager; }
protected override void UpdateConfig(ApplicationConfig config) { var padding = new Padding(0, 0, 0, config.VerticalLayoutPadding); realFrwIas = config.DisplayRealFrwIas; BackColor = config.ColorBackground; int w_full = 0; int w_left = 0; int w_right = 0; foreach (KeyValuePair <string, Def> pair in def) { Tuple <bool, Color, int> t = pair.Value.settings(config); var enabled = t.Item1; Font font = CreateFont(config.FontName, t.Item3); var labels = pair.Value.labels; var color = t.Item2; var mstr = pair.Value.maxString; var defaults = pair.Value.defaults; pair.Value.enabled = enabled; int i = 0; foreach (var l in labels) { l.Visible = enabled; if (enabled) { l.Font = font; l.ForeColor = color; var teststr = defaults[l].Replace("{}", mstr); l.Size = MeasureText(teststr, l); l.Margin = padding; if (labels.Length == 1) { w_full = Math.Max(l.Size.Width, w_full); } else if (i == 0) { w_left = Math.Max(l.Size.Width, w_left); } else { w_right = Math.Max(l.Size.Width, w_right); } i++; } } } foreach (KeyValuePair <string, Def> pair in def) { int i = 0; foreach (var l in pair.Value.labels) { if (pair.Value.labels.Length == 1) { l.Size = new Size(w_full, l.Size.Height); } else if (i == 0) { l.Size = new Size(w_left, l.Size.Height); } else { l.Size = new Size(w_right, l.Size.Height); } i++; } } if (!config.DisplayRunes) { panelRuneDisplay.Hide(); } }