This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace _26_ManageObjLifecycle | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
using (var baseClass = new BaseClass()) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Win32.SafeHandles; | |
using System; | |
using System.Runtime.InteropServices; | |
namespace _26_ManageObjLifecycle | |
{ | |
class BaseClass : IDisposable | |
{ | |
// Flag: Has Dispose already been called? | |
bool disposed = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace _25RuntimeReflection | |
{ | |
public class ClassForReflectionPractice | |
{ | |
public ClassForReflectionPractice(string oneString) | |
{ | |
_oneString = oneString; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq.Expressions; | |
namespace _25_RuntimeReflection | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Calculating 3 to the power 2."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
namespace _25_RuntimeReflection | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var oneToTen = Enumerable.Range(0, 10).ToList(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------------------------------ | |
// <auto-generated> | |
// O código foi gerado por uma ferramenta. | |
// Versão de Tempo de Execução:4.0.30319.42000 | |
// | |
// As alterações ao arquivo poderão causar comportamento incorreto e serão perdidas se | |
// o código for gerado novamente. | |
// </auto-generated> | |
//------------------------------------------------------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.CSharp; | |
using System; | |
using System.CodeDom; | |
using System.CodeDom.Compiler; | |
using System.IO; | |
using System.Reflection; | |
namespace _25_RuntimeReflection | |
{ | |
class Program |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Reflection; | |
namespace _25RuntimeReflection | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace _25RuntimeReflection | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Checking if the Phrase property was set when using the custom attribute on UsingAttribute class. | |
var attribute = (MyCoolAttribute)Attribute.GetCustomAttribute(typeof(UsingAttribute), typeof(MyCoolAttribute)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
namespace CreateAndImplClassHierar | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |