示例#1
0
        private static List <string> GetPath(List <string> path, IoDeviceDirectoryItem item)
        {
            if (item == null)
            {
                return(path);
            }
            path.Insert(0, item.ItemName);
            var parent = item.Parent as IoDeviceDirectoryItem;

            return(parent != null?GetPath(path, parent) : path);
        }
示例#2
0
 private void IoDeviceTypeEditorLoaded(object sender, RoutedEventArgs e)
 {
     Loaded -= IoDeviceTypeEditorLoaded;
     if (!DesignerProperties.GetIsInDesignMode(this))
     {
         string path = string.Join(
             Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture),
             Path.GetDirectoryName(Assembly.GetAssembly(typeof(IoDeviceTypeEditor)).Location),
             PHmiConstants.PHmiIoDevicesDirectoryName);
         foreach (TreeViewItem i in IoDeviceDirectoryItem.GetItems(path))
         {
             treeView.Items.Add(i);
         }
         Action action = () =>
                         UpdateType(Type);
         Dispatcher.BeginInvoke(action);
     }
 }
示例#3
0
 private static List<string> GetPath(List<string> path, IoDeviceDirectoryItem item)
 {
     if (item == null)
         return path;
     path.Insert(0, item.ItemName);
     var parent = item.Parent as IoDeviceDirectoryItem;
     return parent != null ? GetPath(path, parent) : path;
 }