This file contains 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
/// <summary> | |
/// 抽象再帰クラス | |
/// </summary> | |
public abstract class RecursionBase<T> where T : RecursionBase<T> { | |
#region コンストラクタ | |
protected RecursionBase() { | |
Children = new RecursionCollection(this); | |
} |
This file contains 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
public class testClass : RecursionBase<testClass> { | |
public testClass() { | |
this.Name = "oya"; | |
//Addしてみる | |
this.Children.Add(new testClass() { Name = "ko1" }); | |
this.Children[0].Children.Add(new testClass() { Name = "mago1" }); | |
//AddRangeしてみる | |
var children = new RecursionCollection(this); | |
children.Add(new testClass() { Name = "ko2" }); | |
children.Add(new testClass() { Name = "ko3" }); |
This file contains 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
/// <summary> | |
///Within のテスト | |
///</summary> | |
public void WithinTest2Helper<T>(StructInterval<T> target, T obj, bool expected) where T : struct, IComparable<T> { | |
bool actual = target.Within(obj); | |
Assert.AreEqual(expected, actual); | |
} | |
[TestMethod()] | |
public void WithinTest2() { |
This file contains 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
class Program | |
{ | |
[STAThread] | |
static void Main(string[] args) | |
{ | |
TestFlag f = TestFlag.b | TestFlag.d; //bとdにフラグを立てる | |
Console.WriteLine("{0}", f.HasFlag(TestFlag.a)); | |
Console.WriteLine("{0}", f.HasFlag(TestFlag.b)); | |
Console.WriteLine("{0}", f.HasFlag(TestFlag.c)); |
This file contains 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
interface IData //データインターフェース | |
{ | |
} | |
public abstract class SchemaBase//DBスキーマ抽象クラス | |
{ | |
public SchemaBase() { } | |
} | |
public abstract class DAOBase<TSchema, TData>//DAOパターン抽象クラス |
This file contains 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
interface IData //データインターフェース | |
{ | |
} | |
public abstract class SchemaBase//DBスキーマ抽象クラス | |
{ | |
public SchemaBase() { } | |
} | |
public abstract class DAOBase<TSchema, TData>//DAOパターン抽象クラス |
This file contains 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
class Program{ | |
static void Main(string[] args){ | |
//参照型の値渡し | |
TestClass t1 = new TestClass(); | |
TestClass t2 = ValMethod(t1); | |
Console.WriteLine(t1 == t2);//false | |
//参照型の参照渡し | |
TestClass t3 = new TestClass(); |
This file contains 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.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Reflection; | |
namespace Enumに柔軟な拡張を追加する試み { | |
class Program { | |
enum tesyEnum { | |
[Obsolete] |
This file contains 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.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace Linqメソッドで遊ぶ | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains 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.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace Linqメソッドで遊ぶ | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
OlderNewer