Ejemplo n.º 1
0
        internal bool GetVstoAddInData(bool scanManagedInterfaces, bool scanRemote, ref bool isUncPath, ref bool isHttpPath)
        {
            bool flag = true;

            string[] assemblyDetails = (string[])null;
            this.assemblyPath        = (string)null;
            this.vstoRuntime         = (string)null;
            this.assemblyVersion     = Resources.NOT_APPLICABLE;
            this.addInType           = Resources.ADDIN_TYPE_VSTO;
            this.assemblyName        = (string)null;
            this.clrVersion          = (string)null;
            this.supportedInterfaces = (string)null;
            string str = string.Empty;

            if (this.manifestPath.EndsWith(".manifest"))
            {
                this.assemblyPath = this.manifestPath.Substring(0, this.manifestPath.LastIndexOf(".manifest"));
                this.vstoRuntime  = "2005 SE";
            }
            else if (this.manifestPath.EndsWith(".vsto|vstolocal"))
            {
                this.vstoRuntime  = "2008";
                this.clsid        = Resources.NOT_APPLICABLE;
                this.assemblyPath = this.manifestPath.Substring(0, this.manifestPath.LastIndexOf(".vsto|vstolocal")) + ".dll";
            }
            else if (this.manifestPath.EndsWith(".vsto"))
            {
                this.vstoRuntime = "2008";
                this.clsid       = Resources.NOT_APPLICABLE;
                string[] clickOnceInfo = ManifestReader.GetClickOnceInfo(ref this.manifestPath, scanRemote, ref isUncPath, ref isHttpPath);
                this.assemblyPath    = clickOnceInfo[0];
                this.assemblyVersion = clickOnceInfo[1];
            }
            if (File.Exists(this.assemblyPath))
            {
                assemblyDetails = AssemblyScanner.GetAssemblyInfo(this.assemblyPath, this.hostName, true);
            }
            if (assemblyDetails != null && assemblyDetails.Length > 1)
            {
                this.assemblyName        = assemblyDetails[0];
                this.clrVersion          = assemblyDetails[1];
                this.supportedInterfaces = !scanManagedInterfaces ? (string)null : this.GetSupportedInterfaces(assemblyDetails);
            }
            else
            {
                flag = false;
                this.assemblyName        = (string)null;
                this.clrVersion          = (string)null;
                this.supportedInterfaces = (string)null;
            }
            return(flag);
        }