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


C# Function.Contains方法代碼示例

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


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

示例1: GetFunction

        public CodeWriter GetFunction( Function function, IList<TypeMap> typeMapList, IList<CSTypeMap> csTypeMapList, IList<EnumData> enumDatas )
        {
            var writer = new CodeWriter();

            if ((function.Version == null || (function.Version.MajorVersion <= 1 && function.Version.MinorVersion <= 1)) && !function.Contains( "extension" ))
                return writer;
            writer.Indent = 0;
            writer.Append( "_" );
            writer.AppendText( function.Name );
            writer.Indent = 0;
            writer.Append( " = GetProcAdress< " );
            writer.AppendText( function.Name );
            writer.Indent = 0;
            writer.Append( "Delegate >( \"gl" );
            writer.AppendText( function.Name );
            writer.Indent = 0;
            writer.Append( "\" );" );

            return writer;
        }
開發者ID:werwolfby,項目名稱:Managed-OpenGL,代碼行數:20,代碼來源:FunctionGenerator.cs

示例2: GenerateFunction

 public CodeWriter GenerateFunction( Function function, IList<TypeMap> typeMapList, IList<CSTypeMap> csTypeMapList, IList<EnumData> enumDatas )
 {
     if ((function.Version == null || (function.Version.MajorVersion <= 1 && function.Version.MinorVersion <= 1)) && !function.Contains( "extension" ))
         return GenerateOpenGLFunction( function, typeMapList, csTypeMapList, enumDatas );
     return GenerateDelegateFunction( function, typeMapList, csTypeMapList, enumDatas );
 }
開發者ID:werwolfby,項目名稱:Managed-OpenGL,代碼行數:6,代碼來源:FunctionGenerator.cs

示例3: GenerateOpenGLFunction

        public CodeWriter GenerateOpenGLFunction( Function function, IList<TypeMap> typeMapList, IList<CSTypeMap> csTypeMapList, IList<EnumData> enumDatas )
        {
            var writer = new CodeWriter();

            writer.Indent = 0;
            writer.Append( "[DllImport( \"opengl32.dll\", EntryPoint=\"gl" );
            writer.AppendText( function.Name );
            writer.Indent = 0;
            writer.AppendLine( "\" )]" );
            writer.Append( "public static extern " );
            if (function.IsUnsafeMethod(typeMapList, csTypeMapList)){
            writer.Indent = 0;
            writer.Append( "unsafe " );
            }
            writer.AppendText( function.Return.GetCSName( typeMapList, csTypeMapList, enumDatas ) );
            writer.Indent = 0;
            writer.Append( " " );
            writer.AppendText( function.Name );
            writer.Indent = 0;
            writer.Append( "( " );
            {
                var list = new List<CodeWriter>();
                CodeWriter temp;

                foreach (var item in function.ParamList)
                {
                    temp = this.Invoke( "GenerateParam", item, typeMapList, csTypeMapList, enumDatas );
                    list.Add( temp );
                }

                writer.AppendType = AppendType.EmptyLastLine;
                for (var listI = 0; listI < list.Count; listI++)
                {
                    var codeWriter = list[listI];
                    writer.Append( codeWriter );
                    if (listI < list.Count - 1)
                        writer.AppendText( ", " );
                }
                writer.AppendType = AppendType.EmptyLastLine;
            }
            writer.Indent = 0;
            writer.Append( " ); // " );
            if (function.Contains( "extension" )){
            writer.Indent = 0;
            writer.Append( " extension method" );
            }
            writer.Indent = 0;
            writer.AppendLine();
            writer.Indent = 1;

            return writer;
        }
開發者ID:werwolfby,項目名稱:Managed-OpenGL,代碼行數:52,代碼來源:FunctionGenerator.cs

示例4: GenerateDelegateFunction

        public CodeWriter GenerateDelegateFunction( Function function, IList<TypeMap> typeMapList, IList<CSTypeMap> csTypeMapList, IList<EnumData> enumDatas )
        {
            var writer = new CodeWriter();

            writer.Indent = 0;
            writer.Append( "public " );
            if (function.IsUnsafeMethod(typeMapList, csTypeMapList)){
            writer.Indent = 0;
            writer.Append( "unsafe " );
            }
            writer.Indent = 0;
            writer.Append( "delegate " );
            writer.AppendText( function.Return.GetCSName( typeMapList, csTypeMapList, enumDatas ) );
            writer.Indent = 0;
            writer.Append( " " );
            writer.AppendText( function.Name );
            writer.Indent = 0;
            writer.Append( "Delegate( " );
            {
                var list = new List<CodeWriter>();
                CodeWriter temp;

                foreach (var item in function.ParamList)
                {
                    temp = this.Invoke( "GenerateParam", item, typeMapList, csTypeMapList, enumDatas );
                    list.Add( temp );
                }

                writer.AppendType = AppendType.EmptyLastLine;
                for (var listI = 0; listI < list.Count; listI++)
                {
                    var codeWriter = list[listI];
                    writer.Append( codeWriter );
                    if (listI < list.Count - 1)
                        writer.AppendText( ", " );
                }
                writer.AppendType = AppendType.EmptyLastLine;
            }
            writer.Indent = 0;
            writer.Append( " ); // " );
            if (function.Contains( "extension" )){
            writer.Indent = 0;
            writer.Append( " extension method" );
            }
            writer.Indent = 0;
            writer.AppendLine();
            writer.AppendLine();
            writer.Append( "private static " );
            writer.AppendText( function.Name );
            writer.Indent = 0;
            writer.Append( "Delegate _" );
            writer.AppendText( function.Name );
            writer.Indent = 0;
            writer.AppendLine( ";" );
            writer.AppendLine();
            writer.Append( "public static " );
            if (function.IsUnsafeMethod(typeMapList, csTypeMapList)){
            writer.Indent = 0;
            writer.Append( "unsafe " );
            }
            writer.Indent = 0;
            writer.Append( " " );
            writer.AppendText( function.Return.GetCSName( typeMapList, csTypeMapList, enumDatas ) );
            writer.Indent = 0;
            writer.Append( " " );
            writer.AppendText( function.Name );
            writer.Indent = 0;
            writer.Append( "( " );
            {
                var list = new List<CodeWriter>();
                CodeWriter temp;

                foreach (var item in function.ParamList)
                {
                    temp = this.Invoke( "GenerateParam", item, typeMapList, csTypeMapList, enumDatas );
                    list.Add( temp );
                }

                writer.AppendType = AppendType.EmptyLastLine;
                for (var listI = 0; listI < list.Count; listI++)
                {
                    var codeWriter = list[listI];
                    writer.Append( codeWriter );
                    if (listI < list.Count - 1)
                        writer.AppendText( ", " );
                }
                writer.AppendType = AppendType.EmptyLastLine;
            }
            writer.Indent = 0;
            writer.AppendLine( " )" );
            writer.AppendLine( "{" );
            writer.Indent = 1;
            writer.Append( "if (_" );
            writer.AppendText( function.Name );
            writer.Indent = 0;
            writer.Append( " == null) throw new Exception( \"Extension method " );
            writer.AppendText( function.Name );
            writer.Indent = 0;
            writer.AppendLine( " not found\" );" );
            writer.Indent = 1;
//.........這裏部分代碼省略.........
開發者ID:werwolfby,項目名稱:Managed-OpenGL,代碼行數:101,代碼來源:FunctionGenerator.cs


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