private void BuildApps() { var apps = new List <string>(); try { //build the directory path, if it doesn't exist if (!Directory.Exists(tbBaseFolder.Text)) { Directory.CreateDirectory(tbBaseFolder.Text); } foreach (int i in lbApps.SelectedIndices) { apps.Add(lbApps.Items[i] as string); } //CatalogExplorerFactory.CatalogExplorer(tbConnectionString.Text.Trim(), bool.TrueString); var at = new AppsTopic(tbBaseFolder.Text.Trim(), Path.Combine(tbBaseFolder.Text.Trim(), "images"), apps, tbRules.Text); at.Save(); status("Build complete. Please check your build directory for your project."); } catch (Exception ex) { HandleException("BuildApps", ex); } }
public void TestTopicFile() { try { //initialize catalog explorer witho our optimized connection string const string connStr = "Data Source=(local);Initial Catalog=BizTalkMgmtDb;Integrated Security=True;Min Pool Size=10;MultipleActiveResultSets=True;Connect Timeout=30;Network Library=dbnmpntw;Application Name=ShoBiz"; const string appName = "EPS Cloud Catalog"; const string baseDirectory = @"C:\Temp\"; const string imagesDirectory = @"C:\Temp\images\"; const string contentFile = @"C:\Temp\ContentFile.content"; const string projectFile = baseDirectory + "ShoBizProject.shfbproj"; const string tokenFile = baseDirectory + "ShoBizTokens.tokens"; const string rulesDb = "BizTalkRuleEngineDb"; //CatalogExplorerFactory.CatalogExplorer(connStr, true); //what apps do we want to document? List <string> apps = new List <string>(); apps.Add(appName); AppsTopic appsTopic = new AppsTopic(baseDirectory, imagesDirectory, apps, rulesDb); do { Thread.Sleep(250); } while (!appsTopic.ReadyToSave); //save applications topic (and all children) appsTopic.Save(); //save content file and add to the project ContentFile.GetContentFile().AddApplicationTopic(appsTopic.GetContentLayout()); ContentFile.GetContentFile().Save(contentFile); ProjectFile.GetProjectFile().AddContentLayoutFile(contentFile); //save token file and add to the project TokenFile.GetTokenFile().Save(tokenFile); ProjectFile.GetProjectFile().AddTokenFile(tokenFile); //save the project file ProjectFile.GetProjectFile().Save(projectFile); } catch (Exception e) { Trace.WriteLine(string.Format("{0}: {1} : {2}", e.GetType(), e.Message, e.StackTrace)); } }