public opis InitNewScriptContext(string[] sentenceParts) { opis cont = null; OntologyTreeBuilder otb = new OntologyTreeBuilder(); otb.context = Parser.ContextGlobal["words"]; cont = new opis("context"); cont.PartitionName = "context"; cont.Vset("level", "topBranch"); cont.Vset(context.Higher, "none"); cont.Vset(context.Organizer, "контекстречення"); foreach (string term in sentenceParts) { otb.buildTree(otb.context.Find(term), cont); } cont[OntologyTreeBuilder.globalcomm] = new opisEventsSubscription(); otb.initInstances(cont); otb.contextToIgnite = cont; otb.igniteTree(); return(cont); }
public opis CodenotionScript(string specName, string sysName, string method, opis param) { var methodRun = CreateMethodMessage(sysName, method, param); lock (scriptLocker) { if (ScriptContext == null) { OntologyTreeBuilder tpb = new OntologyTreeBuilder(); tpb.context = Parser.ContextGlobal["words"]; opis o = new opis("context"); o.PartitionName = "context"; o.Vset("level", "topBranch"); o.Vset(context.Higher, "none"); o.Vset(context.Organizer, "контекстречення"); tpb.buildTree(tpb.context.Find(specName), o); opis currContext = o; currContext["globalcomm"] = new opisEventsSubscription(); var vmsg = CreateMethodMessage(sysName, "version"); tpb.messagesToSend = new opis(); tpb.messagesToSend.AddArr(vmsg); tpb.initInstances(currContext); #if NETFRAMEWORK if (SysInstance.Log != null) { SysInstance.Log.Clear(); } #endif tpb.contextToIgnite = currContext; tpb.igniteTree(); ScriptContext = currContext; //AddAnalytic(222, "Init new ScriptContext ", specName, vmsg["p"].serialize(), ""); ScriptContext["globalcomm"][sysName] = methodRun; } else { try { ScriptContext["globalcomm"][sysName] = methodRun; } catch (Exception e) { //AddAnalytic(222, "Exception running ScriptContext " + e.StackTrace, specName, methodRun.serialize(), e.Message); } } } return(methodRun["p"]); }