private void lb_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (this._targetListBoxItem != null) { this._targetListBoxItem.IsSelected = false; this._targetListBoxItem = null; } if ((e.AddedItems != null) && (e.AddedItems.Count > 0)) { ListBoxItem item = e.AddedItems[0] as ListBoxItem; if (item != null) { CategoryItem tag = item.Tag as CategoryItem; this._item = tag; this.processitem(tag); } } }
private void processitem(CategoryItem item) { this._control = null; this.tabSample.Content = null; //this.txtSrc.Text = ""; //this.txtXaml.Text = ""; this.txtSrc.SourceCode = ""; this.txtXaml.SourceCode = ""; this.txtSrcExplain.Text = ""; this.tabPanel.SelectedIndex = 0; Type type = Type.GetType(item.XAML); if (type != null) { this._control = Activator.CreateInstance(type) as UserControl; this.tabSample.Content = this._control; } this.SampleCaption.Text = item.ID; HtmlPage.Window.Invoke("setParentHash", new object[] { item.XAML.Split(new char[] { '.' })[1] }); }
public void ProcessTarget() { if (!string.IsNullOrEmpty(this._target)) { string str = "iServerJava2_SampleCode." + this._target; int num = 0; foreach (Category category in this._categoryList) { int num2 = 0; foreach (CategoryItem item in category.CategoryItems) { if (item.XAML.ToLower() == str.ToLower()) { this._item = item; this.processitem(item); Expander expander = base.FindName(string.Format("Category_{0}", num)) as Expander; expander.IsExpanded = true; this._targetListBoxItem = base.FindName(string.Format("Item_{0}_{1}", num, num2)) as ListBoxItem; this._targetListBoxItem.IsSelected = true; return; } num2++; } num++; } } }