In my Windows 8 application written using Visual Studio 11 Express Beta, I cannot use ArrayList. Here is my code:
using System.Collections; ArrayList al = new ArrayList();
Compiler Error:
Could not find type name or namespace 'ArrayList' (do you miss using directive or assembly reference?)
This is something new? I like ArrayLists :)
For WinRT, they got all non-common collections - it is faster and makes your code more reliable. Use the <T> list instead.
ps ... this is not your last time you said: "Why did they pick up this API?" when switching to WinRT
EDIT
Given the documentation of ArrayList , it is available up to version 4.0. Check the version of the .NET Framework project. Given that you write Metro, this should be 4.5 (at least).
More information on this post:
How to use the ArrayList class in a subway-style class library project?
And the System.Collections namespace for Metro Style applications is missing an ArrayList type.
ArrayList
ArrayList is not available in .NET 4.5 for metro-style applications. Use the generic version of List; if you need a list of objects, use List<object> .
List<object>
For reference, the API API for metro style applications see here: http://msdn.microsoft.com/en-us/library/windows/apps/hh454064%28v=vs.110%29.aspx
You cannot use ArrayList in a WinRT application, you will need to use List .
List
It depends on the version of the .NET Framework you are using. ArrayList is not supported in .Net 4.5.1. you should use the generic form List, List<T> instead of ArrayList as collection types.
List<T>
Take a look here:
Is the <Object> list a good replacement for ArrayList?
and you can find out more here:
https://msdn.microsoft.com/en-us/library/41107z8a.aspx
Source: https://habr.com/ru/post/916947/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/916942/add-activities-to-activity-dropdown-in-task-work-item&usg=ALkJrhg2CSwC-yhNdtqb3gDaXhZW1UOnOgWindows Endless Message Cycle - c ++A good example of combining WPF + WCF + Entity Framework - c #Python: create a global variable from a string? - pythonHow to access html elements contained within a web view? - androidUsing Charles Debugging proxy server with virtual hosts in a virtual machine - debuggingHow to connect to mysql from C # via SSH - c #Regenerate evolution scenarios in game 2 - playframeworkCreating a global variable (from a string) from inside a class - pythonHow to resize browser window when starting FirefoxWebDriverProvider in JBehave Web - seleniumAll Articles