Beispiel #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <SearchBar> e)
        {
            base.OnElementChanged(e);

            var newElement = ((CustomSearchBar)e.NewElement);

            BorderColor = newElement.BorderColor.ToUIColor();

            if (newElement.BorderWidth != 0)
            {
                BorderWidth = newElement.BorderWidth;
            }

            var searchbar = (UISearchBar)Control;

            if (e.NewElement != null)
            {
                Foundation.NSString _searchField = new Foundation.NSString("searchField");
                var textFieldInsideSearchBar     = (UITextField)searchbar.ValueForKey(_searchField);
                textFieldInsideSearchBar.BackgroundColor = UIColor.FromRGB(255, 255, 255);
                textFieldInsideSearchBar.TextColor       = UIColor.Gray;
                searchbar.Layer.BackgroundColor          = UIColor.White.CGColor;
                searchbar.TintColor          = UIColor.Black;
                searchbar.BarTintColor       = UIColor.White;
                searchbar.Layer.CornerRadius = 10;
                searchbar.Layer.BorderWidth  = BorderWidth;
                searchbar.Layer.BorderColor  = BorderColor.CGColor;

                //searchbar.ShowsCancelButton = false;
            }
        }
Beispiel #2
0
 private void JoiningCompleted(Foundation.NSString channel, nuint uid, nint elapsed)
 {
     _localId = (uint)uid;
     AgoraKit.SetEnableSpeakerphone(true);
     UIApplication.SharedApplication.IdleTimerDisabled = true;
     RefreshDebug();
 }
Beispiel #3
0
        // Constructor:
        public CAvailableCell(Foundation.NSString cellId) : base(UITableViewCellStyle.Default, cellId)
        {
            // ---------------------------------------------------------------------

            SelectionStyle = UITableViewCellSelectionStyle.Gray;
            //ContentView.BackgroundColor = UIColor.White;
            nfloat fontSize = 18f;

            lblName = new UILabel()
            {
                Font          = UIFont.FromName("Arial", fontSize),
                TextColor     = UIColor.Black,
                TextAlignment = UITextAlignment.Left,
                //BackgroundColor = UIColor.White
            };
            lblSkill = new UILabel()
            {
                Font          = UIFont.FromName("Arial", fontSize),
                TextColor     = UIColor.Black,
                TextAlignment = UITextAlignment.Left,
                //BackgroundColor = UIColor.White
            };

            ContentView.AddSubviews(new UIView[] {
                lblName, lblSkill
            });
        }
        private void JoiningCompleted(Foundation.NSString channel, nuint uid, nint elapsed)
        {
            LoadingIndicator.Hidden = true;
            _localId = (uint)uid;
            AgoraKit.SetEnableSpeakerphone(true);
            UIApplication.SharedApplication.IdleTimerDisabled = true;
            RefreshDebug();

            var bundle = NSBundle.MainBundle.GetUrlForResource("DT.Samples.Agora.ScreenSharing.iOS.Extension", "appex", "PlugIns");

            var frame           = new CGRect(100, 100, 60, 60);
            var broadcastPicker = new RPSystemBroadcastPickerView(frame);
            var bundle2         = new NSBundle(bundle);

            broadcastPicker.PreferredExtension = bundle2.BundleIdentifier;
            View.AddSubview(broadcastPicker);
            Console.WriteLine("Run RPSystemBroadcastPickerView");
            //RPScreenRecorder.SharedRecorder.StartRecording(false, error =>
            //{
            //    if (error != null)
            //    {

            //    }
            //});
            //RPBroadcastActivityViewController.LoadBroadcastActivityViewController(bundle.AbsoluteUrl.ToString(), (controller, error) =>
            //{
            //    if(error != null)
            //    {
            //        return;
            //    }
            //    UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(controller, true, null);

            //    //RPBroadcastActivityViewController = controller;
            //});
        }
Beispiel #5
0
 public override Foundation.NSObject AnimationFor(Foundation.NSString key)
 {
     if (key == "Value")
     {
         return(new CABasicAnimation());
     }
     return(base.AnimationFor(key));
 }
        public override void ObserveValue(Foundation.NSString keyPath,
                                          Foundation.NSObject ofObject,
                                          Foundation.NSDictionary change,
                                          IntPtr context)
        {
            var top = (Bounds.Size.Height - ContentSize.Height * ZoomScale) / 2.0;

            top = top < 0.0 ? 0.0 : top;
            this.SetContentOffset(CGPoint.Empty, false);
        }
Beispiel #7
0
 static void OutputStringToConsole(string text)
 {
     using (var nsText = new Foundation.NSString(text))
     {
         if (IsDevice && Is64Bit)
         {
             NSLog_ARM64(nsFormat.Handle, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, nsText.Handle);
         }
         else
         {
             NSLog(nsFormat.Handle, nsText.Handle);
         }
     }
 }
Beispiel #8
0
        // Constructor:
        public CLineupCardCell(Foundation.NSString cellId) : base(UITableViewCellStyle.Default, cellId)
        {
            // ---------------------------------------------------------------------

            SelectionStyle = UITableViewCellSelectionStyle.Gray;
            //ContentView.BackgroundColor = UIColor.White;

            string fontName = "Arial";
            nfloat fontSize = 15f;

            lblName = new UILabel()
            {
                Font          = UIFont.FromName(fontName, fontSize),
                TextColor     = UIColor.Black,
                TextAlignment = UITextAlignment.Left
                                //BackgroundColor = UIColor.White
            };
            lblSlot = new UILabel()
            {
                Font            = UIFont.FromName(fontName, fontSize),
                TextColor       = UIColor.Black,
                TextAlignment   = UITextAlignment.Center,
                BackgroundColor = UIColor.White
            };
            lblPos = new UILabel()
            {
                Font          = UIFont.FromName(fontName, fontSize),
                TextColor     = UIColor.Black,
                TextAlignment = UITextAlignment.Center
                                //BackgroundColor = UIColor.White
            };
            lblBase = new UILabel()
            {
                Font          = UIFont.FromName(fontName, fontSize),
                TextColor     = UIColor.Black,
                TextAlignment = UITextAlignment.Center
                                //BackgroundColor = UIColor.White
            };
            lblSkill = new UILabel()
            {
                Font          = UIFont.FromName(fontName, fontSize),
                TextColor     = UIColor.Black,
                TextAlignment = UITextAlignment.Left
                                //BackgroundColor = UIColor.White
            };

            ContentView.AddSubviews(new UIView[] {
                lblName, lblSlot, lblPos, lblBase, lblSkill
            });
        }
Beispiel #9
0
        public void TestIOKitPInvokes()
        {
            // Test the pinvokes don't crash. Don't care about the details returned

            var matchingDict = MacTelemetryDetails.IOServiceMatching("IOService");

            // IOServiceGetMatchingServices takes ownership of matchingDict, so no need to CFRelease it
            var success = MacTelemetryDetails.IOServiceGetMatchingServices(0, matchingDict, out var iter);

            if (MacTelemetryDetails.IOIteratorIsValid(iter) == 0)
            {
                // An invalid iter isn't a test failure, but it means we can't really test anything else
                // so just return
                return;
            }

            var entry = MacTelemetryDetails.IOIteratorNext(iter);

            if (entry == 0)
            {
                MacTelemetryDetails.IOObjectRelease(iter);
                return;
            }

            success = MacTelemetryDetails.IORegistryEntryGetChildIterator(entry, "IOService", out var childIter);
            if (success != 0)
            {
                MacTelemetryDetails.IOObjectRelease(entry);
                return;
            }

            MacTelemetryDetails.IOObjectRelease(childIter);

            var name    = new Foundation.NSString("testService");
            var namePtr = MacTelemetryDetails.IORegistryEntrySearchCFProperty(entry, "IOService", name.Handle, IntPtr.Zero, 0x0);

            MacTelemetryDetails.IOObjectRelease(entry);
            MacTelemetryDetails.IOObjectRelease(iter);

            MacTelemetryDetails.CFRelease(namePtr);
        }
Beispiel #10
0
 public static NSError FromDomain(NSString domain, nint code)
 {
     return(FromDomain(domain, code, null));
 }
Beispiel #11
0
        double GetDouble(NSString key)
        {
            var n = Runtime.GetNSObject <NSNumber> (GetHandle(key));

            return(n == null ? 0 : n.DoubleValue);
        }
Beispiel #12
0
        bool GetBool(NSString key)
        {
            var n = Runtime.GetNSObject <NSNumber> (GetHandle(key));

            return(n == null ? false : n.BoolValue);
        }
Beispiel #13
0
 public NSError(NSString domain, nint code) : this(domain, code, null)
 {
 }
 public override UICollectionReusableView GetViewForSupplementaryElement(UICollectionView collectionView, Foundation.NSString elementKind, Foundation.NSIndexPath indexPath)
 {
     if (elementKind == "UICollectionElementKindSectionHeader")
     {
         var sgh = collectionView.DequeueReusableSupplementaryView((Foundation.NSString) "UICollectionElementKindSectionHeader", "GroupHeader", indexPath) as SimpleGroupHeader;
         if (sgh != null)
         {
             var key = eventsViewController.Data.Keys.ElementAt(indexPath.Section);
             sgh.Configure(key);
         }
         return(sgh);
     }
     return(null);
 }
Beispiel #15
0
        bool?GetNullableBool(NSString key)
        {
            var n = Runtime.GetNSObject <NSNumber> (GetHandle(key));

            return(n?.BoolValue);
        }
Beispiel #16
0
        nint?GetNInt(NSString key)
        {
            var n = Runtime.GetNSObject <NSNumber> (GetHandle(key));

            return(n?.NIntValue);
        }
Beispiel #17
0
 public static NSString LocalizedFormat(string format, params object [] args)
 {
     using (var ns = new NSString(format))
         return(LocalizedFormat(ns, args));
 }
Beispiel #18
0
 protected override void OnCancel(CFRunLoop loop, CFRunLoopString mode)
 {
     DebugOutput("IOService.FileSystemNotifcationPort.OnCancel()");
 }
Beispiel #19
0
        // Constructor:
        public CBoxScoreLine_Batting(Foundation.NSString cellId) : base(UITableViewCellStyle.Default, cellId)
        {
            // ---------------------------------------------------------------------

            SelectionStyle = UITableViewCellSelectionStyle.Gray;
            ContentView.BackgroundColor = UIColor.White;
            imageView = new UIImageView();


            lblBName = new UILabel()
            {
                Font            = UIFont.FromName("Arial", 12f),
                TextColor       = UIColor.Black,
                TextAlignment   = UITextAlignment.Left,
                BackgroundColor = UIColor.White
            };
            lblAb = new UILabel()
            {
                Font            = UIFont.FromName("AmericanTypewriter", 12f),
                TextColor       = UIColor.Black,
                TextAlignment   = UITextAlignment.Right,
                BackgroundColor = UIColor.White
            };
            lblR = new UILabel()
            {
                Font            = UIFont.FromName("AmericanTypewriter", 12f),
                TextColor       = UIColor.Black,
                TextAlignment   = UITextAlignment.Right,
                BackgroundColor = UIColor.White
            };
            lblH = new UILabel()
            {
                Font            = UIFont.FromName("AmericanTypewriter", 12f),
                TextColor       = UIColor.Black,
                TextAlignment   = UITextAlignment.Right,
                BackgroundColor = UIColor.White
            };
            lblRbi = new UILabel()
            {
                Font            = UIFont.FromName("AmericanTypewriter", 12f),
                TextColor       = UIColor.Black,
                TextAlignment   = UITextAlignment.Right,
                BackgroundColor = UIColor.White
            };
            lblB2 = new UILabel()
            {
                Font            = UIFont.FromName("AmericanTypewriter", 12f),
                TextColor       = UIColor.Black,
                TextAlignment   = UITextAlignment.Right,
                BackgroundColor = UIColor.White
            };
            lblB3 = new UILabel()
            {
                Font            = UIFont.FromName("AmericanTypewriter", 12f),
                TextColor       = UIColor.Black,
                TextAlignment   = UITextAlignment.Right,
                BackgroundColor = UIColor.White
            };
            lblHr = new UILabel()
            {
                Font            = UIFont.FromName("AmericanTypewriter", 12f),
                TextColor       = UIColor.Black,
                TextAlignment   = UITextAlignment.Right,
                BackgroundColor = UIColor.White
            };
            lblBb = new UILabel()
            {
                Font            = UIFont.FromName("AmericanTypewriter", 12f),
                TextColor       = UIColor.Black,
                TextAlignment   = UITextAlignment.Right,
                BackgroundColor = UIColor.White
            };
            lblSo = new UILabel()
            {
                Font            = UIFont.FromName("AmericanTypewriter", 12f),
                TextColor       = UIColor.Black,
                TextAlignment   = UITextAlignment.Right,
                BackgroundColor = UIColor.White
            };

            ContentView.AddSubviews(new UIView[] {
                lblBName, lblAb, lblR, lblH, lblRbi, lblB2, lblB3, lblHr, lblBb, lblSo
            });
        }
Beispiel #20
0
        double?GetNullableDouble(NSString key)
        {
            var n = Runtime.GetNSObject <NSNumber> (GetHandle(key));

            return(n?.DoubleValue);
        }