Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 protected void OnWarning(WEMessage Warning)
 {
     if (WarningEvent != null)
     {
         WarningEvent(this, new WarningEventArgs(Warning));
     }
 }
Ejemplo n.º 3
0
 protected void OnError(WEMessage Error)
 {
     if (ErrorEvent != null)
     {
         ErrorEvent(this, new ErrorEventArgs(Error));
     }
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 6
0
 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);
     }
 }
Ejemplo n.º 7
0
 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;
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
        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");
        }
Ejemplo n.º 13
0
        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;
            }
        }
Ejemplo n.º 14
0
        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");
        }
Ejemplo n.º 15
0
 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);
     }
 }
Ejemplo n.º 16
0
        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;
            }
        }
Ejemplo n.º 17
0
 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);
 }
Ejemplo n.º 18
0
        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);
            }
        }
Ejemplo n.º 19
0
 public ErrorEventArgs(WEMessage Error)
 {
     this.Error = Error;
 }
Ejemplo n.º 20
0
 public WarningEventArgs(WEMessage Warning)
 {
     this.Warning = Warning;
 }
Ejemplo n.º 21
0
 public WarningEventArgs(WEMessage Warning)
 {
     this.Warning = Warning;
 }
Ejemplo n.º 22
0
 protected void OnWarning(WEMessage Warning)
 {
     if (this.mEWList.AddWarning(Warning))
     {
         if (WarningEvent != null)
         {
             WarningEvent(this, new WarningEventArgs(Warning));
         }
     }
 }
Ejemplo n.º 23
0
 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;
 }
Ejemplo n.º 24
0
        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);
                }
            }

        }
Ejemplo n.º 25
0
        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");
        }
Ejemplo n.º 26
0
        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);
                }
            }
        }
Ejemplo n.º 27
0
        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");
        }
Ejemplo n.º 28
0
 protected void OnError(WEMessage Error)
 {
     if (ErrorEvent != null)
     {
         ErrorEvent(this, new ErrorEventArgs(Error));
     }
 }
Ejemplo n.º 29
0
 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);
     }
 }
Ejemplo n.º 30
0
 public ErrorEventArgs(WEMessage Error)
 {
     this.Error = Error;
 }
Ejemplo n.º 31
0
 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++;
 }