Exemple #1
0
        // Construct a property as a copy of another.
        public Property(Property copy)
        {
            name          = copy.name;
            type          = copy.type;
            objectValue   = copy.objectValue;
            nextSibling   = null;
            firstChild    = null;
            documentation = null;
            action        = copy.action;
            properties    = null;
            baseProperty  = null;

            if (copy.firstChild != null)
            {
                firstChild = new Property(copy.firstChild);
            }
            if (copy.nextSibling != null)
            {
                nextSibling = new Property(copy.nextSibling);
            }
            if (copy.documentation != null)
            {
                documentation = new PropertyDocumentation(copy.documentation);
            }
        }
Exemple #2
0
        public async Task ValidateAsync(Property entity, PropertyAction action)
        {
            switch (action)
            {
            case PropertyAction.Create:
                await ValidateCreateAsync(entity);

                break;

            case PropertyAction.Update:
                break;

            case PropertyAction.Delete:
                break;

            case PropertyAction.Process:
                break;

            case PropertyAction.Activate:
                break;

            default:
                throw new NotImplementedException();
            }
        }
 protected void AddAction(PropertyAction action)
 {
     if (!actions.Contains(action))
     {
         actions.Add(action);
     }
 }
 public OnPropertyEvent(string propertyName, string ownerMemberId, PropertyAction action, object propertyData = null)
 {
     this.propertyName  = propertyName;
     this.ownerMemberId = ownerMemberId;
     this.propertyData  = propertyData;
     this.action        = action;
 }
Exemple #5
0
        internal static void NetworkProperty(PropertyData propertyData, PropertyAction action)
        {
            var caller = new[] { (byte)Types.Property, (byte)action, (byte)Internals.Padding };
            var buffer = GsSerializer.Object.GetBuffer(propertyData);

            GsSerializer.Object.SendObject(caller, buffer);
        }
Exemple #6
0
        public void ValidActionCanBeParsed(string input)
        {
            PropertyAction action = DocumentParser.PropertyAction.Parse(input);

            Assert.NotEqual(PropertyAction.Invalid, action);
            Assert.Equal(input, action == PropertyAction.Add ? "+=" : "=");
        }
    protected void RemoveAction(PropertyAction action)
    {
        if (!actions.Contains(action))
        {
            return;
        }

        actions.Remove(action);
    }
        public PropertyElement(PropertyAction action, IEnumerable <string> nameParts, ValueElement valueElement,
                               string conditionalExpression)
            : base(action.ToString(), conditionalExpression)
        {
            Action       = action;
            NameParts    = nameParts.ToArray();
            ValueElement = valueElement;

            FullName = string.Join(' ', NameParts);
        }
Exemple #9
0
        private void InvokeOnProperty(PSObject value, bool raw, PropertyAction action)
        {
            DirectoryEntryPropertyDictionary entryProperties = GetProperties(raw);

            foreach (PSPropertyInfo psprop in value.Properties)
            {
                if (entryProperties.ContainsKey(psprop.Name))
                {
                    action(entryProperties[psprop.Name], psprop.Value);
                }
            }
        }
 /// <summary>
 /// Settings the property action.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="func">The func.</param>
 protected static T2 SettingPropertyAction <T2>(T2 owner, PropertyAction func) where T2 : class, new()
 {
     if (owner == null)
     {
         owner = new T2();
     }
     foreach (PropertyInfo propInfo in typeof(T2).GetProperties(BindingFlags.Public | BindingFlags.Instance))
     {
         func(propInfo, owner);
     }
     return(owner);
 }
Exemple #11
0
        private static void Main(string[] args)
        {
            var configMap = new ExeConfigurationFileMap();

            configMap.ExeConfigFilename = args[0];
            var config = ConfigurationManager.OpenMappedExeConfiguration(configMap, ConfigurationUserLevel.None);

            PropertyIdentification.BAL.PropertyAction action = new PropertyAction();
            var logger = new NLogger();

            logger.WriteLog("Test", LogLevel.Info);

            action.ProcessStart();
            Console.ReadLine();
        }
Exemple #12
0
        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        // Construct a property with the given name and type.
        public Property(string name, PropertyType type = PropertyType.String)
        {
            this.name			= name;
            this.type			= type;
            this.objectValue	= 0;
            this.nextSibling	= null;
            this.firstChild		= null;
            this.documentation	= null;
            this.action			= null;
            this.properties		= null;
            this.baseProperty	= null;

            // Add the property action.
            if (Resources.ExistsResource<PropertyAction>(name))
                this.action = Resources.GetResource<PropertyAction>(name);
        }
Exemple #13
0
        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------

        // Construct a property with the given name and type.
        public Property(string name, PropertyType type = PropertyType.String)
        {
            this.name          = name;
            this.type          = type;
            this.objectValue   = 0;
            this.nextSibling   = null;
            this.firstChild    = null;
            this.documentation = null;
            this.action        = null;
            this.properties    = null;
            this.baseProperty  = null;

            // Add the property action.
            if (Resources.ExistsResource <PropertyAction>(name))
            {
                this.action = Resources.GetResource <PropertyAction>(name);
            }
        }
 /// <summary>
 /// [Constructor] Create property object using value and delegate.
 /// </summary>
 public UnitPropertyWrapper(T initialValue, PropertyAction <T> getAction, PropertyAction <T> setAction)
 {
     this.initialValue = initialValue;
     this.getAction    = getAction ?? (x => x);
     this.setAction    = setAction ?? (x => x);
 }
Exemple #15
0
        // Construct a property as a copy of another.
        public Property(Property copy)
        {
            name			= copy.name;
            type			= copy.type;
            objectValue		= copy.objectValue;
            nextSibling		= null;
            firstChild		= null;
            documentation	= null;
            action			= copy.action;
            properties		= null;
            baseProperty	= null;

            if (copy.firstChild != null)
                firstChild = new Property(copy.firstChild);
            if (copy.nextSibling != null)
                nextSibling = new Property(copy.nextSibling);
            if (copy.documentation != null)
                documentation = new PropertyDocumentation(copy.documentation);
        }
Exemple #16
0
 // Set the property action to occur when this property is modified.
 public Property SetAction(PropertyAction action)
 {
     this.action = action;
     return this;
 }
Exemple #17
0
        // Construct a property as a copy of another.
        public Property(Property copy)
        {
            name			= copy.name;
            type			= copy.type;
            intValue		= copy.intValue;
            floatValue		= copy.floatValue;
            stringValue		= copy.stringValue;
            next			= null;
            firstChild		= null;
            documentation	= null;
            action			= copy.action;
            properties		= null;

            if (copy.firstChild != null)
                firstChild = new Property(copy.firstChild);
            if (copy.next != null)
                next = new Property(copy.next);
            if (copy.documentation != null)
                documentation = new PropertyDocumentation(copy.documentation);
        }
Exemple #18
0
        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        // Construct a property with the given name and type.
        public Property(string name, PropertyType type = PropertyType.String)
        {
            this.name			= name;
            this.type			= type;
            this.intValue		= 0;
            this.floatValue		= 0;
            this.stringValue	= "";
            this.next			= null;
            this.firstChild		= null;
            this.documentation	= null;
            this.action			= null;
            this.properties		= null;

            if (Resources.ExistsResource<PropertyAction>(name))
                this.action		= Resources.GetResource<PropertyAction>(name);
        }
Exemple #19
0
 // Set the property action to occur when this property is modified.
 public Property SetAction(PropertyAction action)
 {
     this.action = action;
     return(this);
 }
 protected void AddAction(PropertyAction action)
 {
     _actions.Add(action);
 }
Exemple #21
0
        private void InvokeOnProperty(PSObject value, bool raw, PropertyAction action)
        {
            DirectoryEntryPropertyDictionary entryProperties = GetProperties(raw);

            foreach (PSPropertyInfo psprop in value.Properties)
            {
                if (entryProperties.ContainsKey(psprop.Name))
                {
                    action(entryProperties[psprop.Name], psprop.Value);
                }
            }
        }