public static U50TaskInfo[] LoadTaskSetting( string strTaskFile )
        {
            if ( File.Exists( strTaskFile ) == false )
            {
                if ( U50GlobalSetting.TaskFilePath == strTaskFile )
                    SaveTaskSetting( U50GlobalSetting.TaskFilePath, U50GlobalSetting.TaskInfos );
                else
                    return null;
            }

            XDocument documentConfig = XDocument.Load( strTaskFile );
            if ( documentConfig == null )
                return null;

            XElement elementRoot = documentConfig.Element( (XName)"Demo.Stock" );
            if ( elementRoot == null )
                return null;

            XAttribute attributeVer = elementRoot.Attribute( (XName)"Ver" );
            if ( attributeVer == null )
                return null;

            //////////////////////////////////////////////////////////////////////////
            // <Settings>
            IEnumerable<XElement> elementU50Tasks = elementRoot.Elements( (XName)"U50Task" );
            if ( elementU50Tasks == null )
                return null;

            List<U50TaskInfo> policyInfoList = new List<U50TaskInfo>();
            foreach ( var elementU50Task in elementU50Tasks )
            {
                XAttribute attributeName = elementU50Task.Attribute( (XName)"Name" );
                if ( attributeName == null )
                    continue;

                XAttribute attributeGuid = elementU50Task.Attribute( (XName)"Guid" );
                if ( attributeGuid == null )
                    continue;

                U50TaskInfo taskInfo = new U50TaskInfo();
                taskInfo.Name = attributeName.Value;
                taskInfo.Guid = attributeGuid.Value;

                // U50Task -> General
                XElement elementGeneral = elementU50Task.Element( (XName)"General" );
                if ( elementGeneral == null )
                    continue;
                {
                    XAttribute attributeAutoScan = elementGeneral.Attribute( (XName)"SaneType" );
                    if ( attributeAutoScan == null )
                        continue;
                    else
                        taskInfo.General.SaneType = (U50TaskSaneType)int.Parse( attributeAutoScan.Value );
                }

                // U50Task -> Request
                XElement elementRequest = elementU50Task.Element( (XName)"Request" );
                if ( elementRequest == null )
                    continue;
                {
                    XAttribute attributeSelectType = elementRequest.Attribute( (XName)"SelectType" );
                    if ( attributeSelectType == null )
                        continue;
                    else
                        taskInfo.Request.Select = (U50TaskSelectType)int.Parse( attributeSelectType.Value );

                    XAttribute attributePlate = elementRequest.Attribute( (XName)"Plate" );
                    if ( attributePlate == null )
                        continue;
                    else
                        taskInfo.Request.Plate = attributePlate.Value;

                    XAttribute attributeVariety = elementRequest.Attribute( (XName)"Variety" );
                    if ( attributeVariety == null )
                        continue;
                    else
                        taskInfo.Request.Variety = attributeVariety.Value;

                    // U50Task -> Request -> StockInfo
                    IEnumerable<XElement> elementStockInfo = elementRequest.Elements( (XName)"StockInfo" );
                    if ( elementStockInfo != null )
                    {
                        List<U50StockInfo> stockInfoList = new List<U50StockInfo>();

                        foreach ( var item in elementStockInfo )
                        {
                            U50StockInfo stockInfo = new U50StockInfo();

                            XAttribute attributePlateSub = item.Attribute( (XName)"Plate" );
                            if ( attributePlateSub == null )
                                continue;
                            else
                                stockInfo.Plate = attributePlateSub.Value;

                            XAttribute attributeVarietySub = item.Attribute( (XName)"Variety" );
                            if ( attributeVarietySub == null )
                                continue;
                            else
                                stockInfo.Variety = attributeVarietySub.Value;

                            XAttribute attributeNameSub = item.Attribute( (XName)"Name" );
                            if ( attributeNameSub == null )
                                continue;
                            else
                                stockInfo.Name = attributeNameSub.Value;

                            XAttribute attributeSymbolSub = item.Attribute( (XName)"Symbol" );
                            if ( attributeSymbolSub == null )
                                continue;
                            else
                                stockInfo.Symbol = attributeSymbolSub.Value;

                            stockInfoList.Add( stockInfo );
                        }

                        taskInfo.Request.StockInfo = stockInfoList.ToArray();
                    }
                }

                // U50Task -> Policy
                XElement elementPolicy = elementU50Task.Element( (XName)"Policy" );
                if ( elementPolicy == null )
                    continue;
                {
                    XAttribute attributeScanType = elementPolicy.Attribute( (XName)"ScanType" );
                    if ( attributeScanType == null )
                        continue;
                    else
                        taskInfo.Policy.ScanType = (U50ScanType)int.Parse( attributeScanType.Value );

                    // U50Task -> Policy -> PolicyGuid
                    IEnumerable<XElement> elementPolicyGuid = elementPolicy.Elements( (XName)"PolicyGuid" );
                    if ( elementRequest != null )
                    {
                        List<string> stockPolicyList = new List<string>();

                        foreach ( var item in elementPolicyGuid )
                        {
                            XAttribute attributeNameSub = item.Attribute( (XName)"Guid" );
                            if ( attributeNameSub == null )
                                continue;
                            else
                                stockPolicyList.Add( attributeNameSub.Value );
                        }

                        taskInfo.Policy.PolicyGuid = stockPolicyList.ToArray();
                    }
                }

                // U50Task -> Result
                XElement elementResult = elementU50Task.Element( (XName)"Result" );
                if ( elementResult == null )
                    continue;
                {
                    // U50Task -> Request -> LastReportGuid
                    XAttribute attributeLastReportGuid = elementResult.Attribute( (XName)"LastReportGuid" );
                    if ( attributeLastReportGuid == null )
                        continue;
                    else
                        taskInfo.Result.LastReportGuid = attributeLastReportGuid.Value;
                }

                policyInfoList.Add( taskInfo );
            }

            return policyInfoList.ToArray();
        }
        public static U50ReportInfo[] LoadReports( string strTaskGuid )
        {
            U50ReportInfo[] reportInfos = new U50ReportInfo[0];

            if ( File.Exists( strTaskGuid ) == false )
                SaveReport( U50GlobalSetting.TaskFilePath, reportInfos );

            XDocument documentConfig = XDocument.Load( strTaskGuid );
            if ( documentConfig == null )
                return null;

            XElement elementRoot = documentConfig.Element( (XName)"Demo.Stock" );
            if ( elementRoot == null )
                return null;

            XAttribute attributeVer = elementRoot.Attribute( (XName)"Ver" );
            if ( attributeVer == null )
                return null;

            //////////////////////////////////////////////////////////////////////////
            // <Settings>
            IEnumerable<XElement> elementU50Reports = elementRoot.Elements( (XName)"U50Report" );
            if ( elementU50Reports == null )
                return null;

            List<U50ReportInfo> reportInfoList = new List<U50ReportInfo>();
            foreach ( var elementU50Task in elementU50Reports )
            {
                XAttribute attributeGuid = elementU50Task.Attribute( (XName)"Guid" );
                if ( attributeGuid == null )
                    continue;

                XAttribute attributeScanTime = elementU50Task.Attribute( (XName)"ScanTime" );
                if ( attributeScanTime == null )
                    continue;

                XAttribute attributeScanSpan = elementU50Task.Attribute( (XName)"ScanSpan" );
                if ( attributeScanSpan == null )
                    continue;

                U50ReportInfo reportInfo = new U50ReportInfo();
                reportInfo.Guid = attributeGuid.Value;
                reportInfo.ScanTime = DateTime.Parse( attributeScanTime.Value );
                reportInfo.ScanSpan = TimeSpan.Parse( attributeScanSpan.Value );

                XElement elementTask = elementU50Task.Element( (XName)"Task" );
                if ( elementTask == null )
                    continue;
                {
                    XAttribute attributeName = elementU50Task.Attribute( (XName)"Name" );
                    if ( attributeName == null )
                        continue;

                    XAttribute attributeGuid1 = elementU50Task.Attribute( (XName)"Guid" );
                    if ( attributeGuid1 == null )
                        continue;

                    U50TaskInfo taskInfo = new U50TaskInfo();
                    taskInfo.Name = attributeName.Value;
                    taskInfo.Guid = attributeGuid1.Value;

                    // U50Task -> General
                    XElement elementGeneral = elementU50Task.Element( (XName)"General" );
                    if ( elementGeneral == null )
                        continue;
                    {
                        XAttribute attributeAutoScan = elementGeneral.Attribute( (XName)"SaneType" );
                        if ( attributeAutoScan == null )
                            continue;
                        else
                            taskInfo.General.SaneType = (U50TaskSaneType)int.Parse( attributeAutoScan.Value );
                    }

                    // U50Task -> Request
                    XElement elementRequest = elementU50Task.Element( (XName)"Request" );
                    if ( elementRequest == null )
                        continue;
                    {
                        XAttribute attributeSelectType = elementRequest.Attribute( (XName)"SelectType" );
                        if ( attributeSelectType == null )
                            continue;
                        else
                            taskInfo.Request.Select = (U50TaskSelectType)int.Parse( attributeSelectType.Value );

                        XAttribute attributePlate = elementRequest.Attribute( (XName)"Plate" );
                        if ( attributePlate == null )
                            continue;
                        else
                            taskInfo.Request.Plate = attributePlate.Value;

                        XAttribute attributeVariety = elementRequest.Attribute( (XName)"Variety" );
                        if ( attributeVariety == null )
                            continue;
                        else
                            taskInfo.Request.Variety = attributeVariety.Value;

                        // U50Task -> Request -> StockInfo
                        IEnumerable<XElement> elementStockInfo = elementRequest.Elements( (XName)"StockInfo" );
                        if ( elementStockInfo == null )
                            continue;
                        {
                            List<U50StockInfo> stockInfoList = new List<U50StockInfo>();

                            foreach ( var item in elementStockInfo )
                            {
                                U50StockInfo stockInfo = new U50StockInfo();

                                XAttribute attributePlateSub = item.Attribute( (XName)"Plate" );
                                if ( attributePlateSub == null )
                                    continue;
                                else
                                    stockInfo.Variety = attributeVariety.Value;

                                XAttribute attributeVarietySub = item.Attribute( (XName)"Variety" );
                                if ( attributeVarietySub == null )
                                    continue;
                                else
                                    stockInfo.Variety = attributeVariety.Value;

                                XAttribute attributeNameSub = item.Attribute( (XName)"Name" );
                                if ( attributeNameSub == null )
                                    continue;
                                else
                                    stockInfo.Name = attributeVariety.Value;

                                XAttribute attributeSymbolSub = item.Attribute( (XName)"Symbol" );
                                if ( attributeSymbolSub == null )
                                    continue;
                                else
                                    stockInfo.Symbol = attributeVariety.Value;

                                stockInfoList.Add( stockInfo );
                            }

                            taskInfo.Request.StockInfo = stockInfoList.ToArray();
                        }
                    }

                    // U50Task -> Policy
                    XElement elementPolicy = elementU50Task.Element( (XName)"Policy" );
                    if ( elementPolicy == null )
                        continue;
                    {
                        XAttribute attributeScanType = elementPolicy.Attribute( (XName)"ScanType" );
                        if ( attributeScanType == null )
                            continue;
                        else
                            taskInfo.Policy.ScanType = (U50ScanType)int.Parse( attributeScanType.Value );

                        // U50Task -> Policy -> PolicyGuid
                        IEnumerable<XElement> elementPolicyGuid = elementPolicy.Elements( (XName)"PolicyGuid" );
                        if ( elementRequest == null )
                            continue;
                        {
                            List<string> stockPolicyList = new List<string>();

                            foreach ( var item in elementPolicyGuid )
                            {
                                XAttribute attributeNameSub = item.Attribute( (XName)"Guid" );
                                if ( attributeNameSub == null )
                                    continue;
                                else
                                    stockPolicyList.Add( attributeNameSub.Value );
                            }

                            taskInfo.Policy.PolicyGuid = stockPolicyList.ToArray();
                        }
                    }

                    // U50Task -> Result
                    XElement elementResult = elementU50Task.Element( (XName)"Result" );
                    if ( elementResult == null )
                        continue;
                    {
                        // U50Task -> Request -> LastReportGuid
                        XAttribute attributeStockInfo = elementResult.Attribute( (XName)"LastReportGuid" );
                        if ( attributeStockInfo == null )
                            continue;
                        else
                            taskInfo.Result.LastReportGuid = attributeStockInfo.Value;
                    }

                    reportInfo.StaticTaskInfo = taskInfo;
                }

                IEnumerable<XElement> elementPolicyInfo = elementU50Task.Elements( (XName)"PolicyInfo" );
                if ( elementPolicyInfo == null )
                    continue;
                {
                    List<U50PolicyInfo> rolicyInfo = new List<U50PolicyInfo>();
                    foreach ( var item in elementPolicyInfo )
                    {
                        XAttribute attributeName = item.Attribute( (XName)"Name" );
                        if ( attributeName == null )
                            continue;

                        XAttribute attributeGuid11 = item.Attribute( (XName)"Guid" );
                        if ( attributeGuid11 == null )
                            continue;

                        U50PolicyInfo policyInfo = new U50PolicyInfo { Name = attributeName.Value, Guid = attributeGuid11.Value };

                        // U50Policy -> Policy
                        XElement elementPolicy = item.Element( (XName)"Policy" );
                        if ( elementPolicy == null )
                            continue;

                        // U50Policy -> Policy -> DateTime
                        XElement elementDateTime = elementPolicy.Element( (XName)"DateTime" );
                        if ( elementDateTime == null )
                            continue;
                        {
                            XAttribute attributeIsDateNow = elementDateTime.Attribute( (XName)"IsDateNow" );
                            if ( attributeIsDateNow == null )
                                continue;
                            else
                                policyInfo.Policy.IsDateNow = bool.Parse( attributeIsDateNow.Value );

                            XAttribute attributeKN = elementDateTime.Attribute( (XName)"KN" );
                            if ( attributeKN == null )
                                continue;
                            else
                                policyInfo.Policy.KN = uint.Parse( attributeKN.Value );

                            XAttribute attributeDate = elementDateTime.Attribute( (XName)"Date" );
                            if ( attributeDate == null )
                                continue;
                            else
                                policyInfo.Policy.DateSelect = DateTime.Parse( attributeDate.Value );
                        }

                        // U50Policy -> Policy -> ExOption
                        XElement elementExOption = elementPolicy.Element( (XName)"ExOption" );
                        if ( elementExOption == null )
                            continue;
                        {
                            XAttribute attributePriority = elementExOption.Attribute( (XName)"Priority" );
                            if ( attributePriority == null )
                                continue;
                            else
                                policyInfo.Policy.Priority = (U50PriorityType)int.Parse( attributePriority.Value );

                            XAttribute attributeOutput = elementExOption.Attribute( (XName)"Output" );
                            if ( attributeOutput == null )
                                continue;
                            else
                                policyInfo.Policy.Output = (U50OutputType)int.Parse( attributeOutput.Value );

                            // U50Policy -> Policy -> ExOption -> Date
                            XElement elementDate = elementExOption.Element( (XName)"Date" );
                            if ( elementDate == null )
                                continue;
                            {
                                XAttribute attributeDateAllow = elementDate.Attribute( (XName)"Allow" );
                                if ( attributeDateAllow == null )
                                    continue;
                                else
                                    policyInfo.Policy.IsAllowDate = bool.Parse( attributeDateAllow.Value );

                                XAttribute attributeDateStep = elementDate.Attribute( (XName)"Step" );
                                if ( attributeDateStep == null )
                                    continue;
                                else
                                    policyInfo.Policy.DateStep = uint.Parse( attributeDateStep.Value );

                                XAttribute attributeDateEnd = elementDate.Attribute( (XName)"End" );
                                if ( attributeDateEnd == null )
                                    continue;
                                else
                                    policyInfo.Policy.DateEnd = DateTime.Parse( attributeDateEnd.Value );
                            }

                            // U50Policy -> Policy -> ExOption -> KN
                            XElement elementKN = elementExOption.Element( (XName)"KN" );
                            if ( elementKN == null )
                                continue;
                            {
                                XAttribute attributeKNAllow = elementKN.Attribute( (XName)"Allow" );
                                if ( attributeKNAllow == null )
                                    continue;
                                else
                                    policyInfo.Policy.IsAllowKN = bool.Parse( attributeKNAllow.Value );

                                XAttribute attributeKNStep = elementKN.Attribute( (XName)"Step" );
                                if ( attributeKNStep == null )
                                    continue;
                                else
                                    policyInfo.Policy.KNStep = uint.Parse( attributeKNStep.Value );

                                XAttribute attributeKNEnd = elementKN.Attribute( (XName)"End" );
                                if ( attributeKNEnd == null )
                                    continue;
                                else
                                    policyInfo.Policy.KNEnd = uint.Parse( attributeKNEnd.Value );
                            }
                        }

                        // U50Policy -> Filtrate
                        XElement elementFiltrate = item.Element( (XName)"Filtrate" );
                        if ( elementFiltrate == null )
                            continue;
                        {
                            // U50Policy -> Filtrate -> PDU
                            XElement elementPDU = elementFiltrate.Element( (XName)"PDU" );
                            if ( elementPDU == null )
                                continue;
                            {
                                XAttribute attributePDUEnabled = elementPDU.Attribute( (XName)"Enabled" );
                                if ( attributePDUEnabled == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.PDU.Enabled = bool.Parse( attributePDUEnabled.Value );

                                XAttribute attributePDUSelect = elementPDU.Attribute( (XName)"Select" );
                                if ( attributePDUSelect == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.PDU.Select = (U50SelectType)int.Parse( attributePDUSelect.Value );

                                XAttribute attributePDUBig = elementPDU.Attribute( (XName)"Big" );
                                if ( attributePDUBig == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.PDU.Big = float.Parse( attributePDUBig.Value );

                                XAttribute attributePDUSmall = elementPDU.Attribute( (XName)"Small" );
                                if ( attributePDUSmall == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.PDU.Small = float.Parse( attributePDUSmall.Value );
                            }

                            // U50Policy -> Filtrate -> PCU
                            XElement elementPCU = elementFiltrate.Element( (XName)"PCU" );
                            if ( elementPCU == null )
                                continue;
                            {
                                XAttribute attributePCUEnabled = elementPCU.Attribute( (XName)"Enabled" );
                                if ( attributePCUEnabled == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.PCU.Enabled = bool.Parse( attributePCUEnabled.Value );

                                XAttribute attributePCUSelect = elementPCU.Attribute( (XName)"Select" );
                                if ( attributePCUSelect == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.PCU.Select = (U50SelectType)int.Parse( attributePCUSelect.Value );

                                XAttribute attributePCUBig = elementPCU.Attribute( (XName)"Big" );
                                if ( attributePCUBig == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.PCU.Big = float.Parse( attributePCUBig.Value );

                                XAttribute attributePCUSmall = elementPCU.Attribute( (XName)"Small" );
                                if ( attributePCUSmall == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.PCU.Small = float.Parse( attributePCUSmall.Value );
                            }

                            // U50Policy -> Filtrate -> TDU
                            XElement elementTDU = elementFiltrate.Element( (XName)"TDU" );
                            if ( elementTDU == null )
                                continue;
                            {
                                XAttribute attributeTDUEnabled = elementTDU.Attribute( (XName)"Enabled" );
                                if ( attributeTDUEnabled == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.TDU.Enabled = bool.Parse( attributeTDUEnabled.Value );

                                XAttribute attributeTDUSelect = elementTDU.Attribute( (XName)"Select" );
                                if ( attributeTDUSelect == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.TDU.Select = (U50SelectType)int.Parse( attributeTDUSelect.Value );

                                XAttribute attributeTDUBig = elementTDU.Attribute( (XName)"Big" );
                                if ( attributeTDUBig == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.TDU.Big = float.Parse( attributeTDUBig.Value );

                                XAttribute attributeTDUSmall = elementTDU.Attribute( (XName)"Small" );
                                if ( attributeTDUSmall == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.TDU.Small = float.Parse( attributeTDUSmall.Value );
                            }

                            // U50Policy -> Filtrate -> TCD
                            XElement elementTCD = elementFiltrate.Element( (XName)"TCD" );
                            if ( elementTCD == null )
                                continue;
                            {
                                XAttribute attributeTCDEnabled = elementTCD.Attribute( (XName)"Enabled" );
                                if ( attributeTCDEnabled == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.TCD.Enabled = bool.Parse( attributeTCDEnabled.Value );

                                XAttribute attributeTCDSelect = elementTCD.Attribute( (XName)"Select" );
                                if ( attributeTCDSelect == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.TCD.Select = (U50SelectType)int.Parse( attributeTCDSelect.Value );

                                XAttribute attributeTCDBig = elementTCD.Attribute( (XName)"Big" );
                                if ( attributeTCDBig == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.TCD.Big = float.Parse( attributeTCDBig.Value );

                                XAttribute attributeTCDSmall = elementTCD.Attribute( (XName)"Small" );
                                if ( attributeTCDSmall == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.TCD.Small = float.Parse( attributeTCDSmall.Value );
                            }

                            // U50Policy -> Filtrate -> TBU
                            XElement elementTBU = elementFiltrate.Element( (XName)"TBU" );
                            if ( elementTBU == null )
                                continue;
                            {
                                XAttribute attributeTCUEnabled = elementTBU.Attribute( (XName)"Enabled" );
                                if ( attributeTCUEnabled == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.TBU.Enabled = bool.Parse( attributeTCUEnabled.Value );

                                XAttribute attributeTCUSelect = elementTBU.Attribute( (XName)"Select" );
                                if ( attributeTCUSelect == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.TBU.Select = (U50SelectType)int.Parse( attributeTCUSelect.Value );

                                XAttribute attributeTCUBig = elementTBU.Attribute( (XName)"Big" );
                                if ( attributeTCUBig == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.TBU.Big = float.Parse( attributeTCUBig.Value );

                                XAttribute attributeTCUSmall = elementTBU.Attribute( (XName)"Small" );
                                if ( attributeTCUSmall == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.TBU.Small = float.Parse( attributeTCUSmall.Value );
                            }

                            // U50Policy -> Filtrate -> Vac-UC
                            XElement elementVacUC = elementFiltrate.Element( (XName)"Vac-UC" );
                            if ( elementVacUC == null )
                                continue;
                            {
                                XAttribute attributeVacUCEnabled = elementVacUC.Attribute( (XName)"Enabled" );
                                if ( attributeVacUCEnabled == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.VacUC.Enabled = bool.Parse( attributeVacUCEnabled.Value );

                                XAttribute attributeVacUCSelect = elementVacUC.Attribute( (XName)"Select" );
                                if ( attributeVacUCSelect == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.VacUC.Select = (U50SelectType)int.Parse( attributeVacUCSelect.Value );

                                XAttribute attributeVacUCBig = elementVacUC.Attribute( (XName)"Big" );
                                if ( attributeVacUCBig == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.VacUC.Big = float.Parse( attributeVacUCBig.Value );

                                XAttribute attributeVacUCSmall = elementVacUC.Attribute( (XName)"Small" );
                                if ( attributeVacUCSmall == null )
                                    continue;
                                else
                                    policyInfo.Filtrate.VacUC.Small = float.Parse( attributeVacUCSmall.Value );
                            }
                        }

                        // U50Policy -> Extend
                        XElement elementExtend = item.Element( (XName)"Extend" );
                        if ( elementExtend == null )
                            continue;
                        {
                            // U50Policy -> Extend -> Info01
                            XElement elementInfo01 = elementExtend.Element( (XName)"Info01" );
                            if ( elementInfo01 == null )
                                continue;
                            {
                                XAttribute attributeInfo01Enabled = elementInfo01.Attribute( (XName)"Enabled" );
                                if ( attributeInfo01Enabled == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info01.Enabled = bool.Parse( attributeInfo01Enabled.Value );

                                XAttribute attributeInfo01Select = elementInfo01.Attribute( (XName)"Select" );
                                if ( attributeInfo01Select == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info01.Select = (U50ExtendInfo01Type)int.Parse( attributeInfo01Select.Value );

                                XAttribute attributeInfo01Big = elementInfo01.Attribute( (XName)"HighNumber" );
                                if ( attributeInfo01Big == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info01.HighNumber = int.Parse( attributeInfo01Big.Value );
                            }

                            // U50Policy -> Extend -> Info02
                            XElement elementInfo02 = elementExtend.Element( (XName)"Info02" );
                            if ( elementInfo02 == null )
                                continue;
                            {
                                XAttribute attributeInfo02Enabled = elementInfo02.Attribute( (XName)"Enabled" );
                                if ( attributeInfo02Enabled == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info02.Enabled = bool.Parse( attributeInfo02Enabled.Value );

                                XAttribute attributeInfo02Select = elementInfo02.Attribute( (XName)"Select" );
                                if ( attributeInfo02Select == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info02.Select = (U50SelectType)int.Parse( attributeInfo02Select.Value );

                                XAttribute attributeInfo02Big = elementInfo02.Attribute( (XName)"Big" );
                                if ( attributeInfo02Big == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info02.Big = long.Parse( attributeInfo02Big.Value );

                                XAttribute attributeInfo02Small = elementInfo02.Attribute( (XName)"Small" );
                                if ( attributeInfo02Small == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info02.Small = long.Parse( attributeInfo02Small.Value );
                            }

                            // U50Policy -> Extend -> Info03
                            XElement elementInfo03 = elementExtend.Element( (XName)"Info03" );
                            if ( elementInfo03 == null )
                                continue;
                            {
                                XAttribute attributeInfo03Enabled = elementInfo03.Attribute( (XName)"Enabled" );
                                if ( attributeInfo03Enabled == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info03.Enabled = bool.Parse( attributeInfo03Enabled.Value );

                                XAttribute attributeInfo03Select = elementInfo03.Attribute( (XName)"Select" );
                                if ( attributeInfo03Select == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info03.Select = (U50SelectType)int.Parse( attributeInfo03Select.Value );

                                XAttribute attributeInfo03Big = elementInfo03.Attribute( (XName)"Big" );
                                if ( attributeInfo03Big == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info03.Big = int.Parse( attributeInfo03Big.Value );

                                XAttribute attributeInfo03Small = elementInfo03.Attribute( (XName)"Small" );
                                if ( attributeInfo03Small == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info03.Small = int.Parse( attributeInfo03Small.Value );
                            }

                            // U50Policy -> Extend -> Info04
                            XElement elementInfo04 = elementExtend.Element( (XName)"Info04" );
                            if ( elementInfo04 == null )
                                continue;
                            {
                                XAttribute attributeInfo04Enabled = elementInfo04.Attribute( (XName)"Enabled" );
                                if ( attributeInfo04Enabled == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info04.Enabled = bool.Parse( attributeInfo04Enabled.Value );

                                XAttribute attributeInfo04Select = elementInfo04.Attribute( (XName)"Select" );
                                if ( attributeInfo04Select == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info04.Select = (U50ExtendInfo04Type)int.Parse( attributeInfo04Select.Value );
                            }

                            // U50Policy -> Extend -> Info05
                            XElement elementInfo05 = elementExtend.Element( (XName)"Info05" );
                            if ( elementInfo05 == null )
                                continue;
                            {
                                XAttribute attributeInfo05Enabled = elementInfo05.Attribute( (XName)"Enabled" );
                                if ( attributeInfo05Enabled == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info05.Enabled = bool.Parse( attributeInfo05Enabled.Value );

                                XAttribute attributeInfo05Select = elementInfo05.Attribute( (XName)"Select" );
                                if ( attributeInfo05Select == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info05.Select = (U50SelectType)int.Parse( attributeInfo05Select.Value );

                                XAttribute attributeInfo05Big = elementInfo05.Attribute( (XName)"Big" );
                                if ( attributeInfo05Big == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info05.Big = int.Parse( attributeInfo05Big.Value );

                                XAttribute attributeInfo05Small = elementInfo05.Attribute( (XName)"Small" );
                                if ( attributeInfo05Small == null )
                                    continue;
                                else
                                    policyInfo.Extend.Info05.Small = int.Parse( attributeInfo05Small.Value );
                            }
                        }

                        rolicyInfo.Add( policyInfo );
                    }

                    reportInfo.StaticReportInfo = rolicyInfo.ToArray();
                }

                IEnumerable<XElement> elementReportInfo = elementU50Task.Elements( (XName)"ReportInfo" );
                if ( elementReportInfo == null )
                    continue;
                {
                    List<U50Report> reportList = new List<U50Report>();
                    foreach ( var item in elementReportInfo )
                    {
                        U50Report report = new U50Report();

                        XAttribute attributeName = item.Attribute( (XName)"Name" );
                        if ( attributeName == null )
                            continue;
                        else
                            report.Name = attributeName.Value;

                        XAttribute attributeSymbol = item.Attribute( (XName)"Symbol" );
                        if ( attributeSymbol == null )
                            continue;
                        else
                            report.Symbol = attributeSymbol.Value;

                        //XAttribute attributeS_Date = item.Attribute( (XName)"S_Date" );
                        //if ( attributeS_Date == null )
                        //    continue;
                        //else
                        //    report.S_Date = DateTime.Parse( attributeS_Date.Value );

                        //XAttribute attributeVa_U50 = item.Attribute( (XName)"Va_U50" );
                        //if ( attributeVa_U50 == null )
                        //    continue;
                        //else
                        //    report.Va_U50 = int.Parse( attributeVa_U50.Value );

                        //XAttribute attributeVsc = item.Attribute( (XName)"Vsc" );
                        //if ( attributeVsc == null )
                        //    continue;
                        //else
                        //    report.Vsc = int.Parse( attributeVsc.Value );

                        //XAttribute attributeClose = item.Attribute( (XName)"Close" );
                        //if ( attributeClose == null )
                        //    continue;
                        //else
                        //    report.Close = int.Parse( attributeClose.Value );

                        //XAttribute attributeScanner = item.Attribute( (XName)"Scanner" );
                        //if ( attributeScanner == null )
                        //    continue;
                        //else
                        //    report.Scanner = attributeScanner.Value;

                        //XAttribute attributeQ_U50 = item.Attribute( (XName)"Q_U50" );
                        //if ( attributeQ_U50 == null )
                        //    continue;
                        //else
                        //    report.Q_U50 = int.Parse( attributeQ_U50.Value );

                        //XAttribute attributeKLineNumber = item.Attribute( (XName)"KLineNumber" );
                        //if ( attributeKLineNumber == null )
                        //    continue;
                        //else
                        //    report.KLineNumber = int.Parse( attributeKLineNumber.Value );

                        XAttribute attributeScanTime1 = item.Attribute( (XName)"ScanTime" );
                        if ( attributeScanTime1 == null )
                            continue;
                        else
                            report.ScanTime = DateTime.Parse( attributeScanTime1.Value );

                        XAttribute attributeScanSpan1 = item.Attribute( (XName)"ScanSpan" );
                        if ( attributeScanSpan1 == null )
                            continue;
                        else
                            report.ScanSpan = TimeSpan.Parse( attributeScanSpan1.Value );

                        reportList.Add( report );
                    }

                    reportInfo.ReportArray = reportList.ToArray();
                }

                reportInfoList.Add( reportInfo );
            }

            return reportInfos;
        }