Example #1
0
		private static String ConvertToReadableNavigationName (String InputNavigationName)
			{
			if ((!InputNavigationName.Contains ("<"))
			    && (!InputNavigationName.Contains (">")))
				return InputNavigationName;
			int StartIndex = InputNavigationName.IndexOf ("id=");
			if (StartIndex == -1)
				return InputNavigationName;
			int EndIndex = InputNavigationName.IndexOf("\"", StartIndex + 5);
			if (EndIndex == -1)
				return InputNavigationName;
			if (IsTreeRun)
				{
				String Name = InputNavigationName.Substring(StartIndex + 4, EndIndex - StartIndex - 4);
				RootMenu NewRoot = new RootMenu (Name, TreeEntry.EntryTyp.RootEntry);
				Root.Childs.Add (NewRoot);
				return "OnMouseOver_" + InputNavigationName.Substring(StartIndex + 4, EndIndex - StartIndex - 4);
				}
			else
				{

				return "OnMouseOver_" + InputNavigationName.Substring (StartIndex + 4, EndIndex - StartIndex - 4);
				}
			}
Example #2
0
		private static void LoadTreeWizzardData ()
			{
			StreamReader WizzardInput = new StreamReader(TreeWizzardInput);
			String [] Lines = WizzardInput.ReadToEnd ().Replace ("\r\n", "\n").Split ('\n');
			TreeEntry LastParent = null;
			TreeEntry LastEntry = null;
			Root.Level = 0;
			RootMenu ActuallRoot = null;
			foreach (String Line in Lines)
				{
				if (String.IsNullOrEmpty (Line))
					continue;
				String [] Entries = Line.Split ('\t');
				int Level = 0;
				while (String.IsNullOrEmpty (Entries [Level]))
					{
					Level++;
					}
				RootMenu NewEntry = new RootMenu(Entries[Level], TreeEntry.EntryTyp.RootEntryChild);
				if (Level + 1 < Entries.Length)
					{
					NewEntry.InsertTarget (Entries [Level + 1]);
					}
				NewEntry.Level = Level + 1;
				if (NewEntry.Level == 1)
					{
					Root.Childs.Add(NewEntry);
					NewEntry.Parent = Root;
					LastParent = Root;
					}
				else
					{
					if (LastParent.Level < NewEntry.Level - 1)
						LastParent = LastEntry;
					else
						while (LastParent.Level > NewEntry.Level - 1)
							LastParent = LastParent.Parent;

					if (LastParent.Level == NewEntry.Level - 1)
						{
						LastParent.Childs.Add(NewEntry);
						NewEntry.Parent = LastParent;
						}
					}
				LastEntry = NewEntry;

				}

			}