/// <summary> /// UI的适配 /// </summary> /// <returns></returns> public static bool UIResolutionType1136X640() { #if UNITY_EDITOR || UNITY_STANDALONE_WIN float w = Screen.width; float h = Screen.height; #else float w = Screen.currentResolution.width; float h = Screen.currentResolution.height; #endif if (w % 1136 == 0 && h % 640 == 0) { return(true); } if (w % 1024 == 0 && h % 768 == 0) { return(false); } ResolutionType type = ScreenType(); if (type == ResolutionType.Screen_Large || type == ResolutionType.Screen_Small) { return(true); } else { return(false); } }
public ResolverFactory(string source, ResolutionType resolutionType, ILogger logger) { _resolvers = new Resolver[] { new NuGetPackageResolver(source, resolutionType, logger) }; }
public TenantContext(TTenant tenant, ResolutionResult resolutionResult, MappingResult mappingResult, ResolutionType resolvedType) { Tenant = tenant; ResolutionResult = resolutionResult; MappingResult = mappingResult; ResolutionType = resolvedType; }
private static void SetDriverResolution() { ResolutionType resolutionType = TestConfiguration.ResolutionParameter; ResolutionTypeHelper.SetResolution4Browser(resolutionType); Console.WriteLine("Resolution type: " + resolutionType); }
public void Resolve(Conflict conflict, ResolutionType resolutionType) { var result = this.VersionControlService.Resolve(conflict, resolutionType); ProcessGetOperations(result.GetOperations, ProcessType.Get); this.Undo(result.UndoOperations.Select(x => new ItemSpec(x.TargetLocalItem, RecursionType.None)).ToList()); }
public void MapChangeOfChargesMessageToCharge_WhenMessageWithProperties_ThenReturnsChargeWithPropertiesSet() { // Arrange var changeOfChargesMessage = GetValidChangeOfChargesMessage(); changeOfChargesMessage !.MktActivityRecord !.ValidityEndDate = Instant.MaxValue; var chargeType = new ChargeType { Code = changeOfChargesMessage.Type, Id = 1, Name = "Name" }; var chargeTypeOwnerMRid = new MarketParticipant { Id = 1, MRid = changeOfChargesMessage.ChargeTypeOwnerMRid }; var resolutionType = new ResolutionType { Id = 1, Name = changeOfChargesMessage.Period?.Resolution }; var vatPayerType = new VatPayerType { Id = 1, Name = changeOfChargesMessage.MktActivityRecord?.ChargeType?.VatPayer }; // When var result = ChangeOfChargesMapper.MapChangeOfChargesTransactionToCharge(changeOfChargesMessage, chargeType, chargeTypeOwnerMRid, resolutionType, vatPayerType); var properties = result.GetType().GetProperties(); foreach (var property in properties) { var value = property.GetValue(result); Assert.NotNull(value); } }
public void MapChangeOfChargesMessageToCharge_WhenMessageWithProperties_ThenReturnsChargeWithPropertiesSet() { // Arrange var changeOfChargesMessage = GetValidChangeOfChargesMessage(); #pragma warning disable CS8602 // Dereference of a possibly null reference. changeOfChargesMessage.MktActivityRecord.ValidityEndDate = Instant.MaxValue; #pragma warning restore CS8602 // Dereference of a possibly null reference. var chargeType = new ChargeType { Code = changeOfChargesMessage.Type, Id = 1, Name = "Name" }; var chargeTypeOwnerMRid = new Ingestion.Infrastructure.ChangeOfCharges.Context.Model.MarketParticipant { Id = 1, MRid = changeOfChargesMessage.ChargeTypeOwnerMRid }; var resolutionType = new ResolutionType { Id = 1, Name = changeOfChargesMessage.Period?.Resolution }; var vatPayerType = new VatPayerType { Id = 1, Name = changeOfChargesMessage.MktActivityRecord?.ChargeType?.VATPayer }; // When var result = ChangeOfChargesMapper.MapChangeOfChargesMessageToCharge(changeOfChargesMessage, chargeType, chargeTypeOwnerMRid, resolutionType, vatPayerType); var properties = result.GetType().GetProperties(); foreach (var property in properties) { Assert.NotNull(property.GetValue(result)); } }
public ActionResult GetResolutionDO(string doNoteName, int type) { ResolutionType rt = (ResolutionType)type; MemoryStream wavStream = GetResolutionDO(doNoteName, rt); wavStream.WavToMp3File(out string fileName); return(Redirect($"~/Temp/{fileName}")); }
public Resolution(int width, int height, string displayText, string urlPart, ResolutionType resolutionType) { this.Width = width; this.Height = height; this.DisplayText = displayText; this.UrlPart = urlPart.Length > 0 ? urlPart : this.ToString(); this.ResolutionType = resolutionType; }
private MemoryStream GetResolutionNoDO(string doNoteName, ResolutionType resolutionType) { double bpm = double.Parse(ConfigurationManager.AppSettings["BPM"]); double quarterNotemillis = (60 / bpm) * 1000; TimeSpan quarterNoteDuration = TimeSpan.FromMilliseconds(quarterNotemillis); TimeSpan halfNoteDuration = quarterNoteDuration.Add(quarterNoteDuration); TimeSpan wholeNoteDuration = halfNoteDuration.Add(halfNoteDuration); string doFileName = NAudioHelper.GetFileNameFromNoteName(doNoteName); doFileName = Path.GetFileName(doFileName); int doNoteNumber = int.Parse(doFileName.Split('.')[0]); ISampleProvider note1; ISampleProvider note2; switch (resolutionType) { case ResolutionType.DoDoReDo: note1 = NAudioHelper.GetSampleProvider(doNoteNumber + Interval.UpMajor2nd, halfNoteDuration); note2 = NAudioHelper.GetSampleProvider(doNoteNumber, wholeNoteDuration); break; case ResolutionType.DoDoFaMi: note1 = NAudioHelper.GetSampleProvider(doNoteNumber + Interval.UpPerfect4th, halfNoteDuration); note2 = NAudioHelper.GetSampleProvider(doNoteNumber + Interval.UpMajor3rd, wholeNoteDuration); break; case ResolutionType.DoDoLaSo: note1 = NAudioHelper.GetSampleProvider(doNoteNumber + Interval.UpMajor6th, halfNoteDuration); note2 = NAudioHelper.GetSampleProvider(doNoteNumber + Interval.UpPerfect5th, wholeNoteDuration); break; case ResolutionType.DoDoTiHighDo: note1 = NAudioHelper.GetSampleProvider(doNoteNumber + Interval.UpMajor7th, halfNoteDuration); note2 = NAudioHelper.GetSampleProvider(doNoteNumber + 12, wholeNoteDuration); break; case ResolutionType.DoDoLowTiDo: note1 = NAudioHelper.GetSampleProvider(doNoteNumber + Interval.DownMinor2nd, halfNoteDuration); note2 = NAudioHelper.GetSampleProvider(doNoteNumber, wholeNoteDuration); break; default: throw new NotSupportedException($"ResolutionType '{resolutionType}' is not supported."); } ISampleProvider phrase = note1 .FollowedBy(note2); SampleToWaveProvider stwp = new SampleToWaveProvider(phrase); MemoryStream wavStream = new MemoryStream(); WaveFileWriter.WriteWavFileToStream(wavStream, stwp); wavStream.Position = 0; return(wavStream); }
public UserSetData(int audio, int voice, CVType cvType, LanguageType languageType, DisplayModeType displayModeType, ResolutionType resolutionType) { this.audio = audio; this.voice = voice; this.cvType = cvType; this.languageType = languageType; this.displayModeType = displayModeType; this.resolutionType = resolutionType; }
public Issue( string message, string file, Location location, IssueType type = IssueType.Information, ResolutionType resolution = ResolutionType.Open) : this(Guid.NewGuid(), null, message, file, location, type, resolution) { }
public IHttpActionResult GetPublishedResolutionsCount(ResolutionType type, short?year, int?number, string subject, string adoptionDate, string proposer) { return(ActionHelper.TryCatchWithLoggerGeneric(() => { byte idType = Convert.ToByte(type); long count = _unitOfWork.Repository <Resolution>().CountPublishedByType(idType, year, number, subject, adoptionDate, proposer); return Ok(count); }, _logger, LogCategories)); }
internal GraphQLFieldBuilder <TContext, TField> WithResolutionType(ResolutionType type) { _field.ResolutionType = type; if (_field.IsList && (type == ResolutionType.First || type == ResolutionType.FirstOrDefault)) { _field.IsList = false; } return(this); }
public BotEntry(MinigameType _Type, int _Target, RewardLevel _DesiredLevel, int _DesiredReward, ResolutionType _Resolution) { Type = _Type; Target = _Target; Running = false; DesiredLevel = _DesiredLevel; DesiredReward = _DesiredReward; Progress = 0; Resolution = _Resolution; }
/// <summary> /// Selects the resolution type for the selected file type /// </summary> /// <param name="resolution">The resolution type to select (case sensitive).</param> public void SelectFaxResolution(ResolutionType resolution) { OpenOptionsPanel(); if (!_controlPanel.ScrollPressWait("#hpid-option-fax-resolution", "#hpid-option-fax-resolution-screen", TimeSpan.FromSeconds(5))) { throw new DeviceWorkflowException("Unable to select fax resolution option."); } Pacekeeper.Sync(); _controlPanel.ScrollPressWait($"#hpid-fax-resolution-selection-{resolution.ToString().ToLower()}", ".hp-option-list"); }
private void Register(Type iface, Type impl, object dependencies, ResolutionType resType) { var reg = new Registration() { AnonymousDependencies = dependencies, ImplementationType = impl, InterfaceType = iface, ResolutionType = resType }; _container.Register(reg); }
private static string GetViewResolveType(ResolutionType type) { switch (type) { case ResolutionType.XPath: return "xpath"; case ResolutionType.Key: return "key"; case ResolutionType.ContentId: return "contentId"; } return "key"; }
/// <summary> /// Returns the scale value of the resolution for this type. /// </summary> public static float GetResolutionScale(this ResolutionType context) { switch (context) { case ResolutionType.Best: return(1f); case ResolutionType.Good: return(0.833334f); case ResolutionType.Medium: return(0.666667f); case ResolutionType.Low: return(0.5f); } throw new Exception("Unsupported resolution type: " + context); }
public Resolver(string source, ResolutionType resolutionType, ILogger logger) { this.Source = source; this.ResolutionType = resolutionType; this.Logger = logger; if (resolutionType != ResolutionType.None) { this.ResolverOptions = BuildOptions(); } else { this.ResolverOptions = new ResolverOptions(); } }
private static string GetViewResolveType(ResolutionType type) { switch (type) { case ResolutionType.XPath: return("xpath"); case ResolutionType.Key: return("key"); case ResolutionType.ContentId: return("contentId"); } return("key"); }
public Issue( IssueType type, string code, string message, string file, global::StrawberryShake.ILocation location, ResolutionType resolution) { Type = type; Code = code; Message = message; File = file; Location = location; Resolution = resolution; }
public IHttpActionResult GetPublishedResolutions(int skip, int top, ResolutionType type, short?year, int?number, string subject, string adoptionDate, string proposer) { return(ActionHelper.TryCatchWithLoggerGeneric(() => { byte idType = Convert.ToByte(type); IList <Resolution> resolutions = _unitOfWork.Repository <Resolution>().GetPublishedByType(skip, top, idType, year, number, subject, adoptionDate, proposer).ToList(); if (resolutions == null) { throw new ArgumentNullException("Resolution not found"); } IList <ResolutionModel> models = _mapper.Map <ICollection <Resolution>, ICollection <ResolutionModel> >(resolutions).ToList(); return Ok(models.AsQueryable()); }, _logger, LogCategories)); }
public IHttpActionResult GetOnlinePublishedResolutions(ResolutionType type) { return(ActionHelper.TryCatchWithLoggerGeneric(() => { short onlinePublicationInterval = WebApiConfiguration.OnlinePublicationInterval; byte idType = Convert.ToByte(type); ICollection <PrivateResolutionModels.ResolutionTableValuedModel> resolutions = _unitOfWork.Repository <Resolution>().GetOnlinePublishedByType(idType, onlinePublicationInterval); if (resolutions == null) { throw new ArgumentNullException("Resolutions not found"); } ICollection <ResolutionModel> models = _mapper.Map <ICollection <PrivateResolutionModels.ResolutionTableValuedModel>, ICollection <ResolutionModel> >(resolutions).ToList(); return Ok(models.AsQueryable()); }, _logger, LogCategories)); }
public Resolution(ActionPayload payload, ResolutionType type) : base(payload) { this.type = type; if (type == ResolutionType.Approve) { Header.Value = "Согласование документа"; Clarification.Value = "Результат согласования и комментарий будут видны только сотрудникам вашей организации."; ActionName.Value = "Согласовать"; } else { Header.Value = "Отказ в согласовании документа"; ActionName.Value = "Отказать"; } }
static public ResolutionType GetResolutionTypeForCamera(Camera camera, int limitHD, int limitSHD, bool useCachedIfPossible = false) { if (useCachedIfPossible && ScreenHelper.cachedResolution != ResolutionType.None) { return(ScreenHelper.cachedResolution); } if (camera == null) { return(ResolutionType.None); } ResolutionType resolution; Rect screenSize = new Rect(0, 0, camera.pixelWidth, camera.pixelHeight); #if UNITY_ANDROID #if ZTK_NGUI if (Application.platform == RuntimePlatform.Android) { screenSize.width = DisplayMetricsAndroid.WidthPixels; screenSize.height = DisplayMetricsAndroid.HeightPixels; } #endif #endif resolution = ResolutionType.HD; if (screenSize.height >= limitSHD) { resolution = ResolutionType.SHD; ZedLogger.Log("Setting texture to SHD"); } else if (screenSize.height >= limitHD) { resolution = ResolutionType.HD; ZedLogger.Log("Setting texture to HD"); } else { resolution = ResolutionType.SD; ZedLogger.Log("Setting texture to SD"); } ScreenHelper.cachedResolution = resolution; return(resolution); }
internal ResolveResult Resolve(Conflict conflict, ResolutionType resolutionType) { var invoker = new SoapInvoker(this); var msg = invoker.CreateEnvelope("Resolve"); msg.Add(new XElement(MessageNs + "workspaceName", conflict.Workspace.Name)); msg.Add(new XElement(MessageNs + "ownerName", conflict.Workspace.OwnerName)); msg.Add(new XElement(MessageNs + "conflictId", conflict.ConflictId)); msg.Add(new XElement(MessageNs + "resolution", resolutionType)); var response = invoker.InvokeResponse(); ResolveResult result = new ResolveResult(); result.GetOperations = GetOperationExtractor(invoker.MethodResultExtractor(response)); result.UndoOperations = GetOperationExtractor(response.Element(MessageNs + "undoOperations")); result.ResolvedConflicts = ConflictExtractor(response.Element(MessageNs + "resolvedConflicts"), conflict.Workspace); return(result); }
public Issue( Guid id, string?code, string message, string file, Location location, IssueType type, ResolutionType resolution) { Id = id; Code = code ?? "NONE"; Message = message; File = file; Location = location; Type = type; Resolution = resolution; }
/// <summary> /// Creates a TenantResolveResult that indicates a tenant resolution has been performed. /// </summary> /// <param name="value"></param> /// <param name="resolvedType"></param> public TenantResolveResult(string value, ResolutionType resolvedType) { if (string.IsNullOrWhiteSpace(value)) { Value = value; ResolutionResult = ResolutionResult.NotFound; ResolutionType = ResolutionType.Nothing; ErrorMessage = ""; } else { Value = value; ResolutionResult = ResolutionResult.Success; ResolutionType = (resolvedType == ResolutionType.Nothing) ? ResolutionType.TenantName : resolvedType; ErrorMessage = ""; } }
public void SetResolution(ResolutionType type, bool bFullScreen) { int width = 0; int height = 0; switch (type) { case ResolutionType.Resolution_1920_1080: width = 1920; height = 1080; break; case ResolutionType.Resolution_1600_900: width = 1600; height = 900; break; case ResolutionType.Resolution_1280_720: width = 1280; height = 720; break; default: Application.Quit(); return; } try { m_CurResolutionType = type; Screen.SetResolution(width, height, bFullScreen); scaler.referenceResolution = new Vector2(width, height); scaler.scaleFactor = (float)height / 1080f; scaler.referencePixelsPerUnit = 100; Invoke("ResetCursor", 0.1f); } catch (Exception e) { Debug.LogError(e.Message); } }
public static void SetResolution4Browser(ResolutionType type) { if (SeleniumExecutor.GetDriver() == null) { throw new Exception("Driver is null in function ResolutionTypeHelper.SetResolution4Browser"); } switch (type) { case ResolutionType.web: SeleniumExecutor.GetDriver().Manage().Window.Maximize(); break; case ResolutionType.tablet: SeleniumExecutor.GetDriver().Manage().Window.Size = new Size(974, 1200); break; case ResolutionType.mobile: SeleniumExecutor.GetDriver().Manage().Window.Size = new Size(400, 700); break; default: throw new Exception("ResolutionTypeHelper. Cannot find ResolutionType: " + type.ToString()); } }
void ResetScaler() { if (scaler == null) { return; } ResolutionType type = DeviceUtil.ScreenType(); if (type == ResolutionType.Screen_Large) { scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; scaler.referenceResolution = new Vector2(1920, 1080); //(1334, 750); scaler.screenMatchMode = CanvasScaler.ScreenMatchMode.MatchWidthOrHeight; SetCamera(5f); } else if (type == ResolutionType.Screen_Small) { scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; scaler.referenceResolution = new Vector2(1136, 640); scaler.screenMatchMode = CanvasScaler.ScreenMatchMode.MatchWidthOrHeight; scaler.matchWidthOrHeight = 0; SetCamera(5f); } else if (type == ResolutionType.Screen_Small_Ipad) { scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; scaler.referenceResolution = new Vector2(2048, 1536); scaler.screenMatchMode = CanvasScaler.ScreenMatchMode.MatchWidthOrHeight; scaler.matchWidthOrHeight = 0.5f; SetCamera(5.33f); } else if (type == ResolutionType.Screen_Large_Ipad) { scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; scaler.referenceResolution = new Vector2(2048, 1536); scaler.screenMatchMode = CanvasScaler.ScreenMatchMode.MatchWidthOrHeight; scaler.matchWidthOrHeight = 0.5f; SetCamera(5.33f); } //Debug.LogErrorFormat("-----ResetScaler 执行完---name = {0}", transform.gameObject.name); }
internal ResolveResult Resolve(Conflict conflict, ResolutionType resolutionType) { var invoker = new SoapInvoker(this); var msg = invoker.CreateEnvelope("Resolve"); msg.Add(new XElement(MessageNs + "workspaceName", conflict.Workspace.Name)); msg.Add(new XElement(MessageNs + "ownerName", conflict.Workspace.OwnerName)); msg.Add(new XElement(MessageNs + "conflictId", conflict.ConflictId)); msg.Add(new XElement(MessageNs + "resolution", resolutionType)); var response = invoker.InvokeResponse(); ResolveResult result = new ResolveResult(); result.GetOperations = GetOperationExtractor(invoker.MethodResultExtractor(response)); result.UndoOperations = GetOperationExtractor(response.Element(MessageNs + "undoOperations")); result.ResolvedConflicts = ConflictExtractor(response.Element(MessageNs + "resolvedConflicts"), conflict.Workspace); return result; }
public Resolution(int width, int height, ResolutionType resolutionType) : this(width, height, string.Empty, resolutionType) { }
public Resolution(int width, int height, string displayText, ResolutionType resolutionType) : this(width, height, displayText, displayText, resolutionType) { }
public Resolution(List<Pair> resSet, ResolutionType resType) { Resolutions = resSet; ResolutionType = resType; }
public Resolution(int width, int height, ResolutionType resType) : this(new List<Pair>() { new Pair(width, height) }, resType) { }
private void Start () { // Initialize carInput = CarInput.Instance; actualButton = false; canMove = true; resolutionType = (ResolutionType)DataManager.Instance.resolution; switch(resolutionType) { case ResolutionType._800x600: { textButton.text = "Resolution: 800x600"; break; } case ResolutionType._1024x768: { textButton.text = "Resolution: 1024x768"; break; } case ResolutionType._1280x720: { textButton.text = "Resolution: 1280x720"; break; } case ResolutionType._1280x1024: { textButton.text = "Resolution: 1280x1024"; break; } case ResolutionType._1366x768: { textButton.text = "Resolution: 1366x768"; break; } case ResolutionType._1440x900: { textButton.text = "Resolution: 1440x900"; break; } case ResolutionType._1680x1050: { textButton.text = "Resolution: 1680x1050"; break; } case ResolutionType._1920x1080: { textButton.text = "Resolution: 1920x1080"; break; } } // Get references if(settingsManager == null) { settingsManager = transform.root.GetComponent<SettingsManager>(); } if(GetComponent<AudioSource>()) { audioSource = GetComponent<AudioSource>(); } }
public void Resolve(Conflict conflict, ResolutionType resolutionType) { conflict.Workspace.Resolve(conflict, resolutionType); }
private void Update () { if(EventSystem.current.currentSelectedGameObject == resolutionButton) { if(!actualButton) { for(int i = 0; i < resolutionArrows.Length; i++) { resolutionArrows[i].SetActive (true); } actualButton = true; if(audioSource) { audioSource.Play (); } } if(canMove) { if(carInput.Left()) { resolutionType--; if((int)resolutionType < 0) { resolutionType = (ResolutionType)7; } canMove = false; } else if(carInput.Right()) { resolutionType++; if((int)resolutionType > 7) { resolutionType = (ResolutionType)0; } canMove = false; } } else { if(!carInput.Left () && !carInput.Right ()) { canMove = true; } } switch(resolutionType) { case ResolutionType._800x600: { textButton.text = "Resolution: 800x600"; break; } case ResolutionType._1024x768: { textButton.text = "Resolution: 1024x768"; break; } case ResolutionType._1280x720: { textButton.text = "Resolution: 1280x720"; break; } case ResolutionType._1280x1024: { textButton.text = "Resolution: 1280x1024"; break; } case ResolutionType._1366x768: { textButton.text = "Resolution: 1366x768"; break; } case ResolutionType._1440x900: { textButton.text = "Resolution: 1440x900"; break; } case ResolutionType._1680x1050: { textButton.text = "Resolution: 1680x1050"; break; } case ResolutionType._1920x1080: { textButton.text = "Resolution: 1920x1080"; break; } } if(resolutionButton.transform.localScale.x < maxScale) { actualScale = resolutionButton.transform.localScale; actualScale += Vector3.one * Time.deltaTime * fadeSpeed; resolutionButton.transform.localScale = actualScale; } else { actualScale = resolutionButton.transform.localScale; actualScale = Vector3.one * maxScale; resolutionButton.transform.localScale = actualScale; } } else { if(actualButton) { for(int i = 0; i < resolutionArrows.Length; i++) { resolutionArrows[i].SetActive (false); } settingsManager.SetResolution ((int)resolutionType); actualButton = false; } if(resolutionButton.transform.localScale.x > minScale) { actualScale = resolutionButton.transform.localScale; actualScale -= Vector3.one * Time.deltaTime * fadeSpeed; resolutionButton.transform.localScale = actualScale; } else { actualScale = resolutionButton.transform.localScale; actualScale = Vector3.one * minScale; resolutionButton.transform.localScale = actualScale; } } #endregion }