Esempio n. 1
0
        protected virtual void AddAction(InverseActionType actionType, object obj, string propertyName, object value, object master)
        {
            if (value == null)
            {
                this.Context.LogManager.Debug(this, "Caching inverse action", "Action type: " + actionType.ToString() + ", Object of type: " + obj.GetType().ToString() + ", Property: " + propertyName + ", Value: null");                 // do not localize
            }
            else
            {
                this.Context.LogManager.Debug(this, "Caching inverse action", "Action type: " + actionType.ToString() + ", Object of type: " + obj.GetType().ToString() + ", Property: " + propertyName + ", Value type: " + value.GetType().ToString());                   // do not localize
            }
            InverseAction action = new InverseAction();

            action.ActionType   = actionType;
            action.Obj          = obj;
            action.PropertyName = propertyName;
            action.Value        = value;
            action.Master       = master;
            Hashtable objActions;
            ArrayList propActions;
            ArrayList masterActions;

            if (!(inverseActions.ContainsKey(obj)))
            {
                inverseActions[obj] = new Hashtable();
            }
            objActions = (Hashtable)inverseActions[obj];
            if (!(objActions.ContainsKey(propertyName)))
            {
                objActions[propertyName] = new ArrayList();
            }
            propActions = (ArrayList)objActions[propertyName];
            propActions.Add(action);


            if (!(inverseMasters.ContainsKey(master)))
            {
                inverseMasters[master] = new ArrayList();
            }
            masterActions = (ArrayList)inverseMasters[master];
            masterActions.Add(action);
        }
        protected virtual void AddAction(InverseActionType actionType, object obj, string propertyName, object value, object master)
        {
            if (value == null)
            {
                LogMessage message = new LogMessage("Caching inverse action");
                LogMessage verbose = new LogMessage("Action type: {0}, Object of type: {1}, Property: {2}, Value: null" , actionType, obj.GetType(),propertyName );
                this.Context.LogManager.Debug(this, message,verbose ); // do not localize
            }
            else
            {
                LogMessage message = new LogMessage("Caching inverse action");
                LogMessage verbose = new LogMessage("Action type: {0}, Object of type: {1}, Property: {2}, Value type: {3}" , actionType, obj.GetType(),propertyName,value.GetType()) ;
                this.Context.LogManager.Debug(this, message,verbose ); // do not localize

            }

            InverseAction action = new InverseAction() ;
            action.ActionType = actionType ;
            action.Obj = obj;
            action.PropertyName = propertyName;
            action.Value = value;
            action.Master = master;
            Hashtable objActions;
            ArrayList propActions;
            ArrayList masterActions;
            if (!(inverseActions.ContainsKey(obj)))
            {
                inverseActions[obj] = new Hashtable();
            }
            objActions = (Hashtable) inverseActions[obj] ;
            if (!(objActions.ContainsKey(propertyName)))
            {
                objActions[propertyName] = new ArrayList();
            }
            propActions = (ArrayList) objActions[propertyName] ;
            propActions.Add(action);

            if (!(inverseMasters.ContainsKey(master)))
            {
                inverseMasters[master] = new ArrayList();
            }
            masterActions = (ArrayList) inverseMasters[master] ;
            masterActions.Add(action);
        }
Esempio n. 3
0
		protected virtual void AddAction(InverseActionType actionType, object obj, string propertyName, object value, object master)
		{
			if (value == null)
				this.Context.LogManager.Debug(this, "Caching inverse action", "Action type: " + actionType.ToString() + ", Object of type: " + obj.GetType().ToString() + ", Property: " + propertyName + ", Value: null"); // do not localize
			else
				this.Context.LogManager.Debug(this, "Caching inverse action", "Action type: " + actionType.ToString() + ", Object of type: " + obj.GetType().ToString() + ", Property: " + propertyName + ", Value type: " + value.GetType().ToString()  ); // do not localize

			InverseAction action = new InverseAction() ;
			action.ActionType = actionType ;
			action.Obj = obj;
			action.PropertyName = propertyName;
			action.Value = value;
			action.Master = master;
			Hashtable objActions;
			ArrayList propActions;
			ArrayList masterActions;
			if (!(inverseActions.ContainsKey(obj)))
			{
				inverseActions[obj] = new Hashtable();
			}
			objActions = (Hashtable) inverseActions[obj] ;
			if (!(objActions.ContainsKey(propertyName)))
			{
				objActions[propertyName] = new ArrayList();
			}
			propActions = (ArrayList) objActions[propertyName] ;
			propActions.Add(action);			

            
			if (!(inverseMasters.ContainsKey(master)))
			{
				inverseMasters[master] = new ArrayList();
			}
			masterActions = (ArrayList) inverseMasters[master] ;
            masterActions.Add(action);
        }