本文整理汇总了C#中System.Item.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Item.Dispose方法的具体用法?C# Item.Dispose怎么用?C# Item.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Item
的用法示例。
在下文中一共展示了Item.Dispose方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Manual_ShareTextLinkImage
public void Manual_ShareTextLinkImage ()
{
var service = CreateService ();
var item = new Item ("Hello image from Android!");
item.Links.Add (new Uri ("http://xamarin.com"));
item.Images.Add (new ImageData (TestRunner.Shared.Assets.Open ("what_does_that_mean_trollcat.jpg"), "image/jpeg"));
var intent = service.GetShareUI (TestRunner.Shared, item, result => {
Console.WriteLine ("AUTHENTICATE RESULT = " + result);
item.Dispose ();
});
TestRunner.Shared.StartActivityForResult (intent, 42);
}
示例2: Manual_ShareText
public void Manual_ShareText ()
{
var service = CreateService ();
var item = new Item {
Text = "This is just a test. Don't mind me...",
};
var vc = service.GetShareUI (item, result => {
Console.WriteLine ("SHARE RESULT = " + result);
item.Dispose ();
AppDelegate.Shared.RootViewController.DismissModalViewControllerAnimated (true);
});
AppDelegate.Shared.RootViewController.PresentViewController (vc, true, null);
}
示例3: Manual_ShareTextLink
public void Manual_ShareTextLink ()
{
var service = CreateService ();
var item = new Item {
Text = "Hey everyone, I'm going to be spamming Facebook for a little while. Don't mind me!",
};
item.Links.Add (new Uri ("http://praeclarum.org"));
var vc = service.GetShareUI (item, result => {
Console.WriteLine ("SHARE RESULT = " + result);
item.Dispose ();
AppDelegate.Shared.RootViewController.DismissModalViewControllerAnimated (true);
});
AppDelegate.Shared.RootViewController.PresentViewController (vc, true, null);
}
示例4: Manual_ShareTextLink
public void Manual_ShareTextLink ()
{
var service = CreateService ();
var item = new Item {
Text = "This is just a test. Don't mind me...",
};
item.Links.Add (new Uri ("http://docs.xamarin.com/ios/getting_started/intro_to_mvc_in_ios"));
var vc = service.GetShareUI (item, result => {
Console.WriteLine ("SHARE RESULT = " + result);
item.Dispose ();
AppDelegate.Shared.RootViewController.DismissModalViewControllerAnimated (true);
});
AppDelegate.Shared.RootViewController.PresentViewController (vc, true, null);
}
示例5: Manual_ShareTextImageLinks
public void Manual_ShareTextImageLinks ()
{
var service = CreateService ();
var item = new Item {
Text = "Hello, World from Android",
};
item.Images.Add (new ImageData (TestRunner.Shared.Assets.Open ("what_does_that_mean_trollcat.jpg"), "image/jpeg"));
item.Links.Add (new Uri ("http://xamarin.com"));
item.Links.Add (new Uri ("https://twitter.com/xamarinhq"));
var intent = service.GetShareUI (TestRunner.Shared, item, result => {
Console.WriteLine ("SHARE RESULT = " + result);
item.Dispose ();
});
TestRunner.Shared.StartActivityForResult (intent, 42);
}
示例6: Manual_ShareImageTextLinks
public void Manual_ShareImageTextLinks ()
{
var service = CreateService ();
var item = new Item {
Text = "Hello, World",
};
item.Images.Add ("Images/what_does_that_mean_trollcat.jpg");
item.Links.Add (new Uri ("http://xamarin.com"));
item.Links.Add (new Uri ("https://twitter.com/xamarinhq"));
var vc = service.GetShareUI (item, result => {
Console.WriteLine ("SHARE RESULT = " + result);
item.Dispose ();
AppDelegate.Shared.RootViewController.DismissModalViewControllerAnimated (true);
});
AppDelegate.Shared.RootViewController.PresentViewController (vc, true, null);
}
示例7: printIterator
public static void printIterator(Iterator iterator, String pre)
{
Item item = new Item();
iterator.open();
while (iterator.next(item)) {
printItem(item, pre);
}
item.Dispose();
iterator.close();
iterator.Dispose();
}
示例8: printItem
public static void printItem(Item item, String pre)
{
if (item.isAtomic()) {
Item typeItem = item.getType();
System.Console.WriteLine(pre + "Leaf Atomic: \"" + item.getStringValue() + "\" \ttype:" + typeItem.getStringValue());
typeItem.Dispose();
return;
}
if (item.isNode()) {
int kind = item.getNodeKind();
if (kind == 0) { // anyNode
System.Console.WriteLine(pre + "Any node");
System.Console.WriteLine( pre + " Children:");
printIterator(item.getChildren(), pre+" ");
}
if (kind == 1) { // doc
System.Console.WriteLine( pre + "Doc" );
System.Console.WriteLine( pre + " Children:" );
printIterator(item.getChildren(), pre+" ");
}
if (kind == 2) { // element
Item nodeName = new Item();
item.getNodeName(nodeName);
Item typeItem = item.getType();
System.Console.WriteLine( pre + "Start Element: ", nodeName.getStringValue(), " \ttype:", typeItem.getStringValue() );
System.Console.WriteLine( pre + " Attributes:" );
printIterator(item.getAttributes(), pre+" ");
System.Console.WriteLine( pre + " Children:" );
printIterator(item.getChildren(), pre+" ");
System.Console.WriteLine( pre + "End Element: " + nodeName.getStringValue() );
typeItem.Dispose();
nodeName.Dispose();
}
if (kind == 3) { // attribute
Item nodeName = new Item();
item.getNodeName(nodeName);
Item typeItem = item.getType();
System.Console.WriteLine( pre + "Attribute: " + nodeName.getStringValue() + "= \"" + item.getStringValue() + "\" \ttype:" + typeItem.getStringValue());
System.Console.WriteLine( pre+" Atomization value:");
printIterator(item.getAtomizationValue(), pre+" ");
typeItem.Dispose();
nodeName.Dispose();
}
if (kind == 4) { // text
Item typeItem = item.getType();
System.Console.WriteLine( pre + "Text: " + item.getStringValue() + " \ttype:" + typeItem.getStringValue() );
System.Console.WriteLine( pre + " Atomization value:" );
printIterator(item.getAtomizationValue(), pre+" ");
typeItem.Dispose();
}
if (kind == 5) { // pi
Item nodeName = new Item();
item.getNodeName(nodeName);
System.Console.WriteLine( pre + "Pi: " + nodeName.getStringValue() );
nodeName.Dispose();
}
if (kind == 6) { // comment
System.Console.WriteLine( pre + "Comment: " + item.getStringValue() );
}
} else {
System.Console.WriteLine( pre+"Item not Node, not Atomic");
}
}