Esempio n. 1
0
        public DeveloperLogEvent Clone()
        {
            var clone = (DeveloperLogEvent)MemberwiseClone();

            clone.GrpcErrorDetails               = GrpcErrorDetails?.Clone();
            clone.ExternalToolError              = ExternalToolError?.Clone();
            clone.CommandData                    = CommandData?.Clone();
            clone.GameletData                    = GameletData?.Clone();
            clone.GrpcCallDetails                = GrpcCallDetails?.Select(x => x.Clone()).ToList();
            clone.LoadSymbolData                 = LoadSymbolData?.Clone();
            clone.DebugPreflightCheckData        = DebugPreflightCheckData?.Clone();
            clone.DebugSessionEndData            = DebugSessionEndData?.Clone();
            clone.DebugEventBatch                = DebugEventBatch?.Clone();
            clone.DebugParameters                = DebugParameters?.Clone();
            clone.CopyExecutable                 = CopyExecutable?.Clone();
            clone.CopyLldbServer                 = CopyLldbServer?.Clone();
            clone.CustomCommand                  = CustomCommand?.Clone();
            clone.ExceptionsData                 = ExceptionsData?.Select(x => x.Clone()).ToList();
            clone.BoundBreakpointsData           = BoundBreakpointsData?.Clone();
            clone.GameLaunchData                 = GameLaunchData?.Clone();
            clone.DebugExpressionEvaluationBatch = DebugExpressionEvaluationBatch?.Clone();
            return(clone);
        }
        public bool Load(string fileName)
        {
            if (File.Exists(fileName) == false) return false;
            bool bSuccess = false;

            XmlReaderSettings settings = new XmlReaderSettings();
            using (var reader = XmlReader.Create(fileName, settings))
            {
                TaskData task = new TaskData();
                CommandData command = new CommandData();
                bool bTaskData = false;
                bool bCommandData = false;
                bool bOptionData = false;
                while (reader.Read())
                {
                    if (reader.NodeType == XmlNodeType.Element)
                    {
                        if (reader.Name == "TaskData")
                        {
                            bTaskData = true;
                        }
                        if (reader.Name == "CommandData")
                        {
                            bCommandData = true;
                        }
                        if (reader.Name == "OptionData")
                        {
                            bOptionData = true;
                        }
                        if (bCommandData)
                        {
                            command.XmlReader(reader);
                        }
                        else if (bTaskData)
                        {
                            task.XmlReader(reader);
                        }
                        else if (bOptionData)
                        {
                            //一旦仮バッファにいれるべきか?
                            OptionData.GetInstance().XmlReader(reader);
                        }
                    }
                    else if (reader.NodeType == XmlNodeType.EndElement)
                    {
                        if (reader.Name == "TaskData")
                        {
                            this.SaveData.TaskList.Add((TaskData)task.Clone());
                            //初期化。コンストラクタと同一化するのがベター
                            task.CommandDataList.Clear();
                            bTaskData = false;
                        }
                        if (reader.Name == "CommandData")
                        {
                            task.CommandDataList.Add((CommandData)command.Clone());
                            bCommandData = false;
                        }
                    }
                }
            }
            bSuccess = true;
            return bSuccess;
        }