コード例 #1
0
ファイル: PoolRepository.cs プロジェクト: balaTest/WebSamples
        private static void SaveToDataFile(FileStream outFile)
        {
            //Serialize the app state
            var serializer = new DataContractSerializer(typeof(Pool));

            var g = Pool.Instance;

            var c = new GridCell();
            c.Update("test");

            g.Grid[0][0].Update("change");

            //Your app pool's identity should have write access to this file.
            serializer.WriteObject(outFile, g);
        }
コード例 #2
0
ファイル: Pool.cs プロジェクト: balaTest/WebSamples
 private Pool()
 {
     Grid = new GridCell[10][];
     for (int i = 0; i < 10; i++)
     {
         Grid[i] = new GridCell[10];
         for (int j = 0; j < 10; j++)
         {
             Grid[i][j] = new GridCell();
         }
     }
 }