C# Flashcards
in c# whats does reflection accomplish
You can use reflection to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object and invoke its methods or access its fields and properties.
in c# how do you add an attribute to a class
[attribute] puclic class x
in c# this keyword can be used to avoid having to call a class my its full name (System.Console.writeline() vs Console.Writeline();)
using System;
what type of data is created when serializing an object
bytes
In c# what does streamiingcontext do
Describes the source and destination of a given serialized stream, and provides an additional caller-defined context
In c# what 3 things do you need to make an item serializable
the object to be serialized, a stream to contain the serialized object, and a Formatter. System.Runtime.Serialization
In c# what does SerializeInfo class accomplish
Stores all the data needed to serialize or deserialize an object
In c# what attribute decoration can you use to exclude it from sereialization
xmlignore
in c# what is a ManagedThreadPool
provides your application with a pool of worker threads that are managed by the system, allowing you to concentrate on application tasks rather than thread management.
in c# when should you not use a ManagedThreadPool
You require a foreground thread.
You require a thread to have a particular priority.
You have tasks that cause the thread to block for long periods of time. The thread pool has a maximum number of threads, so a large number of blocked thread pool threads might prevent tasks from starting.
You need to place threads into a single-threaded apartment. All ThreadPool threads are in the multithreaded apartment.
You need to have a stable identity associated with the thread, or to dedicate a thread to a task.
in c# this keyword can be used to avoid having to call a class my its full name (System.Console.writeline() vs Console.Writeline();)
using System;
in c# define a lambda expression with one paramter that is a squared expression
x =>x*x
in c# paramaters for a lambda expression go on which side of the => operator
left
in c# managed code is manage by which runtime
common language runtime (CLR)
in c# What is a concurrentbag
thread-safe bag implementation, optimized for scenarios where the same thread will be both producing and consuming data stored in the bag.”