public async Task <IHttpActionResult> PostGlossary(Glossary glossary) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (GlossaryTermExists(glossary.ID, glossary.Term)) { return(Conflict()); } db.Glossaries.Add(glossary); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (GlossaryExists(glossary.ID)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = glossary.ID }, glossary)); }
public void GlossaryDefaultValue_Glossary() { Glossary glossary; glossary = new Glossary(); Assert.AreEqual(0, glossary.Entries.Count, "Entries count is incorrect."); }
public async Task <bool> UpdateAsync(Glossary item) { try { using (var dbConnection = new NpgsqlConnection(connectionString)) { var updateGlossarySql = "UPDATE glossaries SET name=@Name, description=@Description, id_file=@ID_File " + "WHERE id=@id"; var updateGlossaryParam = item; this.LogQuery(updateGlossarySql, item.GetType(), updateGlossaryParam); await dbConnection.ExecuteAsync( sql : updateGlossarySql, param : updateGlossaryParam); return(true); } } catch (NpgsqlException exception) { this._loggerError.WriteLn( $"Ошибка в {nameof(GlossaryRepository)}.{nameof(GlossaryRepository.UpdateAsync)} {nameof(NpgsqlException)} ", exception); return(false); } catch (Exception exception) { this._loggerError.WriteLn( $"Ошибка в {nameof(GlossaryRepository)}.{nameof(GlossaryRepository.UpdateAsync)} {nameof(Exception)} ", exception); return(false); } }
public void FullTest2() { Glossary g = new Glossary(); g.AddGlossaryItem(new GlossaryItem("Person", "PRSN", true)); g.AddGlossaryItem(new GlossaryItem("First Name", "FNM", true)); string logicalName = "Person First Name"; string physicalName = "PRSN_FNM"; GlossaryComplianceResult result = g.CheckCompliance(logicalName, physicalName); Console.WriteLine(g.ExpandAbbreviation("PRSN_FNM").Output); Assert.Equal(result.Term, logicalName); Assert.Equal(result.Abbreviation, physicalName); Assert.Equal(logicalName, result.AbbreviationToTerm); Assert.Equal(physicalName, result.TermToAbbreviation); Assert.Equal(result.TermToAbbreviation, result.AbbreviationToTermToAbbreviation); Assert.Equal(result.AbbreviationToTerm, result.TermToAbbreviationToTerm); Assert.True(result.PreferredTermIsUsed); Assert.False(result.CompoundAvailable); Assert.False(result.Mismatch); Assert.False(result.HyphenNeededForTerm); Assert.True(result.TermAbbreviatesCorrectly); Assert.True(result.AbbreviationExpandsToTermCorrectly); Assert.True(result.EvaluationTimeSpan.TotalMilliseconds > 0); }
private void Start() { gameObject.AddComponent <Glossary>(); glossary = GetComponent <Glossary>(); OnSendTranslation += DestroyGlossary; CreateRootObject(); }
IEnumerator GenerateAttackAnims(UnitProxy oppUnit, GameObject baseProj, Vector3 start, Vector3 finish) { TileProxy dTile = BoardProxy.instance.GetTileAtPosition(GetPosition()); dTile.CreateAnimation(Glossary.GetAtkFx(oppUnit.GetData().GetFactionType(), oppUnit.GetData().GetUnitType()), AnimationInteractionController.NO_WAIT); yield return(null); }
public async Task GetGlossaryAsync() { Mock <TranslationService.TranslationServiceClient> mockGrpcClient = new Mock <TranslationService.TranslationServiceClient>(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock <Operations.OperationsClient>().Object); GetGlossaryRequest expectedRequest = new GetGlossaryRequest { GlossaryName = new GlossaryName("[PROJECT]", "[LOCATION]", "[GLOSSARY]"), }; Glossary expectedResponse = new Glossary { GlossaryName = new GlossaryName("[PROJECT]", "[LOCATION]", "[GLOSSARY]"), EntryCount = 811131134, }; mockGrpcClient.Setup(x => x.GetGlossaryAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <Glossary>(Task.FromResult(expectedResponse), null, null, null, null)); TranslationServiceClient client = new TranslationServiceClientImpl(mockGrpcClient.Object, null); GlossaryName name = new GlossaryName("[PROJECT]", "[LOCATION]", "[GLOSSARY]"); Glossary response = await client.GetGlossaryAsync(name); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void Test_GetGlossary() { //Arrange MockHandler mock = new MockHandler(); Glossary glossary = new Glossary() { GlossaryId = 1, Dutch = "Hallo", English = "Hello", Spanish = "Ola" }; mock.Glossaries = new List <Glossary>() { glossary }; AnalyticsController cont = new AnalyticsController(null, mock); //Act var result1 = cont.GetGlossary("NL"); var result2 = cont.GetGlossary("EN"); var result3 = cont.GetGlossary("SP"); //Assert Assert.Equal("Hallo", result1[1]); Assert.Equal("Hello", result2[1]); Assert.Equal("Ola", result3[1]); }
public void AddGlossary(string SqlWhereClause) { int idFld = m_GlossaryTable.FindField("Glossary_ID"); int trmFld = m_GlossaryTable.FindField("Term"); int defFld = m_GlossaryTable.FindField("Definition"); int dsFld = m_GlossaryTable.FindField("DefinitionSourceID"); IQueryFilter QF = new QueryFilterClass(); QF.WhereClause = SqlWhereClause; ICursor theCursor = m_GlossaryTable.Search(QF, false); IRow theRow = theCursor.NextRow(); while (theRow != null) { Glossary anGlossary = new Glossary(); anGlossary.Glossary_ID = theRow.get_Value(idFld).ToString(); anGlossary.Term = theRow.get_Value(trmFld).ToString(); anGlossary.Definition = theRow.get_Value(trmFld).ToString(); anGlossary.DefinitionSourceID = theRow.get_Value(dsFld).ToString(); anGlossary.RequiresUpdate = true; m_GlossaryDictionary.Add(anGlossary.Glossary_ID, anGlossary); theRow = theCursor.NextRow(); } }
public void VerifyThatPropertiesAreSet() { var category = new Category(); category.PermissibleClass.Add(ClassKind.Glossary); var glossary = new Glossary { Name = "aaaa", ShortName = "bbb" }; var term = new Term(); glossary.Term.Add(term); this.srdl.DefinedCategory.Add(category); var transactionContext = TransactionContextResolver.ResolveContext(this.siteDir); var transaction = new ThingTransaction(transactionContext); var viewmodel = new GlossaryDialogViewModel(glossary, transaction, this.session.Object, true, ThingDialogKind.Create, this.thingDialogNavigationService.Object); Assert.IsNotEmpty(viewmodel.Term); Assert.IsNotEmpty(viewmodel.PossibleContainer); Assert.IsNotEmpty(viewmodel.PossibleCategory); Assert.AreEqual(viewmodel.Name, glossary.Name); Assert.AreEqual(viewmodel.ShortName, glossary.ShortName); Assert.AreEqual(viewmodel.IsDeprecated, glossary.IsDeprecated); }
//private void Start() //{ // for (int i = 0; i < monsterUI.Length; i++) // { // monsterUI[i].SetActive(false); // } //} public void updateMonsterUI(NPCMeta meta, Glossary glossy, int yenGained) { header.text = "" + meta.name; rewards.text = "Looted for: ¥" + yenGained.ToString(); for (int i = 0; i < 6; i++) { if (i < meta.roster.Length) { monsterUI[i].SetActive(true); monsterUI[i].transform.GetChild(0).gameObject.GetComponent <Image>().sprite = glossy.GetMonsterImage(meta.roster[i].name); Color deadC = monsterUI[i].transform.GetChild(1).gameObject.GetComponent <Image>().color; if (meta.roster[i].curHealth > 0) { deadC.a = 0; } else { deadC.a = 1; } monsterUI[i].transform.GetChild(1).gameObject.GetComponent <Image>().color = deadC; } else { monsterUI[i].SetActive(false); } } }
/// <summary>Snippet for CreateGlossaryAsync</summary> public async Task CreateGlossaryAsync() { // Snippet: CreateGlossaryAsync(LocationName,Glossary,CallSettings) // Additional: CreateGlossaryAsync(LocationName,Glossary,CancellationToken) // Create client TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync(); // Initialize request argument(s) LocationName parent = new LocationName("[PROJECT]", "[LOCATION]"); Glossary glossary = new Glossary(); // Make the request Operation <Glossary, CreateGlossaryMetadata> response = await translationServiceClient.CreateGlossaryAsync(parent, glossary); // Poll until the returned long-running operation is complete Operation <Glossary, CreateGlossaryMetadata> completedResponse = await response.PollUntilCompletedAsync(); // Retrieve the operation result Glossary result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <Glossary, CreateGlossaryMetadata> retrievedResponse = await translationServiceClient.PollOnceCreateGlossaryAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result Glossary retrievedResult = retrievedResponse.Result; } // End snippet }
public void AddDuplicate1AbbreviationsToEmptyGlossary_ExpectExceptions() { Glossary glossary = new Glossary(); glossary.AddGlossaryItem(new GlossaryItem("Happy Otters", "HO", true)); Assert.Throws <DuplicateNameException>(() => glossary.AddGlossaryItem(new GlossaryItem("Hearing Office", "HO", true))); }
public void VerifyThatRdlShortnameIsUpdated() { var vm = new GlossaryBrowserViewModel(this.session.Object, this.siteDirectory, null, null, null, null); var sRdl = new SiteReferenceDataLibrary(Guid.NewGuid(), this.assembler.Cache, this.uri); sRdl.Container = this.siteDirectory; var cat = new Glossary(Guid.NewGuid(), this.assembler.Cache, this.uri) { Name = "cat1", ShortName = "1", Container = sRdl }; var cat2 = new Glossary(Guid.NewGuid(), this.assembler.Cache, this.uri) { Name = "cat2", ShortName = "2", Container = sRdl }; CDPMessageBus.Current.SendObjectChangeEvent(cat, EventKind.Added); CDPMessageBus.Current.SendObjectChangeEvent(cat2, EventKind.Added); var rev = typeof(Thing).GetProperty("RevisionNumber"); rev.SetValue(sRdl, 3); sRdl.ShortName = "test"; CDPMessageBus.Current.SendObjectChangeEvent(sRdl, EventKind.Updated); Assert.IsTrue(vm.Glossaries.Count(x => x.ContainerRdlShortName == "test") == 2); }
public void emitExplosion() { Glossary glossy = PanelManager.instance.glossaryObj.GetComponent <Glossary>(); Transform dest = !playerTurn?GameObject.Find("HMonsterImg").transform : GameObject.Find("MMonsterImg").transform; StartCoroutine(sendProjectile(glossy.GetParticleSystem("SlashParticleSystem"), true, dest, dest, SkillEffect.Effect.None, TileMeta.GemType.None, new Vector3(2, 2, 2))); }
public void Delete(Glossary request) { using (Execute) { Execute.Run(ssn => { if (!(request?.Id > 0)) { throw new HttpError(HttpStatusCode.NotFound, $"No Id provided for delete."); } var en = DocEntityGlossary.Get(request?.Id); if (null == en) { throw new HttpError(HttpStatusCode.NotFound, $"No Glossary could be found for Id {request?.Id}."); } if (en.IsRemoved) { return; } if (!DocPermissionFactory.HasPermission(en, currentUser, DocConstantPermission.DELETE)) { throw new HttpError(HttpStatusCode.Forbidden, "You do not have DELETE permission for this route."); } en.Remove(); DocCacheClient.RemoveSearch(DocConstantModelName.GLOSSARY); DocCacheClient.RemoveById(request.Id); }); } }
public ActionResult Create(GlossaryViewModel model) { if (ModelState.IsValid) { var glossary = db.Glossaries.FirstOrDefault( g => (g.term == model.term) && (g.definition == model.definition) ); if (glossary == null) { Glossary g = new Glossary(); g.term = model.term; g.definition = model.definition; g.createUser = WebSecurity.CurrentUserId; g.companyID = (int)db.Users.Find(g.createUser).companyID; db.Glossaries.Add(g); if (model.selectedRules != null) { foreach (int ruleId in model.selectedRules) { SGC_MVC.Models.Rule r = db.Rules.Find(ruleId); g.Rules.Add(r); } } db.SaveChanges(); return(RedirectToAction("Index")); } } model.allRules = Helper.GetRulesSelect(db); return(View(model)); }
public void UpdateFrom(Glossary glossary, GlossaryStatus status = GlossaryStatus.None) { Status = status; GlossaryID = glossary.GlossaryName.GlossaryId; switch (glossary.LanguagesCase) { case Glossary.LanguagesOneofCase.LanguageCodesSet: Type = "M"; SourceLanguage = string.Join(", ", glossary.LanguageCodesSet.LanguageCodes); TargetLanguage = SourceLanguage; break; case Glossary.LanguagesOneofCase.LanguagePair: Type = "U"; SourceLanguage = glossary.LanguagePair.SourceLanguageCode; TargetLanguage = glossary.LanguagePair.TargetLanguageCode; break; default: Type = "?"; SourceLanguage = string.Empty; TargetLanguage = string.Empty; break; } InputUri = glossary.InputConfig.GcsSource.InputUri; _Entries = glossary.EntryCount; OnPropertyChanged(); }
public ActionResult Edit(GlossaryViewModel model) { if (ModelState.IsValid) { Glossary g = db.Glossaries.Include(gs => gs.Rules) .FirstOrDefault(gs => gs.ID == model.glossaryID); if (g.Rules != null) { g.Rules.Clear(); db.SaveChanges(); } if (model.selectedRules != null) { foreach (int ruleId in model.selectedRules) { SGC_MVC.Models.Rule r = db.Rules.Find(ruleId); g.Rules.Add(r); db.SaveChanges(); } } g.term = model.term; g.definition = model.definition; g.updateDate = DateTime.Now; db.Entry(g).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(model)); }
public ActionResult Save(Glossary gloss) { if (ModelState.IsValid) { using (CSE_DatabaseEntities dc = new CSE_DatabaseEntities()) { if (gloss.ID > 0) { //Edit var glossary = dc.Glossaries.Where(a => a.ID == gloss.ID).FirstOrDefault(); if (glossary != null) { glossary.Term = gloss.Term; glossary.Definition = gloss.Definition; } } else { //Save dc.Glossaries.Add(gloss); } dc.SaveChanges(); } } return(RedirectToAction("Index", "Home")); }
void Start() { PlayerMeta player = BaseSaver.GetPlayer(); Glossary glossy = glossary.GetComponent <Glossary>(); string[] endings = new string[] { "Death has come..." }; switch (player.faction) { case Unit.FactionType.Human: faction.sprite = glossy.humanFaction; endings = StoryStatic.HUMAN_DEATHS; break; case Unit.FactionType.Cthulhu: faction.sprite = glossy.chtulhuFaction; endings = StoryStatic.CTHULHU_DEATHS; break; case Unit.FactionType.Egypt: faction.sprite = glossy.egyptFaction; endings = StoryStatic.EGYPT_DEATHS; break; } GetComponent <Image>().color = HelperScripts.GetColorByFaction(player.faction); HelperScripts.Shuffle(endings); headerTxtl.text = endings[0]; }
public DTO_Glossary(Glossary glossary) : this() { Id = glossary.Id; Name = glossary.Name; Description = glossary.Description; TermsArePaged = glossary.TermsArePaged; TermsPerPage = glossary.TermsPerPage; TermsCount = glossary.TermsCount; //IsDefault = glossary.IsDefault; IsPublic = glossary.IsPublic; IsShared = glossary.IsShared; IsPublished = glossary.IsPublished; IdCommunity = glossary.IdCommunity; IdLanguage = glossary.IdLanguage; DisplayOrder = glossary.DisplayOrder; if (glossary.ModifiedOn.HasValue) { LastUpdate = glossary.ModifiedOn.Value; } else if (glossary.CreatedOn.HasValue) { LastUpdate = glossary.CreatedOn.Value; } else { LastUpdate = DateTime.MinValue; } }
public void emitStars(bool player) { Glossary glossy = PanelManager.instance.glossaryObj.GetComponent <Glossary>(); Transform dest = player ? GameObject.Find("HMonsterImg").transform : GameObject.Find("MMonsterImg").transform; StartCoroutine(sendProjectile(glossy.GetParticleSystem("StarParticleSystem"), true, dest, dest, SkillEffect.Effect.None, TileMeta.GemType.None, Vector3.one)); }
public Glossary Post(Glossary request) { if (request == null) { throw new HttpError(HttpStatusCode.NotFound, "Request cannot be null."); } request.Select = request.Select ?? new List <string>(); Glossary ret = null; using (Execute) { Execute.Run(ssn => { if (!DocPermissionFactory.HasPermissionTryAdd(currentUser, "Glossary")) { throw new HttpError(HttpStatusCode.Forbidden, "You do not have ADD permission for this route."); } ret = _AssignValues(request, DocConstantPermission.ADD, ssn); }); } return(ret); }
private Glossary GetGlossary(Glossary request) { var id = request?.Id; Glossary ret = null; var query = DocQuery.ActiveQuery ?? Execute; DocPermissionFactory.SetSelect <Glossary>(currentUser, "Glossary", request.Select); DocEntityGlossary entity = null; if (id.HasValue) { entity = DocEntityGlossary.Get(id.Value); } if (null == entity) { throw new HttpError(HttpStatusCode.NotFound, $"No Glossary found for Id {id.Value}"); } if (!DocPermissionFactory.HasPermission(entity, currentUser, DocConstantPermission.VIEW)) { throw new HttpError(HttpStatusCode.Forbidden, "You do not have VIEW permission for this route."); } ret = entity?.ToDto(); return(ret); }
public string CreateGlossary(string glossaryId, string inputUri) { try { var request = new CreateGlossaryRequest { ParentAsLocationName = new LocationName(projectId, locaionId), Parent = new LocationName(projectId, locaionId).ToString(), Glossary = new Glossary { Name = new GlossaryName(projectId, locaionId, glossaryId).ToString(), LanguageCodesSet = new Glossary.Types.LanguageCodesSet { LanguageCodes = { "en", "ko", }, }, InputConfig = new GlossaryInputConfig { GcsSource = new GcsSource { InputUri = inputUri, }, }, }, }; Glossary response = client.CreateGlossary(request).PollUntilCompleted().Result; return($"name: {response.Name}, Entry count: {response.EntryCount}, Input URI: {response.InputConfig.GcsSource.InputUri}"); } catch (Exception ex) { Console.WriteLine(ex); return(null); } }
public void VerifyThatCategoriesFromExistingRdlsAreLoaded() { var siterefenceDataLibrary = new SiteReferenceDataLibrary(Guid.NewGuid(), null, null); var glossary1 = new Glossary(Guid.NewGuid(), null, null); var glossary2 = new Glossary(Guid.NewGuid(), null, null); siterefenceDataLibrary.Glossary.Add(glossary1); siterefenceDataLibrary.Glossary.Add(glossary2); this.siteDirectory.SiteReferenceDataLibrary.Add(siterefenceDataLibrary); var engineeringModelSetup = new EngineeringModelSetup(Guid.NewGuid(), null, null); var modelReferenceDataLibrary = new ModelReferenceDataLibrary(Guid.NewGuid(), null, null); var glossary3 = new Glossary(Guid.NewGuid(), null, null); var glossary4 = new Glossary(Guid.NewGuid(), null, null); modelReferenceDataLibrary.Glossary.Add(glossary3); modelReferenceDataLibrary.Glossary.Add(glossary4); engineeringModelSetup.RequiredRdl.Add(modelReferenceDataLibrary); this.siteDirectory.Model.Add(engineeringModelSetup); this.session.Setup(x => x.OpenReferenceDataLibraries).Returns(new HashSet <ReferenceDataLibrary>(this.siteDirectory.SiteReferenceDataLibrary) { modelReferenceDataLibrary }); var browser = new GlossaryBrowserViewModel(this.session.Object, this.siteDirectory, null, null, null, null); Assert.AreEqual(4, browser.Glossaries.Count); }
//public static UIGlossary.uiFX ReturnSkillUIGlossaryMapping(SkillGen sGen, Glossary glossy){ // switch(sGen){ // case SkillGen.Aoe:return UIGlossary.uiFX.fxAoe; // case SkillGen.Fire:return UIGlossary.uiFX.fxAoe; // case SkillGen.Force:return UIGlossary.uiFX.fxAoe; // case SkillGen.Heal:return UIGlossary.uiFX.fxAoe; // case SkillGen.WispKill:return UIGlossary.uiFX.fxAoe; // case SkillGen.Thorn:return glossy.fxBloodExplosion.GetComponent<Animator>(); // case SkillGen.Void:return glossy.fxLaser.GetComponent<Animator>(); // case SkillGen.Warp:return glossy.fxLaser.GetComponent<Animator>(); // default: return null; // } //} public static Sprite ReturnSkillSprite(SkillGen sGen, Glossary glossy) { switch (sGen) { case SkillGen.Aegis: return(glossy.emoteAegisGained.GetComponent <SpriteRenderer>().sprite); case SkillGen.Bide: return(glossy.emoteBide.GetComponent <SpriteRenderer>().sprite); case SkillGen.Divine: return(glossy.divineTile); case SkillGen.Enfeeble: return(glossy.emoteEnfeeble.GetComponent <SpriteRenderer>().sprite); case SkillGen.Hobble: return(glossy.emoteHobble.GetComponent <SpriteRenderer>().sprite); case SkillGen.Nullify: return(glossy.emoteNullify.GetComponent <SpriteRenderer>().sprite); case SkillGen.Quicken: return(glossy.emoteQuicken.GetComponent <SpriteRenderer>().sprite); case SkillGen.Rage: return(glossy.emoteRage.GetComponent <SpriteRenderer>().sprite); case SkillGen.Root: return(glossy.emoteRooted.GetComponent <SpriteRenderer>().sprite); case SkillGen.Sickly: return(glossy.emoteSickly.GetComponent <SpriteRenderer>().sprite); case SkillGen.Snow: return(glossy.snowTile); case SkillGen.Wall: return(glossy.obstacles[0].transform.GetChild(0).GetComponent <SpriteRenderer>().sprite); default: return(null); } }
public void VerifyAddGlossary() { Assert.IsFalse(this.glossaryBrowser.Glossaries.Any()); var glossary = new Glossary(Guid.NewGuid(), this.assembler.Cache, this.uri) { Name = "test Glossary", ShortName = "TG" }; this.srdl.Glossary.Add(glossary); CDPMessageBus.Current.SendObjectChangeEvent(glossary, EventKind.Added); Assert.IsTrue(this.glossaryBrowser.Glossaries.Count == 1); // Verify that the same glossary doesn't get added several times CDPMessageBus.Current.SendObjectChangeEvent(glossary, EventKind.Added); Assert.IsTrue(this.glossaryBrowser.Glossaries.Count == 1); // Verify that when a RDL is changed all its glossaries get added to the GlossaryBrowser var glossary2 = new Glossary(Guid.NewGuid(), this.assembler.Cache, this.uri) { Name = "Another test glossary", ShortName = "TG2" }; var rdl = new ModelReferenceDataLibrary(Guid.NewGuid(), this.assembler.Cache, this.uri); rdl.Glossary.Add(glossary2); CDPMessageBus.Current.SendObjectChangeEvent(glossary2, EventKind.Added); Assert.IsTrue(this.glossaryBrowser.Glossaries.Count == 2); }
/// <summary>Snippet for CreateGlossary</summary> public void CreateGlossary_RequestObject() { // Snippet: CreateGlossary(CreateGlossaryRequest,CallSettings) // Create client TranslationServiceClient translationServiceClient = TranslationServiceClient.Create(); // Initialize request argument(s) CreateGlossaryRequest request = new CreateGlossaryRequest { ParentAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), Glossary = new Glossary(), }; // Make the request Operation <Glossary, CreateGlossaryMetadata> response = translationServiceClient.CreateGlossary(request); // Poll until the returned long-running operation is complete Operation <Glossary, CreateGlossaryMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result Glossary result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <Glossary, CreateGlossaryMetadata> retrievedResponse = translationServiceClient.PollOnceCreateGlossary(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result Glossary retrievedResult = retrievedResponse.Result; } // End snippet }
// END CUT HERE // BEGIN CUT HERE public static void Main() { Glossary ___test = new Glossary(); ___test.run_test(-1); try { } catch(Exception e) { //Console.WriteLine(e.StackTrace); Console.WriteLine(e.ToString()); } }
public string NewGlossary(string Term, string Definition, string DefinitionSourceID) { Glossary newGlossary = new Glossary(); sysInfo SysInfoTable = new sysInfo(m_theWorkspace); newGlossary.Glossary_ID = SysInfoTable.ProjAbbr + ".Glossary." + SysInfoTable.GetNextIdValue("Glossary"); newGlossary.Term = Term; newGlossary.Definition = Definition; newGlossary.DefinitionSourceID = DefinitionSourceID; newGlossary.RequiresUpdate = false; m_GlossaryDictionary.Add(newGlossary.Glossary_ID, newGlossary); return newGlossary.Glossary_ID; }
public void UpdateGlossary(Glossary theGlossary) { try { m_GlossaryDictionary.Remove(theGlossary.Glossary_ID); } catch { } theGlossary.RequiresUpdate = true; m_GlossaryDictionary.Add(theGlossary.Glossary_ID, theGlossary); }