コード例 #1
0
        public PackageFolderContentItem(string folderName, PackageFolderContentItem parent)
        {
            // TODO: Complete member initialization
            Label = folderName;
            Parent = parent;

            Contents = new PackageContentCollection();
        }
コード例 #2
0
        public PackageFolderContentItem(string folderName, PackageFolderContentItem parent)
        {
            // TODO: Complete member initialization
            Label  = folderName;
            Parent = parent;

            Contents = new PackageContentCollection();
        }
コード例 #3
0
ファイル: PackageViewModel.cs プロジェクト: thbin/TraceLab
        public PackageViewModel(IPackage package) : base(string.Empty, null)
        {
            m_package = package;
            PackageReferenceCollection references = new PackageReferenceCollection();

            foreach (IPackageReference reference in m_package.References)
            {
                references.Add(reference);
            }
            Imports = references;
            Label   = m_package.Name;
            Icon    = null; // TODO: Initialize to correct icon.

            // Building package contents hierarchy
            char[] separators = new char[] { '/', '\\' };
            foreach (TraceLabSDK.PackageSystem.IPackageFile file in m_package.Files)
            {
                PackageFolderContentItem pkgFolder = this;
                string[] pathLevels = file.Path.Split(separators, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 1; i < pathLevels.Length; ++i)
                {
                    string levelName = pathLevels[i];
                    if (i < pathLevels.Length - 1)
                    {
                        PackageFolderContentItem folder;
                        if (pkgFolder.Contents.Contains(levelName))
                        {
                            folder = (PackageFolderContentItem)pkgFolder.Contents[levelName];
                        }
                        else
                        {
                            folder = new PackageFolderContentItem(levelName, pkgFolder);
                            pkgFolder.Contents.Add(folder);
                        }
                        pkgFolder = folder;
                    }
                    else
                    {
                        if (pkgFolder.Contents.Contains(levelName) == false)
                        {
                            PackageFileContentItem pkgFile = new PackageFileContentItem(levelName, pkgFolder, file.ID);
                            pkgFolder.Contents.Add(pkgFile);
                        }
                    }
                }
            }

            var visibleList = new List <object>();

            visibleList.Add(Imports);
            visibleList.Add(Contents);
            Visible = visibleList;
        }
コード例 #4
0
 public PackageFileContentItem(string name, PackageFolderContentItem parent, string id) : base()
 {
     Label  = name;
     Parent = parent;
     ID     = id;
 }
コード例 #5
0
 public PackageFileContentItem(string name, PackageFolderContentItem parent, string id) : base()
 {
     Label = name;
     Parent = parent;
     ID = id;
 }