public static void DeleteClass(Store store, string subProcessGuid, string itemGuid, GenerateFileType itemType) { Project dteProject = getDteProject(store, "cs"); string itemName = string.Format("{0}.cs", itemGuid.Replace("-", "_")); DeleteProcessFile(dteProject, itemName, itemType.FolderName, subProcessGuid); }
public static void DeleteSQL(Store store, string itemGuid, string subProcessGuid, GenerateFileType itemType) { Project dteProject = getDteProject(store, "sql"); string itemName = string.Format("{0}.sql", itemGuid.Replace("-", "_")); DeleteProcessFile(dteProject, itemName, itemType.FolderName, subProcessGuid); GenerateFileType classType = FileTypes.FilesTypes.Where(a => a.Type == FileType.ActivityPropertiesClass).SingleOrDefault(); itemName = string.Format("{0}.cs", itemGuid.Replace("-", "_")); DeleteProcessFile(dteProject, itemName, classType.FolderName, subProcessGuid); }
public static void OpenClass(Store store, string itemGuid, string subProcessGuid, GenerateFileType itemType) { Project dteProject = getDteProject(store, "cs"); string itemName = string.Format("{0}.cs", itemGuid.Replace("-", "_")); if (!CheckFileExists(dteProject, itemName, subProcessGuid, itemType.FolderName)) { AddClass(store, itemGuid, subProcessGuid, itemType); } OpenProcessFile(dteProject, itemName, itemType.FolderName, subProcessGuid); }
public static void AddClass(Store store, string itemGuid, string subProcessGuid, GenerateFileType itemType) { Project dteProject = getDteProject(store, "cs"); string defaultNamespace = dteProject.Properties.Item("DefaultNamespace").Value.ToString(); // string projectPath = dteProject.FullName.Substring(0, dteProject.FullName.LastIndexOf("\\", System.StringComparison.Ordinal)); string itemName = string.Format("{0}.cs", itemGuid.Replace("-", "_")); var itemContent = (FileTypes.GetList().Where(ft => ft.Type == itemType.Type)).Single(); var item = new UTF8Encoding(true).GetBytes(string.Format(itemContent.Content, defaultNamespace, itemGuid.Replace("-", "_"))); AddProcessFile(dteProject, subProcessGuid, itemType.FolderName, itemName, item); }
public static void AddSql(Store store, string itemGuid, string subProcessGuid, GenerateFileType itemType) { Project dteProject = getDteProject(store, "sql"); string defaultNamespace = dteProject.Properties.Item("DefaultNamespace").Value.ToString(); //Set the new file name, assume you provide fileName for the new file somewhere var itemContent = string.Format(itemType.Content, itemGuid.Replace("-", "_")); var item = new UTF8Encoding(true).GetBytes(itemContent); var fileName = string.Format("{0}.sql", itemGuid.Replace("-", "_")); AddProcessFile(dteProject, subProcessGuid, itemType.FolderName, fileName, item); GenerateFileType classType = FileTypes.FilesTypes.Where(a => a.Type == FileType.ActivityPropertiesClass).SingleOrDefault(); CreatePropertiesFile(store, itemGuid, subProcessGuid, " : " + itemType.Type.ToString()); }