public string SerializeAsteriskBugDirLink() { StringBuilder b = new StringBuilder(); if (Global.Projects.FullyLoaded) { // Called by project refresh button foreach (Project p in Global.Projects) { string key = p.ProjectName; bool value = p.Compat.AsteriskBugDirLink; b.AppendLine($"{key}={value}"); } } else { // Called by Global.Init() foreach (string projectName in Global.Projects.ProjectNames) { Debug.Assert(Global.Projects.CompatOptions.ContainsKey(projectName), "ProjectCollection error at ScriptCache.SerializeAsteriskBugDirLink"); CompatOption compat = Global.Projects.CompatOptions[projectName]; string key = projectName; bool value = compat.AsteriskBugDirLink; b.AppendLine($"{key}={value}"); } } return(b.ToString()); }
public Dictionary <string, bool> Diff(CompatOption other) { return(new Dictionary <string, bool>(StringComparer.OrdinalIgnoreCase) { // Script Tree [nameof(AsteriskBugDirLink)] = AsteriskBugDirLink != other.AsteriskBugDirLink, // Command [nameof(AsteriskBugDirCopy)] = AsteriskBugDirCopy != other.AsteriskBugDirCopy, [nameof(FileRenameCanMoveDir)] = FileRenameCanMoveDir != other.FileRenameCanMoveDir, [nameof(AllowLetterInLoop)] = AllowLetterInLoop != other.AllowLetterInLoop, [nameof(LegacyBranchCondition)] = LegacyBranchCondition != other.LegacyBranchCondition, [nameof(LegacyRegWrite)] = LegacyRegWrite != other.LegacyRegWrite, [nameof(AllowSetModifyInterface)] = AllowSetModifyInterface != other.AllowSetModifyInterface, [nameof(LegacyInterfaceCommand)] = LegacyInterfaceCommand != other.LegacyInterfaceCommand, [nameof(LegacySectionParamCommand)] = LegacySectionParamCommand != other.LegacySectionParamCommand, [nameof(AutoCompactIniWriteCommand)] = AutoCompactIniWriteCommand != other.AutoCompactIniWriteCommand, // Script Interface [nameof(IgnoreWidthOfWebLabel)] = IgnoreWidthOfWebLabel != other.IgnoreWidthOfWebLabel, // Variable [nameof(OverridableFixedVariables)] = OverridableFixedVariables != other.OverridableFixedVariables, [nameof(OverridableLoopCounter)] = OverridableLoopCounter != other.OverridableLoopCounter, [nameof(EnableEnvironmentVariables)] = EnableEnvironmentVariables != other.EnableEnvironmentVariables, [nameof(DisableExtendedSectionParams)] = DisableExtendedSectionParams != other.DisableExtendedSectionParams, }); }
public static Options CreateOptions(CompatOption compat) { return(new Options { OverridableFixedVariables = compat.OverridableFixedVariables, EnableEnvironmentVariables = compat.EnableEnvironmentVariables, }); }
public Project(string baseDir, string projectName, CompatOption compat) { LoadedScriptCount = 0; AllScriptCount = 0; ProjectName = projectName; ProjectRoot = Path.Combine(baseDir, Names.Projects); ProjectDir = Path.Combine(baseDir, Names.Projects, projectName); BaseDir = baseDir; Compat = compat; }
public void CopyTo(CompatOption dest) { // Asterisk dest.AsteriskBugDirCopy = AsteriskBugDirCopy; dest.AsteriskBugDirLink = AsteriskBugDirLink; // Command dest.FileRenameCanMoveDir = FileRenameCanMoveDir; dest.AllowLetterInLoop = AllowLetterInLoop; dest.LegacyBranchCondition = LegacyBranchCondition; dest.LegacyRegWrite = LegacyRegWrite; dest.AllowSetModifyInterface = AllowSetModifyInterface; dest.LegacyInterfaceCommand = LegacyInterfaceCommand; dest.LegacySectionParamCommand = LegacySectionParamCommand; // Script Interface dest.IgnoreWidthOfWebLabel = IgnoreWidthOfWebLabel; // Variable dest.OverridableFixedVariables = OverridableFixedVariables; dest.OverridableLoopCounter = OverridableLoopCounter; dest.EnableEnvironmentVariables = EnableEnvironmentVariables; dest.DisableExtendedSectionParams = DisableExtendedSectionParams; }
/// <summary> /// Used for cloning /// </summary> /// <param name="compatFile"></param> /// <param name="src"></param> private CompatOption(string compatFile, CompatOption src) { _compatFile = compatFile; src.CopyTo(this); }