public SecurityHideForSessionFacet(IIdentifier identifier,
                                    SecurityFacetDecorator decorator,
                                    IFacetHolder holder)
     : base(holder) {
     this.identifier = identifier;
     this.decorator = decorator;
 }
示例#2
0
 public EnterpriseDataService(IIdentifier identifier, IEnterpriseDataRepository repository, IPersonsUploader uploader)
 {
     _identifier = identifier;
     _enterpriseRepository = repository;
     _uploader = uploader;
     _enterpriseId = _identifier.EnterpriseId(System.Threading.Thread.CurrentPrincipal.Identity.Name);
 }
 public DescribedAsFacetDynamicWrapI18n(II18nManager manager, IFacetHolder holder, IIdentifier identifier, IDescribedAsFacet describedAsFacet, int index = -1)
     : base(Type, holder) {
     this.manager = manager;
     this.identifier = identifier;
     this.describedAsFacet = describedAsFacet;
     this.index = index;
 }
 public AuthorizationHideForSessionFacet(IIdentifier identifier,
                                         IAuthorizationManager authorizationManager,
                                         ISpecification holder)
     : base(holder) {
     this.identifier = identifier;
     this.authorizationManager = authorizationManager;
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AssignmentStatement"/> class.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <param name="expression">The expression.</param>
 public AssignmentStatement(IIdentifier id, IExpression expression)
 {
     if (id == null) throw new ArgumentNullException("id");
     if (expression == null) throw new ArgumentNullException("expression");
     this.ID = id;
     this.ID.Type = expression.Type;
     this.Expression = expression;
 }
示例#6
0
        public WithScope(WithScope parent, IIdentifier identifier)
        {
            if (identifier == null)
                throw new ArgumentNullException("identifier");

            Parent = parent;
            Identifier = identifier;
        }
        public NamedFacetDynamicWrapI18n(II18nManager manager, IFacetHolder holder, IIdentifier identifier, INamedFacet namedFacet, int index = -1)
            : base(Type, holder) {
            this.manager = manager;
            this.identifier = identifier;
            this.namedFacet = namedFacet;

            this.index = index;
        }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FunctionCallExpression"/> class.
 /// </summary>
 /// <param name="identifier">The identifier.</param>
 /// <param name="argumentList">The argument list.</param>
 /// <exception cref="System.ArgumentNullException">argumentList or identifier</exception>
 public FunctionCallExpression(IIdentifier identifier, IArgumentList argumentList)
 {
     if (argumentList == null)
         throw new ArgumentNullException("argumentList");
     if (identifier == null)
         throw new ArgumentNullException("identifier");
     this.ArgumentList = argumentList;
     this.Identifier = identifier;
 }
示例#9
0
        public VariableDeclaration(IIdentifier identifier, ExpressionSyntax expression, bool global)
        {
            if (identifier == null)
                throw new ArgumentNullException("identifier");

            Identifier = identifier;
            Expression = expression;
            Global = global;
        }
 protected TypeSpecImmutable(Type type) {
     Type = type.IsGenericType && CollectionUtils.IsCollection(type) ? type.GetGenericTypeDefinition() : type;
     identifier = new IdentifierImpl(type.FullName);
     Interfaces = ImmutableList<ITypeSpecImmutable>.Empty;
     subclasses = ImmutableList<ITypeSpecImmutable>.Empty;
     ContributedActions = ImmutableList<IActionSpecImmutable>.Empty;
     CollectionContributedActions = ImmutableList<IActionSpecImmutable>.Empty;
     FinderActions = ImmutableList<IActionSpecImmutable>.Empty;
 }
        public bool IsVisible(ISession session, INakedObject target, IIdentifier member) {
            var checkViewType = member.IsField ? CheckType.ViewField : CheckType.Action;
            var checkEditType = member.IsField ? CheckType.EditField : CheckType.Action;

            var contextView = new AuthorizationContext((ClaimsPrincipal)session.Principal, member.ToIdentityString(IdentifierDepth.ClassName), ((int)checkViewType).ToString());
            var contextEdit = new AuthorizationContext((ClaimsPrincipal)session.Principal, member.ToIdentityString(IdentifierDepth.ClassName), ((int)checkEditType).ToString());

            // being editable implies visibility 
            return manager.CheckAccess(contextView) || manager.CheckAccess(contextEdit);
        }
示例#12
0
        public CatchClause(IIdentifier identifier, SyntaxNode statement)
        {
            if (identifier == null)
                throw new ArgumentNullException("identifier");
            if (statement == null)
                throw new ArgumentNullException("statement");

            Identifier = identifier;
            Body = statement;
        }
        public bool IsEditable(ISession session, ILifecycleManager lifecycleManager, INakedObjectAdapter target, IIdentifier identifier) {
            object authorizer = GetAuthorizer(target, lifecycleManager);
            Type authType = authorizer.GetType();

            if ((typeof(INamespaceAuthorizer)).IsAssignableFrom(authType)) {
                var nameAuth = (INamespaceAuthorizer) authorizer;
                return nameAuth.IsEditable(session.Principal, target.Object, identifier.MemberName);
            }
            return isEditableDelegates[authType](authorizer, session.Principal, target.GetDomainObject(), identifier.MemberName);
        }
        public void Invoke(INakedObject nakedObject, INakedObject[] parameters, bool queryOnly, IIdentifier identifier) {
            Init();
            IAuditor auditor = GetNamespaceAuthorizerFor(nakedObject) ?? defaultAuditor;

            if (nakedObject.Specification.IsService) {
                string serviceName = nakedObject.Specification.GetTitle(nakedObject);
                auditor.ActionInvoked(NakedObjectsContext.Session.Principal, identifier.MemberName, serviceName, queryOnly, parameters.Select(no => no.GetDomainObject()).ToArray());
            }
            else {
                auditor.ActionInvoked(NakedObjectsContext.Session.Principal, identifier.MemberName, nakedObject.GetDomainObject(), queryOnly, parameters.Select(no => no.GetDomainObject()).ToArray());
            }
        }
        public void Invoke(INakedObjectAdapter nakedObjectAdapter, INakedObjectAdapter[] parameters, bool queryOnly, IIdentifier identifier, ISession session, ILifecycleManager lifecycleManager) {
            IAuditor auditor = GetAuditor(nakedObjectAdapter, lifecycleManager);

            IPrincipal byPrincipal = session.Principal;
            string memberName = identifier.MemberName;
            if (nakedObjectAdapter.Spec is IServiceSpec) {
                string serviceName = nakedObjectAdapter.Spec.GetTitle(nakedObjectAdapter);
                auditor.ActionInvoked(byPrincipal, memberName, serviceName, queryOnly, parameters.Select(no => no.GetDomainObject()).ToArray());
            }
            else {
                auditor.ActionInvoked(byPrincipal, memberName, nakedObjectAdapter.GetDomainObject(), queryOnly, parameters.Select(no => no.GetDomainObject()).ToArray());
            }
        }
示例#16
0
 /// <summary>
 /// Returns true when the name comparison is a special case and should not 
 /// be used to determine name conflicts.
 ///  </summary>
 /// <param name="whoIsAsking">the identifier that is checking to see if there is a conflict</param>
 /// <param name="reservedName">the identifier that would normally be reserved.</param>
 /// <returns></returns>
 public override bool IsSpecialCase(IIdentifier whoIsAsking, IIdentifier reservedName)
 {
     if (whoIsAsking is Property && reservedName is CompositeType)
     {
         var parent = (whoIsAsking as IChild)?.Parent as IIdentifier;
         if (ReferenceEquals(parent, reservedName))
         {
             return false;
         }
         // special case: properties can have the same name as a compositetype
         // unless it is the same name as a parent.
         return true;
     }
     return false;
 }
 private InteractionContext(InteractionType interactionType,
                            ISession session,
                            bool programmatic,
                            INakedObjectAdapter target,
                            IIdentifier id,
                            INakedObjectAdapter proposedArgument,
                            INakedObjectAdapter[] arguments) {
     this.interactionType = interactionType;
     this.programmatic = programmatic;
     this.id = id;
     this.session = session;
     this.target = target;
     this.proposedArgument = proposedArgument;
     proposedArguments = arguments;
 }
        public EquationBuilder CreateItem(IIdentifier identifier, out IItem item)
        {
            var selectedFactories = Factories.Where(factory => factory.CanCreate(identifier));

            switch(selectedFactories.Count())
            {
                case 0:
                    throw new ArgumentException("no factory available");
                case 1: item = selectedFactories.First().Create(identifier);
                    break;
                default:
                    throw new ArgumentException("more than one factory can create a such item");
            }

            return this;
        }
        private IFacet GetNamedFacet(IFacetHolder holder, INamedFacet facet, IIdentifier identifier) {
            string original = (facet).Value ?? NameUtils.NaturalName(identifier.MemberName);
            string i18nName;
            if (holder is NakedObjectActionParameterAbstract) {
                int index = ((NakedObjectActionParameterAbstract) holder).Number;
                i18nName = i18nManager.GetParameterName(identifier, index, original);

                if (!staticFacets) {
                    return new NamedFacetDynamicWrapI18n(i18nManager, holder, identifier, facet, index);
                }
            }
            else {
                i18nName = i18nManager.GetName(identifier, original);

                if (!staticFacets) {
                    return new NamedFacetDynamicWrapI18n(i18nManager, holder, identifier, facet);
                }
            }
            return i18nName == null ? null : new NamedFacetWrapI18n(i18nName, facet.FacetHolder);
        }
        private IFacet GetDescriptionFacet(IFacetHolder holder, IDescribedAsFacet facet, IIdentifier identifier) {
            string i18nDescription;
            string original = (facet).Value;
            if (holder is NakedObjectActionParameterAbstract) {
                int index = ((NakedObjectActionParameterAbstract) holder).Number;
                i18nDescription = i18nManager.GetParameterDescription(identifier, index, original);

                if (!staticFacets) {
                    return new DescribedAsFacetDynamicWrapI18n(i18nManager, holder, identifier, facet, index);
                }
            }
            else {
                i18nDescription = i18nManager.GetDescription(identifier, original);

                if (!staticFacets) {
                    return new DescribedAsFacetDynamicWrapI18n(i18nManager, holder, identifier, facet);
                }
            }
            return i18nDescription == null ? null : new DescribedAsFacetWrapI18n(i18nDescription, facet.FacetHolder);
        }
 public ProfileActionInvocationFacet(IActionInvocationFacet underlyingFacet, IProfileManager profileManager)
     : base(underlyingFacet.Specification) {
     this.underlyingFacet = underlyingFacet;
     this.profileManager = profileManager;
     identifier = underlyingFacet.Specification.Identifier;
 }
 public void Remove(IIdentifier id)
 {
     //File.Delete(Path.Combine(_ftpHost, id.ToString()));
     throw new Exception("Нельзя удалять данные из данного хранилища");
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UPMInfoMessageStatus"/> class.
 /// </summary>
 /// <param name="identifier">
 /// The identifier.
 /// </param>
 public UPMInfoMessageStatus(IIdentifier identifier)
     : base(identifier)
 {
 }
示例#24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UPMDateTimeEditField"/> class.
 /// </summary>
 /// <param name="identifier">
 /// The identifier.
 /// </param>
 public UPMDateTimeEditField(IIdentifier identifier)
     : base(identifier)
 {
 }
示例#25
0
 public static string GetSourceName([CanBeNull] this IIdentifier identifier)
 {
     return(identifier?.Name ?? SharedImplUtil.MISSING_DECLARATION_NAME);
 }
示例#26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CoreException"/> class.
 /// </summary>
 /// <param name="identifier">The identifier.</param>
 public CoreException(IIdentifier identifier)
 {
     Identifier = identifier;
 }
 public StudyRootStudyIdentifier(IStudyRootData other, IIdentifier identifier)
     : base(other, identifier)
 {
     CopyFrom(other);
 }
示例#28
0
        public BreakStatement MakeBreakStatement(IIdentifier target = null, int offset = 0)
        {
            var label = target != null ? ((Identifier)target).Symbol.Name : null;

            return(new BreakStatement(label, offset));
        }
示例#29
0
        public GotoStatement MakeGotoStatement(IIdentifier target)
        {
            var t = (Identifier)target;

            return(new GotoStatement(t.Symbol.Name, t.SourceOffset));
        }
示例#30
0
 public LabelStatement MakeLabelStatement(IIdentifier name, IStatement target)
 {
     //TODO: we have to remove name.Symbol, or define a new SymbolType.Label
     return(new LabelStatement((Identifier)name, (Statement)target));
 }
示例#31
0
        public FunctionDeclarationStatement MakeFunctionDeclarationStatement(Scope scope, IIdentifier name, IIdentifierList parameters,
                                                                             IStatement statement, Scope newScope)
        {
            Debug.Assert(newScope.IsFunctionDeclaration == true, "The FunctionDeclaration scope is not properly marked");

            var func = MakeFunctionExpression(scope, name, parameters, statement, newScope);

            //After making the func expression, we are sure name.Symbol belongs to scope
            return(new FunctionDeclarationStatement(func, MakeWriteIdentifierExpression(((Identifier)name).Symbol, func)));
        }
 public void Remove(IIdentifier id)
 {
     throw new NotSupportedException("Cannot add remove data from storage, operation is not supported");
 }
 public void Add(IIdentifier id, IStreamedData data)
 {
     throw new NotSupportedException("Cannot add data to storage, operation is not supported");
 }
示例#34
0
 public Duration(IIdentifier identifier, TimeSpan value) : base(identifier, value)
 {
 }
示例#35
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CoreException"/> class.
 /// </summary>
 /// <param name="identifier">The identifier.</param>
 /// <param name="message">The message.</param>
 public CoreException(IIdentifier identifier, string message) : base(message)
 {
     Identifier = identifier;
 }
 private string GetName(IIdentifier identifier) {
     return GetText(identifier, Name);
 }
示例#37
0
 public ProcuringEntityIdentifier(IIdentifier identifier)
     : base(identifier)
 {
 }
 private string GetParameterDescription(IIdentifier identifier, int index) {
     string key = identifier.ToIdentityString(IdentifierDepth.ClassNameParams) + Action + "/" + Parameter + (index + 1) + "/" + Description;
     return GetText(key);
 }
 private IFacet GetNamedFacet(ISpecification holder, INamedFacet facet, IIdentifier identifier) {
     var spec = holder as IActionParameterSpec;
     string i18NName = spec == null ? GetName(identifier) : GetParameterName(identifier, spec.Number);
     return i18NName == null ? null : new NamedFacetI18N(i18NName, facet.Specification);
 }
 public IdentifierCache(IIdentifier <T> inner, int count)
 {
     this.inner = inner ?? throw new ArgumentNullException(nameof(inner));
     this.count = count;
 }
示例#41
0
 public PatientRootPatientIdentifier(IPatientRootData other, IIdentifier identifier)
     : base(identifier)
 {
     CopyFrom(other);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UPMPhoneField"/> class.
 /// </summary>
 /// <param name="identifier">
 /// The identifier.
 /// </param>
 public UPMPhoneField(IIdentifier identifier)
     : base(identifier)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UPMCatalogFilter"/> class.
 /// </summary>
 /// <param name="identifier">
 /// The identifier.
 /// </param>
 public UPMCatalogFilter(IIdentifier identifier)
     : base(identifier, UPMFilterType.Catalog)
 {
     this.SelectedCatalogCodes = new List <string>();
     this.Invalid = false;
 }
示例#44
0
 protected AssociationSpecImmutable(IIdentifier identifier, IObjectSpecImmutable returnSpec)
     : base(identifier) =>
     this.returnSpec = returnSpec;
示例#45
0
        private UPCharacteristicsItem FindCharacteristicItemWithGroupIdentifierItemIdentifier(IIdentifier groupIdentifier, IIdentifier itemIdentifier)
        {
            foreach (UPCharacteristicsGroup crmGroup in this.Characteristics.Groups)
            {
                if (crmGroup.CatalogValue == groupIdentifier.IdentifierAsString)
                {
                    foreach (UPCharacteristicsItem crmItem in crmGroup.Items)
                    {
                        if (crmItem.CatalogValue == itemIdentifier.IdentifierAsString)
                        {
                            return(crmItem);
                        }
                    }
                }
            }

            return(null);
        }
 public IStreamedData Add(IIdentifier id, IStreamedData data, Action <double> progressChangeAction)
 {
     throw new Exception("Операция добавления данных не поддерживается данным хранилищем");
 }
示例#47
0
 internal AdjustCompDefInvSizeHelper(IIdentifier identifier, ValueChange <int> change)
 {
     this.identifier = identifier;
     this.change     = change;
 }
示例#48
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CoreDisposableEventArgs"/> class.
 /// </summary>
 /// <param name="identifier">The identifier.</param>
 public CoreDisposableEventArgs(IIdentifier identifier)
     : base(identifier)
 {
 }
示例#49
0
 public void MatchesOn(IIdentifier<Type> componentIdentifier)
 {
     this.componentIdentifier = componentIdentifier;
 }
示例#50
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CoreException"/> class.
 /// </summary>
 /// <param name="identifier">The identifier.</param>
 /// <param name="message">The message.</param>
 /// <param name="innerException">The inner exception.</param>
 public CoreException(IIdentifier identifier, string message, Exception innerException) : base(message, innerException)
 {
     Identifier = identifier;
 }
示例#51
0
        public IPropertyAssignment MakePropertySetAssignment(Scope scope, ILiteral name, IIdentifier paramName, IStatement body, Scope innerScope)
        {
            // TODO: Is calling ToString() adequate here?
            // TODO: Implement properly. This is just a quick hack to get things semi-working.
            var paramList = MakeIdentifierList();

            paramList.Add(paramName);
            var setterName = MakeIdentifier(innerScope, name.ToString(), ((Node)name).SourceOffset);
            var setter     = MakeFunctionExpression(scope, setterName, paramList, body, innerScope);

            return(new PropertyAssignment(name.ToString(), setter, null));
        }
示例#52
0
 public TestSpecificationWithId(IIdentifier identifier) => Identifier = identifier;
 public StudyRootStudyIdentifier(IPatientData patientData, IStudyData studyData, IIdentifier identifier)
     : base(studyData, identifier)
 {
     CopyFrom(patientData);
 }
 public string GetIdentifier(IIdentifier identifier)
 {
     return(this.GetIdentifier(identifier.Name));
 }
 private string GetDescription(IIdentifier identifier) {
     return GetText(identifier, Description);
 }
示例#56
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UPMWebContentGroup"/> class.
 /// </summary>
 /// <param name="identifier">
 /// The identifier.
 /// </param>
 public UPMWebContentGroup(IIdentifier identifier)
     : base(identifier)
 {
 }
 private IFacet GetDescriptionFacet(ISpecification holder, IDescribedAsFacet facet, IIdentifier identifier) {
     var spec = holder as IActionParameterSpec;
     string i18NDescription = spec == null ? GetDescription(identifier) : GetParameterDescription(identifier, spec.Number);
     return i18NDescription == null ? null : new DescribedAsFacetI18N(i18NDescription, facet.Specification);
 }
示例#58
0
 internal AdjustCompDefTonnageHelper(IIdentifier identifier, ValueChange <float> change)
 {
     this.identifier = identifier;
     this.change     = change;
 }
 private string GetText(IIdentifier identifier, string type) {
     string form = identifier.IsField ? Property : Action;
     string key = identifier.ToIdentityString(IdentifierDepth.ClassNameParams) + ":" + form + "/" + type;
     return GetText(key);
 }
示例#60
0
 public SeriesIdentifier(ISeriesData other, IIdentifier identifier)
     : base(identifier)
 {
     CopyFrom(other);
 }