CAM/CADソフトウェア用のプラグイン/インターフェイスを作成していますが、このコードを使用して「SaveWindow」を開きます。CAMインターフェイス用に複数のウィンドウを同時に開かない方法
public void Run(string theMode)
{
try
{
if (theMode == "SaveWindow")
{
string aPictureString = GetPictureString();
StartInterface(null, theMode, CreateAndSaveTheToolList(aPictureString));
}
else
{
string aPipeId = GetRandomString();
itsServerStream = new NamedPipeServerStream(aPipeId, PipeDirection.In, 1);
ThreadPool.QueueUserWorkItem(this.ListenToStream);
StartInterface(aPipeId, theMode, "");
StartNamedPipe(aPipeId);
itsRefreshThread = new Thread(this.RefreshTools);
itsRefreshThread.Start();
if (!InitLogger(Path.GetDirectoryName(this.GetType().Assembly.Location)))
{
MessageBox.Show(//Secured code);
return;
}
}
itsLogger.Info("Run execute was successful.");
}
catch (Exception aException)
{
//Secured code
}
LogManager.ResetConfiguration();
}
インターフェイスが開いていて、もう一度プラグインボタンをクリックすると、別の複数のものが開きます。最初のコードが開いていれば、2番目のコードを開かないようにするにはどうすればよいですか?
最高ののは、「独占」プラグインオプションのいくつかの種類が不足している可能性があるためです。それ以外の場合は、IPC同期を試すことができます。 [名前付きミューテックス](https://stackoverflow.com/q/2186747/1997232)。 – Sinatr