private void LoadSpeakers() { RelationshipQuery relaQuery = new RelationshipQuery(); List <Speaker> speakers = relaQuery.getSpeakers(conf.ID); conf.setSpeakers(speakers); }
/// <summary> /// Retrieves list of relationships matching query. /// </summary> /// <param name="query">The query filter to use.</param> /// <param name="token">Optional cancellation token to use.</param> /// <returns>List of Relationships matching given filters and optional cursor</returns> public async Task <ItemsWithCursor <Relationship> > ListAsync(RelationshipQuery query, CancellationToken token = default) { if (query is null) { throw new ArgumentNullException(nameof(query)); } var req = Oryx.Cognite.Playground.Relationships.list <ItemsWithCursor <Relationship> >(query); return(await RunAsync(req, token).ConfigureAwait(false)); }
private void AddSpeaker() { SpeakerQuery speakerQuery = new SpeakerQuery(); int speakerID = speakerQuery.addSpeaker(info.conf.ID, speakerName.Text, speakerTitle.Text, timePickerStart.getTime(), timePickerEnd.getTime()); if (speakerID != 0) { RelationshipQuery relaQuery = new RelationshipQuery(); relaQuery.addRelationship(info.conf.ID, speakerID); } }
public static void Main(string[] args) { // Full query string is specified // to the constructor RelationshipQuery q = new RelationshipQuery( "references of {Win32_ComputerSystem.Name='mymachine'}"); // Only the object of interest is // specified to the constructor RelationshipQuery query = new RelationshipQuery("Win32_Service.Name='Alerter'"); }
public void Static_Relationship_Classes() { using (var searcher = new ManagementObjectSearcher()) { var relationshipQuery = new RelationshipQuery("Class1.MyKey='One2'"); searcher.Scope.Path.NamespacePath = WmiTestHelper.Namespace; searcher.Query = relationshipQuery; ManagementObjectCollection instances = searcher.Get(); Assert.Equal(1, instances.Count); foreach (ManagementObject instance in instances) { Assert.Equal("AssocA", instance.Path.ClassName); } } }
public void Relationship_Classes() { using (var searcher = new ManagementObjectSearcher()) { var relationshipQuery = new RelationshipQuery($"Win32_LogicalDisk.DeviceID='{WmiTestHelper.SystemDriveId}'"); searcher.Query = relationshipQuery; ManagementObjectCollection instances = searcher.Get(); Assert.True(instances.Count > 0); string[] expectedReferenceClasses = { "Win32_LogicalDiskRootDirectory", "Win32_LogicalDiskToPartition", "Win32_SystemDevices", "Win32_VolumeQuotaSetting", "Win32_DiskQuota" }; foreach (ManagementObject instance in instances) { Assert.True(expectedReferenceClasses.Contains(instance.Path.ClassName), $"Unexpected instance of class {instance.Path.ClassName}"); } } }
private static void WqlObjectQueryDemo() { RelationshipQuery query1 = new RelationshipQuery("references of {Win32_ComputerSystem.Name='mymachine'}"); // Only the object of interest is // specified to the constructor RelationshipQuery query2 = new RelationshipQuery("Win32_Service.Name='Alerter'"); WqlObjectQuery wqlQuery = new WqlObjectQuery("SELECT * FROM Win32_LogicalDisk WHERE FreeSpace > 300000000000"); ManagementObjectSearcher searcher = new ManagementObjectSearcher(wqlQuery); foreach (ManagementObject disk in searcher.Get()) { PropertyDataCollection p = disk.Properties; foreach (PropertyData item in p) { Console.WriteLine(item.Origin + " " + item.Value); } Console.WriteLine(disk.ToString()); } }