Пример #1
0
        private static void Cleanup(
            IntPtr FileSystemPtr,
            ref FullContext FullContext,
            String FileName,
            UInt32 Flags)
        {
            FileSystemBase FileSystem = (FileSystemBase)Api.GetUserContext(FileSystemPtr);

            try
            {
                Object FileNode, FileDesc;
                Api.GetFullContext(ref FullContext, out FileNode, out FileDesc);
                FileSystem.Cleanup(
                    FileNode,
                    FileDesc,
                    FileName,
                    Flags);
            }
            catch (Exception ex)
            {
                ExceptionHandler(FileSystem, ex);
            }
        }
Пример #2
0
        private static Int32 SetDelete(
            IntPtr FileSystemPtr,
            ref FullContext FullContext,
            String FileName,
            Boolean DeleteFile)
        {
            FileSystemBase FileSystem = (FileSystemBase)Api.GetUserContext(FileSystemPtr);

            try
            {
                Object FileNode, FileDesc;
                Api.GetFullContext(ref FullContext, out FileNode, out FileDesc);
                return(FileSystem.SetDelete(
                           FileNode,
                           FileDesc,
                           FileName,
                           DeleteFile));
            }
            catch (Exception ex)
            {
                return(ExceptionHandler(FileSystem, ex));
            }
        }
        public virtual PartialViewResult Edit(CommentEditModel model)
        {
            var editCommentId  = FullContext.Value.EntityId.Value;
            var commentsTarget = FullContext.GetCommentsTarget();
            var targetEntityId = commentsTarget.EntityId.Value;

            if (!ModelState.IsValid)
            {
                return(OverView(editCommentId));
            }

            var comment = _commentsService.Get(editCommentId);

            if (!_commentsService.CanEdit(comment, _intranetMemberService.GetCurrentMemberId()))
            {
                return(OverView(editCommentId));
            }

            var editDto = MapToEditDto(model, editCommentId);
            var command = new EditCommentCommand(FullContext, editDto);

            _commandPublisher.Publish(command);

            OnCommentEdited(editCommentId);

            switch (commentsTarget.Type.ToInt())
            {
            case int type
                when ContextExtensions.HasFlagScalar(type, ContextType.Activity | ContextType.PagePromotion):
                var activityCommentsInfo = GetActivityComments(targetEntityId);

                return(OverView(activityCommentsInfo));

            default:
                return(OverView(comment.ActivityId));
            }
        }
Пример #4
0
        private static Int32 DeleteReparsePoint(
            IntPtr FileSystemPtr,
            ref FullContext FullContext,
            String FileName,
            IntPtr Buffer,
            UIntPtr Size)
        {
            FileSystemBase FileSystem = (FileSystemBase)Api.GetUserContext(FileSystemPtr);

            try
            {
                Object FileNode, FileDesc;
                Api.GetFullContext(ref FullContext, out FileNode, out FileDesc);
                return(FileSystem.DeleteReparsePoint(
                           FileNode,
                           FileDesc,
                           FileName,
                           Api.MakeReparsePoint(Buffer, Size)));
            }
            catch (Exception ex)
            {
                return(ExceptionHandler(FileSystem, ex));
            }
        }
Пример #5
0
 public MaintainanceTests()
 {
     fullContext    = new FullContext();
     tagRepository  = new TagRepository(fullContext);
     postRepository = new PostRepository(fullContext);
 }
Пример #6
0
 public ChosenController(FullContext context)
 {
     db = context;
 }
Пример #7
0
 public AccountController(FullContext context)
 {
     db = context;
 }
Пример #8
0
 public RelationController(FullContext context)
 {
     db = context;
 }
 public static void AddInfo(string key, Func <string> valueFunc)
 {
     FullContext.Last().Add(Tuple.Create(key, Lazy.Simple(valueFunc)));
 }
 public static void AddInfo(string key, string value)
 {
     FullContext.Last().Add(Tuple.Create(key, Lazy.Const(value)));
 }