void eventSource_WarningRaised(object sender, BuildWarningEventArgs e) { //string line = string.Empty; //if (e.File == "EXEC") //{ // line = Strings.Warning + " "+ e.Message; //} //else //{ // line = e.File + "(" + e.LineNumber + "," + e.ColumnNumber + "): " + Strings.Warning + " " + e.Code + ": " + e.Message; //} WEMessage message = new WEMessage(); message.Code = e.Code; FileMessageObject FMO = new FileMessageObject(); message.MessageObject = FMO; FMO.ColumnNumber = e.ColumnNumber; FMO.EndColumnNumber = e.EndColumnNumber; FMO.LineNumber = e.LineNumber; FMO.EndLineNumber = e.EndLineNumber; FMO.File = e.File; message.Message = e.Message; if (mEWList.AddWarning(message)) { WriteIntent(); this.OnWarning(message); } }
protected void OnWarning(WEMessage Warning) { if (WarningEvent != null) { WarningEvent(this, new WarningEventArgs(Warning)); } }
protected void OnError(WEMessage Error) { if (ErrorEvent != null) { ErrorEvent(this, new ErrorEventArgs(Error)); } }
private void CanTFindComponentsReference(ComponentWrapper component, string text, ComponentMessageObject CMO) { WEMessage message = new WEMessage(); message.Message = text + "Can't find " + GetStringByComponentType(component.ComponentType) + " with GUID " + component.Guid; message.MessageObject = CMO; this.OnWarning(message); }
private void CompareComponentName(ComponentWrapper component, string Name, string text, ComponentMessageObject CMO) { if (string.Compare(component.Name, Name, StringComparison.Ordinal) != 0) { WEMessage message = new WEMessage(); message.Message = text + "Name mismatch. Component Name: \"" + component.Name + "\" " + GetStringByComponentType(component.ComponentType) + " Name:\"" + Name + "\""; message.MessageObject = CMO; this.OnWarning(message); } }
private void CompareComponentProjectPath(ComponentWrapper component, string ProjectPath, string text, ComponentMessageObject CMO) { if (component.Name == "COM_PAL") { } if (string.Compare(component.ProjectPath, ProjectPath, true) != 0) { WEMessage message = new WEMessage(); message.Message = text + "Project Path mismatch. Component Project Path: \"" + component.ProjectPath + "\" " + GetStringByComponentType(component.ComponentType) + " Project Path:\"" + ProjectPath + "\""; message.MessageObject = CMO; this.OnWarning(message); } }
private bool CheckComponentGUID(ComponentWrapper component, string text, ComponentMessageObject CMO) { if (string.IsNullOrEmpty(component.Guid)) { if (!string.IsNullOrEmpty(component.Name) || !string.IsNullOrEmpty(component.ProjectPath)) { WEMessage message = new WEMessage(); message.Message = text + "GUID missing in " + GetStringByComponentType(component.ComponentType); message.MessageObject = CMO; this.OnWarning(message); } return(false); } return(true); }
public bool AddError(WEMessage error) { bool contains = false; foreach (WEMessage item in mMSBuildErrors) { if (item.Message == error.Message) contains = true; } if (!contains) { this.mMSBuildErrors.Add(error); return true; } return false; }
public bool AddWarning(WEMessage warning) { bool contains = false; foreach (WEMessage item in mMSBuildWarnings) { if (item.Message == warning.Message) contains = true; } if (!contains) { this.mMSBuildWarnings.Add(warning); return true; } return false; }
public bool AddWarning(WEMessage warning) { bool contains = false; foreach (WEMessage item in mMSBuildWarnings) { if (item.Message == warning.Message) { contains = true; } } if (!contains) { this.mMSBuildWarnings.Add(warning); return(true); } return(false); }
public bool AddError(WEMessage error) { bool contains = false; foreach (WEMessage item in mMSBuildErrors) { if (item.Message == error.Message) { contains = true; } } if (!contains) { this.mMSBuildErrors.Add(error); return(true); } return(false); }
private void VerifyStubs() { this.OnMessage("Running Stubs Verification...\r\n"); List<LibraryWrapper> CheckList = new List<LibraryWrapper>(); LibraryWrapper[] LWS = PK.Wrapper.GetLibraries(); foreach (LibraryWrapper LW in LWS) { if (LW.IsStub) CheckList.Add(LW); } foreach (LibraryWrapper LW in CheckList) { ComponentMessageObject CMO = new ComponentMessageObject(); CMO.Component = ComponentWrapper.GetComponentWrapper(LW); if (LW.HasLibraryCategory == false) { WEMessage message = new WEMessage(); message.Message = "Stub " + GetStringByComponentType(ComponentTypeWrapper.Library) + " \"" + LW.Name + "\" has not have library category"; message.MessageObject = CMO; this.OnWarning(message); } else { LibraryCategoryWrapper LCW = PK.Wrapper.FindLibraryCategory(LW.LibraryCategory.Guid); if (string.Compare(LCW.StubLibrary.Guid, LW.Guid, true) != 0) { WEMessage message = new WEMessage(); message.Message = "Stub " + GetStringByComponentType(ComponentTypeWrapper.Library) + " \"" + LW.Name + "\": " + GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" has wrong GUID in it's StubLibrary field"; message.MessageObject = CMO; this.OnWarning(message); } if (string.Compare(LCW.StubLibrary.Name, LW.Name, true) != 0) { WEMessage message = new WEMessage(); message.Message = "Stub " + GetStringByComponentType(ComponentTypeWrapper.Library) + " \"" + LW.Name + "\": " + GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" has wrong NAME in it's StubLibrary field"; message.MessageObject = CMO; this.OnWarning(message); } if (string.Compare(LCW.StubLibrary.ProjectPath, LW.ProjectPath, true) != 0) { WEMessage message = new WEMessage(); message.Message = "Stub " + GetStringByComponentType(ComponentTypeWrapper.Library) + " \"" + LW.Name + "\": " + GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" has wrong ProjectPath in it's StubLibrary field"; message.MessageObject = CMO; this.OnWarning(message); } } } LibraryCategoryWrapper[] LCWS = PK.Wrapper.GetLibraryCategories(); foreach (LibraryCategoryWrapper LCW in LCWS) { ComponentMessageObject CMO = new ComponentMessageObject(); CMO.Component = ComponentWrapper.GetComponentWrapper(LCW); if (LCW.StubLibrary.Guid == null) { WEMessage message = new WEMessage(); message.Message = GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" has not have stub library"; message.MessageObject = CMO; this.OnWarning(message); } else { LibraryWrapper LW = PK.Wrapper.FindLibrary(LCW.StubLibrary.Guid); if (LW == null) { WEMessage message = new WEMessage(); message.Message = GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" Stub Library: Can't find library with GUID"; message.MessageObject = CMO; this.OnWarning(message); } else { if (string.Compare(LCW.StubLibrary.Name, LW.Name, true) != 0) { WEMessage message = new WEMessage(); message.Message = GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" Stub Library: Name mismatch. Stub component Name is \"" + LCW.StubLibrary.Name + "\" " + GetStringByComponentType(ComponentTypeWrapper.Library) + " Name is \"" + LW.Name + "\""; message.MessageObject = CMO; this.OnWarning(message); } if (string.Compare(LCW.StubLibrary.ProjectPath, LW.ProjectPath, true) != 0) { WEMessage message = new WEMessage(); message.Message = GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" Stub Library: Project Path mismatch. Stub component Project Path is \"" + LCW.StubLibrary.Name + "\" " + GetStringByComponentType(ComponentTypeWrapper.Library) + " Project Path is \"" + LW.Name + "\""; message.MessageObject = CMO; this.OnWarning(message); } } } } this.OnMessage("Verified " + CheckList.Count + " object(s).\r\n\r\n"); }
private void CheckComponent(ComponentWrapper OwnerComponent, string text, ComponentWrapper component) { ComponentMessageObject CMO = new ComponentMessageObject(); CMO.Component = OwnerComponent; ComponentsChecked++; switch (component.ComponentType) { #region Library case ComponentTypeWrapper.Library: if (!CheckComponentGUID(component, text, CMO)) return; LibraryWrapper LW = PK.Wrapper.FindLibrary(component.Guid); if (LW == null) { CanTFindComponentsReference(component, text, CMO); return; } CompareComponentName(component, LW.Name, text, CMO); CompareComponentProjectPath(component, LW.ProjectPath, text, CMO); break; #endregion #region Feature case ComponentTypeWrapper.Feature: if (!CheckComponentGUID(component, text, CMO)) return; FeatureWrapper FW = PK.Wrapper.FindFeature(component.Guid); if (FW == null) { CanTFindComponentsReference(component, text, CMO); return; } CompareComponentName(component, FW.Name, text, CMO); CompareComponentProjectPath(component, FW.ProjectPath, text, CMO); break; #endregion #region Assembly case ComponentTypeWrapper.MFAssembly: if (!CheckComponentGUID(component, text, CMO)) return; AssemblyWrapper AW = PK.Wrapper.FindAssembly(component.Guid); if (AW == null) { CanTFindComponentsReference(component, text, CMO); return; } CompareComponentName(component, AW.Name, text, CMO); CompareComponentProjectPath(component, AW.ProjectPath, text, CMO); break; #endregion case ComponentTypeWrapper.MFSolution: break; #region Processors case ComponentTypeWrapper.Processor: if (!CheckComponentGUID(component, text, CMO)) return; ProcessorWrapper PW = PK.Wrapper.FindProcessor(component.Guid); if (PW == null) { CanTFindComponentsReference(component, text, CMO); return; } CompareComponentName(component, PW.Name, text, CMO); CompareComponentProjectPath(component, PW.ProjectPath, text, CMO); break; #endregion case ComponentTypeWrapper.OperatingSystem: break; case ComponentTypeWrapper.BuildTool: break; #region ISA case ComponentTypeWrapper.ISA: if (!CheckComponentGUID(component, text, CMO)) return; ISAWrapper IW = PK.Wrapper.FindISA(component.Guid); if (IW == null) { CanTFindComponentsReference(component, text, CMO); return; } CompareComponentName(component, IW.Name, text, CMO); break; #endregion case ComponentTypeWrapper.BuildParameter: break; #region LibraryCategory case ComponentTypeWrapper.LibraryCategory: if (!CheckComponentGUID(component, text, CMO)) return; LibraryCategoryWrapper LCW = PK.Wrapper.FindLibraryCategory(component.Guid); if (LCW == null) { CanTFindComponentsReference(component, text, CMO); return; } CompareComponentName(component, LCW.Name, text, CMO); CompareComponentProjectPath(component, LCW.ProjectPath, text, CMO); break; #endregion #region Unknown case ComponentTypeWrapper.Unknown: WEMessage UMessage = new WEMessage(); UMessage.Message = text + "Component with \"Type\": " + GetStringByComponentType(component.ComponentType); UMessage.MessageObject = CMO; this.OnWarning(UMessage); break; #endregion default: break; } }
private void VerifyGUID() { this.OnMessage("Running GUIDs Verification...\r\n"); List<ComponentWrapper> CheckList = new List<ComponentWrapper>(); LibraryWrapper[] LWS = PK.Wrapper.GetLibraries(); foreach (LibraryWrapper LW in LWS) { CheckList.Add(ComponentWrapper.GetComponentWrapper(LW)); } FeatureWrapper[] FWS = PK.Wrapper.GetFeatures(); foreach (FeatureWrapper FW in FWS) { CheckList.Add(ComponentWrapper.GetComponentWrapper(FW)); } AssemblyWrapper[] AWS = PK.Wrapper.GetAssembies(); foreach (AssemblyWrapper AW in AWS) { CheckList.Add(ComponentWrapper.GetComponentWrapper(AW)); } ProcessorWrapper[] PWS = PK.Wrapper.GetProcessors(); foreach (ProcessorWrapper PW in PWS) { CheckList.Add(ComponentWrapper.GetComponentWrapper(PW)); } BuildToolWrapper_[] BTWS = PK.Wrapper.GetBuildTools(); foreach (BuildToolWrapper_ BTW in BTWS) { CheckList.Add(ComponentWrapper.GetComponentWrapper(BTW)); } ISAWrapper[] IWS = PK.Wrapper.GetISAs(); foreach (ISAWrapper IW in IWS) { CheckList.Add(ComponentWrapper.GetComponentWrapper(IW)); } // case ComponentTypeWrapper.BuildParameter: LibraryCategoryWrapper[] LCWS = PK.Wrapper.GetLibraryCategories(); foreach (LibraryCategoryWrapper LCW in LCWS) { CheckList.Add(ComponentWrapper.GetComponentWrapper(LCW)); } if (PK.Wrapper.Solution != null) { CheckList.Add(ComponentWrapper.GetComponentWrapper(PK.Wrapper.Solution)); foreach (ProjectWrapper PW in PK.Wrapper.Solution.Projects) { CheckList.Add(ComponentWrapper.GetComponentWrapper(PW)); } } foreach (ComponentWrapper w1 in CheckList) { foreach (ComponentWrapper w2 in CheckList) { if (w1 != w2) { if (string.Compare(w1.Guid, w2.Guid, true) == 0) { WEMessage message = new WEMessage(); message.Message = GetStringByComponentType(w1.ComponentType) + " \"" + w1.Name + "\" have same GUID as " + GetStringByComponentType(w2.ComponentType) + " \"" + w2.Name + "\""; this.OnWarning(message); } } } } this.OnMessage("Verified " + CheckList.Count + " object(s).\r\n\r\n"); }
private void CompareComponentProjectPath(ComponentWrapper component, string ProjectPath, string text, ComponentMessageObject CMO) { if (component.Name == "COM_PAL") { } if (string.Compare(component.ProjectPath, ProjectPath, true) != 0) { WEMessage message = new WEMessage(); message.Message = text + "Project Path mismatch. Component Project Path: \"" + component.ProjectPath + "\" " + GetStringByComponentType(component.ComponentType) + " Project Path:\"" + ProjectPath + "\""; message.MessageObject = CMO; this.OnWarning(message); } }
private void CheckComponent(ComponentWrapper OwnerComponent, string text, ComponentWrapper component) { ComponentMessageObject CMO = new ComponentMessageObject(); CMO.Component = OwnerComponent; ComponentsChecked++; switch (component.ComponentType) { #region Library case ComponentTypeWrapper.Library: if (!CheckComponentGUID(component, text, CMO)) { return; } LibraryWrapper LW = PK.Wrapper.FindLibrary(component.Guid); if (LW == null) { CanTFindComponentsReference(component, text, CMO); return; } CompareComponentName(component, LW.Name, text, CMO); CompareComponentProjectPath(component, LW.ProjectPath, text, CMO); break; #endregion #region Feature case ComponentTypeWrapper.Feature: if (!CheckComponentGUID(component, text, CMO)) { return; } FeatureWrapper FW = PK.Wrapper.FindFeature(component.Guid); if (FW == null) { CanTFindComponentsReference(component, text, CMO); return; } CompareComponentName(component, FW.Name, text, CMO); CompareComponentProjectPath(component, FW.ProjectPath, text, CMO); break; #endregion #region Assembly case ComponentTypeWrapper.MFAssembly: if (!CheckComponentGUID(component, text, CMO)) { return; } AssemblyWrapper AW = PK.Wrapper.FindAssembly(component.Guid); if (AW == null) { CanTFindComponentsReference(component, text, CMO); return; } CompareComponentName(component, AW.Name, text, CMO); CompareComponentProjectPath(component, AW.ProjectPath, text, CMO); break; #endregion case ComponentTypeWrapper.MFSolution: break; #region Processors case ComponentTypeWrapper.Processor: if (!CheckComponentGUID(component, text, CMO)) { return; } ProcessorWrapper PW = PK.Wrapper.FindProcessor(component.Guid); if (PW == null) { CanTFindComponentsReference(component, text, CMO); return; } CompareComponentName(component, PW.Name, text, CMO); CompareComponentProjectPath(component, PW.ProjectPath, text, CMO); break; #endregion case ComponentTypeWrapper.OperatingSystem: break; case ComponentTypeWrapper.BuildTool: break; #region ISA case ComponentTypeWrapper.ISA: if (!CheckComponentGUID(component, text, CMO)) { return; } ISAWrapper IW = PK.Wrapper.FindISA(component.Guid); if (IW == null) { CanTFindComponentsReference(component, text, CMO); return; } CompareComponentName(component, IW.Name, text, CMO); break; #endregion case ComponentTypeWrapper.BuildParameter: break; #region LibraryCategory case ComponentTypeWrapper.LibraryCategory: if (!CheckComponentGUID(component, text, CMO)) { return; } LibraryCategoryWrapper LCW = PK.Wrapper.FindLibraryCategory(component.Guid); if (LCW == null) { CanTFindComponentsReference(component, text, CMO); return; } CompareComponentName(component, LCW.Name, text, CMO); CompareComponentProjectPath(component, LCW.ProjectPath, text, CMO); break; #endregion #region Unknown case ComponentTypeWrapper.Unknown: WEMessage UMessage = new WEMessage(); UMessage.Message = text + "Component with \"Type\": " + GetStringByComponentType(component.ComponentType); UMessage.MessageObject = CMO; this.OnWarning(UMessage); break; #endregion default: break; } }
private void CanTFindComponentsReference(ComponentWrapper component, string text, ComponentMessageObject CMO) { WEMessage message = new WEMessage(); message.Message = text + "Can't find " + GetStringByComponentType(component.ComponentType) + " with GUID " + component.Guid; message.MessageObject = CMO; this.OnWarning(message); }
void eventSource_WarningRaised(object sender, BuildWarningEventArgs e) { //string line = string.Empty; //if (e.File == "EXEC") //{ // line = Strings.Warning + " "+ e.Message; //} //else //{ // line = e.File + "(" + e.LineNumber + "," + e.ColumnNumber + "): " + Strings.Warning + " " + e.Code + ": " + e.Message; //} WEMessage message = new WEMessage(); message.Code = e.Code; FileMessageObject FMO = new FileMessageObject(); message.MessageObject = FMO; FMO.ColumnNumber = e.ColumnNumber; FMO.EndColumnNumber = e.EndColumnNumber; FMO.LineNumber = e.LineNumber; FMO.EndLineNumber = e.EndLineNumber; FMO.File = e.File; message.Message = e.Message; if (mEWList.AddWarning(message)) { WriteIntent(); this.OnWarning(message); } }
public ErrorEventArgs(WEMessage Error) { this.Error = Error; }
public WarningEventArgs(WEMessage Warning) { this.Warning = Warning; }
public WarningEventArgs(WEMessage Warning) { this.Warning = Warning; }
protected void OnWarning(WEMessage Warning) { if (this.mEWList.AddWarning(Warning)) { if (WarningEvent != null) { WarningEvent(this, new WarningEventArgs(Warning)); } } }
private bool CheckComponentGUID(ComponentWrapper component, string text, ComponentMessageObject CMO) { if (string.IsNullOrEmpty(component.Guid)) { if (!string.IsNullOrEmpty(component.Name) || !string.IsNullOrEmpty(component.ProjectPath)) { WEMessage message = new WEMessage(); message.Message = text + "GUID missing in " + GetStringByComponentType(component.ComponentType); message.MessageObject = CMO; this.OnWarning(message); } return false; } return true; }
void eventSource_MessageRaised(object sender, BuildMessageEventArgs e) { //if ((e.Importance == MessageImportance.High && IsVerbosityAtLeast(LoggerVerbosity.Minimal)) // || (e.Importance == MessageImportance.Normal && IsVerbosityAtLeast(LoggerVerbosity.Normal)) // || (e.Importance == MessageImportance.Low && IsVerbosityAtLeast(LoggerVerbosity.Detailed)) // ) //{ //WriteLineWithSenderAndMessage(String.Empty, e); //} //WriteLineWithIntent(e.Message); //this.OnMessage(e.Message); MessInfo Messinfo = new MessInfo(e.Message); if (Messinfo.Success) { WEMessage message = new WEMessage(); message.Code = Messinfo.Error; FileMessageObject FMO = new FileMessageObject(); message.MessageObject = FMO; FMO.ColumnNumber = 0; FMO.EndColumnNumber = 0; FMO.LineNumber = Messinfo.Line; FMO.EndLineNumber = 0; FMO.File = Messinfo.File; message.Message = Messinfo.Message; //string line = string.Empty; switch (Messinfo.Cond) { case MessInfo.Level.Error: //line = message.File + "(" + message.LineNumber + "," + message.ColumnNumber + "): " + Strings.Error + " " + message.Code + ": " + message.Message; if (mEWList.AddError(message)) { WriteIntent(); this.OnError(message); } break; case MessInfo.Level.Warning: //line = message.File + "(" + message.LineNumber + "," + message.ColumnNumber + "): " + Strings.Warning + " " + message.Code + ": " + message.Message; if (mEWList.AddWarning(message)) { WriteIntent(); this.OnWarning(message); } break; } //if(line != string.Empty) //WriteLineWithIntent(line); } //if (e.Message.ToLower().Contains("error:")) //{ //} //if (e.Message.ToLower().Contains("warning:")) //{ // WriteLineWithIntent(e.Message); //} if (e.GetType() == typeof(TaskCommandLineEventArgs)) { if (e.Message.ToLower().Contains("error:")) { WriteLineWithIntent(Strings.ConsoleError + ": " + e.Message); } if (e.Message.ToLower().Contains("warning:")) { WriteLineWithIntent(Strings.ConsoleError + ": " + e.Message); } } }
private void VerifyStubs() { this.OnMessage("Running Stubs Verification...\r\n"); List <LibraryWrapper> CheckList = new List <LibraryWrapper>(); LibraryWrapper[] LWS = PK.Wrapper.GetLibraries(); foreach (LibraryWrapper LW in LWS) { if (LW.IsStub) { CheckList.Add(LW); } } foreach (LibraryWrapper LW in CheckList) { ComponentMessageObject CMO = new ComponentMessageObject(); CMO.Component = ComponentWrapper.GetComponentWrapper(LW); if (LW.HasLibraryCategory == false) { WEMessage message = new WEMessage(); message.Message = "Stub " + GetStringByComponentType(ComponentTypeWrapper.Library) + " \"" + LW.Name + "\" has not have library category"; message.MessageObject = CMO; this.OnWarning(message); } else { LibraryCategoryWrapper LCW = PK.Wrapper.FindLibraryCategory(LW.LibraryCategory.Guid); if (string.Compare(LCW.StubLibrary.Guid, LW.Guid, true) != 0) { WEMessage message = new WEMessage(); message.Message = "Stub " + GetStringByComponentType(ComponentTypeWrapper.Library) + " \"" + LW.Name + "\": " + GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" has wrong GUID in it's StubLibrary field"; message.MessageObject = CMO; this.OnWarning(message); } if (string.Compare(LCW.StubLibrary.Name, LW.Name, true) != 0) { WEMessage message = new WEMessage(); message.Message = "Stub " + GetStringByComponentType(ComponentTypeWrapper.Library) + " \"" + LW.Name + "\": " + GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" has wrong NAME in it's StubLibrary field"; message.MessageObject = CMO; this.OnWarning(message); } if (string.Compare(LCW.StubLibrary.ProjectPath, LW.ProjectPath, true) != 0) { WEMessage message = new WEMessage(); message.Message = "Stub " + GetStringByComponentType(ComponentTypeWrapper.Library) + " \"" + LW.Name + "\": " + GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" has wrong ProjectPath in it's StubLibrary field"; message.MessageObject = CMO; this.OnWarning(message); } } } LibraryCategoryWrapper[] LCWS = PK.Wrapper.GetLibraryCategories(); foreach (LibraryCategoryWrapper LCW in LCWS) { ComponentMessageObject CMO = new ComponentMessageObject(); CMO.Component = ComponentWrapper.GetComponentWrapper(LCW); if (LCW.StubLibrary.Guid == null) { WEMessage message = new WEMessage(); message.Message = GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" has not have stub library"; message.MessageObject = CMO; this.OnWarning(message); } else { LibraryWrapper LW = PK.Wrapper.FindLibrary(LCW.StubLibrary.Guid); if (LW == null) { WEMessage message = new WEMessage(); message.Message = GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" Stub Library: Can't find library with GUID"; message.MessageObject = CMO; this.OnWarning(message); } else { if (string.Compare(LCW.StubLibrary.Name, LW.Name, true) != 0) { WEMessage message = new WEMessage(); message.Message = GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" Stub Library: Name mismatch. Stub component Name is \"" + LCW.StubLibrary.Name + "\" " + GetStringByComponentType(ComponentTypeWrapper.Library) + " Name is \"" + LW.Name + "\""; message.MessageObject = CMO; this.OnWarning(message); } if (string.Compare(LCW.StubLibrary.ProjectPath, LW.ProjectPath, true) != 0) { WEMessage message = new WEMessage(); message.Message = GetStringByComponentType(ComponentTypeWrapper.LibraryCategory) + " \"" + LCW.Name + "\" Stub Library: Project Path mismatch. Stub component Project Path is \"" + LCW.StubLibrary.Name + "\" " + GetStringByComponentType(ComponentTypeWrapper.Library) + " Project Path is \"" + LW.Name + "\""; message.MessageObject = CMO; this.OnWarning(message); } } } } this.OnMessage("Verified " + CheckList.Count + " object(s).\r\n\r\n"); }
void eventSource_MessageRaised(object sender, BuildMessageEventArgs e) { //if ((e.Importance == MessageImportance.High && IsVerbosityAtLeast(LoggerVerbosity.Minimal)) // || (e.Importance == MessageImportance.Normal && IsVerbosityAtLeast(LoggerVerbosity.Normal)) // || (e.Importance == MessageImportance.Low && IsVerbosityAtLeast(LoggerVerbosity.Detailed)) // ) //{ //WriteLineWithSenderAndMessage(String.Empty, e); //} //WriteLineWithIntent(e.Message); //this.OnMessage(e.Message); MessInfo Messinfo = new MessInfo(e.Message); if (Messinfo.Success) { WEMessage message = new WEMessage(); message.Code = Messinfo.Error; FileMessageObject FMO = new FileMessageObject(); message.MessageObject = FMO; FMO.ColumnNumber = 0; FMO.EndColumnNumber = 0; FMO.LineNumber = Messinfo.Line; FMO.EndLineNumber = 0; FMO.File = Messinfo.File; message.Message = Messinfo.Message; //string line = string.Empty; switch (Messinfo.Cond) { case MessInfo.Level.Error: //line = message.File + "(" + message.LineNumber + "," + message.ColumnNumber + "): " + Strings.Error + " " + message.Code + ": " + message.Message; if (mEWList.AddError(message)) { WriteIntent(); this.OnError(message); } break; case MessInfo.Level.Warning: //line = message.File + "(" + message.LineNumber + "," + message.ColumnNumber + "): " + Strings.Warning + " " + message.Code + ": " + message.Message; if (mEWList.AddWarning(message)) { WriteIntent(); this.OnWarning(message); } break; } //if(line != string.Empty) //WriteLineWithIntent(line); } //if (e.Message.ToLower().Contains("error:")) //{ //} //if (e.Message.ToLower().Contains("warning:")) //{ // WriteLineWithIntent(e.Message); //} if (e.GetType() == typeof(TaskCommandLineEventArgs)) { if (e.Message.ToLower().Contains("error:")) { WriteLineWithIntent(Strings.ConsoleError + ": " + e.Message); } if (e.Message.ToLower().Contains("warning:")) { WriteLineWithIntent(Strings.ConsoleError + ": " + e.Message); } } }
private void VerifyGUID() { this.OnMessage("Running GUIDs Verification...\r\n"); List <ComponentWrapper> CheckList = new List <ComponentWrapper>(); LibraryWrapper[] LWS = PK.Wrapper.GetLibraries(); foreach (LibraryWrapper LW in LWS) { CheckList.Add(ComponentWrapper.GetComponentWrapper(LW)); } FeatureWrapper[] FWS = PK.Wrapper.GetFeatures(); foreach (FeatureWrapper FW in FWS) { CheckList.Add(ComponentWrapper.GetComponentWrapper(FW)); } AssemblyWrapper[] AWS = PK.Wrapper.GetAssembies(); foreach (AssemblyWrapper AW in AWS) { CheckList.Add(ComponentWrapper.GetComponentWrapper(AW)); } ProcessorWrapper[] PWS = PK.Wrapper.GetProcessors(); foreach (ProcessorWrapper PW in PWS) { CheckList.Add(ComponentWrapper.GetComponentWrapper(PW)); } BuildToolWrapper_[] BTWS = PK.Wrapper.GetBuildTools(); foreach (BuildToolWrapper_ BTW in BTWS) { CheckList.Add(ComponentWrapper.GetComponentWrapper(BTW)); } ISAWrapper[] IWS = PK.Wrapper.GetISAs(); foreach (ISAWrapper IW in IWS) { CheckList.Add(ComponentWrapper.GetComponentWrapper(IW)); } // case ComponentTypeWrapper.BuildParameter: LibraryCategoryWrapper[] LCWS = PK.Wrapper.GetLibraryCategories(); foreach (LibraryCategoryWrapper LCW in LCWS) { CheckList.Add(ComponentWrapper.GetComponentWrapper(LCW)); } if (PK.Wrapper.Solution != null) { CheckList.Add(ComponentWrapper.GetComponentWrapper(PK.Wrapper.Solution)); foreach (ProjectWrapper PW in PK.Wrapper.Solution.Projects) { CheckList.Add(ComponentWrapper.GetComponentWrapper(PW)); } } foreach (ComponentWrapper w1 in CheckList) { foreach (ComponentWrapper w2 in CheckList) { if (w1 != w2) { if (string.Compare(w1.Guid, w2.Guid, true) == 0) { WEMessage message = new WEMessage(); message.Message = GetStringByComponentType(w1.ComponentType) + " \"" + w1.Name + "\" have same GUID as " + GetStringByComponentType(w2.ComponentType) + " \"" + w2.Name + "\""; this.OnWarning(message); } } } } this.OnMessage("Verified " + CheckList.Count + " object(s).\r\n\r\n"); }
protected void OnError(WEMessage Error) { if (ErrorEvent != null) { ErrorEvent(this, new ErrorEventArgs(Error)); } }
private void CompareComponentName(ComponentWrapper component, string Name, string text, ComponentMessageObject CMO) { if (string.Compare(component.Name, Name, StringComparison.Ordinal) != 0) { WEMessage message = new WEMessage(); message.Message = text + "Name mismatch. Component Name: \"" + component.Name + "\" " + GetStringByComponentType(component.ComponentType) + " Name:\"" + Name + "\""; message.MessageObject = CMO; this.OnWarning(message); } }
public ErrorEventArgs(WEMessage Error) { this.Error = Error; }
private void AddWarning(WEMessage Warning) { ListViewItem LVitem = new ListViewItem("", 1); LVitem.SubItems.Add(index.ToString()); LVitem.SubItems.Add(Warning.Message); if ((Warning.MessageObject as FileMessageObject) != null) { FileMessageObject FMO = Warning.MessageObject as FileMessageObject; if (FMO.File != "EXEC") { LVitem.SubItems.Add(Path.GetFileName(FMO.File)); LVitem.SubItems.Add(FMO.LineNumber.ToString()); //LVitem.SubItems.Add(item.ColumnNumber.ToString()); } } if ((Warning.MessageObject as ComponentMessageObject) != null) { ComponentMessageObject CMO = Warning.MessageObject as ComponentMessageObject; LVitem.SubItems.Add(Path.GetFileName(CMO.Component.Name)); } LVitem.Tag = Warning; AddLVItem(LVitem); index++; }