/// <summary> /// Sets the window location only if the point exists on one of the screens. /// </summary> /// <param name="form">The form.</param> /// <param name="location">The location.</param> public static void SetWindowLocationSafely(Form form, Point location) { if (!location.IsEmpty) { if (Screen.AllScreens.Any(screen => screen.WorkingArea.Contains(location))) { form.Location = location; GeneralHelper.DebugOut("setting form: '" + form + "' location to: " + location); } } }
private void InitializeSelfservicing(IConnectionInfo cxInfo, Type commonDaoBaseType, object context, QueryExecutionManager executionManager) { var actualConnectionStringField = commonDaoBaseType.GetField("ActualConnectionString"); #if DEBUG var actualConnectionString = Convert.ToString(actualConnectionStringField.GetValue(context)); GeneralHelper.DebugOut(actualConnectionString); #endif actualConnectionStringField.SetValue(context, cxInfo.DatabaseInfo.CustomCxString); #if DEBUG GeneralHelper.DebugOut(Convert.ToString(actualConnectionStringField.GetValue(context))); #endif SetSQLTranslationWriter(commonDaoBaseType, executionManager); }