/// <summary> /// Makeerrors the specified r. /// </summary> /// <param name="r"> The r. </param> /// <param name="t"> The t. </param> /// <param name="ic"> The ic. </param> /// <param name="desc"> The desc. </param> /// <param name="error"> The error. </param> /// <param name="code"> The code. </param> /// <returns> </returns> /// <remarks> /// </remarks> private bool Makeerror(XNode r, ThemaDescriptor t, string ic, XmlExtensions.XmlElementDescriptor desc, string error, int code) { r.Remove(); var message = string.Format("error in uselib resolution in {0}/{1} {2}:{3} - {4}", t.Code, ic, desc.File, desc.Line, error); var ecprefix = "WRLIBR0"; var level = ErrorLevel.Warning; if (Context.Project.NonResolvedLibraryIsError) { ecprefix = "ERLIBR0"; level = ErrorLevel.Error; } var ecode = ecprefix + code; AddError(level, message, ecode, null, desc.File, desc.Line); if (ErrorLevel.Error == level) { UserLog.Error(message); } else { UserLog.Warn(message); } return ErrorLevel.Error == level; }
internal static void RemoveIndented(XNode element) { // NOTE: this method is tested by BindinRedirectManagerTest and SettingsTest var textBeforeOrNull = element.PreviousNode as XText; var textAfterOrNull = element.NextNode as XText; var oneIndentLevel = ComputeOneLevelOfIndentation(element); var isLastChild = !element.ElementsAfterSelf().Any(); element.Remove(); if (textAfterOrNull != null && IsWhiteSpace(textAfterOrNull)) { textAfterOrNull.Remove(); } if (isLastChild && textBeforeOrNull != null && IsWhiteSpace(textAfterOrNull)) { textBeforeOrNull.Value = textBeforeOrNull.Value.Substring(0, textBeforeOrNull.Value.Length - oneIndentLevel.Length); } }