• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Local类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Local的典型用法代码示例。如果您正苦于以下问题:C# Local类的具体用法?C# Local怎么用?C# Local使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Local类属于命名空间,在下文中一共展示了Local类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: getAll

        public IEnumerable<Local> getAll()
        {
            MySqlCommand cmm = new MySqlCommand();

            StringBuilder sql = new StringBuilder();
            sql.Append("select  * ");
            sql.Append(" FROM locais  ");

            cmm.CommandText = sql.ToString();

            MySqlDataReader dr = conn.executarConsultas(cmm);
            while (dr.Read())
            {

                Local loc = new Local
                {
                    idLocal = (int)dr["idLocal"],
                    sigla = (string)dr["sigla"],
                    nomeEstado = (string)dr["nomeEstado"],
                    nomeCidade = (string)dr["nomeCidade"],

                };
                local.Add(loc);
            }
            dr.Dispose();
            return local;
        }
开发者ID:Feldens00,项目名称:Music-Empire,代码行数:27,代码来源:LocalRepositorys.cs


示例2: VisitAssignmentStatement

 public override Statement VisitAssignmentStatement(AssignmentStatement assignment)
 {
   MemberBinding binding = assignment.Target as MemberBinding;
   if (binding != null) 
   {
     Expression target = VisitExpression(binding.TargetObject);
     Field boundMember = (Field) binding.BoundMember;
     Expression source = VisitExpression(assignment.Source);
     if (!boundMember.IsStatic && !boundMember.DeclaringType.IsValueType && boundMember.DeclaringType.Contract != null && boundMember.DeclaringType.Contract.FramePropertyGetter != null && boundMember != boundMember.DeclaringType.Contract.FrameField) 
     {
       Local targetLocal = new Local(boundMember.DeclaringType);
       Statement evaluateTarget = new AssignmentStatement(targetLocal, target, assignment.SourceContext);
       Local sourceLocal = new Local(boundMember.Type);
       Statement evaluateSource = new AssignmentStatement(sourceLocal, source, assignment.SourceContext);
       Expression guard = new MethodCall(new MemberBinding(targetLocal, boundMember.DeclaringType.Contract.FramePropertyGetter), null, NodeType.Call, SystemTypes.Guard);
       Statement check = new ExpressionStatement(new MethodCall(new MemberBinding(guard, SystemTypes.Guard.GetMethod(Identifier.For("CheckIsWriting"))), null, NodeType.Call, SystemTypes.Void));
       Statement stfld = new AssignmentStatement(new MemberBinding(targetLocal, boundMember), sourceLocal, assignment.SourceContext);
       return new Block(new StatementList(new Statement[] {evaluateTarget, evaluateSource, check, stfld}));
     } 
     else
     {
       binding.TargetObject = target;
       assignment.Source = source;
       return assignment;
     }
   }
   else
   {
     return base.VisitAssignmentStatement(assignment);
   }
 }
开发者ID:tapicer,项目名称:resource-contracts-.net,代码行数:31,代码来源:GuardedFieldAccessInstrumenter.cs


示例3: agregarLocal

        public void agregarLocal(String _nombre, String _telefono, int _preferencia, int _provincia, String _url, String _descripcion = "")
        {
            try
            {
                Local local = new Local(0,_nombre, _url, _telefono, _descripcion, _preferencia, _provincia);

                if (local.IsValid)
                {
                   LocalRepositorio.Instance.Insert(local);
                   LocalRepositorio.Instance.Save();
                }
                else
                {
                    StringBuilder sb = new StringBuilder();
                    foreach (RuleViolation rv in local.GetRuleViolations())
                    {
                        sb.AppendLine(rv.ErrorMessage);
                    }
                    throw new ApplicationException(sb.ToString());
                }

            }
            catch (DataAccessException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("Error: {0}", ex.Message));
            }
        }
开发者ID:La-Orden-del-Casuario,项目名称:Administrador-de-Mapas,代码行数:31,代码来源:GestorLocales.cs


示例4: frmRegistarRevisionInventario

 public frmRegistarRevisionInventario(Local local)
 {
     InitializeComponent();
     this.local = local;
     btnQuitar.Enabled = false;
     CargaPorFecha();
 }
开发者ID:pfizzer,项目名称:papyrusten,代码行数:7,代码来源:frmRegistrarRevisionInventario.cs


示例5: Reserva_AlterarHorario

        public Reserva_AlterarHorario()
        {
            local = MockRepository.GenerateStub<Local>();
            data = DateTime.Now.Date;

            reserva = new Reserva(local, data, new List<HoraReservaEnum> { HoraReservaEnum.Manha });
        }
开发者ID:danielsilva,项目名称:--Integer--,代码行数:7,代码来源:Reserva_AlterarHorario.cs


示例6: IsAnonymousLocal

        /// <summary>
        /// Returns true if the local variable has no name in the IL and the name was introduced by the IL reader.
        /// </summary>
        public static bool IsAnonymousLocal(Local local)
        {
            if (local == null)
                return false;

            return local.Anonymous;
        }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:10,代码来源:NameUtils.cs


示例7: Delete

        public byte Delete(Local instance)
        {
            ISession hisession = null;
            try
            {
                hisession = NHibernateHelper.GetCurrentSession();
                hisession.BeginTransaction();
                hisession.Delete(instance);
                hisession.Transaction.Commit();
                hisession.Close();
                return 1;
            }
            catch (Exception ex)
            {
                if (hisession != null)
                {
                    if (hisession.IsOpen)
                    {
                        hisession.Close();
                    }
                }

            }
            return 0;
        }
开发者ID:pfizzer,项目名称:papyrusten,代码行数:25,代码来源:LocalDA.cs


示例8: Empresas

 public Empresas(int pIdEmpresa, string pNomeEmpresa, Local pLocalEmpresa, string pEnderecoEmpresa)
 {
     idEmpresa = pIdEmpresa;
     nomeEmpresa = pNomeEmpresa;
     enderecoEmpresa = pEnderecoEmpresa;
     localEmpresa = pLocalEmpresa;
 }
开发者ID:Feldens00,项目名称:Music-Empire,代码行数:7,代码来源:Empresas.cs


示例9: PutLocal

        public IHttpActionResult PutLocal(int id, Local local)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != local.Id)
            {
                return BadRequest();
            }

            db.Entry(local).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LocalExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
开发者ID:marioffdsw,项目名称:AppaLite,代码行数:32,代码来源:LocalesController.cs


示例10: Musico

 public Musico(int pIdMusico, string pNomeMusico, string pEnderecoMusico, Local pLocalMusico)
 {
     idMusico = pIdMusico;
     nomeMusico = pNomeMusico;
     enderecoMusico = pEnderecoMusico;
     localMusico = pLocalMusico;
 }
开发者ID:Feldens00,项目名称:Music-Empire,代码行数:7,代码来源:Musico.cs


示例11: frmIngresarProductos

 public frmIngresarProductos(Local local)
 {
     if (!local.Estado.Equals("Activo"))
     {
         Utils.Utils.Mensaje("El local del cual está realizando la transacción no está activo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     InitializeComponent();
     this.local = local;
     dgvProductos.AllowUserToAddRows = false;
     dgvProductos.AllowUserToDeleteRows = false;
     txtNroDocumento.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Utils.Utils.ValidaNumerico);
     this.AcceptButton = btnCargarDatos;
     List<ListItem> listItem = new List<ListItem>();
     ListItem e1 = new ListItem("Compra", (int)TipoMov.Compra);
     ListItem e3 = new ListItem("Consignacion", (int)TipoMov.Consignacion);
     ListItem e4 = new ListItem("Transferencia", (int)TipoMov.Transferencia);
     listItem.Add(e1);
     listItem.Add(e3);
     listItem.Add(e4);
     cboTipoMovimiento.DataSource = listItem;
     cboTipoMovimiento.DisplayMember = "Mostrar";
     cboTipoMovimiento.ValueMember = "Valor";
     lblFecha.Show();
     zonas = (new ZonasBL()).ObtenerDatos(this.local);
 }
开发者ID:pfizzer,项目名称:papyrusten,代码行数:26,代码来源:frmIngresarProductos.cs


示例12: CopyTo

 public Local CopyTo(Local local)
 {
     local.Type = this.Type;
     local.Name = this.Name;
     local.PdbAttributes = this.PdbAttributes;
     return local;
 }
开发者ID:BahNahNah,项目名称:dnSpy,代码行数:7,代码来源:LocalOptions.cs


示例13: GetAll

        public List<Local> GetAll()
        {
            try
            {
                var lista = new List<Local>();

                var sql = "select * from " + this.Tabela;

                var dataSet = new DataSet();
                var query = new MySqlDataAdapter(sql, CorridaDAO.StringConexao);
                query.Fill(dataSet);

                foreach (var item in dataSet.Tables[0].AsEnumerable().ToList())
                {
                    var local = new Local()
                    {
                        Id = Convert.ToInt16(item["Id"]),
                        Cidade = item["Cidade"].ToString(),
                        Uf = item["Uf"].ToString()
                    };

                    lista.Add(local);
                }

                return lista;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return null;
            }
        }
开发者ID:mdamaceno,项目名称:TodoList,代码行数:32,代码来源:LocalEntity.cs


示例14: frmAgregarZonaIni

 public frmAgregarZonaIni(Local local)
 {
     InitializeComponent();
     this.local = local;
     cargarDatosAnaqueles();
     revisarFuncionalidades();
 }
开发者ID:pfizzer,项目名称:papyrusten,代码行数:7,代码来源:frmAgregarZonaIni.cs


示例15: IsSame

        internal bool IsSame(Local other)
        {
            if((object)this == (object)other) return true;

            object ourVal = value; // use prop to ensure obj-disposed etc
            return other != null && ourVal == (object)(other.value); 
        }
开发者ID:CragonGame,项目名称:GameCloud.IM,代码行数:7,代码来源:Local.cs


示例16: Main

        static void Main(string[] args)
        {
            Centralita centralita = new Centralita("Telefonica");
            Local unaLlamada = new Local("Quilmes", 30f, "Avellaneda", 0.98f);
            Provincial dosLlamada = new Provincial("Cordoba", Franja.Franja_1, 21f, "Santa Fe");
            Local tresLlamada = new Local("Bernal", 45f, "Termperley", 0.98f);
            Provincial cuatroLlamada = new Provincial("Buenos Aires",Franja.Franja_3, 14f, "Tucuman");

            //Cargamos la lista
            centralita.Lista.Add(unaLlamada);
            centralita.Lista.Add(dosLlamada);
            centralita.Lista.Add(tresLlamada);
            centralita.Lista.Add(cuatroLlamada);

            //Mostramos el contenido
            centralita.Mostrar();

            //Ordenamos la lista y la mostramos
            centralita.OrdenarLlamadas();

            Console.WriteLine("------ Lista ordenada -------");
            centralita.Mostrar();

            Console.ReadLine();
        }
开发者ID:FacundoLavagnino1993,项目名称:Centralita,代码行数:25,代码来源:Program.cs


示例17: EmitDerivation

 public IEnumerable<Instruction> EmitDerivation(MethodDef method, ConfuserContext ctx, Local dst, Local src)
 {
     for (int i = 0; i < 0x10; i++) {
         yield return Instruction.Create(OpCodes.Ldloc, dst);
         yield return Instruction.Create(OpCodes.Ldc_I4, i);
         yield return Instruction.Create(OpCodes.Ldloc, dst);
         yield return Instruction.Create(OpCodes.Ldc_I4, i);
         yield return Instruction.Create(OpCodes.Ldelem_U4);
         yield return Instruction.Create(OpCodes.Ldloc, src);
         yield return Instruction.Create(OpCodes.Ldc_I4, i);
         yield return Instruction.Create(OpCodes.Ldelem_U4);
         switch (i % 3) {
             case 0:
                 yield return Instruction.Create(OpCodes.Xor);
                 yield return Instruction.Create(OpCodes.Ldc_I4, (int)k1);
                 yield return Instruction.Create(OpCodes.Add);
                 break;
             case 1:
                 yield return Instruction.Create(OpCodes.Mul);
                 yield return Instruction.Create(OpCodes.Ldc_I4, (int)k2);
                 yield return Instruction.Create(OpCodes.Xor);
                 break;
             case 2:
                 yield return Instruction.Create(OpCodes.Add);
                 yield return Instruction.Create(OpCodes.Ldc_I4, (int)k3);
                 yield return Instruction.Create(OpCodes.Mul);
                 break;
         }
         yield return Instruction.Create(OpCodes.Stelem_I4);
     }
 }
开发者ID:2sic4you,项目名称:ConfuserEx,代码行数:31,代码来源:NormalDeriver.cs


示例18: Filtrar

        public IList<OrdenCompra> Filtrar(DateTime fechaInicio, DateTime fechaFin, string estado, Proveedor proveedor, string numeroOC, Local local)
        {
            List<string> properties = new List<string>();
            List<object> values = new List<object>();

            properties.Add("FechaPedido >=");
            properties.Add("FechaPedido <=");

            values.Add(fechaInicio);
            values.Add(fechaFin);

            if (estado != "Todos")
            {
                properties.Add("Estado = ");
                values.Add(estado);
            }
            if (proveedor != null)
            {
                properties.Add("Proveedor.Id = ");
                values.Add(proveedor.Id);
            }
            if (numeroOC.Trim().Length > 0)
            {
                properties.Add("Id = ");
                values.Add(numeroOC);
            }

            if (local != null) {
                properties.Add("LugarEntrega = ");
                values.Add(local.Nombre);
            }

            return new OrdenCompraDA().FindByProperties(properties, values);
        }
开发者ID:pfizzer,项目名称:papyrusten,代码行数:34,代码来源:OrdenCompraBL.cs


示例19: Reserva_Nova_Criada_Corretamente

        public Reserva_Nova_Criada_Corretamente()
        {
            local = new Local("Um Local");
            data = DateTime.Now.Date;

            reserva = new Reserva(local, data, new List<HoraReservaEnum> { HoraReservaEnum.Manha });
        }
开发者ID:danielsilva,项目名称:--Integer--,代码行数:7,代码来源:Reserva_Nova_Criada_Corretamente.cs


示例20: IsExpressionTreeLocal

        /// <summary>
        /// This method returns true if <paramref name="local"/> is a reference to
        /// anonymous variable generated by C# compiler for expression trees.
        /// </summary>
        /// <remarks>C# compiler generates code for expression trees that would be invalid from
        /// Code Contracts perspective (for instance, local assinment before Requires could happen etc).
        /// </remarks>
        public static bool IsExpressionTreeLocal(Local local)
        {
            if (local == null)
                return false;

            return IsAnonymousLocal(local) && IsOfType(local, typeof(System.Linq.Expressions.ParameterExpression).FullName);
        }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:14,代码来源:NameUtils.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LocalDate类代码示例发布时间:2022-05-24
下一篇:
C# Loader类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap