當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。