本文整理汇总了C#中Scope.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Scope.Save方法的具体用法?C# Scope.Save怎么用?C# Scope.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scope
的用法示例。
在下文中一共展示了Scope.Save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SimpleScope
public void SimpleScope()
{
string filename = TEST_FILE_NAME;
Scope s = new Scope("a");
s.Save<Scope>(filename);
Scope loaded = Scope.Load<Scope>(filename);
Assert.IsTrue(s.Equals(loaded));
}
示例2: NonFlatScope
public void NonFlatScope()
{
string filename = TEST_FILE_NAME;
Scope s = new Scope("abc");
s.DefineInnerScope(1, 1);
s.Save<Scope>(filename);
Scope loaded = Scope.Load<Scope>(filename);
Assert.AreEqual(3,loaded.GetInnerScopes().Length);
}
示例3: SimpleScopeWith1SuggestionInInner
public void SimpleScopeWith1SuggestionInInner()
{
string filename = TEST_FILE_NAME;
Scope s = new Scope("abc");
Suggestion sug = new Suggestion("a","b");
s.DefineInnerScope(1,1).Suggestions.Add(sug);
s.Save<Scope>(filename);
Scope loaded = Scope.Load<Scope>(filename);
Assert.AreEqual(sug, loaded.InnerMiddleScope.Suggestions[0]);
}
示例4: NonFlatScope2LevelsDeep
public void NonFlatScope2LevelsDeep()
{
string filename = TEST_FILE_NAME;
Scope s = new Scope("abcd");
s.DefineInnerScope(1, 2).DefineInnerScope(2,1);
s.Save<Scope>(filename);
Scope loaded = Scope.Load<Scope>(filename);
Assert.IsNotNull(loaded.InnerMiddleScope.InnerLeftScope);
Assert.IsNotNull(loaded.InnerMiddleScope.InnerRightScope);
}