本文整理汇总了C#中ICore.Load方法的典型用法代码示例。如果您正苦于以下问题:C# ICore.Load方法的具体用法?C# ICore.Load怎么用?C# ICore.Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICore
的用法示例。
在下文中一共展示了ICore.Load方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadParameters
//---------------------------------------------------------------------
public override void LoadParameters(string dataFile,
ICore mCore)
{
modelCore = mCore;
InputParametersParser parser = new InputParametersParser();
parameters = modelCore.Load<IInputParameters>(dataFile, parser);
}
示例2: LoadParameters
//---------------------------------------------------------------------
public override void LoadParameters(string dataFile,
ICore mCore)
{
modelCore = mCore;
SiteVars.Initialize(mCore);
ParameterParser parser = new ParameterParser();
parameters = mCore.Load<IInputParameters>(dataFile, parser);
modelCore.Log.WriteLine("Exiting LoadParameters method !!!");
}
示例3: LoadParameters
//---------------------------------------------------------------------
public override void LoadParameters(string dataFile, ICore mCore)
{
modelCore = mCore;
SiteVars.Initialize();
InputParameterParser parser = new InputParameterParser();
parameters = mCore.Load<IInputParameters>(dataFile, parser);
// Add local event handler for cohorts death due to age-only
// disturbances.
Cohort.AgeOnlyDeathEvent += CohortKilledByAgeOnlyDisturbance;
}
示例4: LoadParameters
//---------------------------------------------------------------------
public override void LoadParameters(string dataFile, ICore mCore)
{
modelCore = mCore;
SiteVars.Initialize();
InputParametersParser parser = new InputParametersParser(mCore.Species);
parameters = mCore.Load<IInputParameters>(dataFile, parser);
if (parser.RoundedRepeatIntervals.Count > 0)
{
PlugIn.ModelCore.Log.WriteLine("NOTE: The following repeat intervals were rounded up to");
PlugIn.ModelCore.Log.WriteLine(" ensure they were multiples of the harvest timestep:");
PlugIn.ModelCore.Log.WriteLine(" File: {0}", dataFile);
foreach (RoundedInterval interval in parser.RoundedRepeatIntervals)
PlugIn.ModelCore.Log.WriteLine(" At line {0}, the interval {1} rounded up to {2}",
interval.LineNumber,
interval.Original,
interval.Adjusted);
}
}
示例5: OnConnection
/// <summary>Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.</summary>
/// <param term='application'>Root object of the host application.</param>
/// <param term='connectMode'>Describes how the Add-in is being loaded.</param>
/// <param term='addInInst'>Object representing this Add-in.</param>
/// <seealso class='IDTExtensibility2' />
public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
_application = (DTE2)application;
_addIn = (EnvDTE.AddIn)addInInst;
// Events
_events = (Events2)_application.Events;
_projectsEvents = _events.ProjectsEvents;
_projectItemsEvents = _events.ProjectItemsEvents;
_documentEvents = _events.DocumentEvents;
_buildEvents = _events.BuildEvents;
AttachEvents();
_core = new Core();
// If being connected when Solution is already loaded - try to load all projects
if (_application.Solution != null)
{
_core.Load(_application.Solution);
}
}
示例6: LoadParameters
//---------------------------------------------------------------------
public override void LoadParameters(string dataFile,
ICore mCore)
{
Landis.Extension.BaseHarvest.PlugIn baseHarvest = new BaseHarvest.PlugIn();
try
{
baseHarvest.LoadParameters(null, mCore);
}
catch (System.ArgumentNullException)
{
// ignore
}
modelCore = mCore;
// Add local event handler for cohorts death due to age-only
// disturbances.
Cohort.AgeOnlyDeathEvent += CohortKilledByAgeOnlyDisturbance;
ParametersParser parser = new ParametersParser(modelCore.Species);
BaseHarvest.IInputParameters baseParameters = modelCore.Load<BaseHarvest.IInputParameters>(dataFile, parser);
parameters = baseParameters as IParameters;
if (parser.RoundedRepeatIntervals.Count > 0)
{
modelCore.Log.WriteLine("NOTE: The following repeat intervals were rounded up to");
modelCore.Log.WriteLine(" ensure they were multiples of the harvest timestep:");
modelCore.Log.WriteLine(" File: {0}", dataFile);
foreach (RoundedInterval interval in parser.RoundedRepeatIntervals)
modelCore.Log.WriteLine(" At line {0}, the interval {1} rounded up to {2}",
interval.LineNumber,
interval.Original,
interval.Adjusted);
}
}
示例7: OnConnection
/// <summary>Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.</summary>
/// <param term='application'>Root object of the host application.</param>
/// <param term='connectMode'>Describes how the Add-in is being loaded.</param>
/// <param term='addInInst'>Object representing this Add-in.</param>
/// <seealso class='IDTExtensibility2' />
public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
_application = (DTE2)application;
_addInInstance = (AddIn)addInInst;
// Core
var name = _addInInstance.Name;
var outputPane = _application.ToolWindows.OutputWindow.OutputWindowPanes.GetPane(name);
var feedback = new FeedbackManager(name, outputPane);
_core = new Core(feedback);
// Events
_events = (Events2)_application.Events;
_projectsEvents = _events.ProjectsEvents;
_projectItemsEvents = _events.ProjectItemsEvents;
_documentEvents = _events.DocumentEvents;
_buildEvents = _events.BuildEvents;
AttachEvents();
// If being connected when Solution is already loaded - try to load all projects
if (_application.Solution != null)
{
_core.Load(_application.Solution);
}
}