質問編集履歴
1
title
CHANGED
File without changes
|
body
CHANGED
@@ -3,4 +3,30 @@
|
|
3
3
|
その際に、その拡張機能から、new System.FileStream(string)などといったファイルに無条件にアクセスできるメソッドを拡張機能を読み込む方では普通に使用できるようにした上で、
|
4
4
|
1.上書きで規制
|
5
5
|
2.削除
|
6
|
-
したいです。
|
6
|
+
したいです。
|
7
|
+
|
8
|
+
追記
|
9
|
+
```c#
|
10
|
+
// ロードする方
|
11
|
+
public interface IPlugin{
|
12
|
+
void Start();//ロード時に読み込まれる
|
13
|
+
}
|
14
|
+
public class Base{
|
15
|
+
public static string ProfilePash = "";
|
16
|
+
public static FileStream getFileInProfile(string pash){
|
17
|
+
return new FileStream(Base.ProfilePash+pash,FileMode.Open);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
```
|
21
|
+
|
22
|
+
```c#
|
23
|
+
//プラグインの方
|
24
|
+
public class Plugin : IPlugin{
|
25
|
+
FileStream fs;
|
26
|
+
public void Start(){
|
27
|
+
fs = new FileStream(Base.ProfilePash+"/examplefile",FileMode.Open);//ここでエラーを返す。
|
28
|
+
fs = getFileInProfile("examplefile");//このようにすればエラーが出ない
|
29
|
+
}
|
30
|
+
}
|
31
|
+
```
|
32
|
+
のようにすることはできますか?
|