Exemplo n.º 1
0
 protected override void OnAccessorChanged(IAccessor accessor)
 {
     text.text  = accessor.FieldName;
     InvokeType = InvocationType.None;
     if (accessor is MethodAccessor)
     {
         del        = null;
         uEvent     = null;
         method     = ((MethodAccessor)accessor).Method;
         InvokeType = InvocationType.Method;
     }
     else if (accessor is FieldAccessor || accessor is PropertyAccessor || accessor is CustomPropertyAccessor_Base || accessor is CustomFunctionAccessor)
     {
         method = null;
         uEvent = null;
         del    = null;
         var value = accessor.FieldValue;
         if (value is Delegate)
         {
             del        = (Delegate)value;
             InvokeType = InvocationType.Delegate;
         }
         else if (value is UnityEvent)
         {
             uEvent     = (UnityEvent)value;
             InvokeType = InvocationType.UnityEvent;
         }
     }
     base.OnAccessorChanged(accessor);
 }
 public void SetUp()
 {
     alpha = DnaAlphabet.Instance();
     symbols = new SymbolArray(alpha, "tatgacgt");
     this.indexer = new IndexerDirect(2);
     accessor = new AccessorTransparent(indexer, 4, symbols);
 }
Exemplo n.º 3
0
        public override bool CanWorkWithAccessor(IAccessor accessor)
        {
            if (accessor is MethodAccessor)
            {
                var method = ((MethodAccessor)accessor).Method;

                var parameters = method.GetParameters();

                if (parameters.GetLength(0) == 0)
                {
                    return(true);
                }
            }
            else if (accessor is FieldAccessor || accessor is PropertyAccessor || accessor is CustomPropertyAccessor_Base || accessor is CustomFunctionAccessor)
            {
                var value = accessor.FieldValue;
                if (value != null)
                {
                    if (value is Delegate)
                    {
                        var del = (Delegate)value;
                        if (del.Method.GetParameters().GetLength(0) == 0)
                        {
                            return(true);
                        }
                    }
                    else if (value is UnityEvent)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Exemplo n.º 4
0
        public NuiHelper()
        {
            accessor = MapBuilderClient.Accessor;
            var locator = MapBuilderClient.Locator;

            inputRef = locator.GetServiceReference <Input>();
        }
Exemplo n.º 5
0
        public static WideString FromData_(IAccessor <byte> data, long offset, long length)
        {
            if (offset < 0 || offset + length > data.LongCount)
            {
                throw new IndexOutOfRangeException();
            }

            if (length <= 0)
            {
                length = LengthOf_(data, offset);
                if (length > 0)                 // To comply with scale passed in: the no. of chars
                {
                    length >>= 1;
                }
            }
            if (length > 0)
            {
                length <<= 1;
                if (length <= MAX_LENGTH && offset + length <= data.LongCount)
                {
                    if (data[offset + length - 1] == 0 && data[offset + length - 2] == 0)
                    {
                        IAccessor <byte> shifted = data[offset, length];
                        return(new WideString(Encoding.Unicode.GetString(shifted.ToArray(), 0, (int)(length - 2))));
                    }
                }
            }

            return(null);
        }
 public PropertyViewModel(IPrefab prefab, IAccessor accessor, int index)
 {
     _prefab   = prefab;
     _accessor = accessor;
     Value     = _accessor.ToStringPrefab(_accessor.GetPrefab(prefab));
     Index     = index;
 }
Exemplo n.º 7
0
        public virtual MigrationCommandInfo SetConnectionString(IAccessor accessor)
        {
            accessor.NotNull(nameof(accessor));

            var connector = DataSettings.Preference
                            .MigrationCommandInfoConnectionStringConnector;

            var sb = new StringBuilder();

            sb.Append(nameof(ITenant.Name));
            sb.Append(connector);
            sb.Append(accessor.CurrentTenant.Name);
            sb.Append(';');

            sb.Append(nameof(ITenant.Host));
            sb.Append(connector);
            sb.Append(accessor.CurrentTenant.Host);
            sb.Append(';');

            sb.Append(nameof(ConnectionString));
            sb.Append(connector);
            sb.Append(accessor.GetCurrentConnectionDescription());

            ConnectionString = sb.ToString();

            return(this);
        }
Exemplo n.º 8
0
 private static float GetMeasure(this IAccessor <Measure> accessor, IElement element, IFrameContext context,
                                 float defaultValue = 0)
 {
     return(accessor.TryGetValue(element, out var measure)
 ? measure.Resolve(element, context)
 : defaultValue);
 }
Exemplo n.º 9
0
        /// <summary>
        /// Converts data passed in into a string representation based on type given
        /// </summary>
        /// <param name="type">Type to use for conversion</param>
        /// <param name="data">Data used to form value</param>
        /// <param name="offset">Optional offset into data</param>
        /// <returns>String representation</returns>
        public static string ToString(Type type, IAccessor <byte> data, long offset = 0)
        {
            if (0 > offset || offset >= data.LongCount)
            {
                throw new IndexOutOfRangeException();
            }

            if (type == null)
            {
                return("");
            }

            if (data == null)
            {
                return("<NULL>");
            }

            try
            {
                IDatatype instance = Registry.Instance(type, data, offset);
                if (instance != null)
                {
                    return(instance.ToString());
                }
            }
            catch { }

            throw new ArgumentException(string.Format("Unknown type {0}", type));
        }
 internal IndirectAccessorSpecialization(
     IAccessor declaration,
     IndirectPropertySpecialization parentProperty)
     : base(declaration, (TypeSpecialization)parentProperty.ParentType)
 {
     this.specializedParentProperty = parentProperty;
 }
Exemplo n.º 11
0
 public ServiceImpl()
 {
     if (Accessor == null)
     {
         Accessor = new AccessorImpl <PK, Entity>();
     }
 }
Exemplo n.º 12
0
 public static ICopier <T, R> Copy <T, R>(this IAccessor <T> accessor, Expression <Func <R> > definer)
 {
     return(new CopierImpl <T, R>(
                Expression.Lambda <Action <T, R> >(
                    accessor.Expression.Body,
                    accessor.Expression.Parameters[0], Expression.Parameter(typeof(R)))));
 }
Exemplo n.º 13
0
        public MapBuilderClient() : base()
        {
            _accessor = this;

            FreecamConfig config = new FreecamConfig
            {
                FieldOfView         = 75,
                PositionSensitivity = 1.0f,
                PositionBase        = 100.0f,
                RotationSensitivity = 1.0f,
                RotationBase        = 500.0f,
                KeySmoothTime       = 500,
            };

            input = locator.CreateService <Input>();
            //@TODO(bma) #state-manager: Move this to #move-toggle-to-class.
            input.RegisterKey(0, 37, InputKeyType.Once);
            input.RegisterKey(0, 261, InputKeyType.Once);
            input.RegisterKey(0, 262, InputKeyType.Once);

            freeCam = locator.CreateService <Freecam>(config);
            ui      = locator.CreateService <UserInterface>();
            builder = locator.CreateService <Builder>();

            EventHandlers.Add("onResourceStop", new Action <string>(OnResourceStopped));
        }
Exemplo n.º 14
0
        internal virtual IAccessor <TValueType> CreateIAccessor <TValueType>()
        {
            // TODO: Geeignete konkrete Klasse instanziieren
            IAccessor <TValueType> target = null;

            return(target);
        }
Exemplo n.º 15
0
        private IAccessor CreateSetter(IConstructLanguage language, string propertyName, IFieldDeclaration field)
        {
            string propertyChangedName = language.Name == LanguageNames.CSharp ? "OnPropertyChanged" : "RaisePropertyChangedEvent";

            IMethodInvocation onPropertyChanged = language.MethodInvocation(language.None <IExpression>(),
                                                                            language.Identifier(propertyChangedName),
                                                                            language.None <ITypeArguments>(),
                                                                            language.Arguments(
                                                                                language.Argument(language.StringLiteral(propertyName))));

            IMemberAccess fieldUsage = language.MemberAccess(language.None <IExpression>(), field.Identifier);
            IExpression   valueUsage = language.Expression("value");

            IStatement assignment = language.AssignmentStatement(fieldUsage, valueUsage);

            IIfStatement ifStatement =
                language.IfStatement(
                    language.BinaryExpression(fieldUsage,
                                              Operator.NotEqual,
                                              valueUsage),
                    language.Block(assignment, language.ExpressionStatement(onPropertyChanged)));

            IAccessor setter = language.Setter(language.Block(ifStatement));

            return(setter);
        }
Exemplo n.º 16
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 protected DefaultEvent(IEvent ev)
     : base(ev)
 {
     this.addAccessor    = ev.AddAccessor;
     this.removeAccessor = ev.RemoveAccessor;
     this.invokeAccessor = ev.InvokeAccessor;
 }
        public void PreInject(IAccessor accessor)
        {
            accessor.NotNull(nameof(accessor));

            var contextAccessor = accessor as DbContextAccessor;
            var currentUserId   = contextAccessor.GetService <IUserProfileService>()?.GetCurrentUserId();

            var logs = GetLogs();

#pragma warning disable CS8602 // 解引用可能出现空引用。
            contextAccessor.Logs.AddRange(logs);
#pragma warning restore CS8602 // 解引用可能出现空引用。

            IEnumerable <Log> GetLogs()
            {
#pragma warning disable CS8602 // 解引用可能出现空引用。
                var query = contextAccessor.ChangeTracker.Entries().Where(p
                                                                          => p.Entity.IsNotNull() && p.Metadata.ClrType.IsImplementedInterfaceType <ILoggable>());
#pragma warning restore CS8602 // 解引用可能出现空引用。

                return(query
                       .Where(p => LogEntityStates.Contains(p.State))
                       .Select(p => Log.CreateFromDescriptor(((ILoggable)p.Entity).ToLog(currentUserId))));
            }
        }
Exemplo n.º 18
0
        /// <summary>主要入口方法。把目标对象指定成员写入数据流,处理基础类型、特殊类型、基础类型数组、特殊类型数组,通过委托方法处理成员</summary>
        /// <param name="value">要写入的对象</param>
        /// <param name="type">要写入的对象类型</param>
        /// <param name="callback">处理成员的方法</param>
        /// <returns>是否写入成功</returns>
        public Boolean WriteObject(Object value, Type type, WriteObjectCallback callback)
        {
            if (type == null && value != null)
            {
                type = value.GetType();
            }
            if (callback == null)
            {
                callback = WriteMember;
            }

            // 检查IAcessor接口
            IAccessor accessor = value as IAccessor;

            if (accessor != null && accessor.Write(this))
            {
                return(true);
            }

            Boolean rs = WriteObjectWithEvent(value, type, callback);

            // 检查IAcessor接口
            if (accessor != null)
            {
                rs = accessor.WriteComplete(this, rs);
            }

            return(rs);
        }
Exemplo n.º 19
0
        public Input()
        {
            IAccessor accessor = MapBuilderClient.Accessor;

            accessor.OnUpdateTick(UpdateDisabledKeys);
            accessor.OnUpdateTick(UpdateKeyStates);
        }
Exemplo n.º 20
0
        protected override void OnAccessorChanged(IAccessor accessor)
        {
            base.OnAccessorChanged(accessor);
            dropdown.onValueChanged.RemoveAllListeners();
            var type = accessor.MemberType;

            Title = accessor.FieldName;

            EnumData.Clear();

            List <string> OptionNames = new List <string>();

            foreach (var val in Enum.GetValues(type))
            {
                var valName = Enum.GetName(type, val);
                EnumData.Add(new KeyValuePair <string, object>(valName, val));
                OptionNames.Add(valName);
            }

            dropdown.ClearOptions();
            dropdown.AddOptions(OptionNames);
            dropdown.value = EnumData.FindIndex(kv => kv.Value.Equals(accessor.FieldValue));

            dropdown.onValueChanged.AddListener(OnValueChanged);
            base.OnAccessorChanged(accessor);
        }
Exemplo n.º 21
0
        /// <summary>
        /// Check for valid 16bit UCS-2 string
        /// </summary>
        /// <param name="data">Data to check</param>
        /// <param name="offset">Where to start in data</param>
        /// <param name="length">Assumed length of string</param>
        /// <returns>Outcome</returns>
        public static bool IsWideString(IAccessor <byte> data, long offset, long length)
        {
            long len2 = length << 1;

            if (offset + len2 > data.LongCount)
            {
                return(false);
            }

            // Null-terminator present?
            if (data[offset + len2 - 2] != 0 || data[offset + len2 - 1] != 0)
            {
                return(false);
            }

            for (long idx = offset; idx < offset + len2 - 2; idx += 2)
            {
                byte b1 = data[idx];
                byte b2 = data[idx + 1];

                if (!IsWideChar(b1, b2))
                {
                    return(false);
                }
            }

            return(true);
        }
 public ServiceFabricHealthCheckPublisher(
     IAccessor <IServicePartition> partitionAccessor,
     ILogger <ServiceFabricHealthCheckPublisher> logger)
 {
     m_partitionAccessor = partitionAccessor;
     m_logger            = logger;
 }
Exemplo n.º 23
0
        /// <summary>
        /// Find length of required data based on type given
        /// </summary>
        /// <param name="type">Type to use</param>
        /// <param name="data">Data (in case type is of varying length like {Ansi|Wide|Var}String)</param>
        /// <param name="offset">Offset into data (in case type is of varying length like VarString)</param>
        /// <returns>Number of bytes for given type, or -1 if none found (or error occured)</returns>
        public static long LengthOf(Type type, IAccessor <byte> data, long offset)
        {
            if (data == null || data.LongCount == 0 ||
                offset < 0 || offset >= data.LongCount)
            {
                return(-1);
            }

            if (type == null)
            {
                return(data.LongCount - offset);
            }

            try
            {
                IDatatype instance = Registry.Instance(type, data, offset);
                if (instance != null)
                {
                    return(instance.LengthOf(data, offset));
                }
            }
            catch { }

            throw new ArgumentException(string.Format("Unknown type {0}", type));
        }
Exemplo n.º 24
0
        public static int LengthOf_(IAccessor <byte> data, long offset)
        {
            int length = 0;

            // Scan up until null-terminator found, or max. allowed length exceeded
            while (length <= MAX_LENGTH)
            {
                if (offset + length > data.LongCount)
                {
                    length = -1;
                    break;
                }

                byte b1 = data[offset + length];
                byte b2 = data[offset + length + 1];

                if (!Helper.Analyzers.IsWideChar(b1, b2))
                {
                    break;
                }

                length += 2;

                if (b1 == 0 && b2 == 0)
                {
                    break;
                }
            }

            return(length);
        }
Exemplo n.º 25
0
		/// <summary>
		/// Copy constructor
		/// </summary>
		protected DefaultEvent(IEvent ev)
			: base(ev)
		{
			this.addAccessor = ev.AddAccessor;
			this.removeAccessor = ev.RemoveAccessor;
			this.invokeAccessor = ev.InvokeAccessor;
		}
Exemplo n.º 26
0
        public static long LengthOf_(IAccessor <byte> data, long offset)
        {
            int length = 0;

            // Scan up until null-terminator found, or max. allowed length exceeded
            while (length <= MAX_LENGTH)
            {
                if (offset + length > data.LongCount)
                {
                    length = -1;
                    break;
                }

                byte b = data[offset + length];

                if (!Helper.Analyzers.IsAsciiChar(b))
                {
                    break;
                }

                length++;

                if (b == 0)
                {
                    break;
                }
            }

            return(length);
        }
 public void SetUp()
 {
     alpha = DnaAlphabet.Instance();
     symbols = new SymbolArray(alpha, "actgactg");
     this.indexer = new IndexerDirect(2);
     accessor = new AccessorLinear(indexer, 4, symbols);
 }
    /// <summary>
    /// 对存取器的数据库分片。
    /// </summary>
    /// <param name="shardingManager">给定的 <see cref="IShardingManager"/>。</param>
    /// <param name="accessor">给定的 <see cref="IAccessor"/>。</param>
    /// <param name="descriptor">输出 <see cref="ShardedDescriptor"/>。</param>
    /// <returns>返回 <see cref="IAccessor"/>。</returns>
    public static IAccessor ShardDatabase(this IShardingManager shardingManager, IAccessor accessor,
                                          [MaybeNullWhen(false)] out ShardedDescriptor descriptor)
    {
        var attribute = accessor.AccessorDescriptor?.Sharded;

        if (attribute is null)
        {
            descriptor = null;
            return(accessor);
        }

        descriptor = shardingManager.CreateDescriptor(attribute);

        descriptor.DefaultStrategy?.FormatSuffix(descriptor);

        var shardedName = descriptor.ToString();

        if (!shardedName.Equals(descriptor.BaseName, StringComparison.Ordinal))
        {
            var newConnectionString = accessor.CurrentConnectionString !
                                      .Replace(attribute.BaseName !, shardedName);

            accessor.ChangeConnection(newConnectionString);
        }

        return(accessor);
    }
 public void SetUp()
 {
     alpha = DnaAlphabet.Instance();
     symbols = new SymbolArray(alpha, "actgactg");
     indexer = new IndexerDirect(2);
     indexerReverse = new IndexerReverse(2,symbols.Length);
     accessor = new AccessorCircular(this.indexer, 4, symbols);
 }
Exemplo n.º 30
0
 /// <inheritdoc/>
 public override bool IsLegalAccessor(IAccessor accessor)
 {
     return(object.Equals(
                accessor.ReturnParameter.Type,
                accessor.ParentProperty.PropertyType) &&
            accessor.Parameters.SequenceEqual <Parameter>(
                accessor.ParentProperty.IndexerParameters));
 }
Exemplo n.º 31
0
 public override bool CanWorkWithAccessor(IAccessor accessor)
 {
     if (accessor.MemberType != null)
     {
         return(accessor.MemberType.IsEnum);
     }
     return(false);
 }
Exemplo n.º 32
0
        public void SetCreated(IAccessor accessor)
        {
            var now = accessor.Clock.GetNowOffset();

            var filePath = GetReportFilePath(accessor as DbContextAccessorBase);

            filePath.WriteAllText($"The database was successfully created at {now}.");
        }
Exemplo n.º 33
0
        /// <summary>
        /// 构造一个内容图形 API 变化。
        /// </summary>
        /// <param name="accessor">给定的 <see cref="IAccessor"/>。</param>
        /// <param name="loggerFactory">给定的 <see cref="ILoggerFactory"/>。</param>
        public ContentGraphApiMutation(IAccessor accessor, ILoggerFactory loggerFactory)
            : base(loggerFactory)
        {
            ContentAccessor = accessor.CastTo <IAccessor,
                                               IContentAccessor <TCategory, TSource, TClaim, TTag, TUnit, TUnitClaim, TUnitTag, TUnitVisitCount, TPane, TPaneClaim> >(nameof(accessor));

            AddCategoryTypeField();
        }
Exemplo n.º 34
0
 public CSVController(IApplicantRepository repository, ICSVSerializer serializer,
                      IBuilder <Applicant> builder, IAccessor <Applicant> accessor)
 {
     _repository = repository;
     _serializer = serializer;
     _builder    = builder;
     _accessor   = accessor;
 }
Exemplo n.º 35
0
		public override void ApplyInterningProvider(IInterningProvider provider)
		{
			base.ApplyInterningProvider(provider);
			if (provider != null) {
				getter = provider.Intern(getter);
				setter = provider.Intern(setter);
				parameters = provider.InternList(parameters);
			}
		}
        public void TestReverseSymbolAt()
        {
            accessor = new AccessorCircular
                (this.indexerReverse, 4, symbols);

            Assert.AreEqual(alpha['t'], accessor.SymbolAt(-1));
            Assert.AreEqual(alpha['c'], accessor.SymbolAt(0));
            Assert.AreEqual(alpha['a'], accessor.SymbolAt(1));
            Assert.AreEqual(alpha['g'], accessor.SymbolAt(2));
            Assert.AreEqual(alpha['t'], accessor.SymbolAt(3));
            Assert.AreEqual(alpha['c'], accessor.SymbolAt(4));
        }
        public void TestReverseSymbolAt()
        {
            this.indexer = new IndexerReverse(2, symbols.Length);
            accessor = new AccessorLinear(indexer, 4, symbols);

            Assert.AreEqual(alpha['-'], accessor.SymbolAt(-1));
            Assert.AreEqual(alpha['c'], accessor.SymbolAt(0));
            Assert.AreEqual(alpha['a'], accessor.SymbolAt(1));

            Assert.AreEqual(alpha['g'], accessor.SymbolAt(2));
            Assert.AreEqual(alpha['t'], accessor.SymbolAt(3));
            Assert.AreEqual(alpha['-'], accessor.SymbolAt(4));
        }
        private void HighlightPropertyType(IAccessor accessor, IElement nameAttribute, ITypeOwner field, IElement typeAttribute, IXmlTag xmlTag, string attributeName) {
            ITypeElement propertyClass = HighlightUndefinedType(xmlTag, attributeName);
            if (accessor != null) {
                // TODO: use accessor.ReturnType on getter
                IDeclaredType declaredType = accessor.Parameters[0].Type as IDeclaredType;
                if (declaredType != null) {
                    ITypeElement propertyTypeElement = declaredType.GetTypeElement();
                    if ((propertyTypeElement != null) && (propertyClass != null) && (!propertyClass.IsDescendantOf(propertyTypeElement))) {
                        AddHighlighting(typeAttribute, new TypeHighlighting(string.Format("Class name '{0}' should be '{1}' or a descendant", propertyClass.ShortName, propertyTypeElement.ShortName)));
                    }
                }
            }
            if (field != null) {
                IDeclaredType declaredType = field.Type as IDeclaredType;
                if (declaredType != null) {
                    ITypeElement fieldTypeElement = declaredType.GetTypeElement();
                    if ((fieldTypeElement != null) && (propertyClass != null) && (!propertyClass.IsDescendantOf(fieldTypeElement))) {
                        AddHighlighting(typeAttribute, new TypeHighlighting(string.Format("Class name '{0}' should be '{1}' or a descendant", propertyClass.ShortName, fieldTypeElement.ShortName)));
                    }
                }
            }

            if ((accessor != null) && (field != null)) {
                IDeclaredType declaredAccessorType = accessor.Parameters[0].Type as IDeclaredType;
                IDeclaredType declaredFieldType = field.Type as IDeclaredType;
                if ((declaredAccessorType != null) && (declaredFieldType != null)) {
                    ITypeElement propertyTypeElement = declaredAccessorType.GetTypeElement();
                    ITypeElement fieldTypeElement = declaredFieldType.GetTypeElement();
                    if ((propertyTypeElement != null) && (fieldTypeElement != null) && (!propertyTypeElement.Equals(fieldTypeElement))) {
                        AddHighlighting(nameAttribute, new TypeHighlighting(string.Format("Property and field type differ: '{0}' vs. '{1}'", propertyTypeElement.ShortName, fieldTypeElement.ShortName)));
                    }
                }
            }
        }
 private void HighlightPropertyGetter(string propertyName, IAccessor accessor, IElement nameAttribute, string className) {
     if (accessor == null) {
         AddHighlighting(nameAttribute, new PropertyHighlighting(string.Format("Getter for property '{0}' not found in class '{1}'", propertyName, className)));
     }
 }
Exemplo n.º 40
0
		public FileData(IAccessor file, long size)
		{
			Size = size;
			File = file;
		}
Exemplo n.º 41
0
 public PropertyMetadata(IAccessor accessor, IConstraint constraint)
 {
     Accessor = accessor;
     Constraint = constraint;
 }
Exemplo n.º 42
0
 private static void RunSecondEntityCUI(IAccessor<SecondEntity> accessor)
 {
     Console.WriteLine("Commands:\np - print all\np [id] - print one\ni [id] - insert with id\nd [id] - delete by id\nx - quit");
     Console.WriteLine("Now using accessor: {0} ", accessor.GetType().Name);
     while (true)
     {
         string[] command = Console.ReadLine().Split(' ', ',');
         if (command[0] == "p")
         {
             Stopwatch s = new Stopwatch();
             s.Start();
             if (command.Length == 1)
             {
                 foreach (SecondEntity p in accessor.GetAll())
                 {
                     Console.WriteLine(p);
                 }
             }
             else if (command.Length == 2)
             {
                 string id = command[1];
                 SecondEntity p = accessor.GetById(id);
                 Console.WriteLine(p.ToString());
             }
             s.Stop();
             Console.WriteLine("Complete! elapsed: {0}ms", s.ElapsedMilliseconds);
         }
         else if (command[0] == "d")
         {
             Stopwatch s = new Stopwatch();
             s.Start();
             int id = Int32.Parse(command[1]);
             accessor.DeleteById(id);
             s.Stop();
             Console.WriteLine("Complete! elapsed: {0}ms", s.ElapsedMilliseconds);
         }
         else if (command[0] == "i")
         {
             Stopwatch s = new Stopwatch();
             s.Start();
             string id = command[1];
             SecondEntity p = new SecondEntity() { Field = id };
             if (command.Length >= 3)
             {
                 p.UnattributeField = command[2];
             }
             accessor.Insert(p);
             s.Stop();
             Console.WriteLine("Complete! elapsed: {0}ms", s.ElapsedMilliseconds);
         }
         else if (String.IsNullOrEmpty(command[0]) || command[0] == "x")
         {
             break;
         }
         else
         {
             Console.WriteLine("Unknown command");
         }
     }
 }
Exemplo n.º 43
0
		Accessor ConvertAccessor(IAccessor accessor)
		{
			if (accessor == null)
				return Accessor.Null;
			Accessor decl = new Accessor();
			decl.Modifiers = ModifierFromAccessibility(accessor.Accessibility);
			return decl;
		}
Exemplo n.º 44
0
		protected DefaultProperty(IProperty p) : base(p)
		{
			this.getter = p.Getter;
			this.setter = p.Setter;
			this.parameters = CopyList(p.Parameters);
		}
Exemplo n.º 45
0
 private StaticMethodWrapper WrapAccessor(IAccessor accessorHandle, StaticMemberWrapper member)
 {
     return accessorHandle != null ? new StaticMethodWrapper(this, accessorHandle, member.DeclaringType, member.ReflectedType, member.Substitution) : null;
 }
Exemplo n.º 46
0
 public MemberInformation(IAccessor accessor, bool isPublic)
 {
     Accessor = accessor;
     IsPublic = isPublic;
 }