Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
Project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Coscine
B
backend
apis
Project
Commits
6e3bf886
Commit
6e3bf886
authored
Jul 23, 2019
by
Benedikt Heinrichs
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update: Simplify Event firing (coscine/issues#179)
parent
bd1ed418
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
19 deletions
+3
-19
src/Project/Controllers/ProjectController.cs
src/Project/Controllers/ProjectController.cs
+3
-18
src/Project/Project.csproj
src/Project/Project.csproj
+0
-1
No files found.
src/Project/Controllers/ProjectController.cs
View file @
6e3bf886
...
...
@@ -7,7 +7,6 @@ using Coscine.ApiCommons;
using
Coscine.ApiCommons.Exceptions
;
using
Coscine.ApiCommons.Factories
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.SharePoint
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -91,24 +90,10 @@ namespace Coscine.Api.Project.Controllers
private
void
FireEvents
(
Action
<
IProjectAction
,
ProjectEventArgs
>
eventAction
)
{
var
sharePointSite
=
Request
.
Headers
[
"Referer"
];
SPUserToken
systemAccount
=
SPUserToken
.
SystemAccount
;
using
(
SPSite
site
=
new
SPSite
(
sharePointSite
,
systemAccount
))
ProjectEventArgs
projectEventArgs
=
new
ProjectEventArgs
(
Program
.
Configuration
,
new
object
[
0
]);
foreach
(
var
projectAction
in
projectActions
)
{
using
(
SPWeb
web
=
site
.
OpenWeb
())
{
SPContext
context
=
SPContext
.
GetContext
(
web
);
object
[]
args
=
new
object
[]
{
context
};
ProjectEventArgs
projectEventArgs
=
new
ProjectEventArgs
(
Program
.
Configuration
,
args
);
foreach
(
var
projectAction
in
projectActions
)
{
eventAction
(
projectAction
,
projectEventArgs
);
}
}
eventAction
(
projectAction
,
projectEventArgs
);
}
}
}
...
...
src/Project/Project.csproj
View file @
6e3bf886
...
...
@@ -353,7 +353,6 @@
<Reference
Include=
"Microsoft.Net.Http.Headers, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Microsoft.Net.Http.Headers.2.2.0\lib\netstandard2.0\Microsoft.Net.Http.Headers.dll
</HintPath>
</Reference>
<Reference
Include=
"Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL"
/>
<Reference
Include=
"Microsoft.Win32.Registry, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Microsoft.Win32.Registry.4.5.0\lib\net461\Microsoft.Win32.Registry.dll
</HintPath>
</Reference>
...
...
Ghost User
@ghost
mentioned in commit
f91a1c23
·
Aug 16, 2019
mentioned in commit
f91a1c23
mentioned in commit f91a1c2321609c4d0768b3560622779d49efc6a3
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment