Ejemplo n.º 1
0
        public ProfilerSocketServer( Project.Options po, Run run )
        {
            _fsm = new FunctionSignatureMap();
            _run = run;
            _tic = run.ThreadInfoCollection;
            _nStopFlag = 0;
            _po = po;
            _bHasStopped = false;

            _run.Messages.AddMessage( "Waiting for application..." );
        }
Ejemplo n.º 2
0
        public ProfilerSocketServer( Project.Options po, Run run )
        {
            _run = run;
            _nStopFlag = 0;
            _po = po;
            _bHasStopped = false;
            _nCurrentApplicationID = 0;
            _nProfileCount = 0;

            _run.Messages.AddMessage( "Waiting for application..." );
        }
Ejemplo n.º 3
0
        public ProfilerSocketServer(Project.Options po, Run run)
        {
            _run                   = run;
            _nStopFlag             = 0;
            _po                    = po;
            _bHasStopped           = false;
            _nCurrentApplicationID = 0;
            _nProfileCount         = 0;

            _run.Messages.AddMessage("Waiting for application...");
        }
Ejemplo n.º 4
0
        public ProfilerSocketServer(Project.Options po, Run run)
        {
            _fsm         = new FunctionSignatureMap();
            _run         = run;
            _tic         = run.ThreadInfoCollection;
            _nStopFlag   = 0;
            _po          = po;
            _bHasStopped = false;

            _run.Messages.AddMessage("Waiting for application...");
        }
Ejemplo n.º 5
0
        /// <summary>
        /// element callback for settings files of version 1.1.0.0
        /// </summary>
        /// <param name="element">element that has been read</param>
        /// <param name="value">value of the xmlelement</param>
        public override void ElementCallback(Element element)
        {
            try
            {
                //-----Metadata
                if (element.Parent != null && element.Parent.Name == "ProjectOptions"
                    && element.Parent.Parent != null && element.Parent.Parent.Name == "GeneralOptions")
                {
                    if (element.Attributes.ContainsKey("identifier"))
                    {
                        Enumerations.ProjectIdentifier identifier = (Enumerations.ProjectIdentifier)Enum.Parse(typeof(Enumerations.ProjectIdentifier), element.Attributes["identifier"]);

                        Project.Options projectOptions = _configuration.ProjectOptions.FirstOrDefault(x => x.Identifier == identifier);

                        if (projectOptions == null)
                        {
                            projectOptions = new Project.Options() { Identifier = identifier };
                            _configuration.ProjectOptions.Add(projectOptions);
                        }

                        if (element.Attributes.ContainsKey("storage"))
                            projectOptions.GeneralOptions.Storage = (Enumerations.SettingsStorage)Enum.Parse(typeof(Enumerations.SettingsStorage), element.Attributes["storage"]);
                        if (element.Attributes.ContainsKey("filename"))
                            projectOptions.GeneralOptions.Filename = element.Attributes["filename"];
                    }
                }
                else if (element.Name == "Increment"
                        && element.Parent != null && element.Parent.Name == "GeneralOptions"
                        && element.Parent.Parent != null && element.Parent.Parent.Name == "ProjectOption")
                {
                    if (element.Parent.Parent.Attributes.ContainsKey("identifier"))
                    {
                        Enumerations.ProjectIdentifier identifier = (Enumerations.ProjectIdentifier)Enum.Parse(typeof(Enumerations.ProjectIdentifier), element.Parent.Parent.Attributes["identifier"]);

                        Project.Options projectOptions = _configuration.ProjectOptions.FirstOrDefault(x => x.Identifier == identifier);

                        if (projectOptions == null)
                        {
                            projectOptions = new Project.Options() { Identifier = identifier };
                            _configuration.ProjectOptions.Add(projectOptions);
                        }

                        if (element.Value != "None")
                            projectOptions.GeneralOptions.VersionComponent = (Common.Definitions.Enumerations.VersionComponent)Enum.Parse(typeof(Common.Definitions.Enumerations.VersionComponent), element.Value);
                    }
                }
                else if (element.Parent != null && element.Parent.Name == "Servers" && element.Name == "Server")
                {
                    General.NuGet.Server server = _configuration.GeneralOptions.NuGetOptions.Servers.FirstOrDefault(x => x.Url == element.Attributes["url"]);

                    if (server == null)
                    {
                        server = new General.NuGet.Server()
                        {
                            Url = element.Attributes["url"],
                            ApiKey = ExtensionManager.Instance.Encryptor.Encrypt(element.Attributes["apiKey"]),
                            IsPreferred = System.Convert.ToBoolean(element.Attributes["isPreferred"]),
                            LastAttemptedDeploy = System.Convert.ToDateTime(element.Attributes["lastAttemptedDeploy"]),
                            LastSuccessfulDeploy = System.Convert.ToDateTime(element.Attributes["lastSuccessfulDeploy"])
                        };

                        _configuration.GeneralOptions.NuGetOptions.Servers.Add(server);
                    }
                    else
                    {
                        server.ApiKey = ExtensionManager.Instance.Encryptor.Encrypt(server.ApiKey);
                    }
                }
            }
            catch (Exception ex)
            {
                LoggingManager.Instance.Logger.Warn(string.Format("could not convert element [{0}] with value [{1}]", element.Name, element.Value), ex);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// element callback for settings files of version 1.1.0.0
        /// </summary>
        /// <param name="element">element that has been read</param>
        /// <param name="value">value of the xmlelement</param>
        public override void ElementCallback(Element element)
        {
            try
            {
                //-----Metadata
                if (element.Parent != null && element.Parent.Name == "ProjectOptions" &&
                    element.Parent.Parent != null && element.Parent.Parent.Name == "GeneralOptions")
                {
                    if (element.Attributes.ContainsKey("identifier"))
                    {
                        Enumerations.ProjectIdentifier identifier = (Enumerations.ProjectIdentifier)Enum.Parse(typeof(Enumerations.ProjectIdentifier), element.Attributes["identifier"]);

                        Project.Options projectOptions = _configuration.ProjectOptions.FirstOrDefault(x => x.Identifier == identifier);

                        if (projectOptions == null)
                        {
                            projectOptions = new Project.Options()
                            {
                                Identifier = identifier
                            };
                            _configuration.ProjectOptions.Add(projectOptions);
                        }

                        if (element.Attributes.ContainsKey("storage"))
                        {
                            projectOptions.GeneralOptions.Storage = (Enumerations.SettingsStorage)Enum.Parse(typeof(Enumerations.SettingsStorage), element.Attributes["storage"]);
                        }
                        if (element.Attributes.ContainsKey("filename"))
                        {
                            projectOptions.GeneralOptions.Filename = element.Attributes["filename"];
                        }
                    }
                }
                else if (element.Name == "Increment" &&
                         element.Parent != null && element.Parent.Name == "GeneralOptions" &&
                         element.Parent.Parent != null && element.Parent.Parent.Name == "ProjectOption")
                {
                    if (element.Parent.Parent.Attributes.ContainsKey("identifier"))
                    {
                        Enumerations.ProjectIdentifier identifier = (Enumerations.ProjectIdentifier)Enum.Parse(typeof(Enumerations.ProjectIdentifier), element.Parent.Parent.Attributes["identifier"]);

                        Project.Options projectOptions = _configuration.ProjectOptions.FirstOrDefault(x => x.Identifier == identifier);

                        if (projectOptions == null)
                        {
                            projectOptions = new Project.Options()
                            {
                                Identifier = identifier
                            };
                            _configuration.ProjectOptions.Add(projectOptions);
                        }

                        if (element.Value != "None")
                        {
                            projectOptions.GeneralOptions.VersionComponent = (Common.Definitions.Enumerations.VersionComponent)Enum.Parse(typeof(Common.Definitions.Enumerations.VersionComponent), element.Value);
                        }
                    }
                }
                else if (element.Parent != null && element.Parent.Name == "Servers" && element.Name == "Server")
                {
                    General.NuGet.Server server = _configuration.GeneralOptions.NuGetOptions.Servers.FirstOrDefault(x => x.Url == element.Attributes["url"]);

                    if (server == null)
                    {
                        server = new General.NuGet.Server()
                        {
                            Url                  = element.Attributes["url"],
                            ApiKey               = ExtensionManager.Instance.Encryptor.Encrypt(element.Attributes["apiKey"]),
                            IsPreferred          = System.Convert.ToBoolean(element.Attributes["isPreferred"]),
                            LastAttemptedDeploy  = System.Convert.ToDateTime(element.Attributes["lastAttemptedDeploy"]),
                            LastSuccessfulDeploy = System.Convert.ToDateTime(element.Attributes["lastSuccessfulDeploy"])
                        };

                        _configuration.GeneralOptions.NuGetOptions.Servers.Add(server);
                    }
                    else
                    {
                        server.ApiKey = ExtensionManager.Instance.Encryptor.Encrypt(server.ApiKey);
                    }
                }
            }
            catch (Exception ex)
            {
                LoggingManager.Instance.Logger.Warn(string.Format("could not convert element [{0}] with value [{1}]", element.Name, element.Value), ex);
            }
        }