/// <summary> /// Gets the instance. /// </summary> /// <returns>The instance.</returns> public static FramePool GetInstance() { if(instance == null){ instance = new FramePool(); } return instance; }
public ModernCaptureMonitorSession(IDirect3DDevice device, ModernCaptureMonitorDescription description) : base(description) { this.CaptureItem = WinRTCaptureHelper.CreateItemForMonitor(description.MonitorInfo.Hmon); this.FramePool = Direct3D11CaptureFramePool.Create(device, description.HdrMetadata.EnableHdrProcessing ? DirectXPixelFormat.R16G16B16A16Float : DirectXPixelFormat.B8G8R8A8UIntNormalized, 2, CaptureItem.Size); this.Session = FramePool.CreateCaptureSession(CaptureItem); this.Session.IsCursorCaptureEnabled = description.CaptureCursor; }
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { Session?.Dispose(); FramePool?.Dispose(); } Session = null; FramePool = null; disposedValue = true; } }
public OSSPool(OSS oSS) { InitializeComponent(); Analytics.TrackEvent("Вопросы ОСС"); NavigationPage.SetHasNavigationBar(this, false); var profile = new TapGestureRecognizer(); profile.Tapped += async(s, e) => { if (Navigation.NavigationStack.FirstOrDefault(x => x is ProfilePage) == null) { await Navigation.PushAsync(new ProfilePage()); } }; IconViewProfile.GestureRecognizers.Add(profile); var techSend = new TapGestureRecognizer(); techSend.Tapped += async(s, e) => { await Navigation.PushAsync(new AppPage()); }; LabelTech.GestureRecognizers.Add(techSend); var call = new TapGestureRecognizer(); call.Tapped += async(s, e) => { if (Settings.Person.Phone != null) { IPhoneCallTask phoneDialer; phoneDialer = CrossMessaging.Current.PhoneDialer; if (phoneDialer.CanMakePhoneCall && !string.IsNullOrWhiteSpace(Settings.Person.companyPhone)) { phoneDialer.MakePhoneCall(System.Text.RegularExpressions.Regex.Replace(Settings.Person.companyPhone, "[^+0-9]", "")); } } }; switch (Device.RuntimePlatform) { case Device.iOS: int statusBarHeight = DependencyService.Get <IStatusBar>().GetHeight(); Pancake.Padding = new Thickness(0, statusBarHeight, 0, 0); //BackgroundColor = Color.White; break; default: break; } var backClick = new TapGestureRecognizer(); backClick.Tapped += async(s, e) => { ClosePage(); }; BackStackLayout.GestureRecognizers.Add(backClick); UkName.Text = Settings.MobileSettings.main_name; //FrameBack.BackgroundColor = colorFromMobileSettings; FrameBtnNext.BackgroundColor = colorFromMobileSettings; FrameBtnFinish.BackgroundColor = colorFromMobileSettings; var nextClick = new TapGestureRecognizer(); nextClick.Tapped += async(s, e) => { NextQuest(); }; FrameBtnNext.GestureRecognizers.Add(nextClick); //var backClickQuest = new TapGestureRecognizer(); //backClickQuest.Tapped += async (s, e) => { BackQuest(); }; //FrameBack.GestureRecognizers.Add(backClickQuest); var finishClick = new TapGestureRecognizer(); finishClick.Tapped += async(s, e) => { FinishClick(); }; FrameBtnFinish.GestureRecognizers.Add(finishClick); _oss = oSS; for (int qNow = 0; qNow < _oss.Questions.Count; qNow++) { if (!string.IsNullOrWhiteSpace(_oss.Questions[qNow].Answer)) { quest++; } } setIndicator(); setQuest(); setQuestVisible(); ChechQuestions(); setVisibleButton(); SetQuestion(quest); if (quest > 0) { visibleIndicator(quest, true); } if (ProtokolStackL.IsVisible) { urlProtokol.TextColor = colorFromMobileSettings; urlProtokol.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(async() => await Launcher.OpenAsync(fileLink)) }); } pdf2.Foreground = colorFromMobileSettings; Color hexColor = (Color)Application.Current.Resources["MainColor"]; FramePool.SetAppThemeColor(Frame.BorderColorProperty, hexColor, Color.White); //IconViewTech.SetAppThemeColor(IconView.ForegroundProperty, hexColor, Color.White); //LabelTech.SetAppThemeColor(Label.TextColorProperty, hexColor, Color.White); Color unselect = hexColor.AddLuminosity(0.3); StackLayoutIndicator.SetAppThemeColor(StackLayout.BackgroundColorProperty, unselect, Color.White); }