You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
3.2 KiB

using OnDoc.Diverses;
using OnDoc.DocMgmt;
using OnDoc.Klassen;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using Syncfusion.Windows.Forms.Spreadsheet.Commands;
using OnDoc.UICintrols;
namespace OnDoc
{
internal static class Program
{
/// Args
/// shodoc:?partnernr=1000210&vorlagenr=125&interaktion=NO&showdoc=YES&funktion=Createdoc
/// E:\Software-Projekte\OnDoc\EDK_Dateien\3bv.edk
/// <summary>
/// Der Haupteinstiegspunkt für die Anwendung.
/// </summary>
private static Mutex mutex = null;
const string AppId = "OnDoc5094533C-A613-4889-A0E3-8C28C130C6AA)";
//static Start MyForm = new Start();
///
[STAThread]
static void Main(string[] args)
{
ExternalCall.sourceparam = "";
if (args.Length > 0)
{
if (args[0].ToString().ToUpper().Substring(args[0].ToString().Length - 4, 4) == ".EDK")
{
AppParams.init();
string destfile = AppParams.tempdir + DateTime.Now.ToString("yyyyMMddHHmmss") + "_tmpfile.edk";
System.IO.File.Copy(args[0],destfile);
//EDK_Data.Load_EDK_File(args[0]);
}
else
{
if (args[0].ToString().ToUpper().IndexOf("PARTNERNR") > 0 || args[0].ToString().ToUpper().IndexOf("UCHECK") > 0)
{
AppParams.init();
//MessageBox.Show(AppParams.tempdir);
string destfile = AppParams.tempdir + DateTime.Now.ToString("yyyyMMddHHmmss")+ "_tmpfile.uri";
using (StreamWriter outputfile = new StreamWriter(destfile))
{
outputfile.WriteLine(Uri.UnescapeDataString(args[0]));
outputfile.Close();
}
}
else
{
MessageBox.Show("Die Übergabeparemeter '" + args[0].ToString()+"' sind ungültig","Aufruffehler",MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
const string appName = "OnDoc";
bool createdNew;
mutex = new Mutex(true, appName, out createdNew);
if (!createdNew)
{
//MyForm.runparams();
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("Ngo9BigBOggjHTQxAR8/V1NCaF5cXmZCf1FpRmJGdld5fUVHYVZUTXxaS00DNHVRdkdnWXdecXRdQ2heUU13XUI=");
AppParams.init();
// // MyForm = new Start();
// Application.Run(MyForm);
Application.Run(new Start());
}
}
}