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


C# Meta类代码示例

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


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

示例1: SetUp

 public void SetUp()
 {
     _stub = new Stub { Int = 10, Str = "Str", Collection = new List<int> { 1, 2, 3 }, Array = new byte[10] };
     _newStub = new Stub { Collection = new List<int> { 11, 12, 13 } };
     _meta = new Meta { Int = 10, Str = "Str", Collection = new List<int> { 1, 2, 3 }, Array = new byte[10] };
     _helper = new EditorHelper();
 }
开发者ID:guozanhua,项目名称:phmi,代码行数:7,代码来源:EditorHelperTests.cs

示例2: ChessGameFromFEN

 public void ChessGameFromFEN()
 {
     const string fenString = "rnbqkbnr/pppppppp/8/8/8/3P4/PPP1PPPP/RNBQKBNR w KQkq - 0 1";
     var i = new Meta();
     i["FEN"] = fenString;
     var g = new ChessGame(i);
     Assert.AreEqual(fenString, g.State.ToString());
 }
开发者ID:Maniulo,项目名称:GameWarden,代码行数:8,代码来源:ChessGameTests.cs

示例3: ItemTest

 public void ItemTest()
 {
     var i = new Meta();
     i["Key"] = "Value";
     i["Key2"] = "Value2";
     Assert.AreEqual("Value", i["Key"]);
     Assert.AreEqual("Value2", i["Key2"]);
 }
开发者ID:Maniulo,项目名称:GameWarden,代码行数:8,代码来源:MetaTests.cs

示例4: HandleCommand

 public void HandleCommand(IStore store, Meta.BSon.BSonDoc command)
 {
     if (command.HasProperty(CommandKeyword.Collection))
       {
     var cc = store.GetCollection((command[CommandKeyword.Collection] ?? string.Empty).ToString());
     if (cc != null)
       cc.Flush();
       }
 }
开发者ID:MohammadHabbab,项目名称:DensoDB,代码行数:9,代码来源:CollectionFlushHandler.cs

示例5: ChessGame

        public ChessGame(Meta metainfo)
        {
            Info = metainfo;

            Players.Add(new Player(1));
            Players.Add(new Player(2));

            State = new FENParser().Parse(
                (Info["FEN"] == null) || (Info["FEN"].Equals("")) ? FENParser.DefaultFEN : Info["FEN"],
                 Players);
        }
开发者ID:Maniulo,项目名称:GameWarden,代码行数:11,代码来源:ChessGame.cs

示例6: AccionGuardar

        private bool AccionGuardar()
        {
            if (!this.Validar())
                return false;

            Cargando.Mostrar();
            int iSucursalID = Util.Entero(this.cmbSucursal.SelectedValue);

            // Se guardan las metas específicas
            Meta oMeta;
            foreach (DataGridViewRow oFila in this.dgvEspecificas.Rows)
            {
                if (oFila.IsNewRow) continue;

                int iMetaID = Util.Entero(oFila.Cells["mesMetaID"].Value);
                int iCambio = Util.Entero(oFila.Cells["mesCambio"].Value);
                switch (iCambio)
                {
                    case Cat.TiposDeAfectacion.Agregar:
                    case Cat.TiposDeAfectacion.Modificar:
                        if (iCambio == Cat.TiposDeAfectacion.Agregar)
                            oMeta = new Meta() { SucursalID = iSucursalID };
                        else
                            oMeta = Datos.GetEntity<Meta>(c => c.MetaID == iMetaID);
                        oMeta.VendedorID = (Util.Entero(oFila.Cells["mesUsuarioID"].Value) > 0 ?
                            (int?)Util.Entero(oFila.Cells["mesUsuarioID"].Value) : null);
                        oMeta.MarcaParteID = (Util.Entero(oFila.Cells["mesMarcaID"].Value) > 0 ?
                            (int?)Util.Entero(oFila.Cells["mesMarcaID"].Value): null);
                        oMeta.LineaID = (Util.Entero(oFila.Cells["mesLineaID"].Value) > 0 ?
                            (int?)Util.Entero(oFila.Cells["mesLineaID"].Value) : null);
                        oMeta.ParteID = (Util.Entero(oFila.Cells["mesParteID"].Value) > 0 ?
                            (int?)Util.Entero(oFila.Cells["mesParteID"].Value) : null);
                        oMeta.NombreMeta = Util.Cadena(oFila.Cells["mesNombre"].Value);
                        oMeta.Cantidad = Util.Decimal(oFila.Cells["mesCantidad"].Value);
                        oMeta.RutaImagen = Util.Cadena(oFila.Cells["mesRutaImagen"].Value);
                        Datos.Guardar<Meta>(oMeta);
                        break;
                    case Cat.TiposDeAfectacion.Borrar:
                        oMeta = Datos.GetEntity<Meta>(c => c.MetaID == iMetaID);
                        Datos.Eliminar<Meta>(oMeta);
                        break;
                }
            }

            Cargando.Cerrar();
            this.CargarDatos();
            return true;
        }
开发者ID:moisesiq,项目名称:aupaga,代码行数:48,代码来源:CatMetas.cs

示例7: SetPara

        /// <summary>
        /// Create parametter grid from meta.ParameterDefaultValues
        /// </summary>
        /// <param name="meta"></param>
        protected void SetPara(Meta meta)
        {
            this.ShowMessage("");

            this.myMeta = meta;
            paramGrid.Rows.Clear();
            string[] keys = meta.ParameterList.Keys;
            object[] values = meta.ParameterList.Values;
            for (int idx = 0; idx < keys.Length; idx++)
            {
                paramGrid.Rows.Add(keys[idx],values[idx]);
            }
            valueColumn.DefaultCellStyle.Format = "N" + meta.ParameterPrecision.ToString();
            paraDescEd.Text = common.system.ToString(meta.ParameterDescriptions);
            hintTextEd.Text = meta.Description + common.Consts.constCRLF + meta.URL;
        }
开发者ID:oghenez,项目名称:trade-software,代码行数:20,代码来源:baseStrategyForm.cs

示例8: HandleCommand

        public void HandleCommand(IStore store, Meta.BSon.BSonDoc command)
        {
            BSonDoc value = null;
              var collection = string.Empty;

              if (command.HasProperty(CommandKeyword.Value))
              {
            value = command[CommandKeyword.Value] as BSonDoc;
              }
              if (command.HasProperty(CommandKeyword.Collection))
              {
            collection = (command[CommandKeyword.Collection] ?? string.Empty).ToString();
              }

              OnHandle(store, collection, command, value);
        }
开发者ID:MohammadHabbab,项目名称:DensoDB,代码行数:16,代码来源:BaseCommandHandler.cs

示例9: AlternateViewStartPath

            public void AlternateViewStartPath()
            {
                // Given
                Engine engine = new Engine();
                engine.RootFolder = TestContext.CurrentContext.TestDirectory;
                engine.InputFolder = @"TestFiles\Input\";
                ReadFiles readFiles = new ReadFiles(@"AlternateViewStartPath\Test.cshtml");
                Razor razor = new Razor().WithViewStart(@"AlternateViewStart\_ViewStart.cshtml");
                Meta meta = new Meta("Content", (x, y) => x.Content);
                engine.Pipelines.Add("Pipeline", readFiles, razor, meta);

                // When
                engine.Execute();

                // Then
                Assert.AreEqual(1, engine.Documents.FromPipeline("Pipeline").Count());
                Assert.AreEqual("LAYOUT\r\n<p>This is a test</p>", engine.Documents.FromPipeline("Pipeline").First().String("Content"));
            }
开发者ID:ryanrousseau,项目名称:Wyam,代码行数:18,代码来源:RazorTests.cs

示例10: RunWithSqlServer

        public static void RunWithSqlServer(IEnumerable<RecordBlueprint> recordDescriptors, Action<ISessionFactory> action)
        {
            var temporaryPath = Path.GetTempFileName();
            if (File.Exists(temporaryPath))
                File.Delete(temporaryPath);
            Directory.CreateDirectory(temporaryPath);
            var databasePath = Path.Combine(temporaryPath, "Coevery.mdf");
            var databaseName = Path.GetFileNameWithoutExtension(databasePath);
            try {
                // create database
                if (!TryCreateSqlServerDatabase(databasePath, databaseName))
                    return;

                var meta = new Meta<CreateDataServicesProvider>((dataFolder, connectionString) =>
                    new SqlServerDataServicesProvider(dataFolder, connectionString),
                    new Dictionary<string, object> { { "ProviderName", "SqlServer" } });

                var manager = (IDataServicesProviderFactory)new DataServicesProviderFactory(new[] { meta });

                var parameters = new SessionFactoryParameters {
                    Provider = "SqlServer",
                    DataFolder = temporaryPath,
                    ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFileName=" + databasePath + ";Integrated Security=True;User Instance=True;",
                    RecordDescriptors = recordDescriptors,
                };

                var configuration = manager
                    .CreateProvider(parameters)
                    .BuildConfiguration(parameters);

                new SchemaExport(configuration).Execute(false, true, false);

                using (var sessionFactory = configuration.BuildSessionFactory()) {
                    action(sessionFactory);
                }
            }
            finally {
                try {
                    Directory.Delete(temporaryPath, true);
                }
                catch (IOException) { }
            }
        }
开发者ID:gokhandisikara,项目名称:Coevery-Framework,代码行数:43,代码来源:ProviderUtilities.cs

示例11: MetaEmString

 public string MetaEmString(Meta meta)
 {
     if (meta == Meta.GANHAR_2KG)
         return "Ganhar 2kg/semana";
     else if (meta == Meta.GANHAR_1_5KG)
         return "Ganhar 1.5kg/semana";
     else if (meta == Meta.GANHAR_1KG)
         return "Ganhar 1kg/semana";
     else if (meta == Meta.GANHAR_0_5KG)
         return "Ganhar 0.5kg/semana";
     else if (meta == Meta.MANTER)
         return "Manter peso";
     else if (meta == Meta.PERDER_0_5KG)
         return "Perder 0.5kg/semana";
     else if (meta == Meta.PERDER_1KG)
         return "Perder 1kg/semana";
     else if (meta == Meta.PERDER_1_5KG)
         return "Perder 1.5kg/semana";
     else if (meta == Meta.PERDER_2KG)
         return "Perder 2.0kg/semana";
     else
         throw new NotImplementedException();
 }
开发者ID:CarlosMota,项目名称:Dieta,代码行数:23,代码来源:ConversorMeta.cs

示例12: MetaEmDouble

 public double MetaEmDouble(Meta meta)
 {
     if (meta == Meta.GANHAR_2KG)
         return 2;
     else if (meta == Meta.GANHAR_1_5KG)
         return 1.5;
     else if (meta == Meta.GANHAR_1KG)
         return 1;
     else if (meta == Meta.GANHAR_0_5KG)
         return 0.5;
     else if (meta == Meta.MANTER)
         return 0;
     else if (meta == Meta.PERDER_0_5KG)
         return -0.5;
     else if (meta == Meta.PERDER_1KG)
         return 1;
     else if (meta == Meta.PERDER_1_5KG)
         return -1.5;
     else if (meta == Meta.PERDER_2KG)
         return -2;
     else
         throw new NotImplementedException();
 }
开发者ID:CarlosMota,项目名称:Dieta,代码行数:23,代码来源:ConversorMeta.cs

示例13: Buffer

        public Buffer(Meta.File _file, UndoStack _undo, UndoStack _redo)
            : base(tags)
        {
            /**
             * Prepare for undo/redo.
             */
            UndoStack = _undo;
            RedoStack = _redo;
            UndoStack.Applied.Add(e => RedoStack.Push(e.Invert()));
            RedoStack.Applied.Add(e => UndoStack.Push(e.Invert()));

            /**
             * Read the file.
             */
            File = _file;
            var input = File.Info.OpenText();
            IgnoreChanges(() => InsertAtCursor(input.ReadToEnd()));
            input.Close();
            PlaceCursor(GetIterAtOffset(0));
            Changed += (o, a) =>
            {
                HasUnsavedChanges.Value = true;
            };
        }
开发者ID:ktvoelker,项目名称:di,代码行数:24,代码来源:Buffer.cs

示例14: LoadSimpleTemplateFile

            public void LoadSimpleTemplateFile()
            {
                // Given
                Engine engine = new Engine();
                engine.RootFolder = TestContext.CurrentContext.TestDirectory;
                engine.InputFolder = @"TestFiles\Input\";
                ReadFiles readFiles = new ReadFiles(@"SimpleTemplate\Test.cshtml");
                Razor razor = new Razor();
                Meta meta = new Meta("Content", (x, y) => x.Content);
                engine.Pipelines.Add("Pipeline", readFiles, razor, meta);

                // When
                engine.Execute();

                // Then
                Assert.AreEqual(1, engine.Documents.FromPipeline("Pipeline").Count());
                Assert.AreEqual(@"<p>This is a test</p>", engine.Documents.FromPipeline("Pipeline").First().String("Content"));
            }
开发者ID:ryanrousseau,项目名称:Wyam,代码行数:18,代码来源:RazorTests.cs

示例15: SaveRawToFile

        /// <summary>
        /// The save raw to file.
        /// </summary>
        /// <param name="outputFilePath">The output file path.</param>
        /// <param name="meta">The meta.</param>
        /// <remarks></remarks>
        public void SaveRawToFile(string outputFilePath, Meta.Meta meta)
        {
            int x = outputFilePath.LastIndexOf('.');
            string temp = outputFilePath.Substring(0, x + 1) + meta.type + "raw";

            if (meta.type == "snd!" &&
                (meta.Map.HaloVersion == HaloVersionEnum.Halo2 ||
                 meta.Map.HaloVersion == HaloVersionEnum.Halo2Vista))
            {
                Stream s = File.Open(temp + "layout", FileMode.Create);
                BinaryFormatter b = new BinaryFormatter();
                Sound temps = (Sound)meta.raw;
                b.Serialize(s, temps.Permutations);
                s.Flush();
                s.Close();
            }

            XmlTextWriter xtw = new XmlTextWriter(temp + ".xml", Encoding.Default);
            xtw.Formatting = Formatting.Indented;
            xtw.WriteStartElement("RawData");
            xtw.WriteAttributeString("TagType", meta.type);
            xtw.WriteAttributeString("TagName", meta.name);
            xtw.WriteAttributeString("RawType", meta.raw.containerType.ToString());
            xtw.WriteAttributeString("RawChunkCount", this.rawChunks.Count.ToString());
            xtw.WriteAttributeString("Date", DateTime.Today.ToShortDateString());
            xtw.WriteAttributeString("Time", DateTime.Now.ToShortTimeString());
            xtw.WriteAttributeString("EntityVersion", "0.1");

            BinaryWriter BW = new BinaryWriter(new FileStream(temp, FileMode.Create));
            int loc = 0;
            for (x = 0; x < this.rawChunks.Count; x++)
            {
                RawDataChunk r = this.rawChunks[x];
                if (r.offset == -1)
                {
                    continue;
                }

                xtw.WriteStartElement("RawChunk");
                xtw.WriteAttributeString("RawDataType", r.rawDataType.ToString());
                xtw.WriteAttributeString("PointerMetaOffset", r.pointerMetaOffset.ToString());
                xtw.WriteAttributeString("ChunkSize", r.size.ToString());
                xtw.WriteAttributeString("RawDataOffset", loc.ToString());
                xtw.WriteAttributeString("PointsToOffset", r.offset.ToString());
                xtw.WriteAttributeString("RawLocation", r.rawLocation.ToString());
                xtw.WriteEndElement();
                BW.BaseStream.Write(r.MS.ToArray(), 0, r.size);
                loc += r.size;
            }

            BW.Flush();
            BW.Close();
            xtw.WriteEndElement();
            xtw.Flush();
            xtw.Close();
        }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:62,代码来源:RawData.cs


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