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

C# SymbolId类代码示例

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

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



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

示例1: Define

 public void Define(SymbolId name, Definition definition)
 {
     if (name != SymbolTable.Empty)
     {
         current.Define(name, definition);
     }
 }
开发者ID:smartmobili,项目名称:parsing,代码行数:7,代码来源:Analyzer.cs


示例2: Contains

        public override bool Contains(SymbolId key) {
            if (_data == null) return false;

            lock (this) {
                return _data.ContainsKey(key);
            }
        }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:7,代码来源:SymbolIdDictionaryStorage.cs


示例3: TryGetPackageAny

 public MemberTracker TryGetPackageAny(SymbolId name) {
     MemberTracker ret;
     if (TryGetValue(name, out ret)) {
         return ret;
     }
     return null;
 }
开发者ID:Hank923,项目名称:ironruby,代码行数:7,代码来源:TopNamespaceTracker.cs


示例4: PythonTypeChangedEventArgs

 public PythonTypeChangedEventArgs(CodeContext context, SymbolId changed, ChangeType type, object previous, object newValue) {
     _context = context;
     _changed = changed;
     _type = type;
     _previous = previous;
     _newValue = newValue;
 }
开发者ID:JamesTryand,项目名称:IronScheme,代码行数:7,代码来源:PythonTypeChangedEventArgs.cs


示例5: TryGetPackage

 public NamespaceTracker TryGetPackage(SymbolId name) {
     NamespaceTracker pm = TryGetPackageAny(name) as NamespaceTracker;
     if (pm != null) {
         return pm;
     }
     return null;
 }
开发者ID:Hank923,项目名称:ironruby,代码行数:7,代码来源:TopNamespaceTracker.cs


示例6: TryGetExtraValue

        protected override bool TryGetExtraValue(SymbolId key, out object value)
        {
            var property = _viewType.GetProperty(key.ToString());
            if (property != null)
            {
                value = property.GetValue(_view, null);
                return true;
            }

            var field = _viewType.GetField(key.ToString());
            if (field != null)
            {
                value = field.GetValue(_view);
                return true;
            }

            var method = _viewType.GetMethod(key.ToString());
            if (method != null)
            {
                var parameterTypes = method.GetParameters().Select(p => p.ParameterType).ToList();
                parameterTypes.Add(method.ReturnType);
                value = Delegate.CreateDelegate(
                    CompilerHelpers.MakeCallSiteDelegateType(parameterTypes.ToArray()),
                    _view,
                    key.ToString());
                return true;
            }

            if (_view.TryGetViewData(key.ToString(), out value))
                return true;

            value = null;
            return false;
        }
开发者ID:ronniebarker,项目名称:spark,代码行数:34,代码来源:ScriptingViewSymbolDictionary.cs


示例7: PythonVariable

 public PythonVariable(SymbolId name, Type/*!*/ type, VariableKind kind, ScopeStatement/*!*/ scope) {
     Assert.NotNull(type, scope);
     _name = name;
     _type = type;
     _kind = kind;
     _scope = scope;
 }
开发者ID:octavioh,项目名称:ironruby,代码行数:7,代码来源:PythonVariable.cs


示例8: Add

        public override void Add(SymbolId key, object value) {
            lock (this) {
                EnsureData();

                _data[key] = value;
            }
        }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:7,代码来源:SymbolIdDictionaryStorage.cs


示例9: FromImportStatement

 public FromImportStatement(ModuleName root, SymbolId[] names, SymbolId[] asNames, bool fromFuture, bool forceAbsolute) {
     _root = root;
     _names = names;
     _asNames = asNames;
     _fromFuture = fromFuture;
     _forceAbsolute = forceAbsolute;
 }
开发者ID:octavioh,项目名称:ironruby,代码行数:7,代码来源:FromImportStatement.cs


示例10: CreateSlot

        protected override Slot CreateSlot(SymbolId name, Type type)
        {
            FieldBuilder fb = _typeGen.TypeBuilder.DefineField(SymbolTable.IdToString( name),
              type, FieldAttributes.Assembly | FieldAttributes.Static);

            return new StaticFieldSlot(fb);
        }
开发者ID:robertlj,项目名称:IronScheme,代码行数:7,代码来源:StaticFieldSlotFactory.cs


示例11: Method

        public static object Method(object[] args)
        {
            Debug.Assert(args.Length >= 3, "A call to «method» should have at least two parameters: the name of the method and its block");
            Debug.Assert(args[0] is DictionaryBonsaiFunction);
            for (int i = 1; i < args.Length - 1; i++)
                Debug.Assert(args[i] is SymbolId, "Argument " + i + " should be a SymbolId");
            Debug.Assert(args[args.Length - 1] is BlockBonsaiFunction, "The last arguments should be a block");

            var scope = (DictionaryBonsaiFunction)args[0];
            var name = (SymbolId)args[1];
            var block = (BlockBonsaiFunction)args[args.Length - 1];
            var self = (BonsaiPrototypeFunction)scope["self"];

            var parameters = new SymbolId[args.Length - 3];
            for (int i = 2; i < args.Length - 1; i++)
                parameters[i - 2] = (SymbolId)args[i];

            self[name] = new DelegateBonsaiFunction(callArgs => {
                Debug.Assert(callArgs.Length - 1 == parameters.Length, "The number of arguments should equal the number of parameters");

                var blockLocalVariables = new DictionaryBonsaiFunction();
                for (int i = 0; i < parameters.Length; i++) {
                    blockLocalVariables[parameters[i]] = callArgs[i + 1];
                }
                var callSelf = ((DictionaryBonsaiFunction)callArgs[0])["self"];
                blockLocalVariables["self"] = callSelf;
                return block.Invoke(blockLocalVariables);
            });

            return self[name];
        }
开发者ID:eugen,项目名称:Bonsai,代码行数:31,代码来源:BonsaiPrototypeFunction.cs


示例12: BonsaiPrototypeFunction

        public BonsaiPrototypeFunction(SymbolId? name = null, BonsaiPrototypeFunction prototype = null)
            : base(null)
        {
            if (name.HasValue)
                this.Name = name.Value;
            else
                this.Name = "«unnamed»".ToSymbol();

            if (prototype == null) {
                foreach (MethodInfo method in this.GetType().GetMethods(
                    BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static   )) {
                    var attrs = method.GetCustomAttributes(typeof(MapsToSymbolAttribute), false);
                    foreach (MapsToSymbolAttribute mapper in attrs) {
                        this.Dict.Add(
                            mapper.Symbol,
                            new DelegateBonsaiFunction((Func<object[], object>)Delegate.CreateDelegate(
                                typeof(Func<object[], object>),
                                method.IsStatic ? null : this,
                                method)));
                    }
                }
            } else {
                this.Dict = new SortedList<SymbolId, object>(prototype.Dict);
            }
        }
开发者ID:eugen,项目名称:Bonsai,代码行数:25,代码来源:BonsaiPrototypeFunction.cs


示例13: ComparisonPattern

 public ComparisonPattern(SymbolId symbol, object testedValue)
 {
     if (!(testedValue is IComparable))
         throw new ArgumentException("testedValue must be IComparable", "testedValue");
     this.ParameterName = symbol;
     this.TestedValue = testedValue;
 }
开发者ID:eugen,项目名称:Bonsai,代码行数:7,代码来源:Patterns.cs


示例14: TryGetPackageLazy

 public MemberTracker TryGetPackageLazy(SymbolId name) {
     MemberTracker ret;
     if (_dict.TryGetValue(SymbolTable.IdToString(name), out ret)) {
         return ret;
     }
     return null;
 }
开发者ID:JamesTryand,项目名称:IronScheme,代码行数:7,代码来源:TopNamespaceTracker.cs


示例15: PythonGlobal

        public PythonGlobal(CodeContext/*!*/ context, SymbolId name) {
            Assert.NotNull(context);

            _value = Uninitialized.Instance;
            _context = context;
            _name = name;
        }
开发者ID:joshholmes,项目名称:ironruby,代码行数:7,代码来源:PythonGlobal.cs


示例16: VariableInfo

 internal VariableInfo(SymbolId symbol, Type type, bool parameter, bool hidden, bool strongBoxed)
     : this(symbol, type, parameter, hidden, strongBoxed, Int32.MaxValue, Int32.MaxValue) {
     _symbol = symbol;
     _type = type;
     _parameter = parameter;
     _hidden = hidden;
     _strongBoxed = strongBoxed;
 }
开发者ID:rudimk,项目名称:dlr-dotnet,代码行数:8,代码来源:VariableInfo.cs


示例17: CustomOldClassDictionaryStorage

 public CustomOldClassDictionaryStorage(SymbolId[] extraKeys, int keyVersion) {
     _extraKeys = extraKeys;
     _keyVersion = keyVersion;
     _values = new object[extraKeys.Length];
     for (int i = 0; i < _values.Length; i++) {
         _values[i] = Uninitialized.Instance;
     }
 }
开发者ID:octavioh,项目名称:ironruby,代码行数:8,代码来源:CustomOldClassDictionary.cs


示例18: Contains

 public override bool Contains(SymbolId key) {
     foreach (Scope scope in GetVisibleScopes()) {
         if (scope.ContainsVariable(key)) {
             return true;
         }
     }
     return false;
 }
开发者ID:joshholmes,项目名称:ironruby,代码行数:8,代码来源:ScopeDictionaryStorage.cs


示例19: Contains

        public override bool Contains(SymbolId key) {
            int ikey = FindKey(key);
            if (ikey != -1) {
                return _values[ikey] != Uninitialized.Instance;
            }

            return base.Contains(key);
        }
开发者ID:octavioh,项目名称:ironruby,代码行数:8,代码来源:CustomOldClassDictionary.cs


示例20: Add

 public override void Add(SymbolId key, object value) {
     int ikey = FindKey(key);
     if (ikey != -1) {
         _values[ikey] = value;
     } else {
         base.Add(key, value);
     }
 }
开发者ID:octavioh,项目名称:ironruby,代码行数:8,代码来源:CustomOldClassDictionary.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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