Example #1
0
 /// <summary>
 /// 绑定临时任务和最终任务信息
 /// </summary>
 /// <param name="item"></param>
 private void GetTempInfo(NDCItem item)
 {
     try
     {
         if (item._mTask.TASKID != 0)
         {
             try
             {
                 AGVMagicUpdate?.Invoke(item._mTask.TASKID, item.CarrierId + "", item.Magic);
                 return;
             }
             catch (Exception e)
             {
                 Console.WriteLine(e.Message);
             }
         }
         if (item._mTask.NDCLOADSITE == null)
         {
             return;
         }
         TempItem tempItem = TempList.Find(c => { return(c.NdcLoadSite == item._mTask.NDCLOADSITE); });
         if (tempItem != null)
         {
             item._mTask.TASKID          = tempItem.TaskID;
             item._mTask.LOADSITE        = tempItem.LoadSite;
             item._mTask.UNLOADSITE      = tempItem.UnloadSite;
             item._mTask.REDIRECTSITE    = tempItem.RedirectSite;
             item._mTask.NDCREDIRECTSITE = tempItem.NdcRedirectSite;
             TempList.Remove(tempItem);
         }
     }catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
 }
Example #2
0
    protected override void AtDidRegister(Unit unit)
    {
        unit.parts.bodyParts.Setup(unit);

        using (var colls = TempList <Collider> .Get())
        {
            unit.parts.bodyParts.GetAttachedColliders(colls.buffer);

            for (int i = 0; i < colls.Count; i++)
            {
                Collider coll = colls[i];
                collToUnit[coll] = unit;
            }
        }

        if (unit.parts.weaponPrefabs.Count > 0)
        {
            List <Weapon> tempWeaponPfs = unit.parts.weaponPrefabs;
            unit.manState.weaponData.weapons = new List <Weapon>(tempWeaponPfs.Count);

            for (int i = 0; i < tempWeaponPfs.Count; i++)
            {
                Weapon tempWeapon = Instantiate(tempWeaponPfs[i]);
                unit.manState.weaponData.weapons.Add(tempWeapon);
            }

            SetWeapon(unit, unit.manState.weaponData.weapons[unit.manState.weaponData.weaponIndex]);
        }
    }
        /// <summary>
        /// Updates the data for this node and triggers updates for any connected output nodes.
        /// </summary>
        internal override void Update()
        {
            var childFolderArrays = GetInputValues(nameof(_childFolders), new object[] { _childFolders })
                                    .OfType <FolderRef[]>()
                                    .ToArray();

            TempList.Clear();

            for (var i = 0; i < childFolderArrays.Length; i++)
            {
                var childFolderArray = childFolderArrays[i];
                for (var j = 0; j < childFolderArray.Length; j++)
                {
                    var childFolderRef = childFolderArray[j];
                    var newFolderRef   = new FolderRef
                    {
                        FolderName = Path.Combine(COCEditorConstants.ASSET_ROOT, childFolderRef.FolderName),
                        ShouldGenerateCodeToGetPath = childFolderRef.ShouldGenerateCodeToGetPath
                    };
                    TempList.Add(newFolderRef);
                }
            }

            TempList.Sort();

            _outputFolders = TempList.ToArray();

            // Make base call to trigger update on all output ports
            base.Update();
        }
Example #4
0
    public void Spawn()
    {
        if (instantiated != null || isSpawning)
        {
            return;
        }

        NestedPrefab rootParent = FindRootNested(this);

        if (rootParent != null && rootParent != this)
        {
            rootParent.Spawn();
            return;
        }

        isSpawning = true;

        //Dbg.LogRelease(this, "Spawning from {0}", this);

        using (var previouslyInstantiated = TempList <GameObject> .Get())
        {
            WalkRecursive(transform, previouslyInstantiated.buffer);
        }

        isSpawning = false;
    }
        public void Foo()
        {
            var xs = new TempList <int>(6);

            xs.Add(10);
            xs.Add(20);
            xs.Add(30);
            xs.Add(40);
            xs.Add(50);

            xs.AsSpan().SequenceEqual(new[] { 10, 20, 30, 40, 50 }).Should().BeTrue();

            xs.Dispose();

            var ys = new TempList <int>(3);

            foreach (var item in Enumerable.Range(1, 100))
            {
                ys.Add(item);
            }

            ys.AsSpan().SequenceEqual(Enumerable.Range(1, 100).ToArray()).Should().BeTrue();

            ys.Dispose();
        }
Example #6
0
    private static bool Resurrect(out TempList <T> twl)
    {
        TempList <T> tempList;

        if (TempList <T> .dumpCount == 0)
        {
            twl = null;
            return(false);
        }
        twl = TempList <T> .dump;
        int num = TempList <T> .dumpCount - 1;

        TempList <T> .dumpCount = num;
        if (num != 0)
        {
            tempList = twl.prev;
        }
        else
        {
            tempList = null;
        }
        TempList <T> .dump = tempList;
        twl.inDump         = false;
        twl.prev           = null;
        return(true);
    }
Example #7
0
    public void Remove(List <T> dynEnums)
    {
        using (var newNames = TempList <string> .Get())
        {
            newNames.buffer.AddRange(dynEnumNames);

            for (int i = 0; i < dynEnums.Count; ++i)
            {
                T dynEnum = dynEnums[i];

                for (int ti = newNames.Count - 1; ti >= 0; --ti)
                {
                    if (dynEnum.name == newNames[ti])
                    {
                        newNames.buffer.RemoveAt(ti);
                        break;
                    }
                }
            }

            if (newNames.Count != dynEnumNames.Length)
            {
                dynEnumNames = newNames.buffer.ToArray();
            }
        }
    }
Example #8
0
        public TempList <AttributeVariable> GetAttributeVariables(IAttributeProvider attributeProvider)
        {
            var list = TempList <AttributeVariable> .Alloc();

            if (Attributes != null && Attributes.Length > 0)
            {
                switch (Type)
                {
                case AttributeSetType.NORMAL:
                    foreach (AttributeMetadata attribute in Attributes)
                    {
                        AttributeVariable v = new AttributeVariable((int)attribute.Type, new AttributeValue(attribute.ModifyType, attribute.Value));
                        list.Add(v);
                    }
                    break;

                case AttributeSetType.CHANGE:
                    AttributeVariable variable = attributeProvider.GetAttributeVariable((int)ChangeType);
                    if (!variable.Value.Value1.IsZero())
                    {
                        double d = variable.Value.Value1 / ChangeValue;
                        foreach (AttributeMetadata attribute in Attributes)
                        {
                            AttributeVariable v = new AttributeVariable((int)attribute.Type, new AttributeValue(AttributeModifyType.ABSOLUTE, attribute.Value * d));
                            list.Add(v);
                        }
                    }
                    break;
                }
            }
            return(list);
        }
        public static GameObject[] FindGameObjectsWithMultiTagSlow(string tag)
        {
            if (tag == SPConstants.TAG_MULTITAG)
            {
                return(GameObject.FindGameObjectsWithTag(SPConstants.TAG_MULTITAG));
            }
            else
            {
                using (var tmp = TempList <GameObject> .GetList())
                {
                    foreach (var go in GameObject.FindGameObjectsWithTag(tag))
                    {
                        tmp.Add(go);
                    }

                    foreach (var m in GameObject.FindObjectsOfType <MultiTag>())
                    {
                        if (m.HasTag(tag))
                        {
                            tmp.Add(m.gameObject);
                        }
                    }

                    return(tmp.ToArray());
                }
            }
        }
Example #10
0
        public IWork BootLoad()
        {
            if (state == ManagerState.INIT)
            {
                state = ManagerState.BOOT_LOADING;
                var loaders = TempList <IWork> .Alloc();

                var loader = DoLoad();
                if (loader != null)
                {
                    loaders.Add(loader);
                }

                foreach (var module in modules.Values)
                {
                    var work = module.Load();
                    if (work != null)
                    {
                        loaders.Add(work);
                    }
                }
                if (loaders.Count > 0)
                {
                    return(bootLoader = new ParallelWork("", loaders));
                }
            }

            return(null);
        }
Example #11
0
        public void setValues(ref T element, int lenght)
        {
            //MessageBox.Show("El largo de la lista recibida es : " + lenght);

            TempList.Add(element);
            //MessageBox.Show("Se agregado en genericList el valor : " + element);
        }
Example #12
0
    public void Add(List <T> dynEnums)
    {
        using (var newNames = TempList <string> .Get())
        {
            for (int i = 0; i < dynEnumNames.Length; ++i)
            {
                newNames.Add(dynEnumNames[i]);
            }

            for (int i = 0; i < dynEnums.Count; ++i)
            {
                string dynEnumName = dynEnums[i].name;
                int    index       = Array.IndexOf(dynEnumNames, dynEnumName);

                if (index == -1)
                {
                    newNames.Add(dynEnumName);
                }
            }

            if (newNames.Count != dynEnumNames.Length)
            {
                dynEnumNames = newNames.buffer.ToArray();
            }
        }
    }
        public override bool CanMoveCards(int whichOne, out int lastOne)
        {
            if (PreviousSelected == -1)
            {
                throw new BasicBlankException("Cannot find out whether we can move the cards because none was selected");
            }
            lastOne = -1; //until i figure out what else to do.
            var givList = Piles.ListGivenCards(PreviousSelected);

            TempList = givList.ListValidCardsAlternateColors();
            var           thisPile = Piles.PileList[whichOne];
            SolitaireCard oldCard;

            if (thisPile.CardList.Count == 0)
            {
                lastOne = TempList.Count - 1;
                return(true);
            }
            oldCard = Piles.GetLastCard(whichOne);
            if (oldCard.Value == EnumCardValueList.LowAce)
            {
                return(false);
            }
            return(TempList.CanMoveCardsAlternateColors(oldCard, ref lastOne));
        }
Example #14
0
            Temp.Temp TranslateExpr(CALL expr)
            {
                Call c = new Call();

                c.Name = new Label((expr.Func as NAME).Label);
                TempList args = null, ptr = null;

                for (ExpList exp = expr.Args; exp != null; exp = exp.Tail)
                {
                    Temp.Temp arg = TranslateExpr(exp.Head);
                    if (args == null)
                    {
                        ptr = args = new TempList(arg, null);
                    }
                    else
                    {
                        ptr = ptr.Tail = new TempList(arg, null);
                    }
                }
                c.Param = args;
                MipsFrame t = null;

                foreach (MipsFrame f in MipsFrame.AllFrames)
                {
                    if (c.Name.Lab == f.Name)
                    {
                        t = f;
                        break;
                    }
                }
                if (t == null)
                {
                    int count = 0;
                    for (ptr = c.Param; ptr != null; ptr = ptr.Tail)
                    {
                        InstrList.Add(new Move(Frame.A(count), ptr.Head));
                        ++count;
                    }
                }
                else
                {
                    int count = 0;
                    ptr = c.Param;
                    for (AccessList al = t.Formals; al != null; al = al.Tail, ptr = ptr.Tail)
                    {
                        if (al.Head is InReg)
                        {
                            InstrList.Add(new Move(t.A(count), ptr.Head));
                            ++count;
                        }
                        else
                        {
                            InstrList.Add(new Store(t.SP(), (al.Head as InFrame).Offset, ptr.Head));
                        }
                    }
                }
                InstrList.Add(c);
                return(Frame.RV());
            }
Example #15
0
        static void PostProcessAsset(string assetPath, List <GameObject> dirtyPrefabs)
        {
            if (!assetPath.EndsWith("prefab"))
            {
                return;
            }

            var asset = AssetDatabase.LoadAssetAtPath <GameObject>(assetPath);

            if (asset == null)
            {
                return;
            }

            PrefabType pfType = PrefabUtility.GetPrefabType(asset);

            if (pfType != PrefabType.Prefab)
            {
                return;
            }

            using (var nesteds = TempList <NestedPrefab> .Get())
            {
                asset.GetComponentsInChildren <NestedPrefab>(
                    includeInactive: true,
                    results: nesteds.buffer
                    );

                if (nesteds.Count > 0)
                {
                    Dbg.LogRelease(asset, "PostProcessing {0} with NestedPrefab(s)", asset);
                    dirtyPrefabs.Add(asset);
                }

                for (int i = 0; i < nesteds.Count; ++i)
                {
                    var nested = nesteds[i];

                    // May have been destroyed by parent
                    if (nested == null)
                    {
                        continue;
                    }

                    nested = FindRootNested(nested);

                    nested.instantiated = null;

                    for (int z = nested.transform.childCount - 1; z >= 0; --z)
                    {
                        Transform child = nested.transform.GetChild(z);
                        DestroyImmediate(child.gameObject, allowDestroyingAssets: true);
                        Dbg.LogRelease(asset, "Destroying {0} child[{1}] in asset", nested.gameObject.name, z);
                    }
                }
            }
        }
Example #16
0
    static void OnSelectionChanged()
    {
        if (editorSelectionChanging)
        {
            return;
        }

        editorSelectionChanging = true;

        bool dirty = false;

        UE.Object[] results = null;

        if (!NestedPrefab.editorSelectionAllowed)
        {
            using (var selectedObjs = TempList <UE.Object> .Get())
            {
                selectedObjs.buffer.AddRange(Selection.objects);

                for (int i = selectedObjs.Count - 1; i >= 0; --i)
                {
                    var go = selectedObjs[i] as GameObject;
                    if (go == null)
                    {
                        continue;
                    }

                    var nested = go.GetComponentInParent <NestedPrefab>();
                    if (nested == null)
                    {
                        continue;
                    }

                    dirty = true;

                    nested = FindRootNested(nested);

                    selectedObjs.RemoveAt(i);
                    if (!selectedObjs.buffer.Contains(nested.gameObject))
                    {
                        selectedObjs.buffer.Add(nested.gameObject);
                    }
                }

                results = selectedObjs.buffer.ToArray();
            }
        }

        if (dirty)
        {
            EditorCoroutine.Start(SelectionRoutine(results));
        }
        else
        {
            editorSelectionChanging = false;
        }
    }
Example #17
0
        /// <summary>
        /// 添加接货任务
        /// </summary>
        /// <param name="taskid">任务ID </param>
        /// <param name="loadstation">装货区域</param>
        /// <param name="unloadstation">卸货区域</param>
        /// <param name="result">失败原因</param>
        /// <returns></returns>
        public bool AddNDCTask(int taskid, string loadstation, string unloadstation, out string result)
        {
            if (!VCP9412.Instance.IsConnected)
            {
                result = "NDC服务未连接";
                return(false);
            }

            if (!loadStaDic.TryGetValue(loadstation, out string ndcLoadsta))
            {
                result = "装货点未配置";
                return(false);
            }

            if (!unLoadStaDic.TryGetValue(unloadstation, out string ndcUnloadsta))
            {
                result = "卸货点未配置";
                return(false);
            }

            if (Items.Find(c => { return(c._mTask.TASKID == taskid); }) != null)
            {
                result = "找到相同任务ID(" + taskid + ")任务,不能再次添加";
                return(false);
            }

            if (TempList.Find(c => { return(c.TaskID == taskid); }) != null)
            {
                result = "找到相同任务ID(" + taskid + ")任务,不能再次添加";
                return(false);
            }


            TempItem item = new TempItem
            {
                Prio          = "1",
                IKey          = Ikey++,
                TaskID        = taskid,
                LoadSite      = loadstation,
                UnloadSite    = unloadstation,
                NdcLoadSite   = ndcLoadsta,
                NdcUnloadSite = ndcUnloadsta
            };

            TempList.Add(item);
            if (Ikey >= 99)
            {
                Ikey = 1;
            }
            DoStartOrder(item);

            //TaskListUpdate(new NdcTaskModel(item));//更新界面数据

            result = "";
            return(true);
        }
Example #18
0
    public static TempList <T> New()
    {
        TempList <T> list;

        if (TempList <T> .Resurrect(out list))
        {
            return(list);
        }
        return(new TempList <T>());
    }
Example #19
0
    public static TempList <T> GetComponentsInParentTempList <T>(this GameObject @this, bool includeInactive = false)
    {
        var tempList = TempList <T> .Get();

        if (@this != null)
        {
            @this.GetComponentsInParent <T>(includeInactive, tempList.list);
        }
        return(tempList);
    }
Example #20
0
    public static TempList <T> GetComponentsInChildrenTempList <T>(this Component @this, bool includeInactive = false)
    {
        var tempList = TempList <T> .Get();

        if (@this != null)
        {
            @this.GetComponentsInChildren <T>(includeInactive, tempList.list);
        }
        return(tempList);
    }
    public static TempList <T> GetComponentsTempList <T>(this GameObject @this)
    {
        var tempList = TempList <T> .Get();

        if (@this != null)
        {
            @this.GetComponents <T>(tempList.list);
        }
        return(tempList);
    }
Example #22
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            label.tooltip = EditorHelper.GetTooltipFromAttribute(fieldInfo, label.tooltip);

            bool  enabled = GUI.enabled;
            Color color   = GUI.color;

            if (IsReadOnly(property))
            {
                GUI.enabled = false;
            }

            if (!Validate(property))
            {
                GUI.color = errorColor;
            }

            using (var titles = TempList <string> .Get())
            {
                GetTitles(property, titles.buffer);

                string title = JoinTitle(titles.buffer);

                if (!string.IsNullOrEmpty(title))
                {
                    content.text = title;
                    float titleHeight = GetTitleHeight(title);

                    Rect titleRect = position;
                    titleRect.height = titleHeight;
                    EditorGUIHelper.Indent(ref titleRect, steps: EditorGUI.indentLevel);
                    GUI.Label(titleRect, content);
                    position.y      += titleHeight;
                    position.height -= titleHeight;
                }

                if (!UseObjField(property))
                {
                    EditorGUI.PropertyField(position, property, label, includeChildren: true);
                }
                else
                {
                    property.objectReferenceValue = EditorGUI.ObjectField(
                        position,
                        label,
                        property.objectReferenceValue,
                        GetObjRefType(),
                        allowSceneObjects: attribute.objRefRestriction != PropObjRefRestrict.OnlyAsset
                        );
                }
            }

            GUI.color   = color;
            GUI.enabled = enabled;
        }
Example #23
0
    public static TempList <T> New(IEnumerable <T> windows)
    {
        TempList <T> list;

        if (TempList <T> .Resurrect(out list))
        {
            list.AddRange(windows);
            return(list);
        }
        return(new TempList <T>(windows));
    }
Example #24
0
 public bool repitance(T element)
 {
     if (TempList.Contains(element))
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Example #25
0
    public static TempList <T> New(IEnumerable <T> windows)
    {
        TempList <T> tempList;

        if (!TempList <T> .Resurrect(out tempList))
        {
            return(new TempList <T>(windows));
        }
        tempList.AddRange(windows);
        return(tempList);
    }
        protected override void ProcessImport()
        {
            Trace.WriteLine($"Saved {TempList.Count} records");
            var last = TempList.LastOrDefault();

            if (last != null)
            {
                Trace.WriteLine($"Last record: TestInt={last.TestInt};" +
                                $"TestString={last.TestString};TestDateTime={last.TestDateTime}...");
            }
        }
Example #27
0
 protected void DoLoadConfigAutomatically(ConfigFieldInfo field, int index, TempList <IWork> loaders)
 {
     if (field.LoadAll)
     {
         loaders.Add(new AtomWork(() => ReadAll(index)));
     }
     else if (field.FieldMode == ConfigFieldInfo.Mode.CONST)
     {
         loaders.Add(new AtomWork(() => ReadConst(index, field.ElemType)));
     }
 }
Example #28
0
    public void SystemUpdate()
    {
        using (var enemies = TempList <EnemyQuirk> .Get())
            using (var players = TempList <Unit> .Get())
            {
                unitMan.GetQuirks(enemies.buffer);
                unitMan.GetUnits(players.buffer, notInFaction: 0);

                UpdateEnemies(enemies.buffer, players.buffer);
            }
    }
Example #29
0
 public static void EditorRespawnAll()
 {
     using (var prefabs = TempList <NestedPrefab> .Get())
     {
         EditorHelper.FindSceneObjects(prefabs.buffer);
         for (int i = 0; i < prefabs.Count; i++)
         {
             NestedPrefab pf = prefabs[i];
             pf.Respawn();
         }
     }
 }
        /// <summary>
        /// Updates the data for this node and triggers updates for any connected output nodes.
        /// </summary>
        internal override void Update()
        {
            var isFolderNameValid = !string.IsNullOrEmpty(_folderRef.FolderName);
            var childFolderArrays = GetInputValues(nameof(_childFolders), new object[0])
                                    .OfType <FolderRef[]>()
                                    .ToArray();
            var length = childFolderArrays.Sum(x => x.Length);

            // If there are not any child folders from other nodes present, return this folder as the
            // array of output folders.
            if (length == 0 && isFolderNameValid)
            {
                _outputFolders = new[]
                {
                    _folderRef
                };
            }
            else if (length > 0 && isFolderNameValid)
            {
                TempList.Clear();

                for (var i = 0; i < childFolderArrays.Length; i++)
                {
                    var childFolderArray = childFolderArrays[i];
                    for (var j = 0; j < childFolderArray.Length; j++)
                    {
                        var childFolderRef = childFolderArray[j];
                        var newFolderRef   = new FolderRef
                        {
                            FolderName = Path.Combine(_folderRef.FolderName, childFolderRef.FolderName),
                            ShouldGenerateCodeToGetPath = childFolderRef.ShouldGenerateCodeToGetPath
                        };

                        TempList.Add(newFolderRef);
                    }
                }

                if (_folderRef.ShouldGenerateCodeToGetPath)
                {
                    TempList.Add(_folderRef);
                }

                _outputFolders = TempList.ToArray();
            }
            else
            {
                _outputFolders = new FolderRef[0];
            }

            // Make base call to trigger update on all output ports
            base.Update();
        }
Example #31
0
 Temp.Temp TranslateExpr(CALL expr)
 {
     Call c = new Call();
     c.Name = new Label((expr.Func as NAME).Label);
     TempList args = null, ptr = null;
     for (ExpList exp = expr.Args; exp != null; exp = exp.Tail)
     {
         Temp.Temp arg = TranslateExpr(exp.Head);
         if (args == null)
             ptr = args = new TempList(arg, null);
         else
             ptr = ptr.Tail = new TempList(arg, null);
     }
     c.Param = args;
     MipsFrame t = null;
     foreach (MipsFrame f in MipsFrame.AllFrames)
     {
         if (c.Name.Lab == f.Name)
         {
             t = f;
             break;
         }
     }
     if (t == null)
     {
         int count = 0;
         for (ptr = c.Param; ptr != null; ptr = ptr.Tail)
         {
             InstrList.Add(new Move(Frame.A(count), ptr.Head));
             ++count;
         }
     }
     else
     {
         int count = 0;
         ptr = c.Param;
         for (AccessList al = t.Formals; al != null; al = al.Tail, ptr = ptr.Tail)
         {
             if (al.Head is InReg)
             {
                 InstrList.Add(new Move(t.A(count), ptr.Head));
                 ++count;
             }
             else
                 InstrList.Add(new Store(t.SP(), (al.Head as InFrame).Offset, ptr.Head));
         }
     }
     InstrList.Add(c);
     return Frame.RV();
 }
Example #32
0
 public TempList(Temp head, TempList tail)
 {
     Head = head;
     Tail = tail;
 }
Example #33
0
        /// <summary>
        /// 生成线性图标
        /// </summary>
        /// <param name="dt">数据源</param>
        /// <param name="X">X轴</param>
        /// <param name="Y">Y轴数组</param>
        /// <param name="SavePath">临时文件保存地址</param>
        /// <param name="type">显示类型(1:线性|2:线性+柱形)</param>
        /// <param name="isupdate">是否更新</param>
        public static void GetLine(DataTable dt, string X, Dictionary<string, string> Y, string SavePath, int type)
        {
            StringBuilder xml = new StringBuilder();
            StringBuilder xmlmouth = new StringBuilder();
            StringBuilder xmldata = new StringBuilder();
            StringBuilder xmldata2 = new StringBuilder();
            xml.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            xml.Append("<chart>");
            xml.Append("<series>");
            xml.Append("{0}");
            xml.Append("</series>");
            xml.Append("<graphs>");
            xml.Append("{1}");
            xml.Append("</graphs>");
            xml.Append("</chart>");

            List<TempList> dic = new List<TempList>();
            int ii = 0;
            List<string> str = new List<string>();
            foreach (DataRow item in dt.Rows)
            {
                ii++;
                string _x = "";
                if (X == "")
                    _x = item[0].ToString();
                else
                    _x = item[X].ToString();

                xmlmouth.Append("<value xid=\"" + ii + "\">" + _x + "</value>");

                foreach (KeyValuePair<string, string> a in Y)
                {
                    string _y = "";
                    _y = item[a.Value].ToString();
                    TempList tl = new TempList();
                    tl.key = a.Key;
                    tl.value = "<value xid=\"" + ii + "\" >" + _y + "</value>";
                    dic.Add(tl);

                }
            }
            int i = 1;
            if (type == 1)
                i = 2;
            foreach (KeyValuePair<string, string> a in Y)
            {

                xmldata.Append("<graph gid=\"" + i + "\" title=\"" + a.Key + "\">");
                foreach (TempList entry in dic)
                {
                    if (entry.key == a.Key)
                        xmldata.Append(entry.value);
                }
                xmldata.Append("</graph>");
                i++;

            }
            File.WriteAllText(SavePath, string.Format(xml.ToString(), xmlmouth.ToString(), xmldata.ToString()));
        }