예제 #1
0
 public void GetTreeViewData(System.IO.DirectoryInfo dir, ReadProgramFolderItemViewModel node)
 {
     System.IO.DirectoryInfo[] allDs = dir.GetDirectories();
     node.Nodes = new ObservableCollection <ReadProgramFolderItemViewModel>();
     for (int i = 0; i < allDs.Length; i++)
     {
         ReadProgramFolderItemViewModel child = new ReadProgramFolderItemViewModel();
         child.Name   = allDs[i].Name;
         child.Folder = allDs[i].FullName;
         node.Nodes.Add(child);
         GetTreeViewData(allDs[i], child);
     }
 }
예제 #2
0
        private void GetProgramFolder(JObject jObject)
        {
            ReadProgramFolderItemViewModel readProgramFolder = new ReadProgramFolderItemViewModel();

            if (jObject != null)
            {
                readProgramFolder.RegNum = (int)jObject["regNum"];
                readProgramFolder.Name   = jObject["name"].ToString();
                readProgramFolder.Folder = jObject["folder"].ToString();
                var jArray = JArray.Parse(jObject["nodes"].ToString());

                ReadProgramFolderNode(jArray, readProgramFolder);
                ProgramConfigConsts.CurrentReadProgramFolder = readProgramFolder;
            }
        }
예제 #3
0
        private void ReadProgramFolderNode(JArray jArray, ReadProgramFolderItemViewModel node)
        {
            if (jArray == null)
            {
                return;
            }

            node.Nodes = new System.Collections.ObjectModel.ObservableCollection <ReadProgramFolderItemViewModel>();
            foreach (var item in jArray)
            {
                var childNode = new ReadProgramFolderItemViewModel
                {
                    RegNum = (int)item["regNum"],
                    Name   = item["name"].ToString(),
                    Folder = item["folder"].ToString(),
                };
                node.Nodes.Add(childNode);
                ReadProgramFolderNode(JArray.Parse(item["nodes"].ToString()), childNode);
            }
        }
예제 #4
0
 public ProgramDetailViewModel()
 {
     SelectedProgramFolders = new ReadProgramFolderItemViewModel();
 }
예제 #5
0
 public CNCPathViewModel(ReadProgramFolderItemViewModel programFolderInfo)
 {
     ProgramFolders         = programFolderInfo;
     SelectedProgramFolders = programFolderInfo;
 }
예제 #6
0
 public CNCPathControl(ReadProgramFolderItemViewModel readProgramFolder)
 {
     InitializeComponent();
     this.DataContext = cncPathVM = new CNCPathViewModel(readProgramFolder);
 }