Ejemplo n.º 1
0
        public SharperCryptoApiExtensionMetadata(string name, ExtensionType type, string installPath, bool installExtension, string summary, string author, string description,
                                                 Version version, string source, bool external)
        {
            Name = name;
            EnsureExtensionType(type);
            Type             = type;
            InstallPath      = installPath;
            InstallExtension = installExtension;
            Summary          = summary;
            Version          = version;
            Source           = source;
            External         = external;
            Author           = author;
            Description      = description;

            var extension = Path.GetExtension(installPath);

            if (extension == null)
            {
                throw new ArgumentException("Install path is not a valid file");
            }

            if (extension.EndsWith(".dll"))
            {
                FileType = ExtensionFileType.Assembly;
            }
            else if (extension.EndsWith(".zip"))
            {
                FileType = ExtensionFileType.Assembly;
            }
            else
            {
                throw new NotSupportedException("The file type is not supported");
            }
        }
Ejemplo n.º 2
0
 public virtual IFileMetaData CreateExtensionMetaData(ExtensionFileType extensionFileType)
 {
     return(new ExtensionFileMetaData(extensionFileType));
 }
Ejemplo n.º 3
0
 public ExtensionFileMetaData(ExtensionFileType extensionFileType)
     : base(extensionFileType)
 {
     this.extensionFileType = extensionFileType ?? new ExtensionFileType();
     Fields = new FieldMetaData(this.extensionFileType?.Coreid, this.extensionFileType?.Field);
 }