当前位置: 首页>>代码示例>>C#>>正文


C# Sequence.ToArray方法代码示例

本文整理汇总了C#中Sequence.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# Sequence.ToArray方法的具体用法?C# Sequence.ToArray怎么用?C# Sequence.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sequence的用法示例。


在下文中一共展示了Sequence.ToArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ComNegotiateRequest

        public void ComNegotiateRequest(Sequence<string> dialects)
        {
            Packet_Header responseHeader = new Packet_Header();
            DialectRevision selectedDialect = DialectRevision.Smb2Unknown;
            NEGOTIATE_Response responsePayload = new NEGOTIATE_Response();
            byte[] smb2ClientGssToken;
            ModelSmb2Status status = ModelSmb2Status.STATUS_SUCCESS;

            try
            {
                status = (ModelSmb2Status)smb2Client.MultiProtocolNegotiate(dialects.ToArray(), out selectedDialect, out smb2ClientGssToken, out responseHeader, out responsePayload);
                if (status != ModelSmb2Status.STATUS_SUCCESS)
                {
                    selectedDialect = DialectRevision.Smb2Unknown;
                }
                this.NegotiateResponse(status, selectedDialect);
                if (selectedDialect == DialectRevision.Smb2Wildcard)
                {
                    messageId = 1;
                }
            }
            catch
            {
            }
        }
开发者ID:gitter-badger,项目名称:WindowsProtocolTestSuites,代码行数:25,代码来源:NegotiateAdapter.cs

示例2: Function

 public Function(Identifier returnType, Identifier name, Sequence<Parameter> pars, Sequence<Statement> stmts)
 {
     Type[] tar = Parameter.ConvertSequenceToTypeArray(pars);
     var mb = CodeGenerator.CreateFunction(name.Value, TypeChecker.ConvertStringToType(returnType.Value), tar);
     mi = mb;
     this.stmts = stmts;
     if (fns.ContainsKey(name.Value))
     {
         throw new Exception("Function redeclared. Note: overloaded functions are not supported at this time.");
     }
     fns.Add(name.Value, this);
     int count = 1; //parameters start at index 1 - 0 is the return. not sure on GetParameters() though - more testing is needed, but i don't think it includes the returntype as there is a separate way to get that
     foreach (Parameter p in pars)
     {
         mb.DefineParameter(count++, ParameterAttributes.None, p.Name);
     }
     ec = new ExecutionContext(null);
     ec.SetParameters(pars.ToArray());
 }
开发者ID:Mooglefrooglian,项目名称:Minim,代码行数:19,代码来源:Function.cs

示例3: NegotiateRequest

        public void NegotiateRequest(Sequence<DialectRevision> dialects)
        {
            Packet_Header responseHeader = new Packet_Header();
            DialectRevision selectedDialect = DialectRevision.Smb2Unknown;
            NEGOTIATE_Response responsePayload = new NEGOTIATE_Response();
            byte[] smb2ClientGssToken;
            ModelSmb2Status status = ModelSmb2Status.STATUS_SUCCESS;

            try
            {
                status = (ModelSmb2Status)smb2Client.Negotiate(0, 1, Packet_Header_Flags_Values.NONE, messageId++, dialects.ToArray(), SecurityMode_Values.NONE, Capabilities_Values.NONE, Guid.NewGuid(),
                    out selectedDialect, out smb2ClientGssToken, out responseHeader, out responsePayload);
                if (status != ModelSmb2Status.STATUS_SUCCESS)
                {
                    selectedDialect = DialectRevision.Smb2Unknown;
                }
                this.NegotiateResponse(status, selectedDialect);
            }
            catch
            {
            }
        }
开发者ID:gitter-badger,项目名称:WindowsProtocolTestSuites,代码行数:22,代码来源:NegotiateAdapter.cs


注:本文中的Sequence.ToArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。