當前位置: 首頁>>代碼示例>>C#>>正文


C# CodeGen.IsThisAssembly方法代碼示例

本文整理匯總了C#中Mono.ILASM.CodeGen.IsThisAssembly方法的典型用法代碼示例。如果您正苦於以下問題:C# CodeGen.IsThisAssembly方法的具體用法?C# CodeGen.IsThisAssembly怎麽用?C# CodeGen.IsThisAssembly使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mono.ILASM.CodeGen的用法示例。


在下文中一共展示了CodeGen.IsThisAssembly方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Run

                        public bool Run ()
                        {
                                if (il_file_list.Count == 0)
                                        Usage ();
                                if (output_file == null)
                                        output_file = CreateOutputFilename ();
                                try {
                                        codegen = new CodeGen (output_file, target == Target.Dll, debugging_info);
                                        foreach (string file_path in il_file_list) {
                                                Report.FilePath = file_path;
                                                ProcessFile (file_path);
                                        }
                                        if (scan_only)
                                                return true;

                                        if (Report.ErrorCount > 0)
                                                return false;

                                        if (target != Target.Dll && !codegen.HasEntryPoint)
                                                Report.Error ("No entry point found.");

					// if we have a key and aren't assembling a netmodule
					if ((keyname != null) && !codegen.IsThisAssembly (null)) {
						LoadKey ();
						// this overrides any attribute or .publickey directive in the source
						codegen.ThisAssembly.SetPublicKey (sn.PublicKey);
					}

                                        try {
                                                codegen.Write ();
                                        } catch {
                                                File.Delete (output_file);
                                                throw;
                                        }
                                } catch (ILAsmException e) {
                                        Error (e.ToString ());
                                        return false;
                                } catch (PEAPI.PEFileException pe) {
                                        Error ("Error : " + pe.Message);
                                        return false;
                                } 

                                try {
					if (sn != null) {
						Report.Message ("Signing assembly with the specified strongname keypair");
						return Sign (output_file);
					}
                                } catch {
                                        return false;
                                }

                                return true;
                        }
開發者ID:nobled,項目名稱:mono,代碼行數:53,代碼來源:Driver.cs

示例2: IsSuppressUnmanaged

                public bool IsSuppressUnmanaged (CodeGen codegen)
                {
			string asmname = "";
			
			BaseTypeRef owner = method_ref.Owner;
			if (owner == null)
				return false;
				
			ExternTypeRef etr = owner as ExternTypeRef;
			if (etr != null) {
				ExternAssembly ea = etr.ExternRef as ExternAssembly;
				if (ea != null)
					asmname = ea.Name;
			}	

                       	return (owner.FullName == "System.Security.SuppressUnmanagedCodeSecurityAttribute" 
				&& (asmname == "mscorlib" || codegen.IsThisAssembly ("mscorlib")) );
                }
開發者ID:nobled,項目名稱:mono,代碼行數:18,代碼來源:CustomAttr.cs


注:本文中的Mono.ILASM.CodeGen.IsThisAssembly方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。