Exemplo n.º 1
0
        public BasePropertyChanger GetPropertyChanger()
        {
            ChangeEnum result = new ChangeEnum();

            result.SetValue(GetValueFromRadioButtons());
            return(result);
        }
Exemplo n.º 2
0
 public static Change Create(object childObject,
                             ChangeEnum changeType = ChangeEnum.UpdateRecursively)
 {
     return new Change()
     {
         ChildObject = childObject,
         ChangeType = changeType
     };
 }
Exemplo n.º 3
0
        /*********************************************************************************************************************************************/

        internal OptionEnum GetChangeOption(ChangeEnum change)
        {
            switch (change)
            {
            case ChangeEnum.Add:
                return(OptionEnum.ChangeAdd);

            case ChangeEnum.Minus:
                return(OptionEnum.ChangeMinus);

            default:
                return(OptionEnum.ChangeAdd);
            }
        }
Exemplo n.º 4
0
        public static List<Color> Interpolate( ColorEnum color, ChangeEnum change, Color baseColor, int step )
        {
            List<Color> colors = new List<Color>();

            if ( change == ChangeEnum.Higher )
            {
                for ( int x = 0 ; x < 255 ; x += step )
                {
                    colors.Add( GetColor( color, baseColor, x ) );
                }
            }
            else
            {
                for ( int x = 255 ; x > 0 ; x -= step )
                {
                    colors.Add( GetColor( color, baseColor, x ) );
                }
            }

            return colors;
        }
Exemplo n.º 5
0
        public static List <Color> Interpolate(ColorEnum color, ChangeEnum change, Color baseColor, int step)
        {
            List <Color> colors = new List <Color>();

            if (change == ChangeEnum.Higher)
            {
                for (int x = 0; x < 255; x += step)
                {
                    colors.Add(GetColor(color, baseColor, x));
                }
            }
            else
            {
                for (int x = 255; x > 0; x -= step)
                {
                    colors.Add(GetColor(color, baseColor, x));
                }
            }

            return(colors);
        }
Exemplo n.º 6
0
 /// <summary>
 /// set 单个字段变更
 /// </summary>
 /// <param name="func">格式: it => it.LockedCount</param>
 /// <param name="modifyVal">变更值</param>
 /// <param name="change">+/-/...</param>
 public static SetU <M> Change <M, F>(this SetU <M> set, Expression <Func <M, F> > propertyFunc, F modifyVal, ChangeEnum change)
     where M : class
 {
     set.DC.Action = ActionEnum.Update;
     set.SetChangeHandle <M, F>(propertyFunc, modifyVal, set.DC.GetChangeOption(change));
     return(set);
 }
Exemplo n.º 7
0
 /// <summary>
 /// set 单个字段变更
 /// </summary>
 /// <param name="func">格式: it => it.LockedCount</param>
 /// <param name="modifyVal">变更值</param>
 /// <param name="change">+/-/...</param>
 public static SetU <M> Change <M, F>(this Updater <M> updater, Expression <Func <M, F> > propertyFunc, F modifyVal, ChangeEnum change)
     where M : class
 {
     updater.DC.Action = ActionEnum.Update;
     updater.SetChangeHandle <M, F>(propertyFunc, modifyVal, updater.DC.GetChangeOption(change));
     return(new SetU <M>(updater.DC));
 }
Exemplo n.º 8
0
 /// <summary>
 /// set 单个字段变更
 /// </summary>
 /// <param name="func">格式: it => it.LockedCount</param>
 /// <param name="modifyVal">变更值</param>
 /// <param name="change">+/-/...</param>
 public static SetU <M> Change <M, F>(this SetU <M> set, Expression <Func <M, F> > func, F modifyVal, ChangeEnum change)
 {
     set.DC.OP.SetChangeHandle <M, F>(func, modifyVal, ActionEnum.Update, set.DC.SqlProvider.GetChangeOption(change));
     return(set);
 }
Exemplo n.º 9
0
 /// <summary>
 /// set 单个字段变更
 /// </summary>
 /// <param name="func">格式: it => it.LockedCount</param>
 /// <param name="modifyVal">变更值</param>
 /// <param name="change">+/-/...</param>
 public static SetU <M> Change <M, F>(this Updater <M> updater, Expression <Func <M, F> > func, F modifyVal, ChangeEnum change)
 {
     updater.DC.OP.SetChangeHandle <M, F>(func, modifyVal, ActionEnum.Update, updater.DC.SqlProvider.GetChangeOption(change));
     return(new SetU <M>(updater.DC));
 }
Exemplo n.º 10
0
        /// <summary>
        /// Create the list of Points
        /// </summary>
        /// <returns></returns>
        public List <int> CreatePoints()
        {
            // Get a value
            int item = this.Shuffler.PullNextItem();

            // Create the Points collection
            this.Points = new List <int>();

            // Get the start value
            int start = item + this.MinHeight;

            // locals
            int        value      = start;
            ChangeEnum lastChange = ChangeEnum.NoChange;

            // iterate the width of this object
            for (int x = 1; x < this.Width - 1; x++)
            {
                // Get a new value
                item = this.Shuffler.PullNextItem();

                // most of the time we want it to go straight to the right, but occassionaly it goes up or down a pixel
                if (item <= 25)
                {
                    // set the lastChange to moveDown
                    lastChange = ChangeEnum.MoveDown;

                    // Decrement the value for value
                    value--;
                }
                else if (item > 75)
                {
                    // set the lastChange to moveUp
                    lastChange = ChangeEnum.MoveUp;

                    // Decrement the value for value
                    value++;
                }
                else
                {
                    // if even
                    if (item % 2 == 0)
                    {
                        // Nothing happens
                    }
                    else
                    {
                        if (lastChange == ChangeEnum.MoveUp)
                        {
                            // Increment the value for value
                            value++;
                        }
                        else if (lastChange == ChangeEnum.MoveDown)
                        {
                            // Decrement the value for value
                            value--;
                        }
                        else
                        {
                            // stay the same
                        }
                    }

                    // Stays the same
                    lastChange = ChangeEnum.NoChange;
                }

                // if the value is greater than MaxHeight
                if (value > MaxHeight)
                {
                    // Set to the MaxHeight
                    value = MaxHeight;
                }

                // if the value is less than MinHeight
                if (value > MaxHeight)
                {
                    // Set to the MinHeight
                    value = MinHeight;
                }

                // Add this item
                this.Points.Add(value);
            }

            // Return the Points
            return(this.Points);
        }
Exemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KapiAcdcQueueAgentChange" /> class.
 /// </summary>
 /// <param name="accountID">accountID (required).</param>
 /// <param name="agentID">agentID (required).</param>
 /// <param name="change">change (required).</param>
 /// <param name="eventCategory">eventCategory.</param>
 /// <param name="eventName">eventName.</param>
 /// <param name="processID">processID.</param>
 /// <param name="queueID">queueID (required).</param>
 public KapiAcdcQueueAgentChange(string accountID = default(string), string agentID = default(string), ChangeEnum change = default(ChangeEnum), EventCategoryEnum?eventCategory = default(EventCategoryEnum?), EventNameEnum?eventName = default(EventNameEnum?), string processID = default(string), string queueID = default(string))
 {
     // to ensure "accountID" is required (not null)
     if (accountID == null)
     {
         throw new InvalidDataException("accountID is a required property for KapiAcdcQueueAgentChange and cannot be null");
     }
     else
     {
         this.AccountID = accountID;
     }
     // to ensure "agentID" is required (not null)
     if (agentID == null)
     {
         throw new InvalidDataException("agentID is a required property for KapiAcdcQueueAgentChange and cannot be null");
     }
     else
     {
         this.AgentID = agentID;
     }
     // to ensure "change" is required (not null)
     if (change == null)
     {
         throw new InvalidDataException("change is a required property for KapiAcdcQueueAgentChange and cannot be null");
     }
     else
     {
         this.Change = change;
     }
     // to ensure "queueID" is required (not null)
     if (queueID == null)
     {
         throw new InvalidDataException("queueID is a required property for KapiAcdcQueueAgentChange and cannot be null");
     }
     else
     {
         this.QueueID = queueID;
     }
     this.EventCategory = eventCategory;
     this.EventName     = eventName;
     this.ProcessID     = processID;
 }
Exemplo n.º 12
0
 public static Change[] CreateOne(object childObject,
                                 ChangeEnum changeType = ChangeEnum.UpdateRecursively)
 {
     return new Change[] { Change.Create(childObject, changeType) };
 }