예제 #1
0
        /// <inheritdoc/>
        public void HandleModalDialog(PageObjectContext context)
        {
            ArgumentUtility.CheckNotNull("context", context);

            context.Window.AcceptModalDialogFixed(context.Browser);
        }
예제 #2
0
        public ConstructorEmitter CreateConstructor(ArgumentReference[] arguments)
        {
            ArgumentUtility.CheckNotNull("arguments", arguments);

            return(InnerEmitter.CreateConstructor(arguments));
        }
예제 #3
0
 // does not create the property's methods
 public CustomPropertyEmitter CreatePublicInterfacePropertyImplementation(PropertyInfo interfaceProperty)
 {
     ArgumentUtility.CheckNotNull("interfaceProperty", interfaceProperty);
     return(CreatePropertyOverrideOrInterfaceImplementation(interfaceProperty, true));
 }
 protected override Expression VisitChildren(ExpressionTreeVisitor visitor)
 {
     ArgumentUtility.CheckNotNull("visitor", visitor);
     return(this);
 }
예제 #5
0
 public SkipResultOperator(Expression count)
 {
     ArgumentUtility.CheckNotNull("count", count);
     Count = count;
 }
        protected QueryAdapterBase(IQuery query)
        {
            ArgumentUtility.CheckNotNull("query", query);

            _query = query;
        }
예제 #7
0
        public static string GetVfpCode(Field field)
        {
            ArgumentUtility.CheckNotNull("field", field);

            return(string.Format("{0} {1} {2} ", field.Name, GetFieldType(field), GetNull(field)));
        }
예제 #8
0
        public static IQuery GetIncrementRevisionQuery(IRevisionKey revisionKey)
        {
            ArgumentUtility.CheckNotNull("revisionKey", revisionKey);

            var storageProviderDefinition = GetStorageProviderDefinition();
            var sqlDialect = storageProviderDefinition.Factory.CreateSqlDialect(storageProviderDefinition);

            const string incrementrevision          = "IncrementRevision";
            string       revisionTable              = GetRevisionTableIdentifier(sqlDialect);
            string       revisionValueColumn        = GetRevisionValueColumnIdentifier(sqlDialect);
            string       revisionValueParameter     = sqlDialect.GetParameterName("value");
            string       revisionGlobalKeyParameter = sqlDialect.GetParameterName("globalKey");
            string       revisionLocalKeyParameter  = sqlDialect.GetParameterName("localKey");

            var parameters = new QueryParameterCollection();

            var statement = new StringBuilder();

            statement.Append("BEGIN TRANSACTION " + incrementrevision);
            statement.Append(sqlDialect.StatementDelimiter);
            statement.AppendLine();
            statement.Append("IF EXISTS (SELECT 0 FROM ");
            statement.Append(revisionTable);
            statement.Append(" WHERE (");
            AppendKeyClause(statement, parameters, revisionKey, sqlDialect);
            statement.Append(")");
            statement.Append(")");
            statement.AppendLine();

            statement.Append("UPDATE ");
            statement.Append(revisionTable);
            statement.Append(" SET ");
            statement.Append(revisionValueColumn);
            statement.Append(" = ");
            statement.Append(revisionValueParameter);
            statement.Append(" WHERE (");
            AppendKeyClause(statement, parameters, revisionKey, sqlDialect);
            statement.Append(")");
            statement.AppendLine();

            statement.Append("ELSE");
            statement.AppendLine();

            statement.Append("INSERT INTO ");
            statement.Append(revisionTable);
            statement.Append("(");
            statement.Append(GetRevisionGlobalKeyColumnIdentifier(sqlDialect));
            statement.Append(",");
            statement.Append(GetRevisionLocalKeyColumnIdentifier(sqlDialect));
            statement.Append(",");
            statement.Append(revisionValueColumn);
            statement.Append(") VALUES (");
            statement.Append(parameters[revisionGlobalKeyParameter].Name);
            statement.Append(",");
            statement.Append(parameters[revisionLocalKeyParameter].Name);
            statement.Append(",");
            statement.Append(revisionValueParameter);
            statement.Append(")");
            statement.Append(sqlDialect.StatementDelimiter);
            statement.AppendLine();
            statement.Append("COMMIT TRANSACTION " + incrementrevision);
            statement.Append(sqlDialect.StatementDelimiter);
            statement.AppendLine();

            parameters.Add(revisionValueParameter, Guid.NewGuid());

            return(QueryFactory.CreateQuery(
                       new QueryDefinition(
                           typeof(Revision) + "." + MethodBase.GetCurrentMethod().Name,
                           storageProviderDefinition,
                           statement.ToString(),
                           QueryType.Scalar),
                       parameters));
        }
예제 #9
0
 /// <summary>
 /// Transforms all the expressions in this clause and its child objects via the given <paramref name="transformation"/> delegate.
 /// </summary>
 /// <param name="transformation">The transformation object. This delegate is called for each <see cref="Expression"/> within this
 /// clause, and those expressions will be replaced with what the delegate returns.</param>
 public virtual void TransformExpressions(Func <Expression, Expression> transformation)
 {
     ArgumentUtility.CheckNotNull("transformation", transformation);
     FromExpression = transformation(FromExpression);
 }
 public bool IsTypeValid(Type type)
 {
     ArgumentUtility.CheckNotNull("type", type);
     return(_validTypes.Contains(type));
 }
예제 #11
0
        public VfpProvider(IDataTableFactory dataTableFactory)
        {
            ArgumentUtility.CheckNotNull("dataTableFactory", dataTableFactory);

            this._dataTableFactory = dataTableFactory;
        }
예제 #12
0
 private void Orderings_ItemAdded(object sender, ObservableCollectionChangedEventArgs <Ordering> e)
 {
     ArgumentUtility.CheckNotNull("e", e);
     ArgumentUtility.CheckNotNull("e.Item", e.Item);
 }
예제 #13
0
        protected override IEnumerable <IPropertyValidator> GetValidators(PropertyInfo property)
        {
            ArgumentUtility.CheckNotNull("property", property);

            return(new[] { new NotNullValidator() });
        }
예제 #14
0
 public bool ContainsMapping(IQuerySource querySource)
 {
     ArgumentUtility.CheckNotNull("querySource", querySource);
     return(_lookup.ContainsKey(querySource));
 }
        public InfrastructureResourceUrlFactory(IResourceUrlFactory resourceUrlFactory)
        {
            ArgumentUtility.CheckNotNull("resourceUrlFactory", resourceUrlFactory);

            _resourceUrlFactory = resourceUrlFactory;
        }
예제 #16
0
        public IEnumerable <IQueryResultRow> ExecuteCustomQuery(IQuery query)
        {
            ArgumentUtility.CheckNotNull("query", query);

            return(_parentTransactionContext.ExecuteCustomQuery(query));
        }
예제 #17
0
 public NonIntroducedAttribute(Type nonIntroducedType)
 {
     _nonIntroducedType = ArgumentUtility.CheckNotNull("nonIntroducedType", nonIntroducedType);
 }
예제 #18
0
        public virtual object ExecuteScalarQuery(IQuery query)
        {
            ArgumentUtility.CheckNotNull("query", query);

            return(_parentTransactionContext.ExecuteScalarQuery(query));
        }
        /// <summary>
        /// Renders a command control as link with an icon, a text or both.
        /// </summary>
        /// <param name="renderingContext">The <see cref="BocColumnRenderingContext{BocColumnDefinition}"/>.</param>
        /// <param name="originalRowIndex">The zero-based index of the current row in <see cref="IBocList"/></param>
        /// <param name="businessObject">The <see cref="IBusinessObject"/> associated with the current row.</param>
        /// <param name="command">The <see cref="Remotion.ObjectBinding.Web.UI.Controls.BocList.RowEditModeCommand"/> that is issued
        /// when the control is clicked. Must not be <see langword="null" />.</param>
        /// <param name="alternateText">The <see cref="Remotion.ObjectBinding.Web.UI.Controls.BocList.ResourceIdentifier"/>
        /// specifying which resource to load as alternate text to the icon.</param>
        /// <param name="icon">The icon to render; must not be <see langword="null"/>.
        /// To skip the icon, set <see cref="IconInfo.Url"/> to <see langword="null" />.</param>
        /// <param name="text">The text to render after the icon. May be <see langword="null"/>, in which case no text is rendered.</param>
        protected virtual void RenderCommandControl(
            BocColumnRenderingContext <BocRowEditModeColumnDefinition> renderingContext,
            int originalRowIndex,
            IBusinessObject businessObject,
            BocList.RowEditModeCommand command,
            BocList.ResourceIdentifier alternateText,
            IconInfo icon,
            string text)
        {
            ArgumentUtility.CheckNotNull("renderingContext", renderingContext);
            ArgumentUtility.CheckNotNull("businessObject", businessObject);
            ArgumentUtility.CheckNotNull("icon", icon);

            string argument      = renderingContext.Control.GetRowEditCommandArgument(new BocListRow(originalRowIndex, businessObject), command);
            string postBackEvent = renderingContext.Control.Page.ClientScript.GetPostBackEventReference(renderingContext.Control, argument) + ";";
            var    commandItemID = "Column_" + renderingContext.ColumnIndex + "_RowEditCommand_" + command + "_Row_" + originalRowIndex;

            Command c;

            if (!renderingContext.Control.IsReadOnly && renderingContext.Control.HasClientScript)
            {
                c = new Command(CommandType.Event)
                {
                    EventCommand = new Command.EventCommandInfo()
                }
            }
            ;
            else
            {
                c = new Command(CommandType.None);
            }

            c.ItemID       = commandItemID;
            c.OwnerControl = renderingContext.Control;

            c.RenderBegin(renderingContext.Writer, RenderingFeatures, postBackEvent, new string[0], c_onCommandClickScript, null);

            bool hasIcon = icon.HasRenderingInformation;
            bool hasText = !string.IsNullOrEmpty(text);

            if (hasIcon && hasText)
            {
                icon.Render(renderingContext.Writer, renderingContext.Control);
                renderingContext.Writer.Write(c_whiteSpace);
            }
            else if (hasIcon)
            {
                bool hasAlternateText = !string.IsNullOrEmpty(icon.AlternateText);
                if (!hasAlternateText)
                {
                    icon.AlternateText = renderingContext.Control.GetResourceManager().GetString(alternateText);
                }

                icon.Render(renderingContext.Writer, renderingContext.Control);
            }
            if (hasText)
            {
                renderingContext.Writer.Write(text); // Do not HTML encode.
            }
            c.RenderEnd(renderingContext.Writer);
        }
예제 #20
0
 public SubPersistenceStrategy(IParentTransactionContext parentTransactionContext)
 {
     ArgumentUtility.CheckNotNull("parentTransactionContext", parentTransactionContext);
     _parentTransactionContext = parentTransactionContext;
 }
예제 #21
0
 public void AddResultOperator(ResultOperatorBase resultOperator)
 {
     ArgumentUtility.CheckNotNull("resultOperator", resultOperator);
     _resultOperators.Add(resultOperator);
 }
예제 #22
0
        public virtual ObjectID CreateNewObjectID(ClassDefinition classDefinition)
        {
            ArgumentUtility.CheckNotNull("classDefinition", classDefinition);

            return(_parentTransactionContext.CreateNewObjectID(classDefinition));
        }
 public ExceptExpressionNode(MethodCallExpressionParseInfo parseInfo, Expression source2)
     : base(parseInfo, null, null)
 {
     ArgumentUtility.CheckNotNull("source2", source2);
     Source2 = source2;
 }
예제 #24
0
        public DomainObject GetEnlistedDomainObject(ObjectID objectID)
        {
            ArgumentUtility.CheckNotNull("objectID", objectID);

            return(_enlistedObjects.GetValueOrDefault(objectID));
        }
예제 #25
0
 public override void TransformExpressions(Func <Expression, Expression> transformation)
 {
     ArgumentUtility.CheckNotNull("transformation", transformation);
     Count = transformation(Count);
 }
예제 #26
0
        public bool IsEnlisted(DomainObject domainObject)
        {
            ArgumentUtility.CheckNotNull("domainObject", domainObject);

            return(GetEnlistedDomainObject(domainObject.ID) == domainObject);
        }
예제 #27
0
 /// <inheritdoc />
 public IMethodEmitter CreatePublicInterfaceMethodImplementation(MethodInfo interfaceMethod)
 {
     ArgumentUtility.CheckNotNull("interfaceMethod", interfaceMethod);
     return(CreateMethodOverrideOrInterfaceImplementation(interfaceMethod, true, MethodAttributes.NewSlot | MethodAttributes.Public));
 }
예제 #28
0
 public FetchManyExpressionNode(MethodCallExpressionParseInfo parseInfo, LambdaExpression relatedObjectSelector)
     : base(parseInfo, ArgumentUtility.CheckNotNull("relatedObjectSelector", relatedObjectSelector))
 {
 }
예제 #29
0
 // does not create the event's methods
 public CustomEventEmitter CreateEventOverride(EventInfo baseEvent)
 {
     ArgumentUtility.CheckNotNull("baseEvent", baseEvent);
     return(CreateEventOverrideOrInterfaceImplementation(baseEvent, true));
 }
예제 #30
0
 void IFlattenedSerializable.SerializeIntoFlatStructure(FlattenedSerializationInfo info)
 {
     ArgumentUtility.CheckNotNull("info", info);
 }