Exemple #1
0
        public NodeViewModel(MegaSDK megaSdk, MNode baseNode)
        {
            this._megaSdk = megaSdk;
            this._baseNode = baseNode;
            this.Name = baseNode.getName();
            this.Size = baseNode.getSize();
            this.CreationTime = ConvertDateToString(_baseNode.getCreationTime()).ToString("dd MMM yyyy");
            this.ModificationTime = ConvertDateToString(_baseNode.getModificationTime()).ToString("dd MMM yyyy");
            this.SizeAndSuffix = Size.ToStringAndSuffix();
            this.Type = baseNode.getType();
            this.NumberOfFiles = this.Type != MNodeType.TYPE_FOLDER ? null : String.Format("{0} {1}", this._megaSdk.getNumChildren(this._baseNode), UiResources.Files);

            if (this.Type == MNodeType.TYPE_FOLDER || this.Type == MNodeType.TYPE_FILE)                
                this.ThumbnailImageUri = new Uri((String)new FileTypeToImageConverter().Convert(this, null, null, null), UriKind.Relative);
        }
Exemple #2
0
        public NodeViewModel(MegaSDK megaSdk, MNode baseNode)
        {
            this._megaSdk         = megaSdk;
            this._baseNode        = baseNode;
            this.Name             = baseNode.getName();
            this.Size             = baseNode.getSize();
            this.CreationTime     = ConvertDateToString(_baseNode.getCreationTime()).ToString("dd MMM yyyy");
            this.ModificationTime = ConvertDateToString(_baseNode.getModificationTime()).ToString("dd MMM yyyy");
            this.SizeAndSuffix    = Size.ToStringAndSuffix();
            this.Type             = baseNode.getType();
            this.NumberOfFiles    = this.Type != MNodeType.TYPE_FOLDER ? null : String.Format("{0} {1}", this._megaSdk.getNumChildren(this._baseNode), UiResources.Files);

            if (this.Type == MNodeType.TYPE_FOLDER || this.Type == MNodeType.TYPE_FILE)
            {
                this.ThumbnailImageUri = new Uri((String) new FileTypeToImageConverter().Convert(this, null, null, null), UriKind.Relative);
            }
        }