void setTabsToIni() { AtributesList.RemoveAll(item => item.Name == "[right]"); AtributesList.RemoveAll(item => item.Name == "[left]"); AtributesList.RemoveAll(item => item.Name == "[righttabs]"); AtributesList.RemoveAll(item => item.Name == "[lefttabs]"); myAtribute right = new myAtribute("[right]"); if (_rightTabs.Count > 0) { right.ValuesList.Add(new myValue(@"path=" + _rightTabs[0].Pth)); right.ValuesList.Add(new myValue(@"show=1")); } myAtribute rightTabs = new myAtribute("[righttabs]"); if (_rightTabs.Count > 1) { for (int i = 1; i <= _rightTabs.Count - 1; i++) { rightTabs.ValuesList.Add(new myValue(i - 1 + "_path=" + _rightTabs[i].Pth)); if (_rightTabs[i].Locked) { rightTabs.ValuesList.Add(new myValue(i - 1 + "_options=1|0|0|0|0|1|0")); } else { rightTabs.ValuesList.Add(new myValue(i - 1 + "_options=1|0|0|0|0|0|0")); } } } if (_rightTabs.Count > 0) { rightTabs.ValuesList.Add(new myValue(@"activetab=0")); if (_rightTabs[0].Locked) { rightTabs.ValuesList.Add(new myValue(@"activelocked=1")); } else { rightTabs.ValuesList.Add(new myValue(@"activelocked=0")); } } if (right != null) { _atributesList.Add(right); } if (rightTabs != null) { _atributesList.Add(rightTabs); } myAtribute left = new myAtribute("[left]"); if (_leftTabs.Count > 0) { left.ValuesList.Add(new myValue(@"path=" + _leftTabs[0].Pth)); left.ValuesList.Add(new myValue(@"show=1")); } myAtribute leftTabs = new myAtribute("[leftTabs]"); if (_leftTabs.Count > 1) { for (int i = 1; i <= _leftTabs.Count - 1; i++) { leftTabs.ValuesList.Add(new myValue(i - 1 + "_path=" + _leftTabs[i].Pth)); if (_leftTabs[i].Locked) { leftTabs.ValuesList.Add(new myValue(i - 1 + "_options=1|0|0|0|0|1|0")); } else { leftTabs.ValuesList.Add(new myValue(i - 1 + "_options=1|0|0|0|0|0|0")); } } } if (_leftTabs.Count > 0) { leftTabs.ValuesList.Add(new myValue(@"activetab=0")); if (_leftTabs[0].Locked) { leftTabs.ValuesList.Add(new myValue(@"activelocked=1")); } else { leftTabs.ValuesList.Add(new myValue(@"activelocked=0")); } } if (left != null) { _atributesList.Add(left); } if (leftTabs != null) { _atributesList.Add(leftTabs); } }
object[] GetTabs() { myAtribute right = AtributesList.Find(item => item.Name == "[right]"); myAtribute left = AtributesList.Find(item => item.Name == "[left]"); myAtribute rightTabs = AtributesList.Find(item => item.Name == "[righttabs]"); myAtribute leftTabs = AtributesList.Find(item => item.Name == "[lefttabs]"); List <myTab> tabsListRight = new List <myTab>(); List <myTab> tabsListLeft = new List <myTab>(); if (rightTabs != null) { for (int i = 0; i <= rightTabs.ValuesList.Count - 1; i++) { if (rightTabs.ValuesList[i].ValName.Contains("_path")) { tabsListRight.Add(new myTab(rightTabs.ValuesList[i].Value, int.Parse(getTabValue(rightTabs.ValuesList[i + 1].Value, 5)), int.Parse(rightTabs.ValuesList[i + 1].ValName.Substring(0, 1)), myTab.strana.R)); } } } if (leftTabs != null) { for (int i = 0; i <= leftTabs.ValuesList.Count - 1; i++) { if (leftTabs.ValuesList[i].ValName.Contains("_path")) { tabsListLeft.Add(new myTab(leftTabs.ValuesList[i].Value, int.Parse(getTabValue(leftTabs.ValuesList[i + 1].Value, 5)), int.Parse(leftTabs.ValuesList[i + 1].ValName.Substring(0, 1)), myTab.strana.L)); } } } if (right != null) { string pth = right.ValuesList.Find(item => item.ValName == "path").Value; int locked = 0; int position = 0; if (rightTabs != null) { if (rightTabs.ValuesList.Find(item => item.ValName == "activelocked") != null) { locked = int.Parse(rightTabs.ValuesList.Find(item => item.ValName == "activelocked").Value); } if (rightTabs.ValuesList.Find(item => item.ValName == "activetab") != null) { position = int.Parse(rightTabs.ValuesList.Find(item => item.ValName == "activetab").Value); } } tabsListRight.Add(new myTab(pth, locked, position, myTab.strana.R)); } if (left != null) { string pth = left.ValuesList.Find(item => item.ValName == "path").Value; int locked = 0; int position = 0; if (leftTabs != null) { if (leftTabs.ValuesList.Find(item => item.ValName == "activelocked") != null) { locked = int.Parse(leftTabs.ValuesList.Find(item => item.ValName == "activelocked").Value); } if (leftTabs.ValuesList.Find(item => item.ValName == "activetab") != null) { position = int.Parse(leftTabs.ValuesList.Find(item => item.ValName == "activetab").Value); } } tabsListLeft.Add(new myTab(pth, locked, position, myTab.strana.L)); } return(new object[] { tabsListLeft, tabsListRight }); }