Example #1
1
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                foreach (DriveInfo driveInfo in DriveInfo.GetDrives())
                {
                    TreeViewItem item = new TreeViewItem();
                    item.Header = driveInfo.Name;
                    MessageBox.Show((string)item.Header);

                    if (driveInfo.IsReady)
                    {
                        DirectoryInfo dirInfo = new DirectoryInfo(driveInfo.Name);
                        foreach (DirectoryInfo di in dirInfo.GetDirectories())
                        {
                            item.Items.Add(new TreeViewItem() { Header = di.Name });
                        }
                        foreach (FileInfo fi in dirInfo.GetFiles())
                        {
                            item.Items.Add(new TreeViewItem() { Header = fi.Name });
                        }
                    }
                    this.treeView1.Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Example #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 20 "..\..\UserManager.xaml"
                ((System.Windows.Controls.TreeView)(target)).AddHandler(System.Windows.Controls.TreeViewItem.SelectedEvent, new System.Windows.RoutedEventHandler(this.TreeViewItem_Selected));

            #line default
            #line hidden
                return;

            case 2:
                this.addManager = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 3:
                this.DeleteManager = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 4:
                this.frame1 = ((System.Windows.Controls.Frame)(target));
                return;
            }
            this._contentLoaded = true;
        }
 private void Tree1_Initialized(object sender, EventArgs e)
 {
     var trv = sender as TreeView;
     var trvItem = new TreeViewItem() {Header = "Initialized item"};
     var trvItemSel = trv.Items[1] as TreeViewItem;
     trvItemSel.Items.Add(trvItem);
 }
        public SpawnExtractorTab(SpawnExtractorTabViewModel viewmodel)
        {
            InitializeComponent();

            ViewModel = viewmodel;
            viewmodel.FileSelectionChanged += new FileLoadingHandler(viewmodel_FileSelectionChanged);
            viewmodel.PropertyChanged += new PropertyChangedEventHandler(viewmodel_PropertyChanged);
            viewmodel.TemplateAppliedToNpcs += new TemplateApplied(viewmodel_TemplateAppliedToNpcs);

            var categories = viewmodel.Templates.GroupBy(x => x.Category);
            foreach (var cat in categories)
            {
                var itemCategory = new TreeViewItem();
                itemCategory.Header = cat.Key;

                foreach (var i in cat)
                {
                    var item = new TreeViewItem();
                    item.Header = i.Name;
                    itemCategory.Items.Add(item);
                }

                TreeView.Items.Add(itemCategory);
            }

            TreeView.SelectedItemChanged += new RoutedPropertyChangedEventHandler<object>(TreeView_SelectedItemChanged);
            NPCDataGrid.AutoGeneratingColumn += new EventHandler<DataGridAutoGeneratingColumnEventArgs>(NPCDataGrid_AutoGeneratingColumn);
            NPCDataGrid.SelectedCellsChanged += new SelectedCellsChangedEventHandler(NPCDataGrid_SelectedCellsChanged);
        }
 /// <summary>
 /// 加载区划树
 /// </summary>
 /// <param name="type">加载类型</param>
 /// <param name="isLock">是否锁定</param>
 public void Load(int type, bool isLock)
 {
     if (isLock)
     {
         analysisTypeComboBox.SelectedItem = "采集";
         analysisTypeComboBox.IsEnabled = false;
     }
     else
     {
         analysisTypeComboBox.IsEnabled = true;
     }
     AppType = type;
     typeTreeView.Items.Clear();
     var list = EduTools.DataDB.code_getRegionTreeNodeList(AppType, "", "", "", "", 0, _recordYear).ToList();
     foreach (var current in list)
     {
         var newItem = new TreeViewItem
         {
             Header = current,
             Tag = current,
             HeaderTemplate = typeTreeView.ItemTemplate
         };
         typeTreeView.Items.Add(newItem);
     }
 }
		public void LoadMatches(Dictionary<GameStats, List<GameStats>> games)
		{
			try
			{
				AllWrappers.Clear();
				foreach(var set in games.OrderBy(x => x.Value.Count))
				{
					var deck = DeckList.Instance.Decks.FirstOrDefault(d => d.DeckId == set.Key.DeckId);
					var tvi = new TreeViewItem
					{
						ItemTemplate = (DataTemplate)FindResource("DataTemplateCheckBox"),
						Header = $"[Original - Deck: {(deck != null ? deck.Name : "")}] : {GetMatchInfo(set.Key)} ({set.Value.Count} duplicate(s))",
						IsExpanded = true
					};
					foreach(var game in set.Value)
					{
						try
						{
							var wrapper = new GameStatsWrapper(game);
							tvi.Items.Add(wrapper);
							AllWrappers.Add(wrapper);
						}
						catch(Exception e)
						{
							Log.Error(e);
						}
					}
					TreeViewGames.Items.Add(tvi);
				}
			}
			catch(Exception ex)
			{
				Log.Error(ex);
			}
		}
        public static bool WalkTreeViewItem(TreeView tree, TreeViewItem treeViewItem, object selectedValue)
        {
            if (treeViewItem.DataContext == selectedValue)
            {
                treeViewItem.SetValue(TreeViewItem.IsSelectedProperty, true);
                treeViewItem.Focus();
                treeViewItem.BringIntoView();
                return true;
            }
            var itemsHostProperty = treeViewItem.GetType().GetProperty("ItemsHost", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);

            var itemsHost = itemsHostProperty?.GetValue(treeViewItem, null) as Panel;

            if (itemsHost == null)
            {
                return false;
            }

            foreach (var item in itemsHost.Children.OfType<TreeViewItem>())
            {
                var oldExpanded = item.IsExpanded;
                item.IsExpanded = true;
                item.UpdateLayout();
                if (WalkTreeViewItem(tree, item, selectedValue))
                {
                    return true;
                }
                item.IsExpanded = oldExpanded;
            }

            return false;
        }
Example #8
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.treeView = ((System.Windows.Controls.TreeView)(target));

            #line 10 "..\..\..\..\FLOWeR\UIDesigner\ToolBox.xaml"
                this.treeView.SelectedItemChanged += new System.Windows.RoutedPropertyChangedEventHandler <object>(this.TreeView_SelectedItemChanged);

            #line default
            #line hidden
                return;

            case 2:
                this.treeHeader = ((System.Windows.Controls.TreeViewItem)(target));

            #line 11 "..\..\..\..\FLOWeR\UIDesigner\ToolBox.xaml"
                this.treeHeader.Collapsed += new System.Windows.RoutedEventHandler(this.TreeHeader_Collapsed);

            #line default
            #line hidden

            #line 11 "..\..\..\..\FLOWeR\UIDesigner\ToolBox.xaml"
                this.treeHeader.Selected += new System.Windows.RoutedEventHandler(this.TreeHeader_Selected);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Example #9
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 8 "..\..\..\View\MainView.xaml"
                ((WPF_MVVM.MainView)(target)).Initialized += new System.EventHandler(this.UserControl_Initialized);

            #line default
            #line hidden
                return;

            case 2:
                this.lblCursorPosition = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 3:
                this.tree = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 4:
                this.SourceCollection = ((System.Windows.Controls.ListBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #10
0
 /// <summary>
 /// Select specified item in a TreeView
 /// </summary>
 public static void SelectItem(this System.Windows.Controls.TreeViewItem treeView, object item)
 {
     if (treeView.ItemContainerGenerator.ContainerFromItem(item) is System.Windows.Controls.TreeViewItem tvItem)
     {
         tvItem.IsSelected = true;
     }
 }
        private void BuildConfictSet(FunctionConflictSet conflictSet, TreeViewItem item, int setIndex)
        {
            if (conflictSet == null || item == null)
                return;

            StringBuilder headerBuidller = new StringBuilder();
            headerBuidller.Append("Конфликтный набор №{0}. ");
            headerBuidller.Append("Функция ");
            headerBuidller.Append(conflictSet.FunctionType.ToString());
            headerBuidller.Append(".");

            TreeViewItem setItem = new TreeViewItem();
            setItem.Header = String.Format(headerBuidller.ToString(), setIndex);

            item.Items.Add(setItem);

            conflictSet.Reset();

            while (conflictSet.ClosedEx == false)
            {
                FunctionGenerationInfo info = conflictSet.CurrentFunction;

                headerBuidller.Clear();
                headerBuidller.Append("Функция \"{0}\". ");
                headerBuidller.Append("Коэффициент релевантности: {1}.");

                TreeViewItem functionItem = new TreeViewItem();
                functionItem.Header = String.Format(headerBuidller.ToString(), info.Function.Name, info.RelevanceLevel);
                setItem.Items.Add(functionItem);

                conflictSet.NextEx();
            }

            conflictSet.Reset();
        }
Example #12
0
        private WC.TreeViewItem GenerateTree(DirectoryInfo root)
        {
            WC.TreeViewItem treeViewRoot = new WC.TreeViewItem
            {
                Header = root.Name,
                Tag    = root
            };

            foreach (var directory in root.GetDirectories())
            {
                var item = GenerateTree(directory);
                treeViewRoot.Items.Add(item);
            }

            foreach (var file in root.GetFiles())
            {
                var item = new WC.TreeViewItem
                {
                    Header = file.Name,
                    Tag    = file
                };
                treeViewRoot.Items.Add(item);
            }

            return(treeViewRoot);
        }
Example #13
0
        void deleteFromContextMenu_click(object sender, System.EventArgs e)
        {
            TreeViewItem selectedItem = (TreeViewItem)treeView.SelectedItem;

            if (selectedItem == null)
            {
                return;
            }

            File.SetAttributes(selectedItem.Tag.ToString(), FileAttributes.Normal);

            if (File.GetAttributes(selectedItem.Tag.ToString()) == FileAttributes.Directory)
            {
                DirectoryInfo dr = new DirectoryInfo(selectedItem.Tag.ToString());
                ClearReadOnly(dr);
                dr.Delete(true);
            }
            else
            {
                FileInfo fi = new FileInfo(selectedItem.Tag.ToString());
                fi.Delete();
            }

            if (selectedItem.Tag.ToString() != selectedPath)
            {
                System.Windows.Controls.TreeViewItem selectedItemParent = (System.Windows.Controls.TreeViewItem)selectedItem.Parent;
                selectedItemParent.Items.Remove(selectedItem);
            }
            else
            {
                selectedItem.Items.Remove(selectedItem);
                selectedItem.Items.Clear();
            }
        }
Example #14
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.GridTree = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:
                this.treeView = ((System.Windows.Controls.TreeView)(target));
                return;

            case 3:
                this.UserName = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 4:
                this.motherboard = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 5:
                this.proc = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 6:
                this.memory = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 7:
                this.gpuu = ((System.Windows.Controls.TreeViewItem)(target));
                return;
            }
            this._contentLoaded = true;
        }
		public void LoadMatches(Dictionary<GameStats, List<GameStats>> games)
		{
			try
			{
				_allWrappers.Clear();
				foreach(var set in games.OrderBy(x => x.Value.Count))
				{
					var deck = DeckList.Instance.Decks.FirstOrDefault(d => d.DeckId == set.Key.DeckId);
					var tvi = new TreeViewItem();
					tvi.ItemTemplate = (DataTemplate)FindResource("DataTemplateCheckBox");
					tvi.Header = string.Format("[Original - Deck: {0}] : {1} ({2} duplicate(s))", deck != null ? deck.Name : "", GetMatchInfo(set.Key),
					                           set.Value.Count);
					tvi.IsExpanded = true;
					foreach(var game in set.Value)
					{
						try
						{
							var wrapper = new GameStatsWrapper(game);
							tvi.Items.Add(wrapper);
							_allWrappers.Add(wrapper);
						}
						catch(Exception e)
						{
							Logger.WriteLine("Error loading duplicate match: " + e, "DuplicateMatchesWindow");
						}
					}
					TreeViewGames.Items.Add(tvi);
				}
			}
			catch(Exception ex)
			{
				Logger.WriteLine("Error loading duplicate matches: " + ex, "DuplicateMatchesWindow");
			}
		}
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.myAST = ((System.Windows.Controls.TreeView)(target));
                return;

            case 2:
                this.myAST_Node1 = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 3:
                this.Expand_Btn = ((System.Windows.Controls.Button)(target));

            #line 49 "..\..\..\Parser\AbstractSyntaxTree.xaml"
                this.Expand_Btn.Click += new System.Windows.RoutedEventHandler(this.Expand_Btn_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.Collapse_Btn = ((System.Windows.Controls.Button)(target));

            #line 50 "..\..\..\Parser\AbstractSyntaxTree.xaml"
                this.Collapse_Btn.Click += new System.Windows.RoutedEventHandler(this.Collapse_Btn_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Example #17
0
 private void Folder_Expanded(object sender, RoutedEventArgs e)
 {
     object dummyNode = null;
     TreeViewItem item = (TreeViewItem)sender;
     if (item.Items.Count == 1 && item.Items[0] == dummyNode)
     {
         item.Items.Clear();
         try
         {
             foreach (string folder in Directory.GetDirectories(item.Tag.ToString()))
             {
                 TreeViewItem subitem = new TreeViewItem();
                 subitem.Header = folder.Substring(folder.LastIndexOf("\\") + 1);
                 subitem.Tag = folder;
                 subitem.FontWeight = FontWeights.Normal;
                 subitem.Items.Add(dummyNode);
                 subitem.Expanded += new RoutedEventHandler(Folder_Expanded);
                 item.Items.Add(subitem);
             }
         }
         catch (UnauthorizedAccessException uae)
         {
             MessageBox.Show(uae.Message);
         }
     }
 }
        public void Fill(SolutionBrowserForm parent, string projectType, string objectName,
            ProjectItem defaultPath = null)
        {
            ObjectName.Text = objectName;
            _parent = parent;
            _defaultPath = defaultPath;

            var enumerator = new ProjectEnumerator();
            foreach (var project in enumerator.Get(projectType))
            {
                var newNode = new TreeViewItem();
                newNode.Header = project.Name;
                newNode.Tag = project;

                for (var i = 1; i <= project.ProjectItems.Count; i++)
                {
                    var expandParent = false;
                    var node = AddChildren(project.ProjectItems.Item(i), out expandParent);

                    if (node != null)
                    {
                        newNode.Items.Add(node);
                        if (expandParent)
                        {
                            newNode.IsExpanded = true;
                            node.IsExpanded = true;
                        }
                    }
                }

                Tree.Items.Add(newNode);
            }
        }
Example #19
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.TreeView1 = ((System.Windows.Controls.TreeView)(target));

            #line 22 "..\..\MainWindow.xaml"
                this.TreeView1.SelectedItemChanged += new System.Windows.RoutedPropertyChangedEventHandler <object>(this.TreeView1_SelectedItemChanged);

            #line default
            #line hidden
                return;

            case 2:
                this.MySystem = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 3:
                this.TextBox2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.scrollViewer1 = ((System.Windows.Controls.ScrollViewer)(target));
                return;

            case 5:
                this.TextBox1 = ((System.Windows.Controls.TextBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #20
0
        public static TreeViewItem[] ToTree(this Result[] results)
        {
            var nodes = new List<TreeViewItem>();

            foreach(var result in results)
            {
                var node = new TreeViewItem();
                node.Header = "(" + result.Types.FirstOrDefault() + ") " + result.FormattedAddress;
                node.Tag = result.Geometry.Location;

                foreach(var component in result.AddressComponents)
                {
                    node.Items.Add(new TreeViewItem
                    {
                        Header = component.Types.FirstOrDefault() + ": " + component.LongName,
                        Tag = result.Geometry.Location
                    });
                }

                node.Items.Add(new TreeViewItem { Header = "Lat: " + result.Geometry.Location.Latitude });
                node.Items.Add(new TreeViewItem { Header = "Lng: " + result.Geometry.Location.Longitude });

                nodes.Add(node);
            }

            return nodes.ToArray();
        }
        private void addLicFileToTree(string filename, bool fileExists = true)
        {
            TreeViewItem RootItem = new TreeViewItem();
            RootItem.IsExpanded = true;
            RootItem.Tag = filename;
            string rootItemName = filename.Split('\\').Last();
            RootItem.Header = rootItemName;

            if (fileExists)
            {
                LicFile file = new LicFile(rootItemName, filename);
                foreach (Product p in file.Products)
                {
                    TreeViewItem product = new TreeViewItem();
                    product.Header = p.ID + ": " + p.currUsersNum + " of " + p.maxUsersNum + " users.";
                    product.IsExpanded = false;
                    foreach (User u in p.Users)
                    {
                        product.Items.Add(u.Name);
                    }
                    RootItem.Items.Add(product);
                }
            }
            else
            {
                TreeViewItem notFoundReport = new TreeViewItem();
                notFoundReport.Header = "Файл не найден";
                RootItem.Items.Add(notFoundReport);
            }

            treeView.Items.Add(RootItem);
            fileNames.AddMonitorFileName(filename);
        }
Example #22
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 2:
                this.treeView = ((System.Windows.Controls.TreeView)(target));
                return;

            case 3:
                this.treeHeader = ((System.Windows.Controls.TreeViewItem)(target));

            #line 19 "..\..\..\..\FLOWeR\FlowchartDesigner\FlowTool.xaml"
                this.treeHeader.Collapsed += new System.Windows.RoutedEventHandler(this.TreeHeader_Collapsed);

            #line default
            #line hidden

            #line 19 "..\..\..\..\FLOWeR\FlowchartDesigner\FlowTool.xaml"
                this.treeHeader.Selected += new System.Windows.RoutedEventHandler(this.TreeHeader_Selected);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        private void AddDirsToListBox(string i_Path)
        {
            try
            {
                CurrentDirectory = i_Path;

                treeViewDirectories.Items.Clear();

                string[] dirs = Directory.GetDirectories(i_Path);

                if (m_ParentDirs.Count > 0)
                {
                    TreeViewItem treeViewItem = new TreeViewItem();

                    treeViewItem.Header = "..";
                    treeViewDirectories.Items.Add(treeViewItem);
                }

                foreach (string dir in dirs)
                {
                    TreeViewItem treeViewItem = new TreeViewItem();

                    treeViewItem.Header = dir;
                    treeViewDirectories.Items.Add(treeViewItem);
                }

            }
            catch (Exception e1)
            {
                Debug.WriteLine(e1.Message);
            }
        }
 //这里也是分两步,第一步创建一个Header的DataTemplate,第二步每一个Header都添加这个这个DataTemplate
 private void LoadTree()
 {
     DataTemplate template = GetTreeHeaderDataTemplate();
     TreeViewItem AsianItem=new TreeViewItem();
     AsianItem.Header = "亚洲";
     AsianItem.HeaderTemplate = template;
     TreeViewItem EuropeItem=new TreeViewItem();
     EuropeItem.Header = "欧洲";
     EuropeItem.HeaderTemplate = template;
     TreeViewItem chinaItem=new TreeViewItem();
     chinaItem.Header = "中国";
     chinaItem.HeaderTemplate = template;
     TreeViewItem japnaItem = new TreeViewItem();
     japnaItem.Header = "日本";
     japnaItem.HeaderTemplate = template;
     TreeViewItem ukItem = new TreeViewItem();
     ukItem.Header = "英国";
     ukItem.HeaderTemplate = template;
     TreeViewItem denmarkItem = new TreeViewItem();
     denmarkItem.Header = "丹麦";
     denmarkItem.HeaderTemplate = template;
     AsianItem.Items.Add(chinaItem);
     AsianItem.Items.Add(japnaItem);
     EuropeItem.Items.Add(ukItem);
     EuropeItem.Items.Add(denmarkItem);
     this.MainTreeView.Items.Add(AsianItem);
     this.MainTreeView.Items.Add(EuropeItem);
 }
Example #25
0
 private void ViewLog_Load(object sender, EventArgs e)
 {
     _xmlDoc.Load("log.xml");
     XmlNodeList nodes = _xmlDoc.GetElementsByTagName("date");
     TreeViewLog.Items.Clear();
     TreeViewItem core = new TreeViewItem();
     core.Header = "log";
     List<TreeViewItem> firstLevel = new List<TreeViewItem>();
     int n = 0;
     foreach (XmlNode node in nodes)
     {
         firstLevel.Add(new TreeViewItem());
         firstLevel[n].Header = node.Attributes["id"].Value;
         List<TreeViewItem> secondLevel = new List<TreeViewItem>();
         int k=0;
         foreach (XmlNode m in node.ChildNodes)
         {
             string str = m.Attributes["name"].Value + " " + m.Attributes["status"].Value;
             secondLevel.Add(new TreeViewItem());
             secondLevel[k].Header = str;
             firstLevel[n].Items.Add(secondLevel[k]);
             k++;
         }
         core.Items.Add(firstLevel[n]);
         n++;
     }
     TreeViewLog.Items.Add(core);
 }
Example #26
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Border = ((System.Windows.Controls.Border)(target));
                return;

            case 2:
                this.UserNameTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 3:
                this.FruitTextBox = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.Tree = ((System.Windows.Controls.TreeView)(target));
                return;

            case 5:
                this.Friend = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 6:
                this.AddFriendBtn = ((System.Windows.Controls.Button)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #27
0
 public static TreeStatus Save(TreeViewItem treeViewItem)
 {
     if (treeViewItem == null) return null;
     TreeStatus status = new TreeStatus(treeViewItem);
     SaveStatus(treeViewItem, status);
     return status;
 }
		public MainWindow()
		{
			this.InitializeComponent();

            
           

            treeitem = new List<TreeViewItem>();


            entityproperty = new EntityProperty();
            entityproperty.Name = myThumb1.Title;

            ent = new TreeViewItem();

            ent.Header = entityproperty.Name;

            

            treeitem.Add(ent);
            
            



            treeView1.ItemsSource = treeitem;


            
            
			// Insert code required on object creation below this point.
		}
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.btnClick = ((System.Windows.Controls.Button)(target));

            #line 11 "..\..\TreeViewExample.xaml"
                this.btnClick.Click += new System.Windows.RoutedEventHandler(this.btnClick_Click);

            #line default
            #line hidden
                return;

            case 2:
                this.treeView = ((System.Windows.Controls.TreeView)(target));
                return;

            case 3:
                this.tvOdd = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 4:
                this.tvEven = ((System.Windows.Controls.TreeViewItem)(target));
                return;
            }
            this._contentLoaded = true;
        }
        private void ProcessElement(DependencyObject element, TreeViewItem previousItem)
        { 
            // Create a TreeViewItem for the current element
            TreeViewItem item = new TreeViewItem();
            item.Header = element.GetType().Name;
            item.IsExpanded = true;

            // Check whether this item should be added to the root of the tree
            //(if it's the first item), or nested under another item.
            if (previousItem == null)
            {
                treeElements.Items.Add(item);
            }
            else
            {
                previousItem.Items.Add(item);
            }

            // Check if this element contains other elements
            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(element); i++)
            {
                // Process each contained element recursively
                ProcessElement(VisualTreeHelper.GetChild(element, i), item);
            }
        }
Example #31
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.This = ((ICSharpCode.Data.Core.UI.UserControls.DatabasesTreeView)(target));
                return;

            case 2:
                this.tviDatabases = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 3:

            #line 20 "..\..\..\UserControls\DatabasesTreeView.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.mnuAddDatabase_Click);

            #line default
            #line hidden
                return;

            case 4:

            #line 21 "..\..\..\UserControls\DatabasesTreeView.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.mnuRefresh_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Example #32
0
        //private static void ProcessNode(HtmlNode node, Stack<HtmlNode> stack)
        //{
        //    var depth = stack.Count;
        //    var padding = String.Empty.PadLeft(depth, ' ');
        //    stack.Push(node);
        //    try
        //    {
        //        Debug.WriteLine(padding + "Node: " + node.Name);
        //        foreach (var child in node.ChildNodes)
        //        {
        //            ProcessNode(child, stack);
        //        }
        //    }
        //    finally
        //    {
        //        stack.Pop();
        //    }
        //}

        private void button_Click(object sender, RoutedEventArgs e)
        {
            using (var stream = File.OpenRead(@"C:\Documents\bookmarks_7_27_15.html"))
            {
                var doc = new HtmlDocument();
                doc.Load(stream);

                var rootFolder = new Folder { Name = "<root>" };

                ProcessNode(doc.DocumentNode, rootFolder);
                if (rootFolder.Folders.Count == 1)
                    rootFolder = rootFolder.Folders.Single();

                treeView.Items.Add(GetTree(rootFolder));

                var bookmarks = rootFolder.AllBookmarks.ToList();
                bookmarks.Sort(
                    (l, r) => StringComparer.OrdinalIgnoreCase.Compare(l.Href.ToString(), r.Href.ToString()));
                var lookupItem = new TreeViewItem { Header = "Lookup" };
                var lookup = rootFolder.AllBookmarks.ToLookup(b => b.Href.ToString(), b => b.Folder, StringComparer.OrdinalIgnoreCase);
                foreach (var key in lookup)
                {
                    var folders = new HashSet<string>(key.Select(k => k.FullName), StringComparer.OrdinalIgnoreCase);
                    if (folders.Count > 1)
                    {
                        //folders.Sort((l, r) => StringComparer.OrdinalIgnoreCase.Compare(l.FullName, r.FullName));
                        var keyItem = new TreeViewItem { Header = key.Key + " (" + folders.Count + ")" };
                        foreach (var folder in folders.OrderBy(f => f, StringComparer.OrdinalIgnoreCase))
                            keyItem.Items.Add(new TreeViewItem { Header = folder });
                        lookupItem.Items.Add(keyItem);
                    }
                }
                lookupItem.ExpandSubtree();
                treeView.Items.Add(lookupItem);
                var set = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
                foreach (var bookmark in rootFolder.AllBookmarks)
                    set.Add(bookmark.ToString());
                foreach (var txt in set)
                    Debug.WriteLine(txt);

                using (var output = File.OpenWrite(@"C:\Documents\output.html"))
                {
                    output.SetLength(0);
                    using (var writer = new StreamWriter(output))
                    {

                        writer.WriteLine(@"<!DOCTYPE NETSCAPE-Bookmark-file-1>");
                        writer.WriteLine(@"<!-- This is an automatically generated file.");
                        writer.WriteLine(@"     It will be read and overwritten.");
                        writer.WriteLine(@"     DO NOT EDIT! -->");
                        writer.WriteLine(
                            "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html;charset=UTF-8\">");
                        writer.WriteLine(@"<TITLE>Bookmarks</TITLE>");
                        WriteFolder(rootFolder, writer, new HashSet<string>(StringComparer.OrdinalIgnoreCase), "");
                    }
                }

                //Debugger.Break();
            }
        }
        private static bool SelectItem(object o, TreeViewItem parentItem)
        {
            if (parentItem == null)
                return false;

            bool isExpanded = parentItem.IsExpanded;
            if (!isExpanded)
            {
                parentItem.IsExpanded = true;
                parentItem.UpdateLayout();
            }

            TreeViewItem item = parentItem.ItemContainerGenerator.ContainerFromItem(o) as TreeViewItem;
            if (item != null)
            {
                item.IsSelected = true;
                return true;
            }

            bool wasFound = false;
            for (int i = 0; i < parentItem.Items.Count; i++)
            {
                TreeViewItem itm = parentItem.ItemContainerGenerator.ContainerFromIndex(i) as TreeViewItem;
                var found = SelectItem(o, itm);
                if (!found)
                    itm.IsExpanded = false;
                else
                    wasFound = true;
            }

            return wasFound;
        }
Example #34
0
        private TreeViewItem FindNode(TreeViewItem parentNode, ItemCollection nodes, string directory, int attemptNumber = 1)
        {
            if (attemptNumber < 1)
                throw new ArgumentOutOfRangeException("attemptNumber", attemptNumber, "attemptNumber must be >= 1");

            if (attemptNumber > 2)
            {
                return parentNode;
            }

            List<TreeViewItem> childNodes = new List<TreeViewItem>();
            foreach (TreeViewItem childNode in nodes)
            {
                childNodes.Add(childNode);
                DirectoryTreeNode dirNode = childNode as DirectoryTreeNode;
                if (dirNode == null)
                    continue;

                if (string.Compare(dirNode.Directory, directory, true) == 0)
                {
                    return dirNode;
                }
            }

            UpdateNodeChildren((DirectoryTreeNode)parentNode);

            TreeViewItem node = FindNode(parentNode, parentNode.Items, directory, attemptNumber + 1);
            return node;
        }
Example #35
0
 protected TreeViewItem FindItemNodeInChildren(TreeViewItem parent, object item)
 {
     TreeViewItem node = null;
     bool isExpanded = parent.IsExpanded;
     if (!isExpanded) //Can't find child container unless the parent node is Expanded once
     {
         parent.IsExpanded = true;
         parent.UpdateLayout();
     }
     foreach (object data in parent.Items)
     {
         node = parent.ItemContainerGenerator.ContainerFromItem(data) as TreeViewItem;
         if (node != null)
         {
             if (data == item)
                 break;
             node = FindItemNodeInChildren(node, item);
             if (node != null)
                 break;
         }
     }
     if (node == null && parent.IsExpanded != isExpanded)
         parent.IsExpanded = isExpanded;
     if (node != null)
         parent.IsExpanded = true;
     return node;
 }
Example #36
0
 public TreeViewItem[] GetNew()
 {
     ArrayList r = new ArrayList(ForgeNew.Length);
     TreeViewItem t = new TreeViewItem();
     foreach (ForgeVersion Forge in ForgeNew)
     {
         if (Forge.installer == null)
         {
             continue;
         }
         if (t.Header == null)
         {
             t.Header = Forge.mcver;
         }
         if (t.Header.ToString() != Forge.mcver)
         {
             t = new TreeViewItem();
             r.Add(t);
         }
         if (ForgeDownloadUrl.ContainsKey(Forge.vername))
             ForgeDownloadUrl[Forge.vername] = Forge.installer[1];
         else
             ForgeDownloadUrl.Add(Forge.vername, Forge.installer[1]);
         if (ForgeChangeLogUrl.ContainsKey(Forge.vername))
             ForgeChangeLogUrl[Forge.vername] = Forge.installer[1];
         else
             ForgeChangeLogUrl.Add(Forge.vername, Forge.changelog);
         t.Items.Add(Forge.vername);
         Logger.log("获取Forge"+Forge.vername);
     }
     return r.ToArray(typeof(TreeViewItem)) as TreeViewItem[];
 }
        void GetSubdirectories(TreeViewItem item)
        {
            DirectoryInfo dir = item.Tag as DirectoryInfo;
            DirectoryInfo[] subdirs;

            try
            {
                // Get subdirectories.
                subdirs = dir.GetDirectories();
            }
            catch
            {
                return;
            }

            // Loop through subdirectories.
            foreach (DirectoryInfo subdir in subdirs)
            {
                // Create a new TreeViewItem for each directory.
                TreeViewItem subitem = new TreeViewItem();
                subitem.Header = subdir.Name;
                subitem.Tag = subdir;
                item.Items.Add(subitem);

                // Recursively obtain subdirectories.
                GetSubdirectories(subitem);
            }
        }
Example #38
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:
                this.treeView = ((System.Windows.Controls.TreeView)(target));
                return;

            case 3:
                this.SerialPortConfig = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 4:
                this.SetpointParameter = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 5:
                this.MonitorParameter = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 6:
                this.frame = ((System.Windows.Controls.Frame)(target));
                return;
            }
            this._contentLoaded = true;
        }
 void buildTreeLayer(System.Exception e, TreeViewItem parent)
 {
     String exceptionInformation = "\n\r\n\r" + e.GetType().ToString() + "\n\r\n\r";
     parent.DisplayMemberPath = "Header";
     parent.Items.Add(new TreeViewStringSet() { Header = "Type", Content = e.GetType().ToString() });
     PropertyInfo[] memberList = e.GetType().GetProperties();
     foreach (PropertyInfo info in memberList)
     {
         var value = info.GetValue(e, null);
         if (value != null)
         {
             if (info.Name == "InnerException")
             {
                 TreeViewItem treeViewItem = new TreeViewItem();
                 treeViewItem.Header = info.Name;
                 buildTreeLayer(e.InnerException, treeViewItem);
                 parent.Items.Add(treeViewItem);
             }
             else
             {
                 TreeViewStringSet treeViewStringSet = new TreeViewStringSet() { Header = info.Name, Content = value.ToString() };
                 parent.Items.Add(treeViewStringSet);
                 exceptionInformation += treeViewStringSet.Header + "\n\r\n\r" + treeViewStringSet.Content + "\n\r\n\r";
             }
         }
     }
     _exceptionInformationList.Add(exceptionInformation);
 }
        private void Y_Selected(object sender, RoutedEventArgs e)
        {
            System.Windows.Controls.TreeViewItem selectprojectname = sender as System.Windows.Controls.TreeViewItem;
            var q = ProjectDBContext.Project.Where(n => n.ProjectName == selectprojectname.Header.ToString());

            foreach (var project in q)
            {
                projectIDTextBox.Text            = project.ProjectID;
                projectNameTextBox.Text          = project.ProjectName;
                projectCategoryIDComboBox.Text   = project.ProjectCategory.ProjectCategoryName;
                projectSupervisorIDComboBox.Text = project.Employee.EmployeeName;
                projectStatusIDComboBox.Text     = project.Status.StatusName;
                requiredDeptIDComboBox.Text      = project.Department.DepartmentName;
                requiredDeptPMIDComboBox.Text    = project.Employee.EmployeeName;
                startDateTextBox.Text            = project.StartDate.ToString();
                endDateTextBox.Text           = project.EndDate.ToString();
                estStartDateTextBox.Text      = project.EstStartDate.ToString();
                estEndDateTextBox.Text        = project.EstEndDate.ToString();
                inChargeDeptIDComboBox.Text   = project.Department.DepartmentName;
                inChargeDeptPMIDComboBox.Text = project.Employee.EmployeeName;
                isGeneralManagerConcernedCheckBox.IsChecked = project.IsGeneralManagerConcerned;
            }

            treelist1.Model = new ProjectTreeModel(projectIDTextBox.Text, projectNameTextBox.Text);
        }
        /// <summary>
        /// Handles the Loaded event of the Window control.
        /// </summary>
        public void UpdateView()
        {
            this.Items.Clear();

            // Show top-most point in filesystems.
            if (RootPath == null && ShowDrives)
            {
                foreach (string s in Directory.GetLogicalDrives())
                {
                    var item = new TreeViewItem {Header = s, Tag = s, FontWeight = FontWeights.Bold};
                    item.Items.Add(_dummyNode);
                    item.Expanded += Folder_Expanded;
                    this.Items.Add(item);
                }
            }

            // Show specified filesystem.
            else
            {
                var item = new TreeViewItem { Header = _rootPath.Name, Tag = _rootPath, FontWeight = FontWeights.Bold };
                item.Items.Add(_dummyNode);
                item.Expanded += Folder_Expanded;
                this.Items.Add(item);
            }
        }
Example #42
0
        /// <summary>
        /// Handles the TreeView item visible changed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="DependencyPropertyChangedEventArgs" /> instance containing the event data.</param>
        private void HandleTreeViewItemVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            var selectedItem = sender as TreeViewItem;

             // whenever a TreeViewItem becomes visible re-calculate its sub-items
             if (selectedItem != null && selectedItem.IsVisible)
             {
            var dump = selectedItem.DataContext as IObjectDump;

            if (dump != null)
            {
               // remove old sub-items
               foreach (TreeViewItem oldSubItem in selectedItem.Items)
               {
                  oldSubItem.IsVisibleChanged -= HandleTreeViewItemVisibleChanged;
               }

               selectedItem.Items.Clear();

               // add new sub-items for public fields, properties and enumerable members
               foreach (IObjectDump subItemDump in dump.PublicFields.Union(dump.Properties).Union(dump.EnumerableMembers))
               {
                  var newSubItem = new TreeViewItem {Header = subItemDump.ObjectName, DataContext = subItemDump};
                  newSubItem.IsVisibleChanged += HandleTreeViewItemVisibleChanged;
                  selectedItem.Items.Add(newSubItem);
               }
            }
             }
        }
Example #43
0
        private void FileTreeview_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            System.Windows.Controls.TreeViewItem selectedTreeViewItem = ((System.Windows.Controls.TreeViewItem)FileTreeview.SelectedItem);

            //todo - imrpove logic
            if (selectedTreeViewItem == null)
            {
                return;
            }

            TreeViewItem parentItem = null;

            if (selectedTreeViewItem.Parent.GetType().Name == "TreeViewItem")
            {
                parentItem = (TreeViewItem)selectedTreeViewItem.Parent;
            }

            if (selectedTreeViewItem.Header.ToString().EndsWith(MeshFileExtension))
            {
                ChangeMesh(selectedTreeViewItem);
            }
            else
            {
                return;
            }

            return;
        }
Example #44
0
			private void FillLayers(ItemsControl root)
			{
				foreach (var dwgLayer in dwgDocument.GetLayers())
				{
					var layerItem = new TreeViewItem
					{
						Header = dwgLayer.Name
					};

					FillEntities(layerItem, dwgLayer);
					root.Items.Add(layerItem);

					// Помещаем в таблицу соответствующий слой при его выделении в дереве
					var dwgLayerCopy = dwgLayer;
					layerItem.Selected += delegate(object sender, RoutedEventArgs args)
						{
							// Отсеиваем маршрутизируемые события от дочерних узлов
							if (layerItem.Equals(args.Source) && propertyGrid != null)
								propertyGrid.SelectedObject = dwgLayerCopy;
						};

					// Повторяем в дереве изменения значений имен слоев в таблице
					dwgLayerCopy.NameChanged += (sender, newName) => layerItem.Header = newName;
				}
			}
		void pageTreeViewItem_DoubleClick(object sender, MouseButtonEventArgs eventArgs) {
			LOG.Debug("spaceTreeViewItem_MouseLeftButtonDown is called!");
			TreeViewItem clickedItem = eventArgs.Source as TreeViewItem;
			if (clickedItem ==null) {
				return;
			}
			Confluence.Page page = clickedItem.Tag as Confluence.Page;
			if (page == null) {
				return;
			}
			if (!clickedItem.HasItems) {
				LOG.Debug("Loading pages for page: " + page.Title);
				(new Thread(() => {
					Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)(() => {ShowBusy.Visibility = Visibility.Visible;}));
					List<Confluence.Page> pages = confluenceConnector.getPageChildren(page);
					Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)(() => {
						foreach(Confluence.Page childPage in pages) {
							LOG.Debug("Adding page: " + childPage.Title);
							TreeViewItem pageTreeViewItem = new TreeViewItem();
							pageTreeViewItem.Header = childPage.Title;
							pageTreeViewItem.Tag = childPage;
							clickedItem.Items.Add(pageTreeViewItem);
							pageTreeViewItem.PreviewMouseDoubleClick += new MouseButtonEventHandler(pageTreeViewItem_DoubleClick);
							pageTreeViewItem.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(pageTreeViewItem_Click);
						}
						ShowBusy.Visibility = Visibility.Collapsed;
					}));
				 }
				) { Name = "Loading childpages for confluence page " + page.Title }).Start();
			}
		}
Example #46
0
        public void testTree1()
        {
            var nodes = Tree1.Items;

            TreeViewItem node1 = new TreeViewItem() { Header = "Folder1" };
            TreeViewItem node2 = new TreeViewItem() { Header = "Folder2" };
            TreeViewItem subNode = new TreeViewItem() { Header = "subNode" };

            nodes.Add(node1);
            nodes.Add(node2);
            node2.Items.Add(subNode);

            List<TreeViewItem> nodeList = new List<TreeViewItem>();
            int listLength = 10;
            for (int i = 0; i < listLength; i++)
            {
                TreeViewItem nd = new TreeViewItem() { Header = "subNode" + i };
                nodeList.Add(nd);
            }
            for (int i = 0; i < listLength; i++)
            {
                node1.Items.Add(nodeList[i]);
            }

            return;
        }
Example #47
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.tvMain = ((System.Windows.Controls.TreeView)(target));
                return;

            case 2:
                this.tvCustomerAdd = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 3:

            #line 47 "..\..\PortalWindow.xaml"
                ((System.Windows.Controls.Label)(target)).MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.LblCustomerAdd);

            #line default
            #line hidden
                return;

            case 4:
                this.tvCustomerList = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 5:
                this.lblStatusBar = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 6:
                this.btnFiltreleme = ((System.Windows.Controls.Button)(target));
                return;

            case 7:
                this.btnOpenCustomerDetail = ((System.Windows.Controls.Button)(target));
                return;

            case 8:
                this.btnClearFilter = ((System.Windows.Controls.Button)(target));
                return;

            case 9:
                this.txtCustomerNo = ((System.Windows.Controls.TextBox)(target));
                return;

            case 10:
                this.txtCustomerTaxNumber = ((System.Windows.Controls.TextBox)(target));
                return;

            case 11:
                this.txtCustomerName = ((System.Windows.Controls.TextBox)(target));
                return;

            case 12:
                this.dgPortalMusteriListleme = ((System.Windows.Controls.DataGrid)(target));
                return;
            }
            this._contentLoaded = true;
        }
 private void ExpandAllNodes(System.Windows.Controls.TreeViewItem treeItem, bool isExpanded)
 {
     treeItem.IsExpanded = isExpanded;
     foreach (var childItem in treeItem.Items.OfType <System.Windows.Controls.TreeViewItem>())
     {
         ExpandAllNodes(childItem, isExpanded);
     }
 }
Example #49
0
 private void TreeViewItem_Expanded(object sender, RoutedEventArgs e)
 {
     System.Windows.Controls.TreeViewItem tvi = e.OriginalSource as System.Windows.Controls.TreeViewItem;
     if (tvi != null)
     {
         ExecuteExpandingCommand(tvi);
     }
 }
Example #50
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.w_News = ((My.University.News)(target));

            #line 8 "..\..\News.xaml"
                this.w_News.Loaded += new System.Windows.RoutedEventHandler(this.w_News_Loaded);

            #line default
            #line hidden

            #line 8 "..\..\News.xaml"
                this.w_News.Closed += new System.EventHandler(this.w_News_Closed);

            #line default
            #line hidden
                return;

            case 2:
                this.wb_socnet = ((System.Windows.Controls.WebBrowser)(target));
                return;

            case 3:
                this.grad = ((System.Windows.Shapes.Rectangle)(target));

            #line 13 "..\..\News.xaml"
                this.grad.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.grad_MouseDown);

            #line default
            #line hidden
                return;

            case 4:
                this.stp_icons = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 5:
                this.tv_univ = ((System.Windows.Controls.TreeView)(target));

            #line 24 "..\..\News.xaml"
                this.tv_univ.SelectedItemChanged += new System.Windows.RoutedPropertyChangedEventHandler <object>(this.TreeView_SelectedItemChanged);

            #line default
            #line hidden
                return;

            case 6:
                this.tv_item1 = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 7:
                this.wb_docs = ((System.Windows.Controls.WebBrowser)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 32 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.TreeView)(target)).SelectedItemChanged += new System.Windows.RoutedPropertyChangedEventHandler <object>(this.TreeView_SelectedItemChanged);

            #line default
            #line hidden
                return;

            case 2:
                this.tvContinents = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 3:
                this.lvCountries = ((System.Windows.Controls.ListView)(target));

            #line 48 "..\..\MainWindow.xaml"
                this.lvCountries.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.ListViewItem_DoubleClick);

            #line default
            #line hidden
                return;

            case 4:
                this.txtCountry = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 5:
                this.txtCapital = ((System.Windows.Controls.TextBox)(target));
                return;

            case 6:
                this.txtPresident = ((System.Windows.Controls.TextBox)(target));
                return;

            case 7:
                this.txtArea = ((System.Windows.Controls.TextBox)(target));
                return;

            case 8:
                this.txtPopulationDensity = ((System.Windows.Controls.TextBox)(target));
                return;

            case 9:
                this.txtCurrency = ((System.Windows.Controls.TextBox)(target));
                return;

            case 10:
                this.txtCurrentTime = ((System.Windows.Controls.TextBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
 {
     switch (connectionId)
     {
     case 1:
         this.tviMenu = ((System.Windows.Controls.TreeViewItem)(target));
         return;
     }
     this._contentLoaded = true;
 }
 public void TreeViewDefaultFocus(ItemsControl control)
 {
     foreach (Object oit in control.Items)
     {
         System.Windows.Controls.TreeViewItem tvi = control.ItemContainerGenerator.ContainerFromItem(oit) as TreeViewItem;
         tvi.IsExpanded = true;
         tvi.Focus();
         break;
     }
 }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 19 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.New_Click);

            #line default
            #line hidden
                return;

            case 2:

            #line 20 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Save_Click);

            #line default
            #line hidden
                return;

            case 3:

            #line 22 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Exit_Click);

            #line default
            #line hidden
                return;

            case 4:

            #line 25 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.TXTImport_Click);

            #line default
            #line hidden
                return;

            case 5:

            #line 26 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.XMLImport_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.TreeItemViewMain = ((System.Windows.Controls.TreeViewItem)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #55
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.bbtnFeedBack = ((System.Windows.Controls.Button)(target));

            #line 16 "..\..\UI.xaml"
                this.bbtnFeedBack.Click += new System.Windows.RoutedEventHandler(this.Btndeneme_Click);

            #line default
            #line hidden
                return;

            case 2:
                this.btnGecmis = ((System.Windows.Controls.Button)(target));

            #line 18 "..\..\UI.xaml"
                this.btnGecmis.Click += new System.Windows.RoutedEventHandler(this.BtnGecmis_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.btnProfil = ((System.Windows.Controls.Button)(target));

            #line 21 "..\..\UI.xaml"
                this.btnProfil.Click += new System.Windows.RoutedEventHandler(this.BtnProfil_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.btnPassword = ((System.Windows.Controls.Button)(target));

            #line 24 "..\..\UI.xaml"
                this.btnPassword.Click += new System.Windows.RoutedEventHandler(this.BtnPassword_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.treeViewItemMagzalar = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 6:
                this.gridMain = ((System.Windows.Controls.Grid)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #56
0
        void openLocalisationFromContextMenu_click(object sender, System.EventArgs e)
        {
            TreeViewItem selectedItem = (TreeViewItem)treeView.SelectedItem;

            if (selectedItem == null)
            {
                return;
            }

            System.Windows.Controls.TreeViewItem selectedItemParent = (System.Windows.Controls.TreeViewItem)selectedItem.Parent;
            Process.Start(selectedItemParent.Tag.ToString());
        }
Example #57
0
        private void TreeViewItem_Expanded(object sender, RoutedEventArgs e)
        {
            if (ignoreFolderTreeEvents)
            {
                return;
            }
            System.Windows.Controls.TreeViewItem src = e.OriginalSource as System.Windows.Controls.TreeViewItem;

            BrowsingFile ent = src.DataContext as BrowsingFile;

            Model.CurrentPath = ent.FullPath;
        }
Example #58
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.tvMain = ((System.Windows.Controls.TreeView)(target));
                return;

            case 2:
                this.tvCustomerAdd = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 3:

            #line 49 "..\..\PortalWindow.xaml"
                ((System.Windows.Controls.Label)(target)).MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.lblCustomerAdd);

            #line default
            #line hidden
                return;

            case 4:
                this.tvCustomerList = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 5:

            #line 57 "..\..\PortalWindow.xaml"
                ((System.Windows.Controls.Label)(target)).MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.lblCustomerList);

            #line default
            #line hidden
                return;

            case 6:
                this.lblStatusBar = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 7:
                this.tcPortal = ((System.Windows.Controls.TabControl)(target));
                return;

            case 8:
                this.tiAnasayfa = ((System.Windows.Controls.TabItem)(target));
                return;

            case 9:
                this.tcTabItemAnasayfa = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #59
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.algorithm_introduction = ((MMAWPF.Algorithm)(target));

            #line 6 "..\..\..\Algorithm.xaml"
                this.algorithm_introduction.Closing += new System.ComponentModel.CancelEventHandler(this.algorithm_introduction_Closing);

            #line default
            #line hidden

            #line 6 "..\..\..\Algorithm.xaml"
                this.algorithm_introduction.Closed += new System.EventHandler(this.algorithm_introduction_Closed);

            #line default
            #line hidden
                return;

            case 2:
                this.grid1 = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.treeView = ((System.Windows.Controls.TreeView)(target));

            #line 18 "..\..\..\Algorithm.xaml"
                this.treeView.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.treeView_MouseDoubleClick);

            #line default
            #line hidden
                return;

            case 4:
                this.algorithm = ((System.Windows.Controls.TreeViewItem)(target));
                return;

            case 5:
                this.gridSplitter1 = ((System.Windows.Controls.GridSplitter)(target));
                return;

            case 6:
                this.contentTextBox = ((System.Windows.Forms.RichTextBox)(target));
                return;

            case 7:
                this.label = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #60
0
        void RefreshItem(swc.TreeViewItem item)
        {
            if (item == null)
            {
                return;
            }
            var old = item.DataContext;

            item.DataContext = null;
            item.DataContext = old;

            item.InvalidateProperty(EtoTreeViewItem.IsExpandedProperty);
            item.HeaderTemplate = item.HeaderTemplate == template1 ? template2 : template1;
        }