Example #1
0
 public override void ObserveValue(MonoTouch.Foundation.NSString keyPath, MonoTouch.Foundation.NSObject ofObject, MonoTouch.Foundation.NSDictionary change, IntPtr context)
 {
     if (ofObject == TitleLabel)
     {
         SetColor();
     }
 }
Example #2
0
        /// <summary>
        /// Writes the logging event to the <see cref="System.Diagnostics.Debug"/> system.
        /// </summary>
        /// <param name="loggingEvent">The event to log.</param>
        /// <remarks>
        /// <para>
        /// Writes the logging event to the <see cref="System.Diagnostics.Debug"/> system.
        /// If <see cref="ImmediateFlush"/> is <c>true</c> then the <see cref="System.Diagnostics.Debug.Flush"/>
        /// is called.
        /// </para>
        /// </remarks>
        override protected void Append(LoggingEvent loggingEvent)
        {
            //
            // Write the string to the Debug system
            //
            // mc++: System.Diagnostics.Debug.Write(RenderLoggingEvent(loggingEvent), loggingEvent.LoggerName);
            string messge = loggingEvent.LoggerName + RenderLoggingEvent(loggingEvent);

            MonoTouch.Foundation.NSString p1 = new MonoTouch.Foundation.NSString("%@");
            MonoTouch.Foundation.NSString p2 = new MonoTouch.Foundation.NSString(messge);

            NSLog(p1.Handle, p2.Handle);
            //
            // Flush the Debug system if needed
            //
            if (m_immediateFlush)
            {
                // mc++: System.Diagnostics.Debug.Flush();
            }
        }
Example #3
0
        private static real DoFullGetFont0Width(TFlxFont Fx)
        {
#if (MONOTOUCH)
            using (Font MyFont = ExcelFont.CreateFont(Fx.Name, (Fx.Size20 / 20F), ExcelFont.ConvertFontStyle(Fx)))
            {
                using (MonoTouch.Foundation.NSString o = new MonoTouch.Foundation.NSString("0"))
                {
                    return(o.StringSize(MyFont).Width);
                }
            }
#else
            using (Font MyFont = ExcelFont.CreateFont(Fx.Name, (Fx.Size20 / 20F), ExcelFont.ConvertFontStyle(Fx)))
            {
                using (Bitmap bm = new Bitmap(1, 1))
                {
                    using (Graphics gr = Graphics.FromImage(bm))
                        using (StringFormat sfTemplate = StringFormat.GenericTypographic)                 //GenericTypographic returns a NEW instance. It has to be disposed.
                        {
                            using (StringFormat sf = (StringFormat)sfTemplate.Clone())                    //Even when sfTemplate is a new instance, changing directly on it will change the standard generic typographic :(
                            {
                                //sf.SetMeasurableCharacterRanges was causing a deadlock here.
                                //DONT DO!!

                                /*CharacterRange[] r = {new CharacterRange(0,1)};
                                 * sf.SetMeasurableCharacterRanges(r);*/

                                sf.Alignment     = StringAlignment.Near; //this should be set, but just in case someone changed it.
                                sf.LineAlignment = StringAlignment.Far;  //this should be set, but just in case someone changed it.
                                sf.FormatFlags   = 0;
                                gr.PageUnit      = GraphicsUnit.Pixel;
                                SizeF sz = gr.MeasureString("0", MyFont, 1000, sf);
                                return((real)Math.Round(sz.Width));
                            }
                        }
                }
            }
#endif
        }
		/// <summary>
		/// Writes the logging event to the <see cref="System.Diagnostics.Debug"/> system.
		/// </summary>
		/// <param name="loggingEvent">The event to log.</param>
		/// <remarks>
		/// <para>
		/// Writes the logging event to the <see cref="System.Diagnostics.Debug"/> system.
		/// If <see cref="ImmediateFlush"/> is <c>true</c> then the <see cref="System.Diagnostics.Debug.Flush"/>
		/// is called.
		/// </para>
		/// </remarks>
		override protected void Append(LoggingEvent loggingEvent)
		{
			//
			// Write the string to the Debug system
			//
			// mc++: System.Diagnostics.Debug.Write(RenderLoggingEvent(loggingEvent), loggingEvent.LoggerName);
			string messge = loggingEvent.LoggerName + RenderLoggingEvent(loggingEvent);
			MonoTouch.Foundation.NSString p1 = new MonoTouch.Foundation.NSString("%@");
			MonoTouch.Foundation.NSString p2 = new MonoTouch.Foundation.NSString(messge);

			NSLog(p1.Handle, p2.Handle); 
			//
			// Flush the Debug system if needed
			//
			if (m_immediateFlush)
			{
				// mc++: System.Diagnostics.Debug.Flush();
			}
		}
Example #5
0
 protected ReactiveTableViewCell(MonoTouch.UIKit.UITableViewCellStyle style, MonoTouch.Foundation.NSString reuseIdentifier)
     : base(style, reuseIdentifier)
 {
 }