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


C# Types.ToString方法代码示例

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


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

示例1: Tile

        public Tile(Types tileType)
        {
            Tag = tileType.ToString();

            Type = tileType;
            IsPassable = tileType == Types.Grass || tileType == Types.Sand || tileType == Types.Moor ;
        }
开发者ID:Xellss,项目名称:RougyMon,代码行数:7,代码来源:Tile.cs

示例2: TileData

    public TileData(Types type, int resourceQuantity, int moveCost)
    {
        tileType = type;
        maxResourceQuantity = resourceQuantity;
        movementCost = moveCost;

        if (type != Types.empty) {
            isWalkable = false;
        }
        tileName = type.ToString ();
    }
开发者ID:cesarrac,项目名称:TheyRise,代码行数:11,代码来源:TileData.cs

示例3: TileData

    public TileData(int x, int y, Types type, int resourceQuantity, int moveCost, int _hardness = 0)
    {
        posX = x;
        posY = y;

        tileType = type;
        maxResourceQuantity = resourceQuantity;

        hardness = _hardness;

        movementCost = moveCost;

        // MAKING ROCK UNWAKABLE
        if (type != Types.empty && type != Types.water) {
            isWalkable = false;
        }
        tileName = type.ToString ();

        tileStats = new TileStats();
    }
开发者ID:cesarrac,项目名称:TheyRise-game,代码行数:20,代码来源:TileData.cs

示例4: Start

    void Start()
    {
      
        cells = new Types[9];
        for (int i = 0; i < 9; i++)
        {
            cells[i] = Types.EMPTY;
        }

        int x = rnd.Next(0, 2);
        if (x == 0)
            turn = Types.X;
        else
            turn = Types.O;
        // GameObject start = reference[4];
        // Instantiate(x, start.transform.position, Quaternion.identity);
        //   cells[4] = Types.X;

        //   Destroy(start);
        turn = Types.O;
        instructions.text = "Turn : " + turn.ToString();
         
    }
开发者ID:karamalie,项目名称:Tic-Tac-Toe,代码行数:23,代码来源:GameScript.cs

示例5: Display

 private void Display(Mode m, Color c, State s, Types t) {
     string mstr = m.ToString();
     string cstr = c.ToString();
     string sstr = s.ToString();
     string tstr = t.ToString();
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:6,代码来源:Code1.cs

示例6: Apply

        /// <summary>Apply fertiliser.</summary>
        /// <param name="Amount">The amount.</param>
        /// <param name="Type">The type.</param>
        /// <param name="Depth">The depth.</param>
        /// <exception cref="ApsimXException">Cannot find fertiliser type ' + Type + '</exception>
        public void Apply(double Amount, Types Type, double Depth = 0.0)
        {
            if (Amount > 0 && NitrogenChanged != null)
            {
                // find the layer that the fertilizer is to be added to.
                int layer = GetLayerDepth(Depth, Soil.Thickness);

                FertiliserType fertiliserType = Definitions.FirstOrDefault(f => f.Name == Type.ToString());
                if (fertiliserType == null)
                    throw new ApsimXException(this, "Cannot find fertiliser type '" + Type + "'");

                NitrogenChangedType NitrogenChanges = new NitrogenChangedType();
                NitrogenChanges.Sender = Apsim.FullPath(this);

                if (fertiliserType.FractionNO3 != 0)
                {
                    NitrogenChanges.DeltaNO3 = new double[Soil.Thickness.Length];
                    NitrogenChanges.DeltaNO3[layer] = Amount * fertiliserType.FractionNO3;
                    NitrogenApplied += Amount * fertiliserType.FractionNO3;
                }
                if (fertiliserType.FractionNH4 != 0)
                {
                    NitrogenChanges.DeltaNH4 = new double[Soil.Thickness.Length];
                    NitrogenChanges.DeltaNH4[layer] = Amount * fertiliserType.FractionNH4;
                    NitrogenApplied += Amount * fertiliserType.FractionNH4;
                }
                if (fertiliserType.FractionUrea != 0)
                {
                    NitrogenChanges.DeltaUrea = new double[Soil.Thickness.Length];
                    NitrogenChanges.DeltaUrea[layer] = Amount * fertiliserType.FractionUrea;
                    NitrogenApplied += Amount * fertiliserType.FractionUrea;
                }

                NitrogenChanged.Invoke(NitrogenChanges);
                Summary.WriteMessage(this, string.Format("{0} kg/ha of {1} added at depth {2} layer {3}", Amount, Type, Depth, layer + 1));
            }
        }
开发者ID:hol353,项目名称:ApsimX,代码行数:42,代码来源:Fertiliser.cs

示例7: AddTableScript

        /// <summary>
        /// Adds a script for a crud operation to the table
        /// </summary>
        /// <param name="operationType">The type of operation</param>
        /// <param name="tableName">The name of the WAMS table</param>
        /// <param name="script">The script to add</param>
        /// <param name="permission">The permissions of the script to upload</param>
        public void AddTableScript(CrudOperation operationType, string tableName, string script, Types.MobileServices.Roles permission)
        {
            if (String.IsNullOrEmpty(tableName))
                throw new FluentManagementException("unable to add table with an empty name", "CreateMobileServicesTableScriptCommand");
            EnsureMobileServicesName();
            Refresh();
            // then create the script
            var command = new CreateMobileServiceTableScriptCommand(MobileServiceName, tableName, operationType, script)
            {
                SubscriptionId = SubscriptionId,
                Certificate = ManagementCertificate
            };
            command.Execute();
            // update the script with the new permissions
            var table = Tables.FirstOrDefault(a => a.TableName == tableName);
            var values = new List<string> { table.InsertPermission.ToString(), table.UpdatePermission.ToString(), table.ReadPermission.ToString(), table.DeletePermission.ToString()};
            // TODO: speak to MSFT about this - the cmdlets have a bug and all of the permissions need to be added for them to update more than a single one

            var dictionary = BuildCrudDictionary(values);
            dictionary[operationType.ToString().ToLower()] = permission.ToString().ToLower();

            // updates the script table service permissions
            var config = JsonConvert.SerializeObject(dictionary);
            var updateCommand = new UpdateMobileServiceTablePermissionsCommand(MobileServiceName, tableName, config)
                              {
                                  SubscriptionId = SubscriptionId,
                                  Certificate = ManagementCertificate
                              };
            updateCommand.Execute();
            Refresh();
        }
开发者ID:richorama,项目名称:fluent-management,代码行数:38,代码来源:MobileServiceClient.cs

示例8: AddTable

 /// <summary>
 /// Adds a table to mobile services
 /// </summary>
 /// <param name="tableName">the name of the table</param>
 /// <param name="defaultPermission">Sets the default permission for the table scripts</param>
 public void AddTable(string tableName, Types.MobileServices.Roles defaultPermission = Types.MobileServices.Roles.Application)
 {
     if(String.IsNullOrEmpty(tableName))
         throw new FluentManagementException("unable to add table with an empty name", "CreateMobileServicesTableCommand");
     var permission = defaultPermission.ToString().ToLower();
     var dictionary = BuildCrudDictionary(new List<string> {permission, permission, permission, permission});
     dictionary["name"] = tableName;
     EnsureMobileServicesName();
     var config = JsonConvert.SerializeObject(dictionary);
     var command = new CreateMobileServiceTableCommand(MobileServiceName, tableName, config)
                       {
                           SubscriptionId = SubscriptionId,
                           Certificate = ManagementCertificate
                       };
     command.Execute();
 }
开发者ID:richorama,项目名称:fluent-management,代码行数:21,代码来源:MobileServiceClient.cs

示例9: FromEnv

 public static Environment FromEnv(Types.env env)
 {
     return new Environment(env.ToString());
 }
开发者ID:ShyAlex,项目名称:scheme-ish,代码行数:4,代码来源:Environment.cs

示例10: RulezException

        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="handle"></param>
        /// <param name="message"></param>
        public RulezException(Types id = 0, String message = null, string category = null, string Tag = null, Exception inner = null,  params object[] arguments)
        {
            _id = id;
            _category = category;
            _Tag = Tag;
            if (message != null) _message = message;
            else
            {
                _message = (_ResourceMessages != null) ? _ResourceMessages.GetString(MessagePrefix+id.ToString()) : _messages[(int)id];
                // fall back
                if (_message == null) _message = _messages[(int)id];
            }
            _message = (_message != null ) ? string.Format(_message, arguments) : OnTrack.Core.Converter.Array2StringList (arguments);
            _innerException = inner;

            // log it
            System.Diagnostics.Debug.Print("Exception " + DateTime.Now.ToString("s") + ":" + ID.ToString() + " " + _message);
        }
开发者ID:boschn,项目名称:otRulez,代码行数:23,代码来源:rulezMessaging.cs

示例11: PseudoClassConstUse

 public PseudoClassConstUse(Position position, TypeRef/*!*/typeRef, Types type, Position namePosition)
     : base(position, typeRef, type.ToString().ToLowerInvariant(), namePosition)
 {
     this.consttype = type;
 }
开发者ID:kripper,项目名称:Phalanger,代码行数:5,代码来源:ConstantUse.cs

示例12: ScanNonpluggedILBlock

        /// <summary>
        /// Scans the specified non-plugged IL block.
        /// </summary>
        /// <param name="TheLibrary">The library currently being compiled.</param>
        /// <param name="theMethodInfo">The method which generated the IL block.</param>
        /// <param name="theILBlock">The IL block to scan.</param>
        /// <returns>CompileResult.OK.</returns>
        private static CompileResult ScanNonpluggedILBlock(ILLibrary TheLibrary, Types.MethodInfo theMethodInfo, ILBlock theILBlock)
        {
            CompileResult result = CompileResult.OK;

            ASM.ASMBlock TheASMBlock = new ASM.ASMBlock()
            {
                OriginMethodInfo = theMethodInfo,
                Priority = theMethodInfo.Priority
            };
            
            ILConversionState convState = new ILConversionState()
            {
                TheILLibrary = TheLibrary,
                CurrentStackFrame = new StackFrame(),
                Input = theILBlock,
                Result = TheASMBlock
            };
            foreach (ILOp anOp in theILBlock.ILOps)
            {
                try
                {
                    string commentText = TheASMBlock.GenerateILOpLabel(convState.PositionOf(anOp), "") + "  --  " + anOp.opCode.ToString() + " -- Offset: " + anOp.Offset.ToString("X2");
                    
                    ASM.ASMOp newCommentOp = TargetArchitecture.CreateASMOp(ASM.OpCodes.Comment, commentText);
                    TheASMBlock.ASMOps.Add(newCommentOp);
                    
                    int currCount = TheASMBlock.ASMOps.Count;
                    if (anOp is ILOps.MethodStart)
                    {
                        TargetArchitecture.MethodStartOp.Convert(convState, anOp);
                    }
                    else if (anOp is ILOps.MethodEnd)
                    {
                        TargetArchitecture.MethodEndOp.Convert(convState, anOp);
                    }
                    else if (anOp is ILOps.StackSwitch)
                    {
                        TargetArchitecture.StackSwitchOp.Convert(convState, anOp);
                    }
                    else
                    {
                        ILOp ConverterOp = TargetArchitecture.TargetILOps[(ILOp.OpCodes)anOp.opCode.Value];
                        ConverterOp.Convert(convState, anOp);
                    }

                    if (anOp.LabelRequired)
                    {
                        if (currCount < TheASMBlock.ASMOps.Count)
                        {
                            TheASMBlock.ASMOps[currCount].ILLabelPosition = convState.PositionOf(anOp);
                            TheASMBlock.ASMOps[currCount].RequiresILLabel = true;
                        }
                    }
                }
                catch (KeyNotFoundException)
                {
                    result = CompileResult.PartialFailure;

                    Logger.LogError(Errors.ILCompiler_ScanILOpFailure_ErrorCode, theMethodInfo.ToString(), anOp.Offset,
                        string.Format(Errors.ErrorMessages[Errors.ILCompiler_ScanILOpFailure_ErrorCode], Enum.GetName(typeof(ILOp.OpCodes), anOp.opCode.Value), "Conversion for IL op not found."));
                }
                catch (InvalidOperationException ex)
                {
                    result = CompileResult.PartialFailure;

                    Logger.LogError(Errors.ILCompiler_ScanILOpFailure_ErrorCode, theMethodInfo.ToString(), anOp.Offset,
                        string.Format(Errors.ErrorMessages[Errors.ILCompiler_ScanILOpFailure_ErrorCode], Enum.GetName(typeof(ILOp.OpCodes), anOp.opCode.Value), ex.Message));
                }
                catch (NotSupportedException ex)
                {
                    result = CompileResult.PartialFailure;

                    Logger.LogError(Errors.ILCompiler_ScanILOpFailure_ErrorCode, theMethodInfo.ToString(), anOp.Offset,
                        string.Format(Errors.ErrorMessages[Errors.ILCompiler_ScanILOpFailure_ErrorCode], Enum.GetName(typeof(ILOp.OpCodes), anOp.opCode.Value), "An IL op reported something as not supported : " + ex.Message));
                }
                catch (Exception ex)
                {
                    result = CompileResult.Fail;

                    Logger.LogError(Errors.ILCompiler_ScanILOpFailure_ErrorCode, theMethodInfo.ToString(), anOp.Offset,
                        string.Format(Errors.ErrorMessages[Errors.ILCompiler_ScanILOpFailure_ErrorCode], Enum.GetName(typeof(ILOp.OpCodes), anOp.opCode.Value), ex.Message));
                }
            }

            TheLibrary.TheASMLibrary.ASMBlocks.Add(TheASMBlock);

            return result;
        }
开发者ID:rmhasan,项目名称:FlingOS,代码行数:95,代码来源:ILScanner.cs

示例13: ApplyPrefixes

        private void ApplyPrefixes(ref StringBuilder sb, Types type = Types.INFO)
        {
            if (PrefixDate)
            {
                sb.Append(DateTime.Now.ToString(PrefixDateFormat));
                sb.Append(' ');
            }

            if (PrefixLogs)
            {
                sb.Append(type.ToString());
                sb.Append(' ');
            }
        }
开发者ID:UnifiedTech,项目名称:Atlantis-CSharp,代码行数:14,代码来源:Logger.cs

示例14: Read

 public IList<Test> Read(Types Type)
 {
     return context.Tests.Where(t => t.Type.ToString() == Type.ToString()).ToList();
 }
开发者ID:Lesssnik,项目名称:Labs,代码行数:4,代码来源:TestDBRepository.cs

示例15: PseudoClassConstUse

 public PseudoClassConstUse(Text.Span span, TypeRef/*!*/typeRef, Types type, Text.Span namePosition)
     : base(span, typeRef, type.ToString().ToLowerInvariant(), namePosition)
 {
     this.consttype = type;
 }
开发者ID:dw4dev,项目名称:Phalanger,代码行数:5,代码来源:ConstantUse.cs


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