Exemplo n.º 1
0
        public void FocusFolderList()
        {
            App.Logger.Trace("NotesViewHierachical", "FocusFolderList");

            FolderTreeView.Focus();
            Keyboard.Focus(FolderTreeView);
        }
Exemplo n.º 2
0
        public FreeHFolders()
        {
            _folderTreeView = new FolderTreeView(Utils.NormalizePath(UserData.Path), Utils.NormalizePath(UserData.Path));
            _folderTreeView.CurrentFolderChanged = OnFolderChanged;

            Harmony.CreateAndPatchAll(typeof(FreeHFolders));
        }
Exemplo n.º 3
0
        private void Initialize()
        {
            if (!_initialized)
            {
                if (Cache.FolderTree == null)
                {
                    return;
                }
                if (_treeViewState == null)
                {
                    _treeViewState = new FolderTreeViewState();
                }
                bool firstInit   = _multiColumnHeaderState == null;
                var  headerState = FolderTreeView.CreateDefaultMultiColumnHeaderState(FolderTreeViewRect().width);
                if (MultiColumnHeaderState.CanOverwriteSerializedFields(_multiColumnHeaderState, headerState))
                {
                    MultiColumnHeaderState.OverwriteSerializedFields(_multiColumnHeaderState, headerState);
                }
                _multiColumnHeaderState = headerState;

                var multiColumnHeader = new FolderMultiColumnHeader(headerState);
                if (firstInit)
                {
                    multiColumnHeader.ResizeToFit();
                }

                var treeModel = new TreeModel <FolderTreeElement>(GetData());
                _treeView            = new FolderTreeView(_treeViewState, multiColumnHeader, treeModel);
                _treeViewState.View  = _treeView;
                _treeViewState.Cache = Cache;
                _searchField         = new SearchField();
                _searchField.downOrUpArrowKeyPressed += _treeView.SetFocusAndEnsureSelectedItem;
                _initialized = true;
            }
        }
Exemplo n.º 4
0
        public SceneFolders()
        {
            _folderTreeView = new FolderTreeView(Utils.NormalizePath(UserData.Path), Path.Combine(Utils.NormalizePath(UserData.Path), @"studio\scene"));
            _folderTreeView.CurrentFolderChanged = OnFolderChanged;

            Harmony.CreateAndPatchAll(typeof(SceneFolders));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Create a record of the expanded/collapsed state of the tree.
        /// </summary>
        /// <param name="view">The tree view.</param>
        /// <returns>The record of the expanded/collapsed state.</returns>
        public static ExpandState RecordExpandState(this FolderTreeView view)
        {
            ExpandState expand = new ExpandState()
            {
                Node = view.ItemsSource as FolderTreeNode, Children = new List <ExpandState>()
            };

            foreach (FolderTreeNode node in expand.Node)
            {
                TreeViewItem treeViewItem = view.ItemContainerGenerator.ContainerFromItem(node) as TreeViewItem;

                if (treeViewItem != null)
                {
                    expand.Children.Add(TreeViewHelper.RecordExpandState(treeViewItem));
                }
                // We can't wait for the item to be generated, so we'll to ignore it.
                else
                {
                    expand.Children.Add(new ExpandState()
                    {
                        Node = node, Children = null
                    });
                }
            }

            return(expand);
        }
        public FreeHFolders()
        {
            _folderTreeView = new FolderTreeView(Overlord.GetUserDataRootPath(), Overlord.GetDefaultPath(0));
            _folderTreeView.CurrentFolderChanged = OnFolderChanged;

            Overlord.Init();
        }
Exemplo n.º 7
0
        public NewGameFolders()
        {
            _folderTreeView = new FolderTreeView(Utils.NormalizePath(UserData.Path), Path.Combine(Utils.NormalizePath(UserData.Path), "chara/male/"));
            _folderTreeView.CurrentFolderChanged = OnFolderChanged;

            Harmony.CreateAndPatchAll(typeof(NewGameFolders));
        }
Exemplo n.º 8
0
        public ClassroomFolders()
        {
            _folderTreeView = new FolderTreeView(Utils.NormalizePath(UserData.Path), Path.Combine(Utils.NormalizePath(UserData.Path), "chara/female/"));
            _folderTreeView.CurrentFolderChanged = OnFolderChanged;

            HarmonyWrapper.PatchAll(typeof(ClassroomFolders));
        }
Exemplo n.º 9
0
        /// <summary>
        /// Class constructor
        /// </summary>
        public ApplicationViewModel()
        {
            // Create and initialize list and combobox viemodel
            FolderView = ExplorerFactory.CreateList();

            FolderView.AddRecentFolder(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
            FolderView.AddRecentFolder(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), true);

            FolderView.AddFilter("Executeable files", "*.exe;*.bat");
            FolderView.AddFilter("Image files", "*.png;*.jpg;*.jpeg");
            FolderView.AddFilter("LaTex files", "*.tex");
            FolderView.AddFilter("Text files", "*.txt");
            FolderView.AddFilter("All Files", "*.*");

            // Create and initialize tree, list, and combobox viemodel
            FolderTreeView = ExplorerFactory.CreateTreeList();
            FolderTreeView.AddRecentFolder(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
            FolderTreeView.AddRecentFolder(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), true);

            FolderTreeView.AddFilter("Executeable files", "*.exe;*.bat");
            FolderTreeView.AddFilter("Image files", "*.png;*.jpg;*.jpeg");
            FolderTreeView.AddFilter("LaTex files", "*.tex");
            FolderTreeView.AddFilter("Text files", "*.txt");
            FolderTreeView.AddFilter("All Files", "*.*");

            _SelectedControllerTestViewModel    = new object[2];
            _SelectedControllerTestViewModel[0] = FolderView;
            _SelectedControllerTestViewModel[1] = FolderTreeView;

            // Set this as selected test by default ...
            SelectedTestviewModelIndex = 1;
        }
    private void Init()
    {
        win = this;
       config= LanguageDataUtils.LoadEditorConfig();

        if(config == null)
        {
            return;
        }

        if (!config.gameExistLanguages.Contains(currentLanguage))
        {
            currentLanguage = config.defaultLanguage;
        }
        s_languageFullKeyFileNameList= LanguageDataEditorUtils.LoadLangusgeAllFileNames(currentLanguage);
        if (!string.IsNullOrEmpty(selectFullFileName))
        {
            currentFileDataTable = LanguageDataUtils.LoadFileData(currentLanguage, selectFullFileName);
        }
        if (treeViewState == null)
            treeViewState = new TreeViewState();

        treeView = new FolderTreeView(treeViewState);

        treeView.SetData(s_languageFullKeyFileNameList);
        treeView.dblclickItemCallBack = ModuleFileDblclickItemCallBack;
        treeView.selectCallBack = ModuleFileFolderSelectCallBack;
    }
Exemplo n.º 11
0
        /// <summary>
        /// Call this method to initialize viewmodel items that might need to display
        /// progress information (e.g. call this in OnLoad() method of view)
        /// </summary>
        /// <param name="path"></param>
        public void InitializeViewModel(IPathModel path)
        {
            // Navigate demo controller without Treeview to this location
            FolderView.NavigateToFolder(path);

            // Navigate demo controller with Treeview to this location
            FolderTreeView.NavigateToFolder(path);
        }
Exemplo n.º 12
0
        public MakerFolders()
        {
            _folderTreeView = new FolderTreeView(Utils.NormalizePath(UserData.Path), Utils.NormalizePath(UserData.Path));
            _folderTreeView.CurrentFolderChanged = OnFolderChanged;

            HarmonyWrapper.PatchAll(typeof(MakerFolders));
            MakerCardSave.RegisterNewCardSavePathModifier(DirectoryPathModifier, null);
        }
Exemplo n.º 13
0
        public HOutfitFolders()
        {
            _folderTreeView = new FolderTreeView(Utils.NormalizePath(UserData.Path), Utils.NormalizePath(UserData.Path))
            {
                CurrentFolderChanged = OnFolderChanged
            };

            Harmony.CreateAndPatchAll(typeof(HOutfitFolders));
        }
Exemplo n.º 14
0
        public NewGameFolders()
        {
            _folderTreeView = new FolderTreeView(Overlord.GetUserDataRootPath(), Overlord.GetDefaultPath(0))
            {
                CurrentFolderChanged = OnFolderChanged
            };

            Overlord.Init();
        }
        public ClassroomFolders()
        {
            _folderTreeView = new FolderTreeView(Overlord.GetUserDataRootPath(), Overlord.GetDefaultPath(0));
            _folderTreeView.CurrentFolderChanged = OnFolderChanged;

            Overlord.Init();

            Harmony.CreateAndPatchAll(typeof(ClassroomFolders));
        }
Exemplo n.º 16
0
        public MakerOutfitFolders()
        {
            _folderTreeView = new FolderTreeView(Utils.NormalizePath(UserData.Path), Utils.NormalizePath(UserData.Path))
            {
                CurrentFolderChanged = OnFolderChanged
            };

            Harmony.CreateAndPatchAll(typeof(MakerOutfitFolders));
            //MakerCardSave.RegisterNewCardSavePathModifier(DirectoryPathModifier, null);
        }
Exemplo n.º 17
0
        public FolderTree()
        {
            _folderTreeView = new FolderTreeView();
            _folderTreeView.BeforeBrowse += OnFolderTreeViewBeforeBrowse;
            _folderTreeView.AfterBrowse  += OnFolderTreeViewAfterBrowse;
            _folderTreeView.AfterSelect  += OnFolderTreeViewAfterSelect;
            _folderTreeView.KeyDown      += OnFolderTreeViewKeyDown;
            _folderTreeView.KeyPress     += OnFolderTreeViewKeyPress;
            _folderTreeView.KeyUp        += OnFolderTreeViewKeyUp;
            _folderTreeView.Dock          = DockStyle.Fill;

            base.SuspendLayout();
            base.Controls.Add(_folderTreeView);
            base.ResumeLayout(false);
        }
Exemplo n.º 18
0
		public FolderTree()
		{
			_folderTreeView = new FolderTreeView();
			_folderTreeView.BeforeBrowse += OnFolderTreeViewBeforeBrowse;
			_folderTreeView.AfterBrowse += OnFolderTreeViewAfterBrowse;
			_folderTreeView.AfterSelect += OnFolderTreeViewAfterSelect;
			_folderTreeView.KeyDown += OnFolderTreeViewKeyDown;
			_folderTreeView.KeyPress += OnFolderTreeViewKeyPress;
			_folderTreeView.KeyUp += OnFolderTreeViewKeyUp;
			_folderTreeView.Dock = DockStyle.Fill;

			base.SuspendLayout();
			base.Controls.Add(_folderTreeView);
			base.ResumeLayout(false);
		}
Exemplo n.º 19
0
 private void OnInitialized(object sender, EventArgs e)
 {
     _drives = DriveInfo.GetDrives();
     for (int i = 0, icnt = _drives.Length; i < icnt; ++i)
     {
         Folder       folder = new Folder(_drives[i].RootDirectory, _drives[i]);
         TreeViewItem item   = GetTypeValueSetupTreeViewItem(folder);
         item.Tag = folder;
         FolderTreeView.Items.Add(item);
     }
     ExpandRoot();
     FolderTreeView.UpdateLayout();
     if (_currentTreeViewItem != null)
     {
         _currentTreeViewItem.BringIntoView();
     }
 }
Exemplo n.º 20
0
        /// <summary>
        /// Class constructor
        /// </summary>
        public ApplicationViewModel()
        {
            // Create and initialize tree, list, and combobox viemodel
            FolderTreeView = ExplorerTestFactory.CreateTreeList();
            FolderTreeView.AddRecentFolder(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
            FolderTreeView.AddRecentFolder(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), true);
            FolderTreeView.AddRecentFolder(Environment.GetFolderPath(Environment.SpecialFolder.History), true);
            FolderTreeView.AddRecentFolder(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), true);
            FolderTreeView.AddRecentFolder(Environment.GetFolderPath(Environment.SpecialFolder.MyMusic), true);
            FolderTreeView.AddRecentFolder(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), true);
            FolderTreeView.AddRecentFolder(Environment.GetFolderPath(Environment.SpecialFolder.MyVideos), true);

            FolderTreeView.AddFilter("Executeable files", "*.exe;*.bat");
            FolderTreeView.AddFilter("Image files", "*.png;*.jpg;*.jpeg");
            FolderTreeView.AddFilter("LaTex files", "*.tex");
            FolderTreeView.AddFilter("Text files", "*.txt");
            FolderTreeView.AddFilter("All Files", "*.*");
        }
Exemplo n.º 21
0
        /// <summary>
        /// Detects if a TreeNode is right clicked and then displays a menu
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FolderTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                selectedTreeNode = FolderTreeView.GetNodeAt(e.X, e.Y);

                ContextMenuStrip  mnu         = new ContextMenuStrip();
                ToolStripMenuItem mnuGenerate = new ToolStripMenuItem("Generate Report");

                //Assign event handlers
                mnuGenerate.Click += new EventHandler(mnuGenerate_Click);

                //Add to main context menu
                mnu.Items.AddRange(new ToolStripItem[] { mnuGenerate });
                //Assign to datagridview
                //FolderTreeView.Nodes[0].ContextMenuStrip = mnu;

                selectedTreeNode.ContextMenuStrip = mnu;
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// Replay an expanded state record to return a tree to its previously expanded/collapsed state.
        /// </summary>
        /// <param name="view">The tree view.</param>
        /// <param name="expand">The expand record.</param>
        public static void ReplayExpandState(this FolderTreeView view, ExpandState expand)
        {
            if (view.ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated)
            {
                TreeViewHelper.ReplayExpandState(view, expand.Children);
            }
            else
            {
                EventHandler replay = null;

                replay = delegate(object sender, EventArgs eventArgs)
                {
                    if (view.ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated)
                    {
                        view.ItemContainerGenerator.StatusChanged -= replay;
                        TreeViewHelper.ReplayExpandState(view, expand.Children);
                    }
                };

                view.ItemContainerGenerator.StatusChanged += replay;
            }
        }
    private void Init()
    {
        win = this;
        ResourcesConfigManager.Initialize();

        m_currentSelectIndex = 0;
        EditorGUIStyleData.Init();

        FindAllDataName();
        LoadEditorConfig();
        LoadConfig();

        if (treeViewState == null)
        {
            treeViewState = new TreeViewState();
        }

        treeView = new FolderTreeView(treeViewState);

        treeView.SetData(s_languageFullKeyList);
        treeView.dblclickItemCallBack = ModuleFileDblclickItemCallBack;
        treeView.selectCallBack       = ModuleFileFolderSelectCallBack;
    }
Exemplo n.º 24
0
 private void OnLoaded(object sender, RoutedEventArgs e)
 {
     _drives = DriveInfo.GetDrives();
     for (int i = 0, icnt = _drives.Length; i < icnt; ++i)
     {
         Folder       folder = new Folder(_drives[i].RootDirectory, _drives[i]);
         TreeViewItem item   = GetTypeValueSetupTreeViewItem(folder);
         item.Tag = folder;
         FolderTreeView.Items.Add(item);
     }
     ExpandRoot();
     FolderTreeView.UpdateLayout();
     if (_currentTreeViewItem != null)
     {
         //ScrollViewer scroller = null;
         //DependencyObject border = VisualTreeHelper.GetChild(FolderTreeView, 0);
         //if (border != null)
         //{
         //    scroller = VisualTreeHelper.GetChild(border, 0) as ScrollViewer;
         //}
         //scroller.ScrollToBottom();
         _currentTreeViewItem.BringIntoView();
     }
 }
Exemplo n.º 25
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("");
     System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("My Computer", 2, 3, new System.Windows.Forms.TreeNode[] {
         treeNode1
     });
     System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("My Network Places", 4, 5);
     System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("");
     System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("My Documents", 6, 7, new System.Windows.Forms.TreeNode[] {
         treeNode4
     });
     System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("Recycle Bin", 8, 9);
     System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("");
     System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("C-sharp Corner", 10, 11, new System.Windows.Forms.TreeNode[] {
         treeNode7
     });
     System.Windows.Forms.TreeNode treeNode9  = new System.Windows.Forms.TreeNode("New Folder", 12, 13);
     System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("Release", 14, 15);
     System.Windows.Forms.TreeNode treeNode11 = new System.Windows.Forms.TreeNode("");
     System.Windows.Forms.TreeNode treeNode12 = new System.Windows.Forms.TreeNode("Unsorted", 16, 17, new System.Windows.Forms.TreeNode[] {
         treeNode11
     });
     System.Windows.Forms.TreeNode treeNode13 = new System.Windows.Forms.TreeNode("Desktop", 0, 0, new System.Windows.Forms.TreeNode[] {
         treeNode2,
         treeNode3,
         treeNode5,
         treeNode6,
         treeNode8,
         treeNode9,
         treeNode10,
         treeNode12
     });
     System.Windows.Forms.TreeNode treeNode14 = new System.Windows.Forms.TreeNode("");
     System.Windows.Forms.TreeNode treeNode15 = new System.Windows.Forms.TreeNode("My Computer", 2, 3, new System.Windows.Forms.TreeNode[] {
         treeNode14
     });
     System.Windows.Forms.TreeNode treeNode16 = new System.Windows.Forms.TreeNode("My Network Places", 4, 5);
     System.Windows.Forms.TreeNode treeNode17 = new System.Windows.Forms.TreeNode("");
     System.Windows.Forms.TreeNode treeNode18 = new System.Windows.Forms.TreeNode("My Documents", 6, 7, new System.Windows.Forms.TreeNode[] {
         treeNode17
     });
     System.Windows.Forms.TreeNode treeNode19 = new System.Windows.Forms.TreeNode("Recycle Bin", 8, 9);
     System.Windows.Forms.TreeNode treeNode20 = new System.Windows.Forms.TreeNode("");
     System.Windows.Forms.TreeNode treeNode21 = new System.Windows.Forms.TreeNode("C-sharp Corner", 10, 11, new System.Windows.Forms.TreeNode[] {
         treeNode20
     });
     System.Windows.Forms.TreeNode treeNode22 = new System.Windows.Forms.TreeNode("New Folder", 12, 13);
     System.Windows.Forms.TreeNode treeNode23 = new System.Windows.Forms.TreeNode("Release", 14, 15);
     System.Windows.Forms.TreeNode treeNode24 = new System.Windows.Forms.TreeNode("");
     System.Windows.Forms.TreeNode treeNode25 = new System.Windows.Forms.TreeNode("Unsorted", 16, 17, new System.Windows.Forms.TreeNode[] {
         treeNode24
     });
     System.Windows.Forms.TreeNode treeNode26 = new System.Windows.Forms.TreeNode("Desktop", 0, 0, new System.Windows.Forms.TreeNode[] {
         treeNode15,
         treeNode16,
         treeNode18,
         treeNode19,
         treeNode21,
         treeNode22,
         treeNode23,
         treeNode25
     });
     System.Windows.Forms.TreeNode treeNode27 = new System.Windows.Forms.TreeNode("");
     System.Windows.Forms.TreeNode treeNode28 = new System.Windows.Forms.TreeNode("My Computer", 2, 3, new System.Windows.Forms.TreeNode[] {
         treeNode27
     });
     System.Windows.Forms.TreeNode treeNode29 = new System.Windows.Forms.TreeNode("My Network Places", 4, 5);
     System.Windows.Forms.TreeNode treeNode30 = new System.Windows.Forms.TreeNode("");
     System.Windows.Forms.TreeNode treeNode31 = new System.Windows.Forms.TreeNode("My Documents", 6, 7, new System.Windows.Forms.TreeNode[] {
         treeNode30
     });
     System.Windows.Forms.TreeNode treeNode32 = new System.Windows.Forms.TreeNode("Recycle Bin", 8, 9);
     System.Windows.Forms.TreeNode treeNode33 = new System.Windows.Forms.TreeNode("");
     System.Windows.Forms.TreeNode treeNode34 = new System.Windows.Forms.TreeNode("C-sharp Corner", 10, 11, new System.Windows.Forms.TreeNode[] {
         treeNode33
     });
     System.Windows.Forms.TreeNode treeNode35 = new System.Windows.Forms.TreeNode("New Folder", 12, 13);
     System.Windows.Forms.TreeNode treeNode36 = new System.Windows.Forms.TreeNode("Release", 14, 15);
     System.Windows.Forms.TreeNode treeNode37 = new System.Windows.Forms.TreeNode("");
     System.Windows.Forms.TreeNode treeNode38 = new System.Windows.Forms.TreeNode("Unsorted", 16, 17, new System.Windows.Forms.TreeNode[] {
         treeNode37
     });
     System.Windows.Forms.TreeNode treeNode39 = new System.Windows.Forms.TreeNode("Desktop", 0, 0, new System.Windows.Forms.TreeNode[] {
         treeNode28,
         treeNode29,
         treeNode31,
         treeNode32,
         treeNode34,
         treeNode35,
         treeNode36,
         treeNode38
     });
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmThumuc));
     this.panel1     = new System.Windows.Forms.Panel();
     this.treeView1  = new FolderTreeView();
     this.thumuc     = new System.Windows.Forms.TextBox();
     this.label2     = new System.Windows.Forms.Label();
     this.butOk      = new System.Windows.Forms.Button();
     this.butKetthuc = new System.Windows.Forms.Button();
     this.panel1.SuspendLayout();
     this.SuspendLayout();
     //
     // panel1
     //
     this.panel1.Controls.Add(this.treeView1);
     this.panel1.Location = new System.Drawing.Point(8, 8);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(336, 290);
     this.panel1.TabIndex = 1;
     //
     // treeView1
     //
     this.treeView1.Dock          = System.Windows.Forms.DockStyle.Fill;
     this.treeView1.HideSelection = false;
     this.treeView1.Location      = new System.Drawing.Point(0, 0);
     this.treeView1.Name          = "treeView1";
     treeNode1.Name                = "";
     treeNode1.Text                = "";
     treeNode2.ImageIndex          = 2;
     treeNode2.Name                = "";
     treeNode2.SelectedImageIndex  = 3;
     treeNode2.Text                = "My Computer";
     treeNode3.ImageIndex          = 4;
     treeNode3.Name                = "";
     treeNode3.SelectedImageIndex  = 5;
     treeNode3.Text                = "My Network Places";
     treeNode4.Name                = "";
     treeNode4.Text                = "";
     treeNode5.ImageIndex          = 6;
     treeNode5.Name                = "";
     treeNode5.SelectedImageIndex  = 7;
     treeNode5.Text                = "My Documents";
     treeNode6.ImageIndex          = 8;
     treeNode6.Name                = "";
     treeNode6.SelectedImageIndex  = 9;
     treeNode6.Text                = "Recycle Bin";
     treeNode7.Name                = "";
     treeNode7.Text                = "";
     treeNode8.ImageIndex          = 10;
     treeNode8.Name                = "";
     treeNode8.SelectedImageIndex  = 11;
     treeNode8.Text                = "C-sharp Corner";
     treeNode9.ImageIndex          = 12;
     treeNode9.Name                = "";
     treeNode9.SelectedImageIndex  = 13;
     treeNode9.Text                = "New Folder";
     treeNode10.ImageIndex         = 14;
     treeNode10.Name               = "";
     treeNode10.SelectedImageIndex = 15;
     treeNode10.Text               = "Release";
     treeNode11.Name               = "";
     treeNode11.Text               = "";
     treeNode12.ImageIndex         = 16;
     treeNode12.Name               = "";
     treeNode12.SelectedImageIndex = 17;
     treeNode12.Text               = "Unsorted";
     treeNode13.ImageIndex         = 0;
     treeNode13.Name               = "";
     treeNode13.SelectedImageIndex = 0;
     treeNode13.Text               = "Desktop";
     treeNode14.Name               = "";
     treeNode14.Text               = "";
     treeNode15.ImageIndex         = 2;
     treeNode15.Name               = "";
     treeNode15.SelectedImageIndex = 3;
     treeNode15.Text               = "My Computer";
     treeNode16.ImageIndex         = 4;
     treeNode16.Name               = "";
     treeNode16.SelectedImageIndex = 5;
     treeNode16.Text               = "My Network Places";
     treeNode17.Name               = "";
     treeNode17.Text               = "";
     treeNode18.ImageIndex         = 6;
     treeNode18.Name               = "";
     treeNode18.SelectedImageIndex = 7;
     treeNode18.Text               = "My Documents";
     treeNode19.ImageIndex         = 8;
     treeNode19.Name               = "";
     treeNode19.SelectedImageIndex = 9;
     treeNode19.Text               = "Recycle Bin";
     treeNode20.Name               = "";
     treeNode20.Text               = "";
     treeNode21.ImageIndex         = 10;
     treeNode21.Name               = "";
     treeNode21.SelectedImageIndex = 11;
     treeNode21.Text               = "C-sharp Corner";
     treeNode22.ImageIndex         = 12;
     treeNode22.Name               = "";
     treeNode22.SelectedImageIndex = 13;
     treeNode22.Text               = "New Folder";
     treeNode23.ImageIndex         = 14;
     treeNode23.Name               = "";
     treeNode23.SelectedImageIndex = 15;
     treeNode23.Text               = "Release";
     treeNode24.Name               = "";
     treeNode24.Text               = "";
     treeNode25.ImageIndex         = 16;
     treeNode25.Name               = "";
     treeNode25.SelectedImageIndex = 17;
     treeNode25.Text               = "Unsorted";
     treeNode26.ImageIndex         = 0;
     treeNode26.Name               = "";
     treeNode26.SelectedImageIndex = 0;
     treeNode26.Text               = "Desktop";
     treeNode27.Name               = "";
     treeNode27.Text               = "";
     treeNode28.ImageIndex         = 2;
     treeNode28.Name               = "";
     treeNode28.SelectedImageIndex = 3;
     treeNode28.Text               = "My Computer";
     treeNode29.ImageIndex         = 4;
     treeNode29.Name               = "";
     treeNode29.SelectedImageIndex = 5;
     treeNode29.Text               = "My Network Places";
     treeNode30.Name               = "";
     treeNode30.Text               = "";
     treeNode31.ImageIndex         = 6;
     treeNode31.Name               = "";
     treeNode31.SelectedImageIndex = 7;
     treeNode31.Text               = "My Documents";
     treeNode32.ImageIndex         = 8;
     treeNode32.Name               = "";
     treeNode32.SelectedImageIndex = 9;
     treeNode32.Text               = "Recycle Bin";
     treeNode33.Name               = "";
     treeNode33.Text               = "";
     treeNode34.ImageIndex         = 10;
     treeNode34.Name               = "";
     treeNode34.SelectedImageIndex = 11;
     treeNode34.Text               = "C-sharp Corner";
     treeNode35.ImageIndex         = 12;
     treeNode35.Name               = "";
     treeNode35.SelectedImageIndex = 13;
     treeNode35.Text               = "New Folder";
     treeNode36.ImageIndex         = 14;
     treeNode36.Name               = "";
     treeNode36.SelectedImageIndex = 15;
     treeNode36.Text               = "Release";
     treeNode37.Name               = "";
     treeNode37.Text               = "";
     treeNode38.ImageIndex         = 16;
     treeNode38.Name               = "";
     treeNode38.SelectedImageIndex = 17;
     treeNode38.Text               = "Unsorted";
     treeNode39.ImageIndex         = 0;
     treeNode39.Name               = "";
     treeNode39.SelectedImageIndex = 0;
     treeNode39.Text               = "Desktop";
     this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
         treeNode13,
         treeNode26,
         treeNode39
     });
     this.treeView1.Size         = new System.Drawing.Size(336, 290);
     this.treeView1.TabIndex     = 3;
     this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
     //
     // thumuc
     //
     this.thumuc.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.thumuc.BackColor = System.Drawing.SystemColors.HighlightText;
     this.thumuc.Enabled   = false;
     this.thumuc.Location  = new System.Drawing.Point(64, 301);
     this.thumuc.Name      = "thumuc";
     this.thumuc.Size      = new System.Drawing.Size(280, 20);
     this.thumuc.TabIndex  = 5;
     //
     // label2
     //
     this.label2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.label2.Location  = new System.Drawing.Point(8, 301);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(64, 23);
     this.label2.TabIndex  = 4;
     this.label2.Text      = "Thư mục :";
     this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // butOk
     //
     this.butOk.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.butOk.Location   = new System.Drawing.Point(115, 332);
     this.butOk.Name       = "butOk";
     this.butOk.Size       = new System.Drawing.Size(60, 25);
     this.butOk.TabIndex   = 6;
     this.butOk.Text       = "&Chọn";
     this.butOk.Click     += new System.EventHandler(this.butOk_Click);
     //
     // butKetthuc
     //
     this.butKetthuc.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.butKetthuc.Location   = new System.Drawing.Point(177, 332);
     this.butKetthuc.Name       = "butKetthuc";
     this.butKetthuc.Size       = new System.Drawing.Size(60, 25);
     this.butKetthuc.TabIndex   = 7;
     this.butKetthuc.Text       = "&Kết thúc";
     this.butKetthuc.Click     += new System.EventHandler(this.butKetthuc_Click);
     //
     // frmThumuc
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(352, 373);
     this.Controls.Add(this.butKetthuc);
     this.Controls.Add(this.butOk);
     this.Controls.Add(this.thumuc);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.panel1);
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name          = "frmThumuc";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text          = "Chọn thư mục";
     this.Load         += new System.EventHandler(this.frmThumuc_Load);
     this.panel1.ResumeLayout(false);
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Exemplo n.º 26
0
 public void ClearCaches()
 {
     _folderTreeView = null;
     _backupFileInfos.Clear();
 }
Exemplo n.º 27
0
        // получение сообщений
        void ReceiveMessage()
        {
            while (true)
            {
                try
                {
                    EmigrationObject message;
                    int bytes = 0;
                    do
                    {
                        byte[] data = new byte[500000];
                        bytes   = stream.Read(data, 0, data.Length);
                        message = ByteArrayToObject(data) as EmigrationObject;
                        if (message.type == "file")
                        {
                            EmigrationFileInfo efi = (EmigrationFileInfo)message.message;
                            Tabs.Set(() => Tabs.Visibility = Visibility.Hidden);
                            DownloadFile(efi);
                            Tabs.Set(() => Tabs.Visibility = Visibility.Visible);
                        }
                    }while (stream.DataAvailable);

                    switch (message.type)
                    {
                    case "string":

                        break;

                    case "List<EmigrationPathInfo>":
                        List <EmigrationPathInfo> list = (List <EmigrationPathInfo>)message.message;
                        currentFTPpath = list[0].Name;
                        LabelPathFolder.Set(() => LabelPathFolder.Content = currentFTPpath);
                        list.RemoveAt(0);
                        FolderTreeView.Set(() => FolderTreeView.Items.Clear());
                        FolderTreeView.Set(() => {
                            list.ForEach(a => {
                                TemplateFileElement tfe = new TemplateFileElement();
                                tfe.isFile = a.isFile;
                                tfe.path   = a.Name;
                                tfe.icon   = ToImageSource(BytesToIcon(a.ImagePath));
                                FolderTreeView.Items.Add(tfe);
                            });
                        });
                        break;

                    case "DownloadComplete":
                        Tabs.Set(() => Tabs.Visibility = Visibility.Visible);
                        break;
                    }
                }
                catch (Exception ex)
                {
                    Tabs.Set(() => {
                        Tabs.Set(() => Tabs.SelectedIndex = 0);
                        Title = "Client: Disconnect.";
                        this.ShowMessageAsync("Error", ex.Message);
                    });
                    return;
                }
            }
        }
Exemplo n.º 28
0
 /// <summary>
 /// Call this method to initialize viewmodel items that might need to display
 /// progress information (e.g. call this in OnLoad() method of view)
 /// </summary>
 /// <param name="path"></param>
 public void InitializeViewModel(IPathModel path)
 {
     FolderTreeView.NavigateToFolder(path);
 }