private static void DownloadCustomization(CommandLineParams o, Session epiSession) { EpiTransaction epiTransaction = new EpiTransaction(new ILauncher(epiSession)); Ice.UI.App.CustomizationMaintEntry.Transaction oTrans = new Ice.UI.App.CustomizationMaintEntry.Transaction(epiTransaction); Ice.UI.App.CustomizationMaintEntry.CustomizationMaintForm custData = new Ice.UI.App.CustomizationMaintEntry.CustomizationMaintForm(oTrans); oTrans = (Ice.UI.App.CustomizationMaintEntry.Transaction)custData.GetType().GetField("trans", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(custData); SearchOptions opts = new SearchOptions(SearchMode.ShowDialog) { DataSetMode = DataSetMode.RowsDataSet, SelectMode = SelectMode.SingleSelect, PreLoadSearchFilter = "TypeCode = 'Customization'" }; oTrans.InvokeSearch(opts); EpiDataView edvxxDef = (EpiDataView)oTrans.EpiDataViews["xxxDef"]; if (edvxxDef.Row >= 0) { GenXDataDataSet.XXXDefRow r = (GenXDataDataSet.XXXDefRow)edvxxDef.CurrentDataRow; o.Company = r.Company; o.CSGCode = r.CGCCode; o.Key1 = r.Key1; o.Key2 = r.Key2; o.Key3 = r.Key3; o.LayerType = r.TypeCode; o.ProductType = r.ProductID; } }
public TeamManagement(EpiTransaction iTrans) : base(iTrans) { InitializeComponent(); this._repo = new AuthRepo(); this.trans = new TransModel(); this.epiSession = ((Ice.Core.Session)oTransaction.Session); }
public PRList(EpiTransaction iTrans) : base(iTrans) { InitializeComponent(); this.trans = (Transaction)iTrans; this._repo = new RequisitionRepo(); this._repoAth = new AuthRepo(); this.epiSession = ((Ice.Core.Session)oTransaction.Session); }
public RequestEstimate(EpiTransaction iTrans) : base(iTrans) { InitializeComponent(); this.trans = (Transaction)iTrans; this.epiSession = ((Ice.Core.Session)oTransaction.Session); this._repo = new Erp.Custom.CostManagement.Repositories(); this._repoAth = new AuthRepo(); this.model = new CostRequestModel(); }
public void LaunchInEpicor(CommandLineParams o, Session epiSession, bool edit, bool modal = true) { epiSession["Customizing"] = edit; EpiTransaction epiTransaction = new EpiTransaction(new ILauncher(epiSession)); Ice.UI.App.CustomizationMaintEntry.Transaction oTrans = new Ice.UI.App.CustomizationMaintEntry.Transaction(epiTransaction); Ice.UI.App.CustomizationMaintEntry.CustomizationMaintForm custData = new Ice.UI.App.CustomizationMaintEntry.CustomizationMaintForm(oTrans); oTrans = (Ice.UI.App.CustomizationMaintEntry.Transaction)custData.GetType().GetField("trans", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(custData); SearchOptions opts = new SearchOptions(SearchMode.AutoSearch) { DataSetMode = DataSetMode.RowsDataSet, SelectMode = SelectMode.SingleSelect }; opts.NamedSearch.WhereClauses.Add("XXXDef", $"Key1='{o.Key1}' and Key2 ='{o.Key2}' and Key3='{o.Key3}' and TypeCode='{o.LayerType}' and ProductID='{o.ProductType}'"); oTrans.InvokeSearch(opts); MenuDataSet.MenuRow menuRow = (MenuDataSet.MenuRow)oTrans.GetType().GetMethod("getMenuRow", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(oTrans, new object[] { "Run" }); menuRow["Company"] = string.Empty; epiSession["AllowCustomizing"] = edit; if (edit) { epiSession["Customizing"] = epiSession.CanCustomize; } else { epiSession["Customizing"] = false; } if (edit) { #if EPICOR_10_2_300 oTrans.GetType().GetMethod("addFormnameToArguments", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(oTrans, new object[] { menuRow }); #endif } LaunchFormOptions lfo = new LaunchFormOptions(); lfo.IsModal = modal; lfo.Sender = oTrans; MenuDataSet mnuds = new MenuDataSet(); mnuds.Menu.Rows.Add(menuRow.ItemArray); lfo.MenuDataSet = mnuds; FormFunctions.Launch(oTrans.currentSession, menuRow, lfo); }
public void DownloadAndSyncDashboard(Session epiSession, CommandLineParams o) { string file = Path.GetTempFileName(); using (StreamWriter swLog = new StreamWriter(file)) { swLog.WriteLine("Got in the Function"); try { epiSession["Customizing"] = false; var oTrans = new ILauncher(epiSession); CustomizationVerify cm = new CustomizationVerify(epiSession); swLog.WriteLine("Customization Verify"); string dll = cm.getDllName(o.Key2); swLog.WriteLine("Got Epicor DLL"); StringBuilder refds = new StringBuilder(); dynamic epiBaseForm = null; dynamic epiTransaction = null; if (string.IsNullOrEmpty(dll)) { dll = "*.UI.*.dll"; } Assembly assy = ClientAssemblyRetriever.ForILaunch(oTrans).RetrieveAssembly(dll); swLog.WriteLine("Finding File"); string s = ""; s = assy.Location; var typeE = assy.DefinedTypes.Where(r => r.FullName.ToUpper().Contains(o.Key2.ToUpper())).FirstOrDefault(); var typeTList = assy.DefinedTypes.Where(r => r.BaseType.Name.Equals("EpiTransaction")).ToList(); epiTransaction = new EpiTransaction(oTrans); refds.AppendLine($"<Reference Include=\"{typeE.Assembly.FullName}\">"); refds.AppendLine($"<HintPath>{s}</HintPath>"); refds.AppendLine($"</Reference>"); var typ = assy.DefinedTypes.Where(r => r.Name == "Launch").FirstOrDefault(); dynamic launcher = Activator.CreateInstance(typ); launcher.Session = epiSession; launcher.GetType().GetMethod("InitializeLaunch", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(launcher, null); epiBaseForm = launcher.GetType().GetField("lForm", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(launcher); swLog.WriteLine("Initialize EpiUI Utils"); EpiUIUtils eu = epiBaseForm.GetType().GetField("utils", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(epiBaseForm); eu.GetType().GetField("currentSession", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(eu, epiTransaction.Session); eu.GetType().GetField("customizeName", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(eu, o.Key1); eu.GetType().GetField("baseExtentionName", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(eu, o.Key3.Replace("BaseExtension^", string.Empty)); eu.ParentForm = epiBaseForm; swLog.WriteLine("Get composite Customize Data Set"); var mi = eu.GetType().GetMethod("getCompositeCustomizeDataSet", BindingFlags.Instance | BindingFlags.NonPublic); bool customize = false; mi.Invoke(eu, new object[] { o.Key2, customize, customize, customize }); Ice.Adapters.GenXDataAdapter ad = new Ice.Adapters.GenXDataAdapter(epiTransaction); ad.BOConnect(); GenXDataImpl i = (GenXDataImpl)ad.BusinessObject; swLog.WriteLine("Customization Get By ID"); var ds = i.GetByID(o.Company, o.ProductType, o.LayerType, o.CSGCode, o.Key1, o.Key2, o.Key3); string beName = o.Key3.Replace("BaseExtension^", string.Empty); string exName = (string)eu.GetType().GetField("extensionName", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(eu); CustomizationDS nds = new CustomizationDS(); if (string.IsNullOrEmpty(o.Company)) { eu.CustLayerMan.GetType().GetProperty("RetrieveFromCache", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic).SetValue(eu.CustLayerMan, false); eu.CustLayerMan.GetType().GetField("custAllCompanies", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic).SetValue(eu.CustLayerMan, string.IsNullOrEmpty(o.Company)); eu.CustLayerMan.GetType().GetField("selectCompCode", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic).SetValue(eu.CustLayerMan, o.Company); eu.CustLayerMan.GetType().GetField("companyCode", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic).SetValue(eu.CustLayerMan, o.Company); eu.CustLayerMan.GetType().GetField("loadDeveloperMode", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic).SetValue(eu.CustLayerMan, string.IsNullOrEmpty(o.Company)); bool cancel = false; eu.CustLayerMan.GetType().GetMethod("GetCompositeCustomDataSet", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic).Invoke(eu.CustLayerMan, new object[] { o.Key2, exName, o.Key1, cancel }); } PersonalizeCustomizeManager csm = new PersonalizeCustomizeManager(epiBaseForm, epiTransaction, o.ProductType, o.Company, beName, exName, o.Key1, eu.CustLayerMan, DeveloperLicenseType.Partner, LayerType.Customization); swLog.WriteLine("Init Custom Controls"); csm.InitCustomControlsAndProperties(ds, LayerName.CompositeBase, true); CustomScriptManager csmR = csm.CurrentCustomScriptManager; swLog.WriteLine("Generate Refs"); List <string> aliases = new List <string>(); Match match = Regex.Match(csmR.CustomCodeAll, "((?<=extern alias )(.*)*(?=;))"); while (match.Success) { aliases.Add(match.Value.Replace("_", ".").ToUpper()); match = match.NextMatch(); } o.Version = ds.XXXDef[0].SysRevID; GenerateRefs(refds, csmR, o, null); ExportCustmization(nds, ad, o); Resync(o, swLog, refds, ds, nds, csmR); epiBaseForm.Dispose(); ad.Dispose(); cm = null; eu.CloseCacheRespinSplash(); eu.Dispose(); } catch (Exception ee) { swLog.WriteLine(ee.ToString()); } } //MessageBox.Show(file); }
public void DownloadAndSync(Session epiSession, CommandLineParams o) { string file = Path.GetTempFileName(); using (StreamWriter swLog = new StreamWriter(file)) { swLog.WriteLine("Got in the Function"); try { epiSession["Customizing"] = false; var oTrans = new ILauncher(epiSession); CustomizationVerify cm = new CustomizationVerify(epiSession); swLog.WriteLine("Customization Verify"); string dll = cm.getDllName(o.Key2); swLog.WriteLine("Got Epicor DLL"); StringBuilder refds = new StringBuilder(); dynamic epiBaseForm = null; dynamic epiTransaction = null; if (string.IsNullOrEmpty(dll)) { dll = "*.UI.*.dll"; } Assembly assy = ClientAssemblyRetriever.ForILaunch(oTrans).RetrieveAssembly(dll); swLog.WriteLine("Finding File"); string s = ""; if (assy == null) { foreach (string x in Directory.GetFiles(o.EpicorClientFolder, dll)) { assy = Assembly.LoadFile(x); if (assy.DefinedTypes.Where(r => r.FullName.ToUpper().Contains(o.Key2.ToUpper())).Any()) { s = x; break; } } } s = assy.Location; var typeE = assy.DefinedTypes.Where(r => r.FullName.ToUpper().Contains(o.Key2.ToUpper())).FirstOrDefault(); var typeTList = assy.DefinedTypes.Where(r => r.BaseType.Name.Equals("EpiTransaction") || r.BaseType.Name.Equals("EpiMultiViewTransaction") || r.BaseType.Name.Equals("EpiSingleViewTransaction") || r.BaseType.Name.Equals("UDMultiViewTransaction") || r.BaseType.Name.Equals("UDSingleViewTransaction")).ToList(); if (typeTList != null && typeTList.Count > 0) { foreach (var typeT in typeTList) { try { if (typeT != null) { epiTransaction = Activator.CreateInstance(typeT, new object[] { oTrans }); } else { epiTransaction = new EpiTransaction(oTrans); } epiBaseForm = Activator.CreateInstance(typeE, new object[] { epiTransaction }); break; } catch (Exception e) { } } } else { epiTransaction = new EpiTransaction(oTrans); epiBaseForm = Activator.CreateInstance(typeE, new object[] { epiTransaction }); } epiBaseForm.IsVerificationMode = true; epiBaseForm.CustomizationName = o.Key1; refds.AppendLine($"<Reference Include=\"{typeE.Assembly.FullName}\">"); refds.AppendLine($"<HintPath>{s}</HintPath>"); refds.AppendLine($"</Reference>"); swLog.WriteLine("Initialize EpiUI Utils"); EpiUIUtils eu = new EpiUIUtils(epiBaseForm, epiTransaction, epiBaseForm.MainToolManager, null); eu.GetType().GetField("currentSession", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(eu, epiTransaction.Session); eu.GetType().GetField("customizeName", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(eu, o.Key1); eu.GetType().GetField("baseExtentionName", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(eu, o.Key3.Replace("BaseExtension^", string.Empty)); swLog.WriteLine("Get composite Customize Data Set"); var mi = eu.GetType().GetMethod("getCompositeCustomizeDataSet", BindingFlags.Instance | BindingFlags.NonPublic); bool customize = false; mi.Invoke(eu, new object[] { o.Key2, customize, customize, customize }); Ice.Adapters.GenXDataAdapter ad = new Ice.Adapters.GenXDataAdapter(epiTransaction); ad.BOConnect(); GenXDataImpl i = (GenXDataImpl)ad.BusinessObject; swLog.WriteLine("Customization Get By ID"); var ds = i.GetByID(o.Company, o.ProductType, o.LayerType, o.CSGCode, o.Key1, o.Key2, o.Key3); string beName = o.Key3.Replace("BaseExtension^", string.Empty); string exName = (string)eu.GetType().GetField("extensionName", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(eu); CustomizationDS nds = new CustomizationDS(); if (string.IsNullOrEmpty(o.Company)) { eu.CustLayerMan.GetType().GetProperty("RetrieveFromCache", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic).SetValue(eu.CustLayerMan, false); eu.CustLayerMan.GetType().GetField("custAllCompanies", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic).SetValue(eu.CustLayerMan, string.IsNullOrEmpty(o.Company)); eu.CustLayerMan.GetType().GetField("selectCompCode", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic).SetValue(eu.CustLayerMan, o.Company); eu.CustLayerMan.GetType().GetField("companyCode", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic).SetValue(eu.CustLayerMan, o.Company); eu.CustLayerMan.GetType().GetField("loadDeveloperMode", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic).SetValue(eu.CustLayerMan, string.IsNullOrEmpty(o.Company)); bool cancel = false; eu.CustLayerMan.GetType().GetMethod("GetCompositeCustomDataSet", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic).Invoke(eu.CustLayerMan, new object[] { o.Key2, exName, o.Key1, cancel }); } PersonalizeCustomizeManager csm = new PersonalizeCustomizeManager(epiBaseForm, epiTransaction, o.ProductType, o.Company, beName, exName, o.Key1, eu.CustLayerMan, DeveloperLicenseType.Partner, LayerType.Customization); swLog.WriteLine("Init Custom Controls"); csm.InitCustomControlsAndProperties(ds, LayerName.CompositeBase, true); CustomScriptManager csmR = csm.CurrentCustomScriptManager; swLog.WriteLine("Generate Refs"); GenerateRefs(refds, csmR, o, null); ExportCustmization(nds, ad, o); Resync(o, swLog, refds, ds, nds, csmR); epiBaseForm.Dispose(); ad.Dispose(); cm = null; eu.CloseCacheRespinSplash(); eu.Dispose(); } catch (Exception ee) { swLog.WriteLine(ee.ToString()); } } Console.WriteLine(o.ProjectFolder); //MessageBox.Show(file); }
private static void DownloadAndSync(Session epiSession, CommandLineParams o) { string file = Path.GetTempFileName(); using (StreamWriter swLog = new StreamWriter(file)) { swLog.WriteLine("Got in the Function"); try { epiSession["Customizing"] = false; var oTrans = new ILauncher(epiSession); CustomizationVerify cm = new CustomizationVerify(epiSession); swLog.WriteLine("Customization Verify"); string dll = cm.getDllName(o.Key2); swLog.WriteLine("Got Epicor DLL"); StringBuilder refds = new StringBuilder(); dynamic epiBaseForm = null; dynamic epiTransaction = null; if (string.IsNullOrEmpty(dll)) { dll = "*.UI.*.dll"; } Assembly assy = ClientAssemblyRetriever.ForILaunch(oTrans).RetrieveAssembly(dll); swLog.WriteLine("Finding File"); string s = ""; if (assy == null) { foreach (string x in Directory.GetFiles(o.EpicorClientFolder, dll)) { assy = Assembly.LoadFile(x); if (assy.DefinedTypes.Where(r => r.FullName.ToUpper().Contains(o.Key2.ToUpper())).Any()) { s = x; break; } } } s = assy.Location; var typeE = assy.DefinedTypes.Where(r => r.FullName.ToUpper().Contains(o.Key2.ToUpper())).FirstOrDefault(); var typeTList = assy.DefinedTypes.Where(r => r.BaseType.Name.Equals("EpiTransaction") || r.BaseType.Name.Equals("EpiMultiViewTransaction") || r.BaseType.Name.Equals("EpiSingleViewTransaction") || r.BaseType.Name.Equals("UDMultiViewTransaction") || r.BaseType.Name.Equals("UDSingleViewTransaction")).ToList(); if (typeTList != null && typeTList.Count > 0) { foreach (var typeT in typeTList) { try { if (typeT != null) { epiTransaction = Activator.CreateInstance(typeT, new object[] { oTrans }); } else { epiTransaction = new EpiTransaction(oTrans); } epiBaseForm = Activator.CreateInstance(typeE, new object[] { epiTransaction }); break; } catch (Exception e) { } } } else { epiTransaction = new EpiTransaction(oTrans); epiBaseForm = Activator.CreateInstance(typeE, new object[] { epiTransaction }); } bool dashboard = false; try { epiBaseForm.IsVerificationMode = true; epiBaseForm.CustomizationName = o.Key1; } catch (Exception) { //Dashboard dashboard = true; } refds.AppendLine($"<Reference Include=\"{typeE.Assembly.FullName}\">"); refds.AppendLine($"<HintPath>{s}</HintPath>"); refds.AppendLine($"</Reference>"); if (dashboard) { //epiBaseForm.GetType().GetMethod("InitializeLaunch", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(epiBaseForm); var typ = assy.DefinedTypes.Where(r => r.Name == "Launch").FirstOrDefault(); dynamic launcher = Activator.CreateInstance(typ); launcher.Session = epiSession; launcher.GetType().GetMethod("InitializeLaunch", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(launcher, null); } swLog.WriteLine("Initialize EpiUI Utils"); EpiUIUtils eu = new EpiUIUtils(epiBaseForm, epiTransaction, epiBaseForm.MainToolManager, null); eu.GetType().GetField("currentSession", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(eu, epiTransaction.Session); eu.GetType().GetField("customizeName", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(eu, o.Key1); eu.GetType().GetField("baseExtentionName", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(eu, o.Key3.Replace("BaseExtension^", string.Empty)); swLog.WriteLine("Get composite Customize Data Set"); var mi = eu.GetType().GetMethod("getCompositeCustomizeDataSet", BindingFlags.Instance | BindingFlags.NonPublic); bool customize = false; mi.Invoke(eu, new object[] { o.Key2, customize, customize, customize }); Ice.Adapters.GenXDataAdapter ad = new Ice.Adapters.GenXDataAdapter(epiTransaction); ad.BOConnect(); GenXDataImpl i = (GenXDataImpl)ad.BusinessObject; swLog.WriteLine("Customization Get By ID"); var ds = i.GetByID(o.Company, o.ProductType, o.LayerType, o.CSGCode, o.Key1, o.Key2, o.Key3); string beName = o.Key3.Replace("BaseExtension^", string.Empty); string exName = (string)eu.GetType().GetField("extensionName", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(eu); CustomizationDS nds = new CustomizationDS(); PersonalizeCustomizeManager csm = new PersonalizeCustomizeManager(epiBaseForm, epiTransaction, o.ProductType, o.Company, beName, exName, o.Key1, eu.CustLayerMan, DeveloperLicenseType.Partner, LayerType.Customization); swLog.WriteLine("Init Custom Controls"); csm.InitCustomControlsAndProperties(ds, LayerName.CompositeBase, true); CustomScriptManager csmR = csm.CurrentCustomScriptManager; swLog.WriteLine("Generate Refs"); /*List<string> aliases = new List<string>(); * Match match =Regex.Match(csmR.CustomCodeAll, "((?<=extern alias )(.*)*(?=;))"); * while(match.Success) * { * aliases.Add(match.Value.Replace("_",".").ToUpper()); * match =match.NextMatch(); * }*/ GenerateRefs(refds, csmR, o, null); ExportCustmization(nds, ad, o); int start = csmR.CustomCodeAll.IndexOf("// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **"); int end = csmR.CustomCodeAll.Length - start; string allCode; string script; allCode = csmR.CustomCodeAll.Replace(csmR.CustomCodeAll.Substring(start, end), "}").Replace("public class Script", "public partial class Script").Replace("public static class Script", "public static partial class Script"); script = csmR.Script.Replace("public class Script", "public partial class Script"); script = script.Replace("public static class Script", "public static partial class Script"); swLog.WriteLine("Write Project"); string projectFile = Resource.BasicProjc; projectFile = projectFile.Replace("<CUSTID>", o.Key1); projectFile = projectFile.Replace("<!--<ReferencesHere>-->", refds.ToString()); o.Version = ds.XXXDef[0].SysRevID; swLog.WriteLine("Create Folder"); if (string.IsNullOrEmpty(o.ProjectFolder)) { string origFolderName = ($@"{o.Folder}\{o.Key2}_{ o.Key1}").Replace('.', '_'); string newFolderName = origFolderName; int ct = 0; while (Directory.Exists(newFolderName)) { newFolderName = ($"{origFolderName}_{++ct}").Replace('.', '_'); } o.ProjectFolder = newFolderName; Directory.CreateDirectory(o.ProjectFolder); } using (StreamWriter sw = new StreamWriter($@"{o.ProjectFolder}\{o.Key1}.csproj")) { sw.Write(projectFile); sw.Close(); } swLog.WriteLine("Write Script"); using (StreamWriter sw = new StreamWriter($@"{o.ProjectFolder}\Script.cs")) { sw.Write(script); sw.Close(); } swLog.WriteLine("Write ScriptRO"); using (StreamWriter sw = new StreamWriter($@"{o.ProjectFolder}\ScriptReadOnly.cs")) { sw.Write(allCode); sw.Close(); } swLog.WriteLine("Write Command"); string command = Newtonsoft.Json.JsonConvert.SerializeObject(o); using (StreamWriter sw = new StreamWriter($@"{o.ProjectFolder}\CustomizationInfo.json")) { sw.Write(command); sw.Close(); } File.SetAttributes($@"{o.ProjectFolder}\ScriptReadOnly.cs", File.GetAttributes($@"{o.ProjectFolder}\ScriptReadOnly.cs") & ~FileAttributes.ReadOnly); swLog.WriteLine("Write Customization"); nds.WriteXml($@"{o.ProjectFolder}\{o.Key2}_Customization_{o.Key1}_CustomExport.xml", XmlWriteMode.WriteSchema); epiBaseForm.Dispose(); ad.Dispose(); cm = null; eu.Dispose(); } catch (Exception ee) { swLog.WriteLine(ee.ToString()); } } Console.WriteLine(o.ProjectFolder); //MessageBox.Show(file); }