当前位置: 首页>>代码示例>>C#>>正文


C# Item.Dispose方法代码示例

本文整理汇总了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);
		}
开发者ID:johnbeans,项目名称:Xamarin.Social,代码行数:14,代码来源:TwitterTest.cs

示例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);
		}
开发者ID:johnbeans,项目名称:Xamarin.Social,代码行数:15,代码来源:TwitterTest.cs

示例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);
		}
开发者ID:nissan,项目名称:Xamarin.Social,代码行数:16,代码来源:FacebookTest.cs

示例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);
		}
开发者ID:johnbeans,项目名称:Xamarin.Social,代码行数:16,代码来源:TwitterTest.cs

示例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);
		}
开发者ID:johnbeans,项目名称:Xamarin.Social,代码行数:18,代码来源:FlickrTest.cs

示例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);
		}
开发者ID:johnbeans,项目名称:Xamarin.Social,代码行数:18,代码来源:FlickrTest.cs

示例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();
 }
开发者ID:cezarfx,项目名称:zorba,代码行数:11,代码来源:test08.cs

示例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");
              }
        }
开发者ID:cezarfx,项目名称:zorba,代码行数:64,代码来源:test08.cs


注:本文中的System.Item.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。