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

C# TextManager类代码示例

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

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



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

示例1: GetFor

        public override ISwitchConditionEvaluator GetFor(string spelling, PatternDialect dialect, TextManager manager)
        {
            Match m;
            if ((m = matcher.Match(spelling)).Success)
            {
                var ops = new List<ArithmeticCondition.Operation>();
                foreach (Match op in operation.Matches(m.Groups["Ops"].Value))
                {
                    ops.Add(new ArithmeticCondition.Operation
                    {
                       Number = double.Parse(op.Groups["Number"].Value, dialect.Parser.PatternCulture),
                       Operator = Arithmetic.GetArithmeticOperator(op.Groups["Op"].Value)
                    });
                }

                return new ArithmeticCondition
                {
                    Operations = ops,
                    CompareOperator = Arithmetic.GetCompareOperator(m.Groups["Op"].Value),
                    TargetValue = int.Parse(m.Groups["TargetValue"].Value)
                };
            }

            return null;
        }
开发者ID:paulsuart,项目名称:rebelcmsxu5,代码行数:25,代码来源:ArithmeticCondition.cs


示例2: Parse

        /// <summary>
        /// Parses the specified pattern returned by the reader and localizes error messages with the text manager specified
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="textManager">The text manager.</param>
        /// <returns></returns>
        public override Expression Parse(TextReader reader, TextManager textManager)
        {
            try
            {
                _reader = reader.ReadToEnd();

                _pos = -1;

                MoveNext();

                var expr = ParseExpression();
                if (_current != Eof)
                {
                    UnexpectedToken("Expression", "" + _current);
                }

                expr.Accept(_trimmer);

                return expr;
            }
            catch (InnerParserException template)
            {
                throw new SyntaxErrorException(template.Message, template.Construct, template.Pos);
            }
        }
开发者ID:nikolajw,项目名称:localizationnet,代码行数:31,代码来源:DefaultExpressionParser.cs


示例3: Parse

        public override Expression Parse(System.IO.TextReader reader, TextManager manager)
        {
            var expr = new Expression();
            expr.Parts.Add(new Text { Spelling = reader.ReadToEnd() });

            return expr;
        }
开发者ID:Joebeazelman,项目名称:rebelcmsxu5,代码行数:7,代码来源:TextParser.cs


示例4: Start

 // Use this for initialization
 void Start()
 {
     rb2d = gameObject.GetComponent<Rigidbody2D> ();
     animator = gameObject.GetComponent<Animator> ();
     movement = getDefaultMovement ();
     dragon = GameObject.FindGameObjectWithTag ("Dragon").GetComponent<Dragon> ();
     textManager = GameObject.FindGameObjectWithTag ("TextManager").GetComponent<TextManager> ();
 }
开发者ID:zillix,项目名称:LD33,代码行数:9,代码来源:Player.cs


示例5: GetFor

 public IValueFormatter GetFor(string formatExpression, PatternDialect dialect, TextManager manager)
 {
     if (!string.IsNullOrEmpty(formatExpression))
     {
         return new StringFormatFormatter(formatExpression);
     }
     return null;
 }
开发者ID:Joebeazelman,项目名称:rebelcmsxu5,代码行数:8,代码来源:StringFormatFormatter.cs


示例6: GetFor

        public IValueFormatter GetFor(string formatExpression, PatternDialect dialect, TextManager manager)
        {
            if (!string.IsNullOrEmpty(formatExpression) && formatExpression.Equals("roman", StringComparison.InvariantCulture))
            {
                return new RomanNumberFormatter();
            }

            return null;
        }
开发者ID:paulsuart,项目名称:rebelcmsxu5,代码行数:9,代码来源:RomanToNumberConvertor.cs


示例7: GetEvaluator

        public override PatternEvaluator GetEvaluator(string pattern, TextManager manager)
        {
            lock (_parseLock)
            {
                var expr = Parser.Parse(pattern, manager);

                return new PatternEvaluator(expr);
            }
        }
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:9,代码来源:TextDialect.cs


示例8: GetFor

        public override ISwitchConditionEvaluator GetFor(string spelling, PatternDialect dialect, TextManager manager)
        {
            if (string.IsNullOrEmpty(spelling) || spelling.Equals("true", StringComparison.InvariantCultureIgnoreCase))
            {
                return new TakeAllCondition();
            }

            return null;
        }
开发者ID:nikolajw,项目名称:localizationnet,代码行数:9,代码来源:TakeAllCondition.cs


示例9: GetSwitchConditionEvaluator

 public virtual ISwitchConditionEvaluator GetSwitchConditionEvaluator(Expression expr, TextManager manager)
 {
     ISwitchConditionEvaluator sc = null;
     if (!SwitchConditionEvaluators.Any(x => (sc = x.GetFor(expr, this, manager)) != null))
     {
         throw new LocalizedKeyNotFoundException("Exceptions.SwitchConditionNotFound", "No switch condition evaluator found for {0}", new { Spec = expr });                
     }
     return sc;
 }
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:9,代码来源:PatternDialect.cs


示例10: Start

    // Use this for initialization
    void Start()
    {
        networkManager = gameObject.GetComponent<NetworkManager>();
        collisionManager = gameObject.GetComponent<CollisionManager>();
        textManager = gameObject.GetComponent<TextManager>();
        notificationManager = gameObject.GetComponent<NotificationManager>();

        panelManager = GameObject.Find("Panel");
        scaleChilds(panelManager);
    }
开发者ID:Hargalaten,项目名称:meGAMEss,代码行数:11,代码来源:Manager.cs


示例11: GetValueFormatter

        public virtual IValueFormatter GetValueFormatter(string spelling, TextManager manager)
        {
            IValueFormatter formatter = null;
            if (!ValueFormatters.Any(x => (formatter = x.GetFor(spelling, this, manager)) != null))
            {
                throw new LocalizedKeyNotFoundException("Exceptions.ValueFormatterNotFound", "No parameter evaluator found for {0}", new { Text = spelling});                
            }

            return formatter;
        }
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:10,代码来源:PatternDialect.cs


示例12: GetParameterEvaluator

        public virtual IParameterEvaluator GetParameterEvaluator(ParameterSpec spec, TextManager manager)
        {
            IParameterEvaluator evaluator = null;
            if (!ParameterEvaluators.Any(x => (evaluator = x.GetFor(spec, this, manager)) != null))
            {
                throw new LocalizedKeyNotFoundException("Exceptions.ParameterEvaluatorNotFound", "No parameter evaluator found for {0}", new { Text = spec });
            }

            return evaluator;
        }
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:10,代码来源:PatternDialect.cs


示例13: GetFor

        public IParameterEvaluator GetFor(ParameterSpec spec, PatternDialect dialect, TextManager manager)
        {
            var parts = spec.ParameterName.Split('.');
            if (parts.Length > 1)
            {
                return new ReflectionParameterEvaluator(parts[0], parts.Skip(1).ToArray());
            }

            return null;
        }
开发者ID:paulsuart,项目名称:rebelcmsxu5,代码行数:10,代码来源:ReflectionParameterEvaluator.cs


示例14: GetFor

        public IValueFormatter GetFor(string formatExpression, PatternDialect dialect, TextManager manager)
        {
            StringCaseTransformationType type;
            if (!string.IsNullOrEmpty(formatExpression) 
                && _transformationTypes.TryGetValue(formatExpression.ToLowerInvariant(), out type))
            {
                return new StringCaseFormatter { TransformationType = type };
            }

            return null;
        }
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:11,代码来源:StringCaseFormatter.cs


示例15: Start

	void Start()
    {
        root = GameObject.Find("UI Root");
        ps = transform.GetComponent<PanelSwitch>();
        tm = transform.GetComponent<TextManager>();
        im = transform.GetComponent<ImageManager>();
        playerdata = new UserData();
        for(int i = 0; i < 7; i++)
        {
            girl[i] = new GirlData(i);
        }
    }
开发者ID:lshy1993,项目名称:LianaiYuTuili,代码行数:12,代码来源:GameManager.cs


示例16: OnEnable

    void OnEnable()
    {
        thisScript = (TextManager) target;

        isFinalBoxProp = serializedObject.FindProperty("isFinalBox");
        TypeWritterFrequencyProp = serializedObject.FindProperty("TypeWritterFrequency");
        NumberOfStatementsProp = serializedObject.FindProperty("NumberOfStatements");
        ScriptProp = new SerializedProperty[thisScript.Script.Length];
        for(int i = 0; i < thisScript.Script.Length; i++)
        {
            ScriptProp[i] = serializedObject.FindProperty(string.Format("{0}.Array.data[{1}]", "Script", i));
        }
    }
开发者ID:GirlAnime,项目名称:OtomeMaker,代码行数:13,代码来源:TextManagerEditor.cs


示例17: GetSource

        public ITextSource GetSource(TextManager textManager, Assembly referenceAssembly, string targetNamespace)
        {
            var source = new SimpleTextSource();
            source.Texts.Add(new LocalizedText
            {
                Namespace = targetNamespace,
                Key = "Tulips1",
                Pattern = "resource:TestPlugin.Koala.jpg",
                Language = "da-DK",
                Source = new TextSourceInfo { TextSource = source, ReferenceAssembly = referenceAssembly }
            });

            return source;
        }
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:14,代码来源:TextFactory.cs


示例18: GetSource

 public override ITextSource GetSource(Assembly asm, TextManager textManager, string targetNamespace)
 {            
     var source = XmlTextSource.ForAssembly(asm, ResourceName);
     if (source != null)
     {
         source.DefaultNamespace = targetNamespace;
     }
     else
     {
         throw new LocalizedFileNotFoundException(ResourceName, "Exceptions.ResourceNotFoundException",
             defaultMessage: "The resource {0} could not be opened");
     }
     return source;
 }
开发者ID:Joebeazelman,项目名称:rebelcmsxu5,代码行数:14,代码来源:LocalizationXmlSourceAttribute.cs


示例19: GetFor

        public override ISwitchConditionEvaluator GetFor(string spelling, PatternDialect dialect, TextManager manager)
        {
            if (spelling.StartsWith("@"))
            {
                var evaluator = dialect.GetParameterEvaluator(
                    new ParameterSpec { ParameterName = spelling }, manager) as PatternLookupEvaluator;
                if (evaluator != null)
                {
                    return new LookupCondition
                    {
                        Dialect = dialect,
                        Evaluator = evaluator
                    };
                }
            }

            return null;
        }        
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:18,代码来源:LookupCondition.cs


示例20: GetFor

        public ISwitchConditionEvaluator GetFor(Expression rep, PatternDialect dialect, TextManager manager)
        {
            if (rep == null)
            {
                return GetFor("", dialect, manager);
            }
            else if (rep.Parts.Count == 1)
            {
                var text = rep.Parts[0] as Text;
                if (text != null)
                {
                    return GetFor(text.Spelling.Trim(), dialect, manager);
                }
            }

            //Unsupported expression
            return null;
        }
开发者ID:nikolajw,项目名称:localizationnet,代码行数:18,代码来源:StringBasedSwitchConditionEvaluatorFactory.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# TextMenu类代码示例发布时间:2022-05-24
下一篇:
C# TextLocation类代码示例发布时间: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