public static async Task <bool> streamWkspaceMismatchAsync() { bool ret = false; // assume failure try { // all streams and not just dynamic, include hidden streams AcDepots depots = new AcDepots(dynamicOnly: false, includeHidden: true); if (!(await depots.initAsync())) { return(false); } // all workspaces (not just the script user), include hidden workspaces AcWorkspaces wkspaces = new AcWorkspaces(depots, allWSpaces: true, includeHidden: true); if (!(await wkspaces.initAsync())) { return(false); } foreach (AcDepot depot in depots.OrderBy(n => n)) { var query = from AcStream s in depot.Streams join AcWorkspace w in wkspaces on s.Depot equals w.Depot where w.ID == s.ID && !string.Equals(s.Name, w.Name) // stream ID's equal but names don't orderby w.Name select new { Hidden = w.Hidden, WorkspaceName = w.Name, StreamName = s.Name }; foreach (var f in query) { Console.WriteLine($"{(f.Hidden ? "Hidden" : "Visible")} wspace: {f.WorkspaceName}, stream: {f.StreamName}"); } } ret = true; // operation succeeded } catch (Exception ecx) { Console.WriteLine($"Exception caught and logged in Program.streamWkspaceMismatchAsync{Environment.NewLine}{ecx.Message}"); } return(ret); }
// Initialize our workspaces list class variable. // Returns true if initialization was successful, false otherwise. private static async Task <bool> initWSListAsync() { // fully initialized depots list is required for workspaces list construction below AcDepots depots = new AcDepots(); if (!(await depots.initAsync(_selDepots))) { return(false); } // include all workspaces (not just the script user), include only workspaces that are active _wspaces = new AcWorkspaces(depots, allWSpaces: true, includeHidden: false); if (!(await _wspaces.initAsync())) { return(false); } return(true); }