Пример #1
0
        public StateConditions Clone()
        {
            TestStateConditions scs = new TestStateConditions
            {
                PropertyConditions           = this.PropertyConditions,
                PropertyConditionsDefinition = new SearchConditions(),
                VBScript           = this.VBScript,
                VBScriptDefinition = this.VBScriptDefinition
            };

            for (int i = 1; i <= this.PropertyConditionsDefinition.Count; ++i)
            {
                SearchCondition searchCondition = this.PropertyConditionsDefinition[i];
                scs.PropertyConditionsDefinition.Add(-1, searchCondition.Clone());
            }
            return(scs);
        }
        public StateAdmin Clone()
        {
            TestStateAdmin sa = new TestStateAdmin
            {
                ActionAssignToUser                       = this.ActionAssignToUser,
                ActionAssignToUserDefinition             = this.ActionAssignToUserDefinition.Clone(),
                ActionConvertToPDF                       = this.ActionConvertToPDF,
                ActionConvertToPDFDefinition             = this.ActionConvertToPDFDefinition.Clone(),
                ActionCreateSeparateAssignment           = this.ActionCreateSeparateAssignment,
                ActionCreateSeparateAssignmentDefinition = this.ActionCreateSeparateAssignmentDefinition.Clone(),
                ActionDelete                              = this.ActionDelete,
                ActionMarkForArchiving                    = this.ActionMarkForArchiving,
                ActionRunVBScript                         = this.ActionRunVBScript,
                ActionRunVBScriptDefinition               = this.ActionRunVBScriptDefinition,
                ActionSendNotification                    = this.ActionSendNotification,
                ActionSendNotificationDefinition          = this.ActionSendNotificationDefinition.Clone(),
                ActionSetPermissions                      = this.ActionSetPermissions,
                ActionSetPermissionsDetailedDefinition    = this.ActionSetPermissionsDetailedDefinition.Clone(),
                ActionSetProperties                       = this.ActionSetProperties,
                ActionSetPropertiesDefinition             = this.ActionSetPropertiesDefinition.Clone(),
                AutomaticStateTransitionAllowedByVBScript = this.AutomaticStateTransitionAllowedByVBScript,
                AutomaticStateTransitionCriteria          = new SearchConditions()
            };

            for (int i = 1; i <= this.AutomaticStateTransitionCriteria.Count; ++i)
            {
                SearchCondition sc = this.AutomaticStateTransitionCriteria[i];
                sa.AutomaticStateTransitionCriteria.Add(-1, sc.Clone());
            }
            sa.AutomaticStateTransitionInDays    = this.AutomaticStateTransitionInDays;
            sa.AutomaticStateTransitionMode      = this.AutomaticStateTransitionMode;
            sa.AutomaticStateTransitionNextState = this.AutomaticStateTransitionNextState;
            sa.CheckInOutPermissions             = this.CheckInOutPermissions;
            sa.Description         = this.Description;
            sa.ID                  = this.ID;
            sa.InOutPermissions    = this.InOutPermissions.Clone();
            sa.Name                = this.Name;
            sa.Postconditions      = this.Postconditions.Clone();
            sa.Preconditions       = this.Preconditions.Clone();
            sa.RestrictTransitions = this.RestrictTransitions;
            sa.SemanticAliases     = new SemanticAliases {
                Value = this.SemanticAliases.Value
            };
            sa.TransitionsRequireEditAccessToObject = this.TransitionsRequireEditAccessToObject;
            return(sa);
        }
Пример #3
0
		public void Test_Clone()
		{
			var sc = new SearchCondition<object>();
			var x = new object();
			var y = new object();

			sc.Between(x, y);
			sc.SortDesc(3);

			var copy = (SearchCondition<object>)sc.Clone();

			Assert.AreEqual(sc.Test, copy.Test);
			Assert.AreEqual(sc.Values.Length, copy.Values.Length);
			Assert.AreEqual(sc.Values[0], copy.Values[0]);
			Assert.AreEqual(sc.Values[1], copy.Values[1]);
			Assert.AreEqual(sc.SortDirection, copy.SortDirection);
			Assert.AreEqual(sc.SortPosition, copy.SortPosition);
			Assert.IsFalse(ReferenceEquals(sc.Values, copy.Values));
		}
Пример #4
0
        public void Test_Clone()
        {
            var sc = new SearchCondition <object>();
            var x  = new object();
            var y  = new object();

            sc.Between(x, y);
            sc.SortDesc(3);

            var copy = (SearchCondition <object>)sc.Clone();

            Assert.AreEqual(sc.Test, copy.Test);
            Assert.AreEqual(sc.Values.Length, copy.Values.Length);
            Assert.AreEqual(sc.Values[0], copy.Values[0]);
            Assert.AreEqual(sc.Values[1], copy.Values[1]);
            Assert.AreEqual(sc.SortDirection, copy.SortDirection);
            Assert.AreEqual(sc.SortPosition, copy.SortPosition);
            Assert.IsFalse(ReferenceEquals(sc.Values, copy.Values));
        }