GenerateDocId() public static method

public static GenerateDocId ( string serviceName, string platform ) : string
serviceName string
platform string
return string
コード例 #1
0
            public ManifestAssemblyWrapper(string serviceName, string platform, string assemblyPath, bool useNewAppDomain)
            {
                var docId = NDocUtilities.GenerateDocId(serviceName, platform);

                if (useNewAppDomain)
                {
                    Domain = AppDomain.CreateDomain(assemblyPath);
                    var inst = Domain.CreateInstance(this.GetType().Assembly.FullName,
                                                     typeof(AssemblyWrapper).FullName,
                                                     true,
                                                     BindingFlags.CreateInstance | BindingFlags.Public | BindingFlags.Instance,
                                                     null,
                                                     new object[] { docId }, null, null);
                    SdkAssembly = (AssemblyWrapper)inst.Unwrap();
                    SdkAssembly.LoadAssembly(assemblyPath);
                }
                else
                {
                    SdkAssembly = new AssemblyWrapper(docId);
                    SdkAssembly.LoadAssembly(assemblyPath);
                }
            }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="filePath"></param>
        /// <param name="useAppDomain"></param>
        /// <returns></returns>
        private AssemblyWrapper CreateAssemblyWrapper(string filePath, bool useAppDomain)
        {
            var docId = NDocUtilities.GenerateDocId(ServiceName, Options.Platform);

            if (useAppDomain)
            {
                var domain = AppDomain.CreateDomain(filePath);
                var inst   = domain.CreateInstance(this.GetType().Assembly.FullName,
                                                   typeof(AssemblyWrapper).FullName,
                                                   true,
                                                   BindingFlags.CreateInstance | BindingFlags.Public | BindingFlags.Instance,
                                                   null,
                                                   new object[] { docId }, null, null);
                var wrapper = (AssemblyWrapper)inst.Unwrap();
                wrapper.LoadAssembly(filePath);
                return(wrapper);
            }
            else
            {
                var wrapper = new AssemblyWrapper(docId);
                wrapper.LoadAssembly(filePath);
                return(wrapper);
            }
        }