public void ReplaceTextModule(string name, ModuleType type, VbaFolder source, string fallbackText) { var sourcePath = source.FindModulePath(name, type); var destinationPath = FindModulePath(name, type); if (string.IsNullOrEmpty(destinationPath)) { destinationPath = _so.PathCombine(FolderPath, name + ModuleProcessing.ExtensionFromType(type)); } if (_so.FileExists(sourcePath)) { if (source.ProjectEncoding.Equals(ProjectEncoding)) { _so.FileCopy(sourcePath, destinationPath, true); } else { _so.FileWriteAllText(destinationPath, _so.FileReadAllText(sourcePath, source.ProjectEncoding), ProjectEncoding); } } else { _so.FileWriteAllText(destinationPath, fallbackText, ProjectEncoding); } }
public void AddModule(string name, ModuleType type, VbaFolder source) { var path = _so.PathCombine(FolderPath, name + ModuleProcessing.ExtensionFromType(type)); _so.FileCopy(source.FindModulePath(name, type), path); if (type == ModuleType.Form) { var frxPath = path.Substring(0, path.Length - 4) + ".frx"; _so.FileCopy(source.FindFrxPath(name), frxPath); } ModuleFilePaths.Add(path); }
private void ApplyPatches(IEnumerable <Patch> patches, VbaFolder source, VbaFolder destination) { foreach (var patch in patches) { switch (patch.ChangeType) { case ChangeType.AddFile: destination.AddModule(patch.ModuleName, patch.ModuleType, source); break; case ChangeType.DeleteFile: destination.DeleteModule(patch.ModuleName, patch.ModuleType); break; case ChangeType.ChangeFormControls: destination.ReplaceFormControls(patch.ModuleName, source); break; default: destination.ReplaceTextModule(patch.ModuleName, patch.ModuleType, source, patch.SideBySideNewText); break; } } }
public void ReplaceFormControls(string name, VbaFolder source) { _so.FileCopy(source.FindFrxPath(name), FindFrxPath(name), true); }
internal ModuleLocator(VbaFolder parent) { _parent = parent; }
public void ReplaceFormControls(string name, VbaFolder source) { _so.FileCopy(FindFrxPath(source.FindModulePath(name, ModuleType.Form)), FindFrxPath(FindModulePath(name, ModuleType.Form)), true); }
public ActiveSession(ISession session, ISessionSettings sessionSettings) { _session = session; _sessionSettings = sessionSettings; _vf = new VbaFolder(); }