コード例 #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
ファイル: IoDeviceItem.xaml.cs プロジェクト: guozanhua/phmi
 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;
 }