本文整理汇总了C#中NSString.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# NSString.Dispose方法的具体用法?C# NSString.Dispose怎么用?C# NSString.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NSString
的用法示例。
在下文中一共展示了NSString.Dispose方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetHook
public static MonoTouch.UIKit.UIView GetHook(string hook, int x, int y, MonoTouch.UIKit.UIView view, bool attachToView, string orientation, string canvasOrientation, bool refresh, bool canvasAnimated, string rewardMessage, NSDictionary userCookies)
{
if (hook == null)
throw new ArgumentNullException ("hook");
if (view == null)
throw new ArgumentNullException ("view");
if (orientation == null)
throw new ArgumentNullException ("orientation");
if (canvasOrientation == null)
throw new ArgumentNullException ("canvasOrientation");
if (rewardMessage == null)
throw new ArgumentNullException ("rewardMessage");
if (userCookies == null)
throw new ArgumentNullException ("userCookies");
var nshook = new NSString (hook);
var nsorientation = new NSString (orientation);
var nscanvasOrientation = new NSString (canvasOrientation);
var nsrewardMessage = new NSString (rewardMessage);
MonoTouch.UIKit.UIView ret;
ret = (MonoTouch.UIKit.UIView) Runtime.GetNSObject (Messaging.IntPtr_objc_msgSend_IntPtr_int_int_IntPtr_bool_IntPtr_IntPtr_bool_bool_IntPtr_IntPtr (class_ptr, selGetHookXLocYLocViewAttachToViewOrientationCanvasOrientationAutoRefreshCanvasAnimatedRewardMessageUserCookies, nshook.Handle, x, y, view.Handle, attachToView, nsorientation.Handle, nscanvasOrientation.Handle, refresh, canvasAnimated, nsrewardMessage.Handle, userCookies.Handle));
nshook.Dispose ();
nsorientation.Dispose ();
nscanvasOrientation.Dispose ();
nsrewardMessage.Dispose ();
return ret;
}
示例2: SetString
public void SetString (string value, string defaultName)
{
NSString str = new NSString (value);
SetObjectForKey (str, defaultName);
str.Dispose ();
}
示例3: OpenTakeover
public static void OpenTakeover(string hook, string orientation, MonoTouch.UIKit.UIImage image, string message, NSDictionary userCookies)
{
if (hook == null)
throw new ArgumentNullException ("hook");
if (orientation == null)
throw new ArgumentNullException ("orientation");
if (image == null)
throw new ArgumentNullException ("image");
if (message == null)
throw new ArgumentNullException ("message");
if (userCookies == null)
throw new ArgumentNullException ("userCookies");
var nshook = new NSString (hook);
var nsorientation = new NSString (orientation);
var nsmessage = new NSString (message);
Messaging.void_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr (class_ptr, selOpenTakeoverOrientationRewardImageRewardMessageUserCookies, nshook.Handle, nsorientation.Handle, image.Handle, nsmessage.Handle, userCookies.Handle);
nshook.Dispose ();
nsorientation.Dispose ();
nsmessage.Dispose ();
}
示例4: Draw
public override void Draw (CGRect rect)
{
WeatherForecastAnnotation annotation;
CGPath path;
base.Draw (rect);
annotation = Annotation as WeatherForecastAnnotation;
if (annotation == null)
return;
// Get the current graphics context
using (var context = UIGraphics.GetCurrentContext ()) {
context.SetLineWidth (1.0f);
// Draw the gray pointed shape:
path = new CGPath ();
path.MoveToPoint (14.0f, 0.0f);
path.AddLineToPoint (0.0f, 0.0f);
path.AddLineToPoint (55.0f, 50.0f);
context.AddPath (path);
context.SetFillColor (UIColor.LightGray.CGColor);
context.SetStrokeColor (UIColor.Gray.CGColor);
context.DrawPath (CGPathDrawingMode.FillStroke);
// Draw the cyan rounded box
path = new CGPath ();
path.MoveToPoint (15.0f, 0.5f);
path.AddArcToPoint (59.5f, 00.5f, 59.5f, 05.0f, 5.0f);
path.AddArcToPoint (59.5f, 69.5f, 55.5f, 69.5f, 5.0f);
path.AddArcToPoint (10.5f, 69.5f, 10.5f, 64.0f, 5.0f);
path.AddArcToPoint (10.5f, 00.5f, 15.5f, 00.5f, 5.0f);
context.AddPath (path);
context.SetFillColor (UIColor.Cyan.CGColor);
context.SetStrokeColor (UIColor.Blue.CGColor);
context.DrawPath (CGPathDrawingMode.FillStroke);
// Create the location & temperature string
WeatherForecast forecast = annotation.Forecast;
NSString temperature = new NSString (string.Format ("{0}\n{1} / {2}", forecast.Place, forecast.High, forecast.Low));
// Draw the text in black
UIColor.Black.SetColor ();
temperature.DrawString (new CGRect (15.0f, 5.0f, 50.0f, 40.0f), UIFont.SystemFontOfSize (11.0f));
temperature.Dispose ();
// Draw the icon for the weather condition
string imageName = string.Format ("WeatherMap.WeatherIcons.{0}.png", forecast.Condition);
UIImage image = UIImage.FromResource (typeof(WeatherAnnotationView).Assembly, imageName);
image.Draw (new CGRect (12.5f, 28.0f, 45.0f, 45.0f));
image.Dispose ();
}
}
示例5: Hello
public virtual string Hello (string name)
{
if (name == null)
throw new ArgumentNullException ("name");
var nsname = new NSString (name);
string ret;
if (IsDirectBinding) {
ret = NSString.FromHandle (MonoTouch.ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr (this.Handle, selHello_, nsname.Handle));
} else {
ret = NSString.FromHandle (MonoTouch.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_IntPtr (this.SuperHandle, selHello_, nsname.Handle));
}
nsname.Dispose ();
return ret;
}
示例6: Echo
public static string Echo (string message)
{
if (message == null)
throw new ArgumentNullException ("message");
var nsmessage = new NSString (message);
string ret;
ret = NSString.FromHandle (MonoTouch.ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr (class_ptr, selEcho_, nsmessage.Handle));
nsmessage.Dispose ();
return ret;
}
示例7: DrawFooterForPage
public override void DrawFooterForPage (int index, RectangleF footerRect)
{
NSString footer = new NSString (string.Format ("Page {0} of {1}", index - pageRange.Location + 1, pageRange.Length));
footer.DrawString (footerRect, SystemFont, UILineBreakMode.Clip, UITextAlignment.Center);
footer.Dispose ();
}
示例8: DrawHeaderForPage
// Custom UIPrintPageRenderer's may override this class to draw a custom print page header.
// To illustrate that, this class sets the date in the header.
public override void DrawHeaderForPage (int index, RectangleF headerRect)
{
NSDateFormatter dateFormatter = new NSDateFormatter ();
dateFormatter.DateFormat = "MMMM d, yyyy 'at' h:mm a";
NSString dateString = new NSString (dateFormatter.ToString (NSDate.Now));
dateFormatter.Dispose ();
dateString.DrawString (headerRect, SystemFont, UILineBreakMode.Clip, UITextAlignment.Right);
dateString.Dispose ();
}
示例9: Configure
public static void Configure (string APIKey, string userID)
{
if (APIKey == null)
throw new ArgumentNullException ("APIKey");
if (userID == null)
throw new ArgumentNullException ("userID");
var nsAPIKey = new NSString (APIKey);
var nsuserID = new NSString (userID);
MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr_IntPtr (class_ptr, selConfigureWithAPIKeyAndUserID_, nsAPIKey.Handle, nsuserID.Handle);
nsAPIKey.Dispose ();
nsuserID.Dispose ();
}
示例10: CustomizeViewWithText
public virtual void CustomizeViewWithText (string message)
{
if (message == null)
throw new ArgumentNullException ("message");
var nsmessage = new NSString (message);
if (IsDirectBinding) {
MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (this.Handle, selCustomizeViewWithText_, nsmessage.Handle);
} else {
MonoTouch.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (this.SuperHandle, selCustomizeViewWithText_, nsmessage.Handle);
}
nsmessage.Dispose ();
}