Example #1
0
        public NSScrubberItemView GetViewForItem(NSScrubber scrubber, nint index)
        {
            NSScrubberTextItemView item = new NSScrubberTextItemView();

            item.TextField.StringValue = index.ToString();
            return(item);
        }
        void AddInfoUpdateState()
        {
            NSView superView   = InfoButton.Superview;
            nint   updateCount = PublicationsDataManager.SharedInstance.CurrentPubliction.UpdateCount;

            if (updateCount <= 0)
            {
                NSView [] views = superView.Subviews;
                nint      count = views.Length;
                if (count > 2)
                {
                    NSButton button = (NSButton)views [count - 1];
                    button.RemoveFromSuperview();
                }
                return;
            }

            CGRect   frame     = InfoButton.Frame;
            CGRect   newFrame  = new CGRect(frame.Right - 13, frame.Bottom - 12, 15, 15);
            NSButton newButton = new NSButton(newFrame);

            newButton.Cell.BezelStyle       = NSBezelStyle.Circular;
            newButton.Cell.Bordered         = false;
            newButton.WantsLayer            = true;
            newButton.Layer.BackgroundColor = NSColor.Red.CGColor;
            newButton.Layer.CornerRadius    = 7.5f;
            newButton.Alignment             = NSTextAlignment.Center;
            //button.Enabled = false;

            string infoTitle = updateCount.ToString();

            newButton.AttributedTitle = Utility.AttributeTitle(infoTitle, NSColor.White, 8);
            superView.AddSubview(newButton);
        }
Example #3
0
            public override UIView ViewForItem(CarouselView carousel, nint index, UIView reusingView)
            {
                var button = reusingView as UIButton;

                if (button == null)
                {
                    //no button available to recycle, so create new one
                    var image = UIImage.FromBundle("page.png");
                    button       = UIButton.FromType(UIButtonType.Custom);
                    button.Frame = new CGRect(0, 0, image.Size.Width, image.Size.Height);
                    button.SetTitleColor(UIColor.Black, UIControlState.Normal);
                    button.SetBackgroundImage(image, UIControlState.Normal);
                    button.TitleLabel.Font = button.TitleLabel.Font.WithSize(50);
                    button.TouchUpInside  += (sender, e) =>
                    {
                        var idx = vc.carousel.IndexOfItemViewOrSubview(sender as UIView);
                        new UIAlertView("Hello", "You tapped button number " + idx, null, "Ok", null).Show();
                    };
                }

                // set button label
                button.SetTitle(index.ToString(), UIControlState.Normal);

                if (!vc.objCache.Contains(button))
                {
                    vc.objCache.Add(button);
                }

                return(button);
            }
Example #4
0
        void StopGo(Foundation.NSObject sender)
        {
            ResetElapsedTime();
            if (Timer == null)
            {
                Timer          = new Timer(100);
                Timer.Elapsed += timer_Elapsed;
                Timer.Start();
//				colorTextField.Enabled = false;
//				colorWell.Enabled = false;
//				segControl.Enabled = false;
                CorrectLetters           = 0;
                IncorrectLetters         = 0;
                lblCorrect.StringValue   = CorrectLetters.ToString();
                lblIncorrect.StringValue = IncorrectLetters.ToString();
            }
            else
            {
                Timer.Stop();
                Timer.Elapsed -= timer_Elapsed;
                Timer          = null;
//				colorTextField.Enabled = true;
//				colorWell.Enabled = true;
//				segControl.Enabled = true;
            }
        }
        private void BtnCategory_TouchUpInside(object sender, EventArgs e)
        {
            UIButton btnClicked = (UIButton)sender;
            nint     k          = btnClicked.Tag;

            ShowDeals(k.ToString(), "");
        }
Example #6
0
        public ThumbWithPageNumberView(CGRect frame, nint pageNumber, Action <ThumbWithPageNumberView> thumbSelectedCallback) : base(frame)
        {
            _thumbSelectedCallback = thumbSelectedCallback;
            SetAsUnselected();

            int thumbContentSize = (int)Bounds.Size.Width;
            var thumbViewFrame   = new CGRect(0, Padding, Bounds.Size.Width, Bounds.Size.Height - 2 * Padding - PageNumberLabelHeight);

            _thumbView = new ThumbView(thumbViewFrame, thumbContentSize, pageNumber);

            var pageNumberLabelFrame = new CGRect(0, 2 * Padding + thumbViewFrame.Height, Bounds.Size.Width, PageNumberLabelHeight);

            _pageNumberLabel = new UILabel(pageNumberLabelFrame);
            _pageNumberLabel.TextAlignment             = UITextAlignment.Center;
            _pageNumberLabel.BackgroundColor           = UIColor.Clear;
            _pageNumberLabel.TextColor                 = UIColor.White;
            _pageNumberLabel.Font                      = UIFont.SystemFontOfSize(16.0f);
            _pageNumberLabel.ShadowOffset              = new CGSize(0.0f, 1.0f);
            _pageNumberLabel.ShadowColor               = UIColor.Black;
            _pageNumberLabel.AdjustsFontSizeToFitWidth = true;
            _pageNumberLabel.Text                      = pageNumber.ToString();

            AddSubview(_thumbView);
            AddSubview(_pageNumberLabel);
        }
Example #7
0
        // Returns the NSView for a given column/row. NSTableView is strange as unlike NSOutlineView
        // it does not pass in the data for the given item (obtained from the DataSource) for the NSView APIs
        public override NSView GetViewForItem(NSTableView tableView, NSTableColumn tableColumn, nint row)
        {
            // This pattern allows you reuse existing views when they are no-longer in use.
            // If the returned view is null, you instance up a new view
            // If a non-null view is returned, you modify it enough to reflect the new data
            NSTextField view = (NSTextField)tableView.MakeView(identifer, this);

            if (view == null)
            {
                view            = new NSTextField();
                view.Identifier = identifer;
                view.Bordered   = false;
                view.Selectable = false;
                view.Editable   = false;
            }
            if (tableColumn.Identifier == "Values")
            {
                view.StringValue = (NSString)row.ToString();
            }
            else
            {
                view.StringValue = (NSString)NumberWords [row];
            }

            return(view);
        }
			public override string GetTitle(UIPickerView picker, nint row, nint component)
			{
				if (component == 0)
					return tk.pickerData[row];
				else
					return row.ToString();
			}
        void Ushort()
        {
            ushort a = ushort.MaxValue;

            int   f  = a;
            uint  g  = a;
            long  h  = a;
            ulong i  = a;
            nint  j  = a;
            var   j2 = j.ToString();
            nuint k  = a;
            var   k2 = j.ToString();

            float   l = a;
            double  m = a;
            decimal n = a;
        }
Example #10
0
 public override string GetTitle(UIPickerView pickerView, nint row, nint component)
 {
     if (component == 0)
     {
         return(row.ToString());
     }
     return(((EncodingType)Convert.ToInt32(row)).ToString("F"));
 }
            public override void DidSelectItemAtIndex(iCarousel carousel, nint index)
            {
                var alert = UIAlertController.Create("Clicked index:", index.ToString(), UIAlertControllerStyle.Alert);

                alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Cancel, null));

                _viewController.PresentViewController(alert, animated: true, completionHandler: null);
            }
Example #12
0
        static KokkosCoreLibrary()
        {
            //string operatingSystem      = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "win" : "linux";
            //string platformArchitecture = RuntimeInformation.ProcessArchitecture == Architecture.X64 ? "x64" : "x86";

            //string libraryPath = GetLibraryPath() ?? throw new NullReferenceException("typeof(KokkosCoreLibrary).Assembly.Location is empty.");

            // #if DEBUG
            //             Console.WriteLine("libraryPath: " + libraryPath);
            // #endif

            //Path.Combine(libraryPath,
            //nativeLibraryPath = $"runtimes\\{operatingSystem}-{platformArchitecture}\\native";

            //nativeLibraryPath = Kernel32.GetShortPath(nativeLibraryPath);

            //Kernel32.AddToPath(nativeLibraryPath);
#if DEBUG
            Console.WriteLine("nativeLibraryPath: " + KokkosCoreLibraryName);
#endif

            MpiHandle = PlatformApi.NativeLibrary.Load(MpiLibraryName);

            if (MpiHandle == 0)
            {
                MpiHandle = Kernel32.Native.LoadLibrary(Path.Combine(AppDomain.CurrentDomain.BaseDirectory !, PlatformApi.NativeLibrary.GetRuntimeLibraryPath(), MpiLibraryName + ".dll"));

                if (MpiHandle == 0)
                {
                    KokkosLibraryException.Throw(MpiLibraryName + " failed to load.");
                }
            }

            OpenMpHandle = PlatformApi.NativeLibrary.Load(OpenMpLibraryName);
#if DEBUG
            Console.WriteLine($"OpenMpHandle: 0x{OpenMpHandle.ToString("X")}");
#endif
            CudaHandle = PlatformApi.NativeLibrary.LoadLibrary(CudaLibraryName);
#if DEBUG
            Console.WriteLine($"CudaHandle: 0x{CudaHandle.ToString("X")}");
#endif
            CudartHandle = PlatformApi.NativeLibrary.Load(CudartLibraryName);
#if DEBUG
            Console.WriteLine($"CudartHandle: 0x{CudartHandle.ToString("X")}");
#endif
            CublasLtHandle = PlatformApi.NativeLibrary.Load(CublasLtLibraryName);
#if DEBUG
            Console.WriteLine($"CublasLtHandle: 0x{CublasLtHandle.ToString("X")}");
#endif
            CublasHandle = PlatformApi.NativeLibrary.Load(CublasLibraryName);
#if DEBUG
            Console.WriteLine($"CublasHandle: 0x{CublasHandle.ToString("X")}");
#endif
            CusparseHandle = PlatformApi.NativeLibrary.Load(CusparseLibraryName);
#if DEBUG
            Console.WriteLine($"CusparseHandle: 0x{CusparseHandle.ToString("X")}");
#endif
        }
Example #13
0
            public override NSView GetViewForItem(NSTableView tableView, NSTableColumn tableColumn, nint row)
            {
                string     identifier = row.ToString() + "_" + tableColumn.Identifier;
                ServerInfo info       = null;

                stv.tableRows.TryGetValue((int)row, out info);

                if (tableColumn.Identifier == coldefs[COLS.Buttons])
                {
                    //button
                    NSButton button = (NSButton)tableView.MakeView(identifier, this);
                    if (button == null)
                    {
                        button            = new NSButton();
                        button.Identifier = identifier;
                        button.Activated += stv.StartStopServer;
                        button.BezelStyle = NSBezelStyle.Inline;
                    }
                    button.Title   = info.server.State == ServerState.Started ? STR_STOP : STR_START;
                    button.Enabled = true;

                    return(button);
                }
                else
                {
                    NSTextField textfield = (NSTextField)tableView.MakeView(identifier, this);
                    if (textfield == null)
                    {
                        textfield            = new NSTextField();
                        textfield.Identifier = identifier;
                        textfield.Bordered   = false;
                        textfield.Selectable = false;
                        textfield.Editable   = false;
                    }
                    if (info != null)
                    {
                        if (tableColumn.Identifier == coldefs[COLS.Serial])
                        {
                            textfield.StringValue = info.server.hwInterface.Serial;
                        }
                        else if (tableColumn.Identifier == coldefs[COLS.BwUp])
                        {
                            textfield.StringValue = String.Format(bwFormat, info.bwTx);
                        }
                        else if (tableColumn.Identifier == coldefs[COLS.BwDn])
                        {
                            textfield.StringValue = String.Format(bwFormat, info.bwRx);
                        }
                        else if (tableColumn.Identifier == coldefs[COLS.Port])
                        {
                            textfield.StringValue = info.server.Port.ToString();
                        }
                    }
                    return(textfield);
                }
            }
Example #14
0
        public void DefineInitializedData_EnsureAlignmentIsMinimumNeededForUseOfCreateSpan()
        {
            ModuleBuilder module = Helpers.DynamicModule();

            // Create static field data in a variety of orders that requires the runtime to actively apply alignment
            // RuntimeHelpers.CreateSpan requires data to be naturally aligned within the "PE" file. At this time CreateSpan only
            // requires alignments up to 8 bytes.
            FieldBuilder field1Byte = module.DefineInitializedData("Field1Byte", new byte[] { 1 }, FieldAttributes.Public);

            byte[]       field4Byte_1_data = new byte[] { 1, 2, 3, 4 };
            byte[]       field8Byte_1_data = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };
            byte[]       field4Byte_2_data = new byte[] { 5, 6, 7, 8 };
            byte[]       field8Byte_2_data = new byte[] { 9, 10, 11, 12, 13, 14, 15, 16 };
            FieldBuilder field4Byte_1      = module.DefineInitializedData("Field4Bytes_1", field4Byte_1_data, FieldAttributes.Public);
            FieldBuilder field8Byte_1      = module.DefineInitializedData("Field8Bytes_1", field8Byte_1_data, FieldAttributes.Public);
            FieldBuilder field4Byte_2      = module.DefineInitializedData("Field4Bytes_2", field4Byte_2_data, FieldAttributes.Public);
            FieldBuilder field8Byte_2      = module.DefineInitializedData("Field8Bytes_2", field8Byte_2_data, FieldAttributes.Public);

            module.CreateGlobalFunctions();

            var checkTypeBuilder = module.DefineType("CheckType", TypeAttributes.Public);

            CreateLoadAddressMethod("LoadAddress1", field1Byte);
            CreateLoadAddressMethod("LoadAddress4_1", field4Byte_1);
            CreateLoadAddressMethod("LoadAddress4_2", field4Byte_2);
            CreateLoadAddressMethod("LoadAddress8_1", field8Byte_1);
            CreateLoadAddressMethod("LoadAddress8_2", field8Byte_2);

            var checkType = checkTypeBuilder.CreateType();

            CheckMethod("LoadAddress4_1", 4, field4Byte_1_data);
            CheckMethod("LoadAddress4_2", 4, field4Byte_2_data);
            CheckMethod("LoadAddress8_1", 8, field8Byte_1_data);
            CheckMethod("LoadAddress8_2", 8, field8Byte_2_data);

            void CreateLoadAddressMethod(string name, FieldBuilder fieldBuilder)
            {
                var loadAddressMethod = checkTypeBuilder.DefineMethod(name, MethodAttributes.Public | MethodAttributes.Static, typeof(IntPtr), null);
                var methodIL          = loadAddressMethod.GetILGenerator();

                methodIL.Emit(OpCodes.Ldsflda, fieldBuilder);
                methodIL.Emit(OpCodes.Ret);
            }

            void CheckMethod(string name, int minAlignmentRequired, byte[] dataToVerify)
            {
                var  methodToCall = checkType.GetMethod(name);
                nint address      = (nint)methodToCall.Invoke(null, null);

                for (int i = 0; i < dataToVerify.Length; i++)
                {
                    Assert.Equal(dataToVerify[i], Marshal.ReadByte(address + (nint)i));
                }
                Assert.Equal(name + "_0" + "_" + address.ToString(), name + "_" + (address % minAlignmentRequired).ToString() + "_" + address.ToString());
            }
        }
Example #15
0
        public override IQLPreviewItem GetPreviewItem(QLPreviewController controller, nint index)
        {
            int idx = int.Parse(index.ToString());

            if (idx < sources.Length)
            {
                return(sources.ElementAt(idx));
            }
            return(null);
        }
        void Byte()
        {
            byte a = byte.MaxValue;

            short  d  = a;
            ushort e  = a;
            int    f  = a;
            uint   g  = a;
            long   h  = a;
            ulong  i  = a;
            nint   j  = a;
            var    j2 = j.ToString();
            nuint  k  = a;
            var    k2 = j.ToString();

            float   l = a;
            double  m = a;
            decimal n = a;
        }
        public void PickerSelectedHandler()
        {
            desiredSum = pickerOne.SelectedRowInComponent(0)
                         + pickerFive.SelectedRowInComponent(0) * 5
                         + picker25.SelectedRowInComponent(0) * 25
                         + picker100.SelectedRowInComponent(0) * 100
                         + picker250.SelectedRowInComponent(0) * 250;

            btnExport.SetTitle("Export " + desiredSum.ToString(), UIControlState.Normal);
        }
Example #18
0
 public override string GetTitle(UIPickerView pickerView, nint row, nint component)
 {
     if (component == 0)
     {
         return(data[row]);
     }
     else
     {
         return(row.ToString());
     }
 }
        public override nfloat GetHeightForFooter(UITableView tableView, nint section)
        {
            string index = section.ToString();

            if (settings[int.Parse(index)].ContainsKey(cellDetailsKey))
            {
                return(heigthForText((string)settings[int.Parse(index)][cellDetailsKey]));
            }

            return(base.GetHeightForFooter(tableView, section));
        }
 /// <summary>
 /// Conexion finalizada.
 /// </summary>
 /// <param name="session">Session.</param>
 /// <param name="task">Task.</param>
 /// <param name="error">Error.</param>
 public override void DidCompleteWithError(NSUrlSession session, NSUrlSessionTask task, NSError error)
 {
     if (error != null)
     {
         complete(false, status_code.ToString());
     }
     else
     {
         complete(true, responseBuilder.ToString());
     }
 }
 public override string GetTitle(UIPickerView pickerView, nint row, nint component)
 {
     if (component == 0)
     {
         return(_myItems[Convert.ToInt32(row)]);
     }
     else
     {
         return(row.ToString());
     }
 }
 public override string GetTitle(UIPickerView pickerView, nint row, nint component)
 {
     if (component == 0)
     {
         return(row.ToString());
     }
     else if (component == 1)
     {
         return(null);
     }
     else if (component == 3)
     {
         return(null);
     }
     else if (component == 5)
     {
         return(null);
     }
     return(row.ToString("#0"));
 }
Example #23
0
        public async Task <Tuple <string, QuestionHelper> > GetQuestions(string token, nint compId)
        {
            QuestionHelper QR;

            try {
                TokenValidation tokenVald = new TokenValidation();
                tokenVald.Token = token;
                tokenVald.Objid = compId.ToString();
                string createJson = JsonConvert.SerializeObject(tokenVald);
                byte[] jsonByte   = Encoding.UTF8.GetBytes(createJson);
                var    request    = (HttpWebRequest)WebRequest.Create(string.Format(@"http://www.otclick.com/applications/webservice/?r=TerminalApi/getQuestions"));
                request.ContentType   = "application/json; charset=utf-8";
                request.Method        = "POST";
                request.Accept        = "application/json";
                request.ContentLength = jsonByte.Length;
                using (Stream newStream = await request.GetRequestStreamAsync()) {
                    newStream.Write(jsonByte, 0, jsonByte.Length);
                    newStream.Flush();
                    newStream.Close();
                }
                var task = request.GetResponseAsync();

                var resp = (HttpWebResponse)await task;
                if (resp.StatusCode != HttpStatusCode.OK)
                {
                    return(Tuple.Create((string.Format(@"Error fetching data. Server returned status code: {0}", resp.StatusCode)), new QuestionHelper()
                    {
                        Status = "error"
                    }));
                }
                using (StreamReader stream = new StreamReader(resp.GetResponseStream())) {
                    Task <string> reader = stream.ReadToEndAsync();
                    string        text   = (string)await reader;


                    QR = JsonConvert.DeserializeObject <QuestionHelper> (text);
                }

                if (QR == null)
                {
                    return(Tuple.Create("Error", new QuestionHelper()
                    {
                        Status = "error"
                    }));
                }
                return(Tuple.Create("", QR));
            } catch (Exception ex) {
                return(Tuple.Create(ex.Message, new QuestionHelper()
                {
                    Status = "error"
                }));
            }
        }
Example #24
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();
            progressBar.MaxValue    = (double)timeLimit;
            progressBar.DoubleValue = 0;

            if (Sentences)
            {
                // Sentences
                NextSentence();
                ShowNextLetter();
            }
            else
            {
                // Random Letters;
                ShowAnotherLetter();
            }

            inLetterView.SetValueForKey(userSelectedBgColor, new NSString("BgColor"));
            outLetterView.SetValueForKey(userSelectedBgColor, new NSString("BgColor"));
            CorrectLetters           = 0;
            IncorrectLetters         = 0;
            lblCorrect.StringValue   = CorrectLetters.ToString();
            lblIncorrect.StringValue = IncorrectLetters.ToString();

            colorTextField.EditingEnded += (object sender, EventArgs e) => {
                userSelectedBgColor   = colorWell.Color;
                outLetterView.BgColor = colorWell.Color;
            };

            // ColorWell has issues too, but harder to reproduce. Crash log in notepad, Xamarin folder -> Scratchpad
            colorWell.Activated += (object sender, EventArgs e) => {
                userSelectedBgColor   = colorWell.Color;
                outLetterView.BgColor = colorWell.Color;
            };

            // Native crash - file bug report. go back and forth to repro, especially while running the typing tutor, or going back to "Random Letters
            // after stopping. rfe
            segControl.Activated += (object sender, EventArgs e) => {
                Sentences = segControl.SelectedSegment == 1;
                if (Sentences)
                {
                    // Sentences
                    NextSentence();
                    ShowNextLetter();
                }
                else
                {
                    // Random Letters;
                    ShowAnotherLetter();
                }
            };
        }
 public override string GetTitle(UIPickerView pickerView, nint row, nint component)
 {
     // return values[(int)row];
     if (component == 0)
     {
         return(values[(int)row]);
     }
     else
     {
         return(row.ToString());
     }
 }
        void Short()
        {
            short a = short.MaxValue;

            int  f  = a;
            long h  = a;
            nint j  = a;
            var  j2 = j.ToString();

            float   l = a;
            double  m = a;
            decimal n = a;
        }
Example #27
0
        private void UpdateLimitText(nint length)
        {
            limitLabel.Text = length.ToString() + " Characters Remaining";

            if (length == 0)
            {
                limitLabel.TextColor = eBriefingAppearance.RedColor;
            }
            else
            {
                limitLabel.TextColor = eBriefingAppearance.GreenColor;
            }
        }
        void Int()
        {
            int a = int.MaxValue;

            long h  = a;
            nint j  = a;
            var  j2 = j.ToString();

            float   l  = a;
            var     l2 = $"{l:N}";
            double  m  = a;
            decimal n  = a;
        }
Example #29
0
        public override NSObject GetChild(NSOutlineView outlineView, nint childIndex, NSObject item)
        {
            var index = Convert.ToInt32(childIndex.ToString());

            if (item == null)
            {
                return(OrderList[index]);
            }
            else
            {
                return(((Order)item).OrderList[index]);
            }
        }
        static void Sbyte()
        {
            sbyte a = sbyte.MaxValue;

            short d  = a;
            int   f  = a;
            long  h  = a;
            nint  j  = a;
            var   j2 = j.ToString();

            float   l = a;
            double  m = a;
            decimal n = a;
        }
Example #31
0
        public override string GetTitle(UIPickerView picker, nint row, nint component)
        {
            if (source == null || row > source.Count() || row < 0)
            {
                return(null);
            }

            if (component == 0)
            {
                return(source.ElementAt((int)row));
            }
            else
            {
                return(row.ToString());
            }
        }
		/// <summary>
		/// A simple asset enumerator that adds the asset to our asset list
		/// </summary>
		protected void AssetEnumerator (ALAsset asset, nint index, ref bool stop)
		{
		    // when the enumeration is completed, this method is invoked with group set to null
			if(asset != null) {
				Console.WriteLine ("Found asset: " + index.ToString ());

				// add the asset to the group list
				assetGroups[currentGroup].Add (asset);

				// keep going
				stop = false;

				//Console.WriteLine(asset.AssetType.ToString());
			}
			else
				Console.WriteLine("Asset enumeration completed.");
		}
Example #33
0
		// Returns the NSView for a given column/row. NSTableView is strange as unlike NSOutlineView 
		// it does not pass in the data for the given item (obtained from the DataSource) for the NSView APIs
		public override NSView GetViewForItem (NSTableView tableView, NSTableColumn tableColumn, nint row)
		{
			// This pattern allows you reuse existing views when they are no-longer in use.
			// If the returned view is null, you instance up a new view
			// If a non-null view is returned, you modify it enough to reflect the new data
			NSTextField view = (NSTextField)tableView.MakeView (identifer, this);
			if (view == null) {
				view = new NSTextField ();
				view.Identifier = identifer;
				view.Bordered = false;
				view.Selectable = false;
				view.Editable = false;
			}
			if (tableColumn.Identifier == "Values")
				view.StringValue = (NSString)row.ToString ();
			else
				view.StringValue = (NSString)NumberWords [row];

			return view;		
		}
 public override string GetTitle(UIPickerView pickerView, nint row, nint component)
 {
     switch (component)
     {
         default:
             return string.Empty;
         case 0: // hours
             return row.ToString("00'h'");
         case 1: // minutes
             return row.ToString("00'm'");
         case 2: // seconds
             return row.ToString("00's'");
         case 3: // milliseconds
             return "." + row.ToString(CultureInfo.InvariantCulture);
     }
 }
 public override string GetTitle(UIPickerView pickerView, nint row, nint component)
 {
     return row.ToString(CultureInfo.CurrentCulture);
 }
        private void TodaysStepCountChanged(nint stepCount)
        {
            //Setup Animation
            var stepCountAnimation = new CATransition ();
            stepCountAnimation.Duration = 0.7f;
            stepCountAnimation.Type = "kCATransitionFade";
            stepCountAnimation.TimingFunction = CAMediaTimingFunction.FromName (CAMediaTimingFunction.EaseInEaseOut);

            lblStepCount.Layer.AddAnimation(stepCountAnimation, "changeTextTransition");
            lblStepCount.Text = stepCount.ToString();

            var percentageCountAnimation = new CATransition ();
            percentageCountAnimation.Duration = 0.7f;
            percentageCountAnimation.Type = "kCATransitionFade";
            percentageCountAnimation.TimingFunction = CAMediaTimingFunction.FromName (CAMediaTimingFunction.EaseInEaseOut);
            lblPercentage.Layer.AddAnimation(percentageCountAnimation, "changeTextTransition");

            if (stepCount == 0)
            {
                lblCalories.Text = "";
            }
            else
            {
                lblCalories.Text = Conversion.CaloriesBurnt(Conversion.StepsToMiles(stepCount)) + " Calories";
            }

            //Percentage Complete Label
            if (stepCount <= 10000)
            {
                lblPercentage.Text = Conversion.StepCountToPercentage(stepCount) + "% Complete";
            }
            else
            {
                lblPercentage.Text = "Completed";
            }

            //Date
            lblDate.Text = DateString;

            //Distance
            if (Settings.DistanceIsMetric == false)
            {
                btnDistance.SetTitle(Conversion.StepsToMiles(stepCount).ToString("N2") + " mi", UIControlState.Normal);
            }
            else
            {
                btnDistance.SetTitle(Conversion.StepsToKilometers(stepCount).ToString("N2") + " km",
                    UIControlState.Normal);
            }

            //Update progress filler view
            _progressView.SetStepCount(stepCount);
            if (stepCount <= 10000)
            {
                AnimateToPercentage(Conversion.StepCountToPercentage(stepCount));
            }
            else
            {
                 AnimateToPercentage(100); //I want to show something...
            }
        }
			/// <summary>
			/// Runs after Clicked
			/// </summary>
			public override void Dismissed (UIAlertView alertView, nint buttonIndex)
			{
				Console.WriteLine ("Alert Dismissed, button " + buttonIndex.ToString ());
			}
			/// <summary>
			/// Runs right after clicked, and before Dismissed
			/// </summary>
			public override void WillDismiss (UIAlertView alertView, nint buttonIndex)
			{
				Console.WriteLine ("Alert will dismiss, button " + buttonIndex.ToString ());
			}
 /**
 * Transforms an integer into its String representation and then returns the bytes
 * of that string.
 *
 * @param i The integer to convert
 * @return A byte array representing the integer
 */
 public byte[] IntToByteArray(nint i)
 {
     return DocWriter.GetISOBytes(i.ToString());
 }