本文整理汇总了C#中DataContainer类的典型用法代码示例。如果您正苦于以下问题:C# DataContainer类的具体用法?C# DataContainer怎么用?C# DataContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataContainer类属于命名空间,在下文中一共展示了DataContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
using(var fr = new FlowRuntime())
{
var frc = new FlowRuntimeConfiguration();
var pageBufferContainer = new DataContainer<PageBuffer>();
var frontend = new Frontend();
frc.AddFlow(new Main(new Formatter(),
frontend));
frc.AddFlow(new Features(new CommandlineParser(pageBufferContainer),
new TextFileAdapter(),
new LineBuffer(pageBufferContainer),
new Pager(pageBufferContainer)));
fr.Configure(frc);
frontend.displayFirstPage += fr.CreateEventProcessor(".displayFirstPage");
frontend.displayLastPage += fr.CreateEventProcessor(".displayLastPage");
frontend.displayNextPage += fr.CreateEventProcessor(".displayNextPage");
frontend.displayPrevPage += fr.CreateEventProcessor(".displayPrevPage");
//fr.Message += Console.WriteLine;
fr.Process(new Message(".run", new[]{"test1.txt"}));
fr.WaitForResult();
}
}
示例2: Start
void Start()
{
data = GameObject.FindGameObjectWithTag("GameContainer").GetComponent<DataContainer>();
float TopScoreTime = PlayerPrefs.GetFloat("TopScore");
TopScore.text = "Best time: " + CalculateTime(TopScoreTime);
Time.timeScale = 1;
}
示例3: RecordedRawOutput
public RecordedRawOutput(string filename)
{
r = new System.Random();
startTime = DateTime.Now;
lastTime = DateTime.Now;
if(File.Exists(filename)){
// grab the XML serialized data from a file
FileStream stream = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read);
XmlSerializer xs = new XmlSerializer(typeof(DataContainer));
// then try to deserialize it
try {
container = (DataContainer)xs.Deserialize(stream);
}
catch(FileNotFoundException e){
container.dataPairs = new RawDataPair[0];
}
catch(Exception e){
Debug.Log("General exception: " + e);
}
/*
stream.Close();
*/
}
else {
container.dataPairs = new RawDataPair[0];
}
}
示例4: Start
public virtual void Start()
{
animator = GetComponent<Animator>();
audioSource = GetComponent<AudioSource>();
data = GameObject.FindGameObjectWithTag("GameContainer").GetComponent<DataContainer>();
Targets = GameObject.FindGameObjectsWithTag("Player");
CurrentTarget = GetClosestTarget();
}
示例5: DesisionTreeMainWindow
public DesisionTreeMainWindow()
{
InitializeComponent();
dbHandler = new DataBaseHandler();
desTreeInfo = new DataContainer<List<string[]>>();
learningInfo = new DataContainer<DataContainer<List<string>>>();
LoadInformationForUsingDesTrees();
}
示例6: SettingsFileManager
public SettingsFileManager()
: base()
{
fileName = "PlayerSettings.dat";
pathFile += fileName;
dataContainer = new DataContainer();
FileInitialization();
}
示例7: LaunchGame
public void LaunchGame()
{
SaveSystem.Registery.m_snapshot.m_partyName = charName.text;
DataContainer playerContainer = new DataContainer("player");
playerContainer.Addvalue("marine", selectedMarine);
//...
SaveSystem.RegisterPlayer(playerContainer);
SaveSystem.LoadScene("scn_IntroScreen");
}
示例8: Deserialize
public override void Deserialize(XElement serializedData)
{
base.Deserialize(serializedData);
foreach (XElement bone in serializedData.Element("bones").Elements())
{
DataContainer boneData = new DataContainer();
boneData.Deserialize(bone);
BoneAnimationData.Add(bone.Attribute("id").Value, boneData);
}
}
示例9: AccessFile
public AccessFile( DataContainer _dc )
{
if ( _dc != null ) {
dc = _dc;
if ( dc.GetOwnerDB() == null )
throw new AccessException( " Database is not defined for this DataСontainer! " );
filepath = dc.GetOwnerDB().DbPath+"/_dc_"+dc.Name+".access";
}
}
示例10: LoadData
public override void LoadData(DataContainer container)
{
try
{
waiting = container.GetValue<bool>("waiting");
}
catch(Exception)
{
return;
}
}
示例11: BuildIndex
public static void BuildIndex( string db_name, string container_name )
{
var db1 = DataBase.LoadFrom( db_name, null );
var dc1 = new DataContainer( db1, container_name );
var rec1 = new Record( dc1 );
rec1.Id = 102;
rec1.BuildIndex();
var hash_expected = "2D8C1282A16592B40656F06F80D75172";
Assert.AreEqual( hash_expected, rec1.GetIndex().DwarfHashCode );
}
示例12: Generate
public static string Generate(DataContainer container)
{
string output = "";
foreach(DataGroup group in container.TopGroups)
{
output += GenerateDataGroup(group, 0) + "\n";
}
return output;
}
示例13: Serialize
public Stream Serialize(object item)
{
Should.NotBeNull(item, nameof(item));
EnsureInitialized();
if (_knownTypes.Add(item.GetType()))
_contractSerializer = new DataContractSerializer(typeof(DataContainer), _knownTypes);
item = new DataContainer { Data = item };
var ms = new MemoryStream();
_contractSerializer.WriteObject(ms, item);
return ms;
}
示例14: Save
/// <summary>
/// Save this object in the Resgistery
/// </summary>
public virtual void Save()
{
if (!m_volatile)
{
if (m_data == null)
m_data = new DataContainer(gameObject.name);
CollectData(m_data);
SaveSystem.RegisterData(m_data);
}
}
示例15: CreateContainer
public static void CreateContainer()
{
var user = User.User.New( "root", "12345678");
string container_name = "nunit_container1";
var db = DataBase.LoadFrom( "nunit_db", null );
var new_dc = new DataContainer( db, container_name );
new_dc.AddAccess( user, AccessFunctions.Access.AccessLevel.READ_WRITE );
new_dc.AddColumn( new Column( DataType.STRING, "col1" ), user );
new_dc.AddColumn( new Column( DataType.FLOAT, "col2" ), user );
new_dc.BuildIndex();
new_dc.Save();
}