本文整理汇总了C#中MgaProject.GetRootDirectoryPath方法的典型用法代码示例。如果您正苦于以下问题:C# MgaProject.GetRootDirectoryPath方法的具体用法?C# MgaProject.GetRootDirectoryPath怎么用?C# MgaProject.GetRootDirectoryPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MgaProject
的用法示例。
在下文中一共展示了MgaProject.GetRootDirectoryPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InvokeEx
public void InvokeEx(MgaProject project, MgaFCO currentobj, MgaFCOs selectedobjs, int param)
{
if (this.enabled == false)
{
return;
}
try
{
// Need to call this interpreter in the same way as the MasterInterpreter will call it.
// initialize main parameters
var parameters = new InterpreterMainParameters()
{
Project = project,
CurrentFCO = currentobj,
SelectedFCOs = selectedobjs,
StartModeParam = param
};
this.mainParameters = parameters;
parameters.ProjectDirectory = project.GetRootDirectoryPath();
// set up the output directory
MgaGateway.PerformInTransaction(delegate
{
string outputDirName = project.Name;
if (currentobj != null)
{
outputDirName = currentobj.Name;
}
var outputDirAbsPath = Path.GetFullPath(Path.Combine(
parameters.ProjectDirectory,
"results",
outputDirName));
parameters.OutputDirectory = outputDirAbsPath;
if (Directory.Exists(outputDirAbsPath))
{
Logger.WriteWarning("Output directory {0} already exists. Unexpected behavior may result.", outputDirAbsPath);
}
else
{
Directory.CreateDirectory(outputDirAbsPath);
}
//this.Parameters.PackageName = Schematic.Factory.GetModifiedName(currentobj.Name);
});
PreConfigArgs preConfigArgs = new PreConfigArgs()
{
ProjectDirectory = parameters.ProjectDirectory,
Project = parameters.Project
};
// call the preconfiguration with no parameters and get preconfig
var preConfig = this.PreConfig(preConfigArgs);
// get previous GUI config
var settings_ = META.ComComponent.DeserializeConfiguration(parameters.ProjectDirectory,
typeof(CyPhy2Schematic_Settings),
this.ComponentProgID);
CyPhy2Schematic_Settings settings = (settings_ != null) ? settings_ as CyPhy2Schematic_Settings : new CyPhy2Schematic_Settings();
// Set configuration based on Workflow Parameters. This will override all [WorkflowConfigItem] members.
settings = InitializeSettingsFromWorkflow(settings);
// Don't skip GUI -- we've been invoked directly here.
settings.skipGUI = null;
// get interpreter config through GUI
var config = this.DoGUIConfiguration(preConfig, settings);
if (config == null)
{
Logger.WriteWarning("Operation canceled by the user.");
return;
}
// if config is valid save it and update it on the file system
META.ComComponent.SerializeConfiguration(parameters.ProjectDirectory, config, this.ComponentProgID);
// assign the new configuration to mainParameters
parameters.config = config;
// call the main (ICyPhyComponent) function
this.Main(parameters);
}
catch (Exception ex)
{
Logger.WriteError("Interpretation failed {0}<br>{1}", ex.Message, ex.StackTrace);
}
finally
{
if (MgaGateway != null &&
MgaGateway.territory != null)
{
MgaGateway.territory.Destroy();
}
DisposeLogger();
//.........这里部分代码省略.........