本文整理汇总了C#中LibraryServices类的典型用法代码示例。如果您正苦于以下问题:C# LibraryServices类的具体用法?C# LibraryServices怎么用?C# LibraryServices使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LibraryServices类属于命名空间,在下文中一共展示了LibraryServices类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EngineController
public EngineController(DynamoModel dynamoModel, string geometryFactoryFileName)
{
this.dynamoModel = dynamoModel;
// Create a core which is used for parsing code and loading libraries
libraryCore = new ProtoCore.Core(new Options()
{
RootCustomPropertyFilterPathName = string.Empty
});
libraryCore.Executives.Add(Language.kAssociative,new ProtoAssociative.Executive(libraryCore));
libraryCore.Executives.Add(Language.kImperative, new ProtoImperative.Executive(libraryCore));
libraryCore.ParsingMode = ParseMode.AllowNonAssignment;
libraryServices = new LibraryServices(libraryCore);
libraryServices.LibraryLoading += this.LibraryLoading;
libraryServices.LibraryLoadFailed += this.LibraryLoadFailed;
libraryServices.LibraryLoaded += this.LibraryLoaded;
liveRunnerServices = new LiveRunnerServices(dynamoModel, this, geometryFactoryFileName);
liveRunnerServices.ReloadAllLibraries(libraryServices.ImportedLibraries);
codeCompletionServices = new CodeCompletionServices(LiveRunnerCore);
astBuilder = new AstBuilder(dynamoModel, this);
syncDataManager = new SyncDataManager();
dynamoModel.NodeDeleted += NodeDeleted;
}
示例2: CodeBlockNodeModel
public CodeBlockNodeModel(LibraryServices libraryServices)
{
ArgumentLacing = LacingStrategy.Disabled;
this.libraryServices = libraryServices;
this.libraryServices.LibraryLoaded += LibraryServicesOnLibraryLoaded;
this.ElementResolver = new ElementResolver();
}
示例3: CodeBlockNodeModel
/// <summary>
/// Initilizes a new instance of the <see cref="CodeBlockNodeModel"/> class
/// </summary>
/// <param name="libraryServices"><see cref="LibraryServices"/> object to manage
/// builtin libraries as well as imported libraries</param>
public CodeBlockNodeModel(LibraryServices libraryServices)
{
ArgumentLacing = LacingStrategy.Disabled;
this.libraryServices = libraryServices;
this.ElementResolver = new ElementResolver();
ProcessCodeDirect();
}
示例4: LoadWorkspaceFromJson
/// <summary>
/// Load a WorkspaceModel from json. If the WorkspaceModel is a HomeWorkspaceModel
/// it will be set as the current workspace.
/// </summary>
/// <param name="json"></param>
public static WorkspaceModel LoadWorkspaceFromJson(string json, LibraryServices libraryServices,
EngineController engineController, DynamoScheduler scheduler, NodeFactory factory,
bool isTestMode, bool verboseLogging, CustomNodeManager manager)
{
var settings = new JsonSerializerSettings
{
Error = (sender, args) =>
{
args.ErrorContext.Handled = true;
Console.WriteLine(args.ErrorContext.Error);
},
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
TypeNameHandling = TypeNameHandling.Auto,
Formatting = Formatting.Indented,
Converters = new List<JsonConverter>{
new ConnectorConverter(),
new AnnotationConverter(),
new WorkspaceConverter(engineController, scheduler, factory, isTestMode, verboseLogging),
new NodeModelConverter(manager, libraryServices),
},
ReferenceResolverProvider = () => { return new IdReferenceResolver(); }
};
var result = ReplaceTypeDeclarations(json, true);
var ws = JsonConvert.DeserializeObject<WorkspaceModel>(result, settings);
return ws;
}
示例5: CodeBlockNodeModel
public CodeBlockNodeModel(string userCode, Guid guid, double xPos, double yPos, LibraryServices libraryServices, ElementResolver resolver)
{
ArgumentLacing = LacingStrategy.Disabled;
X = xPos;
Y = yPos;
this.libraryServices = libraryServices;
this.ElementResolver = resolver;
code = userCode;
GUID = guid;
ShouldFocus = false;
ProcessCodeDirect();
}
示例6: Init
public override void Init()
{
base.Init();
var options = new ProtoCore.Options();
options.RootModulePathName = string.Empty;
libraryServicesCore = new ProtoCore.Core(options);
libraryServicesCore.Executives.Add(ProtoCore.Language.kAssociative,
new ProtoAssociative.Executive(libraryServicesCore));
libraryServicesCore.Executives.Add(ProtoCore.Language.kImperative,
new ProtoImperative.Executive(libraryServicesCore));
libraryServices = new LibraryServices(libraryServicesCore);
}
示例7: LoadPackagesIntoDynamo
/// <summary>
/// Scan the PackagesDirectory for packages and attempt to load all of them. Beware! Fails silently for duplicates.
/// </summary>
public void LoadPackagesIntoDynamo( IPreferences preferences, LibraryServices libraryServices )
{
this.ScanAllPackageDirectories( preferences );
foreach (var pkg in LocalPackages)
{
DynamoPathManager.Instance.AddResolutionPath(pkg.BinaryDirectory);
}
foreach (var pkg in LocalPackages)
{
pkg.LoadIntoDynamo(loader, logger, libraryServices);
}
}
示例8: EngineController
public EngineController(DynamoController controller)
{
libraryServices = LibraryServices.GetInstance();
libraryServices.LibraryLoading += this.LibraryLoading;
libraryServices.LibraryLoadFailed += this.LibraryLoadFailed;
libraryServices.LibraryLoaded += this.LibraryLoaded;
liveRunnerServices = new LiveRunnerServices(this);
liveRunnerServices.ReloadAllLibraries(libraryServices.Libraries.ToList());
astBuilder = new AstBuilder(this);
syncDataManager = new SyncDataManager();
this.controller = controller;
this.controller.DynamoModel.NodeDeleted += NodeDeleted;
}
示例9: EngineController
public EngineController(DynamoModel dynamoModel, string geometryFactoryFileName)
{
this.dynamoModel = dynamoModel;
libraryServices = LibraryServices.GetInstance();
libraryServices.LibraryLoading += this.LibraryLoading;
libraryServices.LibraryLoadFailed += this.LibraryLoadFailed;
libraryServices.LibraryLoaded += this.LibraryLoaded;
liveRunnerServices = new LiveRunnerServices(dynamoModel, this, geometryFactoryFileName);
liveRunnerServices.ReloadAllLibraries(libraryServices.Libraries.ToList());
astBuilder = new AstBuilder(dynamoModel, this);
syncDataManager = new SyncDataManager();
dynamoModel.NodeDeleted += NodeDeleted;
}
示例10: Setup
public override void Setup()
{
base.Setup();
libraryCore = new ProtoCore.Core(new Options { RootCustomPropertyFilterPathName = string.Empty });
libraryCore.Compilers.Add(Language.kAssociative, new ProtoAssociative.Compiler(libraryCore));
libraryCore.Compilers.Add(Language.kImperative, new ProtoImperative.Compiler(libraryCore));
libraryCore.ParsingMode = ParseMode.AllowNonAssignment;
var pathResolver = new TestPathResolver();
pathResolver.AddPreloadLibraryPath("DSCoreNodes.dll");
var pathManager = new PathManager(new PathManagerParams
{
PathResolver = pathResolver
});
libraryServices = new LibraryServices(libraryCore, pathManager);
RegisterEvents();
}
示例11: Setup
public override void Setup()
{
base.Setup();
libraryCore = new ProtoCore.Core(new Options());
libraryCore.Compilers.Add(Language.Associative, new ProtoAssociative.Compiler(libraryCore));
libraryCore.Compilers.Add(Language.Imperative, new ProtoImperative.Compiler(libraryCore));
libraryCore.ParsingMode = ParseMode.AllowNonAssignment;
var pathResolver = new TestPathResolver();
pathResolver.AddPreloadLibraryPath("DSCoreNodes.dll");
var pathManager = new PathManager(new PathManagerParams
{
PathResolver = pathResolver
});
var settings = new PreferenceSettings();
libraryServices = new LibraryServices(libraryCore, pathManager, settings);
RegisterEvents();
}
示例12: LoadIntoDynamo
public void LoadIntoDynamo( DynamoLoader loader, ILogger logger, LibraryServices libraryServices)
{
try
{
this.LoadAssembliesIntoDynamo(loader, logger, libraryServices);
this.LoadCustomNodesIntoDynamo( loader );
this.EnumerateAdditionalFiles();
Loaded = true;
}
catch (Exception e)
{
logger.Log("Exception when attempting to load package " + this.Name + " from " + this.RootDirectory);
logger.Log(e.GetType() + ": " + e.Message);
}
}
示例13: CodeBlockNodeSearchElement
public CodeBlockNodeSearchElement(TypeLoadData data, LibraryServices manager)
: base(data)
{
libraryServices = manager;
}
示例14: CodeBlockNodeModel
public CodeBlockNodeModel(string userCode, double xPos, double yPos, LibraryServices libraryServices)
: this(userCode, Guid.NewGuid(), xPos, yPos, libraryServices) { }
示例15: LibraryLoadFailed
/// <summary>
/// LibraryLoadFailed event handler.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void LibraryLoadFailed(object sender, LibraryServices.LibraryLoadFailedEventArgs e)
{
}