Search Project: *:*

 
<< < 1 2 3 4 5 6 .. 3434 > >> (Page 4 of 3434)

cforge: ./trunk/cforge/cforge/Package/CFORGE/Scripts/pysvn.py Bash bash (Bash)
#!/usr/bin/python # # This module is a wrapper for a locally installed SVN command line client. # It can be used to find URLs of CODESYS projects within a repository, or to # checkout all files outside of CODESYS projects. # # - svn_list: # a wrapper for the "svn list" command, supporting recursive lists # # - svn_get_directories_with_codesys_projects / svn_get_directories_without_codesys_projects: # return directories with or without CODESYS projects. Can be used to find # CODESYS library URLs in repositories. # # - svn_checkout_non_codesys: # Checkout top-level directory w/o content. # Then update all directories, which are not containing any CODESYS projects. # import subprocess def svn_list(username, password, url, recursive=False): args = "" if recursive: args += " -R" cmd="svn list %s --username=%s --password=%s %s" % (args, username, password, url) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) (output, err) = p.communicate() entries = list() if "\n" in output.decode(encoding='utf-8', errors='ignore'): entries = output.decode(encoding='utf-8', errors='ignore').strip().replace("\r","").split("\n") return entries def svn_get_directories_with_codesys_projects(username, password, url): allfiles = svn_list(username, password, url, True) codesys_projects = filter(lambda file: 'meta.profile' in file, allfiles) alldirs=list() for cp in codesys_projects: dirname = cp.replace("/meta.profile", "") alldirs.append(dirname) return alldirs def svn_get_directories_without_codesys_projects(username, password, url): allfiles = svn_list(username, password, url, True) codesys_projects = filter(lambda file: 'meta.profile' in file, allfiles) # filter out all subdirectories of the directory containing 'meta.profile', # as well as all files (keep only directories) alldirs=allfiles for cp in codesys_projects: dirname = cp.replace("/meta.profile", "") alldirs = filter(lambda file: not file.startswith(dirname) and file.endswith('/'), alldirs) return alldirs def svn_checkout_non_codesys(username, password, url, destination): dirs = svn_get_directories_without_codesys_projects(username, password, url) cmd="svn checkout --depth=empty --username=%s --password=%s %s %s" % (username, password, url, destination) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) (output, err) = p.communicate() if not err: for d in dirs: cmd="svn update --depth=files --username=%s --password=%s %s/%s" % (username, password, destination, d) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) (output, err) = p.communicate() def svn_checkout_all(username, password, url, destination): cmd="svn checkout --username=%s --password=%s %s %s" % (username, password, url, destination) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) (output, err) = p.communicate() def svn_remove_local(destination): cmd="svn update --set-depth exclude %s" % (destination) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) (output, err) = p.communicate() def svn_get_stat(folder): cmd="svn stat %s" % (folder) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) (stat, err) = p.communicate() return stat def svn_get_url(folder): cmd="svn info --show-item url %s" % (folder) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) (url, err) = p.communicate() return url def svn_update_non_codesys(username, password, folder): url = svn_get_url(folder) dirs = svn_get_directories_without_codesys_projects(username, password, url) for d in dirs: cmd="svn update --depth=files --username=%s --password=%s %s/%s" % (username, password, folder, d) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) (output, err) = p.communicate() def svn_commit_non_codesys(username, password, folder, message): cmd="svn commit -m \"%s\" --username=%s --password=%s" % (message, username, password) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, cwd=folder) (output, err) = p.communicate()
Last updated: 2018-09-10

cforge: ./trunk/cforge/cforge/Package/CFORGE/Scripts/checkout-prj.py Bash bash (Bash)
import sys, os import pysvn import json hasWebClient = True try: from System.Net import WebClient except: import requests hasWebClient = False hasUI = True try: import ui except: hasUI = False base_url = "https://forge.codesys.com/rest" base_svn = "https://forge.codesys.com/svn/" # This is a cforge command (script file) # this will be run as ironpython script. # the filename of this script is automatically the corresponding cforge command # with some magic functions you can easily integrate it nicely into cforge tool # cforge_usage: # here you can return an array of all possible arguments and options that can # be passed to this command script def cforge_usage(): help = [ ["<path to CODESYS project>", "---"] ] return help def get_json(url): r = "" if hasWebClient: web_client = WebClient() r = web_client.DownloadData(url) else: r = requests.get(url).content j = json.loads(bytes(r).decode('utf-8')) return j if len(sys.argv) <= 1: print("Oh, there are no arguments. Perhaps you forgot something?") sys.exit() args = sys.argv[1].split(" ") folder = "" if len(args) == 1: folder = args[0].strip("/").split("/")[-1] # username, password and path are specified at the command line config = dict() if len(sys.argv)>= 3: config['user'] = sys.argv[2] config['pass'] = sys.argv[3] config['folder'] = sys.argv[4] elif hasUI: config = ui.Dialog("Checkout Project", Folder=True, Credentials=True, DefaultFolder=folder) # iterate over all tools of the project, and checkout all SVN repositories, # excluding the CODESYS folders if config != None: tools = get_json(base_url + '/' + sys.argv[1]) for tool in tools['tools']: if tool['name'] == 'svn': repo = tool['url'][1:-1].replace('/', ',') url = base_svn + repo print(url) # checkout pysvn.svn_checkout_all(config['user'], config['pass'], url, os.path.join(config['folder'], repo)) for root, dirs, files in os.walk(config['folder']): for file in files: if file == "meta.profile": pysvn.svn_remove_local(root) print('\n') # store commit count details = get_json(base_url + tool['url']) f = open(os.path.join(config['folder'], repo + '.commit_count'), "w") if f: f.write(str(details['commit_count'])) f.close()
Last updated: 2018-09-13

cforge: ./trunk/cforge/cforge/Package/CFORGE/Scripts/plcopenxml.xslt Bash bash (Bash)
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:po="http://www.plcopen.org/xml/tc6_0200"> <!-- | Parse POU start tags --> <xsl:template match="po:pou[@pouType='functionBlock']"> <xsl:text>--- </xsl:text> <!-- <xsl:value-of select="po:interface/po:documentation"/>--> <xsl:call-template name="trim"> <xsl:with-param name="input" select="po:interface/po:documentation"/> </xsl:call-template> <xsl:text> ~~~ST </xsl:text> <xsl:text>FUNCTION_BLOCK </xsl:text><xsl:value-of select="@name" /> <xsl:apply-templates select="po:interface"/> <xsl:text> ~~~ </xsl:text> <xsl:apply-templates select="po:body"/> <xsl:apply-templates select="po:addData/po:data/po:Method"/> </xsl:template> <xsl:template match="po:pou[@pouType='program']"> <xsl:text>--- ~~~ST </xsl:text> <xsl:text>PROGRAM </xsl:text><xsl:value-of select="@name" /> <xsl:apply-templates select="po:interface"/> <xsl:text> ~~~ </xsl:text> <xsl:apply-templates select="po:body"/> </xsl:template> <xsl:template match="po:Method"> <xsl:text>--- ~~~ST </xsl:text> <xsl:text>METHOD </xsl:text><xsl:value-of select="@name" /> <xsl:text>: </xsl:text> <xsl:apply-templates select="*/po:returnType"/> <xsl:apply-templates select="po:interface"/> <xsl:text> ~~~ </xsl:text> <xsl:apply-templates select="po:body"/> </xsl:template> <!-- | Parse POU body --> <xsl:template match="po:body"> <xsl:apply-templates select="*|@*"/> </xsl:template> <!-- | Parse Interface (also finish the start tag, to be able to set "EXTENDS" or "IMPLEMENTS". --> <xsl:template match="po:interface"> <xsl:if test="po:addData/po:data/po:Inheritance/po:Extends"> <xsl:text> EXTENDS </xsl:text> <xsl:value-of select="po:addData/po:data/po:Inheritance/po:Extends"/> </xsl:if> <xsl:text> </xsl:text> <xsl:apply-templates select="po:localVars|po:tempVars|po:inputVars|po:outputVars|po:inOutVars|po:externalVars|po:globalVars"/> </xsl:template> <!-- | Variables (Part of the interface) --> <xsl:template match="po:localVars"> <xsl:text>VAR </xsl:text> <xsl:apply-templates select="po:variable"/> <xsl:text>END_VAR </xsl:text> </xsl:template> <xsl:template match="po:tempVars"> <xsl:text>VAR_TEMP </xsl:text> <xsl:apply-templates select="po:variable"/> <xsl:text>END_VAR </xsl:text> </xsl:template> <xsl:template match="po:inputVars"> <xsl:text>VAR_INPUT </xsl:text> <xsl:apply-templates select="po:variable"/> <xsl:text>END_VAR </xsl:text> </xsl:template> <xsl:template match="po:outputVars"> <xsl:text>VAR_OUTPUT </xsl:text> <xsl:apply-templates select="po:variable"/> <xsl:text>END_VAR </xsl:text> </xsl:template> <xsl:template match="po:inOutVars"> <xsl:text>VAR_INOUT </xsl:text> <xsl:apply-templates select="po:variable"/> <xsl:text>END_VAR </xsl:text> </xsl:template> <xsl:template match="po:externalVars"> <xsl:text>VAR_EXTERNAL </xsl:text> <xsl:apply-templates select="po:variable"/> <xsl:text>END_VAR </xsl:text> </xsl:template> <xsl:template match="po:globalVars"> <xsl:text>VAR_GLOBAL </xsl:text> <xsl:apply-templates select="po:variable"/> <xsl:text>END_VAR </xsl:text> </xsl:template> <xsl:template match="po:variable"> <xsl:text> </xsl:text> <xsl:if test="@name"> <xsl:value-of select="@name"/> <xsl:text>: </xsl:text> <xsl:apply-templates select="po:type"/> <xsl:text>; </xsl:text> </xsl:if> </xsl:template> <xsl:template match="po:type|po:baseType|po:returnType"> <xsl:if test="po:derived"> <xsl:value-of select="po:derived/@name"/> </xsl:if> <xsl:if test="po:array"> <xsl:text>ARRAY [</xsl:text> <xsl:value-of select="po:array/dimension/@lower"/> <xsl:text>..</xsl:text> <xsl:value-of select="po:array/dimension/@upper"/> <xsl:text>] OF </xsl:text> <xsl:apply-templates select="po:baseType"/> </xsl:if> <xsl:if test="not(po:derived) and not(po:array) and not(po:struct)"> <xsl:value-of select="name(*[1])"/> </xsl:if> </xsl:template> <!-- | Implement the presentation of the different languages --> <xsl:template match="po:ST"> <xsl:text>~~~ST </xsl:text> <xsl:value-of select="*[1]"/> <xsl:text> ~~~ </xsl:text> </xsl:template> <xsl:template name="trim"> <xsl:param name="input"/> <xsl:choose> <xsl:when test="starts-with($input,' ')"> <xsl:call-template name="trim"> <xsl:with-param name="input" select="substring-after($input,' ')"/> </xsl:call-template> </xsl:when> <xsl:when test="substring($input, string-length($input) ) = ' ' "> <xsl:call-template name="trim"> <xsl:with-param name="input" select="substring($input, 1, string-length($input)-1)"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$input"/> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- | Fetch and ignore rest --> <xsl:template match="*|@*"> <xsl:apply-templates select="*|@*"/> </xsl:template> </xsl:stylesheet>
Last updated: 2018-06-04

cforge: ./trunk/cforge/cforge/Package/CFORGE/Scripts/import.py Bash bash (Bash)
# Example Batch: #set WD=%~d0%~p0 #set USER=<username> #set PASS=<password> #set PROJECT=C:\Users\<bla>\Projekte\CODESYS\IoDrvSysfsGPIO.library #set URL=https://forge.codesys.com/svn/,,,,/IoDrvSysfsGPIO/ #set MESSAGE='initial commit' #"C:\Program Files (x86)\3S CODESYS\CODESYS\Common\CODESYS.exe" --Profile="CODESYS V3.5 SP12" --runscript="C:\Program Files (x86)\3S CODESYS\CODESYS\CFORGE\Scripts\import.py" --scriptargs="%USER% %PASS% %PROJECT% %URL% %WD% %MESSAGE%" --noUI # if not all parameters are passed, there will be message prompts # this makes it possible to use it from inside codesys import sys, os class ER(ExportReporter): def error(self, object, message): system.write_message(Severity.Error, "Error exporting %s: %s" % (object, message)) def warning(self, object, message): system.write_message(Severity.Warning, "Warning exporting %s: %s" % (object, message)) def nonexportable(self, object): system.write_message(Severity.Information, "Object not exportable: %s" % object) @property def aborting(self): return False; if len(sys.argv) > 1: username=sys.argv[1] else: username = system.ui.query_string("Enter the svn username") if len(sys.argv) > 2: password=sys.argv[2] else: password = system.ui.query_password("Enter the svn password") if len(sys.argv) > 3: project=sys.argv[3] else: res = system.ui.open_file_dialog("Choose file:", filter="Project files (*.project)|*.project|Library files (*.library)|*.library", filter_index = 0, multiselect=False) project = res if len(sys.argv) > 4: url=sys.argv[4] else: url = system.ui.query_string("Enter the svn url:") if len(sys.argv) > 5: message=sys.argv[5] else: message = system.ui.query_string("Enter the commit message:") def set_username(req): print_all(req) req.username = username req.password = password req.save = True # Optional svn.auth_username_password += set_username print("open project: " + project) p = projects.open(project) reporter = ER() print("export plcopen xml") p.export_xml(reporter, p.get_children(False), p.path + ".plcopen.xml", True, True, True) print("is versioned: " + str(p.svn.is_versioned)) if not p.svn.is_versioned: print("importing project to svn...") p.svn.import_project(url,message) print("import done!") else: print("committing project to svn...") p.svn.commit() print("commit done!") p.close()
Last updated: 2018-04-13

cforge: ./trunk/cforge/cforge/Package/CFORGE/Scripts/action.svn.commit.py Bash bash (Bash)
# Example Batch: # set WD=%~d0%~p0 # set USER=<username> # set PASS=<password> # set URL=https://forge.codesys.com/svn/drv,gpio-mod,code/trunk/GPIOMods # "C:\Program Files (x86)\3S CODESYS-V3.5.12.0\CODESYS\Common\CODESYS.exe" --profile="CODESYS V3.5 SP12" --runscript="%WD%\action.svn.checkout.py" --scriptargs="%URL% %USER% %PASS% %WD%" --noUI import sys import os.path import pysvn if len(sys.argv) <= 1: print("usage: <user> <pass> <working dir>") sys.exit() if len(sys.argv) > 2: username = sys.argv[1].replace("`````", "'") password = sys.argv[2].replace("`````", "'") if len(sys.argv) > 3: path = sys.argv[3].replace("`````", "'") if len(sys.argv) > 4: message = " ".join(sys.argv[4:]).replace("`````", "'") def set_username(req): req.username = username req.password = password req.save = True # Optional # checkout plain SVN files pysvn.svn_commit_non_codesys(username, password, path, message) try: svn.auth_username_password += set_username # iterate over all projects and libraries for root, dirs, files in os.walk(path): for file in files: if file.endswith(".project") or file.endswith(".library"): filepath = os.path.join(root, file) proj = projects.open(filepath) proj.svn.commit(message) proj.save() proj.close() except: print ("Seems like the CODESYS SVN package is missing. Checked out only plain files and no CODESYS projects.") print ("Exception cause: %s" % str(sys.exc_info())) pass system.exit()
Last updated: 2020-08-10

cforge: ./trunk/cforge/cforge/Package/CFORGE/Scripts/action.svn.update.py Bash bash (Bash)
# Example Batch: # set WD=%~d0%~p0 # set USER=<username> # set PASS=<password> # set URL=https://forge.codesys.com/svn/drv,gpio-mod,code/trunk/GPIOMods # "C:\Program Files (x86)\3S CODESYS-V3.5.12.0\CODESYS\Common\CODESYS.exe" --profile="CODESYS V3.5 SP12" --runscript="%WD%\action.svn.checkout.py" --scriptargs="%URL% %USER% %PASS% %WD%" --noUI import sys import os.path import pysvn if len(sys.argv) <= 1: print("usage: <user> <pass> <working dir>") sys.exit() if len(sys.argv) > 2: username = sys.argv[1].replace("`````", "'") password = sys.argv[2].replace("`````", "'") if len(sys.argv) > 3: path = sys.argv[3].replace("`````", "'") def set_username(req): req.username = username req.password = password req.save = True # Optional # checkout plain SVN files pysvn.svn_update_non_codesys(username, password, path) # iterate over all projects and libraries try: svn.auth_username_password += set_username for root, dirs, files in os.walk(path): for file in files: if file.endswith(".project") or file.endswith(".library"): filepath = os.path.join(root, file) proj = projects.open(filepath) proj.svn.update() proj.save() proj.close() except: print ("Seems like the CODESYS SVN package is missing. Checked out only plain files and no CODESYS projects.") print ("Exception cause: %s" % str(sys.exc_info())) pass system.exit()
Last updated: 2020-08-10

cforge: ./trunk/cforge/cforge/Package/CFORGE/Scripts/checkout.py Bash bash (Bash)
import sys, os import cds_script import ui # This is a cforge command (script file) # this will be run as ironpython script. # the filename of this script is automatically the corresponding cforge command # with some magic functions you can easily integrate it nicely into cforge tool # cforge_usage: # here you can return an array of all possible arguments and options that can # be passed to this command script def cforge_usage(): help = [ ["<path to CODESYS project>", "---"] ] return help if len(sys.argv) <= 1: print("Oh, there are no arguments. Perhaps you forgot something?") sys.exit() args = sys.argv[1].split(" ") folder = "" repo = "" if len(args) == 1: folder = args[0].strip("/").split("/")[-1] if not os.path.isdir(args[0]): repo = args[0] config = ui.Dialog("Checkout", Folder=True, Credentials=True, Repo=True, DefaultFolder=folder, DefaultRepo=repo) if config != None: scriptpath = os.path.abspath(os.path.dirname(sys.argv[0])) scriptname = os.path.join(scriptpath, "action.svn.checkout.py") scriptargs = "%s %s %s %s" % (config["repo"], config["user"], config["pass"], config["folder"]) cds_script.RunCodesysWithScript(scriptname, scriptargs, False)
Last updated: 2018-08-22

cforge: ./trunk/cforge/cforge/Package/CFORGE/Uninstall.reg Bash bash (Bash)
Binary file ./trunk/cforge/cforge/Package/CFORGE/Uninstall.reg matches
Last updated: 2020-07-13

cforge: ./trunk/cforge/cforge/Package/CFORGE/Setup.reg Bash bash (Bash)
Binary file ./trunk/cforge/cforge/Package/CFORGE/Setup.reg matches
Last updated: 2020-07-13

cforge: ./trunk/cforge/cforge/Program.cs Bash bash (Bash)
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; delegate string ReadLineDelegate(); namespace cforge { class Program { static void Main(string[] args) { Console.WriteLine(""); Console.WriteLine(@"----------------------------------------------------------------------------"); Console.WriteLine("cforge started"); Console.WriteLine("Build date: " + Resources.BuildTime); Console.WriteLine("Revision based: " + Resources.CurrentSVNRevision); Console.WriteLine(@"----------------------------------------------------------------------------"); Console.WriteLine(""); if (Helper.EasyAttachEnabled()) { Console.WriteLine("Easy attach enabled. Now attach with debugger, and then press Enter here!"); Console.ReadLine(); } if (args.Length == 1 && args[0].StartsWith("cforge:")) { // invokation via URL Handler: // format is // "cforge:<command>:additionalargs_or_path_or_whatever // now we can remove the start // split for the first ":" and the rest is like the normal commandline String arg = args[0].Remove(0, "cforge:".Length); List<string> newargs = new List<string>(); String command = "--" + arg.Split(':')[0]; newargs.Add(command); if (arg.Split(':').Length > 1) { string s = System.Uri.UnescapeDataString(arg.Remove(0, arg.Split(':')[0].Length + 1)); s = System.Uri.UnescapeDataString(s); newargs.Add(s); } if(Helper.EasyAttachEnabled()) { Console.WriteLine("converting arguments from: "); foreach (String s in args) { Console.WriteLine(s); } Console.WriteLine("to: "); foreach (String s in newargs) { Console.WriteLine(s); } } args = newargs.ToArray(); } if (Helper.EasyAttachEnabled()) { Console.WriteLine("CWD: " + Directory.GetCurrentDirectory()); Console.WriteLine("User elevated: " + Helper.IsUserElevated()); } if (!Helper.CheckRegistryProtocol()) { Console.WriteLine(@"[WARNING] URL Handler is not registered. CFORGE: links will not work properly. Use Setup.bat to do this (at <CODESYS Installation folder>\CFORGE\ )"); } List<String> liScripts = Helper.GetAllScripts(); bool bDebug = false; for (int i = 0; i < args.Length; i++) { switch (args[i]) { case "-d": bDebug = true; if (Helper.IsUserElevated()) Console.WriteLine("Running elevated"); break; // fallthrough intended case "-v": case "--version": Version version = Assembly.GetEntryAssembly().GetName().Version; Console.WriteLine("Version: " + version.ToString()); break; case "--setup": if (!Helper.IsUserElevated()) { Console.WriteLine("[INFO] Setup URL Handler and add tool to path. "); Helper.RunElevated("--setup"); } else { Helper.RegisterProtocol(bDebug); Helper.AddToSystemPath(bDebug); } break; case "--license-info": Helper.ShowLicenseInfo(); break; /* fallthrough intended ! */ case "--help": case "-h": ShowUsage(); break; default: if (Helper.EasyAttachEnabled()) { Console.WriteLine("default case: " + args[i]); } // check if we have matching script: if (args[i].StartsWith("--")) { String command = args[i].Replace("--", ""); if (liScripts.Contains(command)) { // the rest of the command is passed as argument to the script string[] newargs = args.Skip(i + 1).ToArray(); Helper.ExecuteIPyScript(command, newargs, bDebug); // as we "used" all params... i = args.Length; } else { if (Helper.EasyAttachEnabled()) { Console.WriteLine("no matching script found: " + command); } ShowUsage(); } } break; } } if (args.Length == 0) ShowUsage(); Console.WriteLine(""); Console.WriteLine(@"----------------------------------------------------------------------------"); Console.WriteLine("cforge finished."); Console.WriteLine(@"----------------------------------------------------------------------------"); Console.WriteLine(""); ReadLineDelegate d = Console.ReadLine; IAsyncResult result = d.BeginInvoke(null, null); result.AsyncWaitHandle.WaitOne(3000); // wait 3s if (result.IsCompleted) { string resultstr = d.EndInvoke(result); } } static void ShowUsage() { // pad right 32 for description ;-) Console.WriteLine(@"usage: cforge <command> <arguments>"); Console.WriteLine(@""); Console.WriteLine(@"internal commands:"); Console.WriteLine(@"-h/--help show this help"); Console.WriteLine(@"--setup register cforge url handler and add cforge to path"); Console.WriteLine(@"--license-info show license information"); Console.WriteLine(@"-v/--version show version information"); Console.WriteLine(@""); Console.WriteLine(@""); Console.WriteLine(@"external commands (scripts):"); Console.WriteLine(@"------------------------------"); // generic part List<String> liCommands = Helper.GetAllScripts(); foreach (String command in liCommands) { Helper.ShowUsageIPyScript(command, false); } Console.WriteLine(@""); Console.WriteLine(@""); } } }
Last updated: 2020-07-13

cforge: ./trunk/cforge/cforge/app.manifest Bash bash (Bash)
<?xml version="1.0" encoding="utf-8"?> <assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> <!-- UAC-Manifestoptionen Wenn Sie die Ebene der Benutzerkontensteuerung für Windows ändern möchten, ersetzen Sie den Knoten "requestedExecutionLevel" wie folgt. <requestedExecutionLevel level="asInvoker" uiAccess="false" /> <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> <requestedExecutionLevel level="highestAvailable" uiAccess="false" /> Durch Angabe des Elements "requestedExecutionLevel" wird die Datei- und Registrierungsvirtualisierung deaktiviert. Entfernen Sie dieses Element, wenn diese Virtualisierung aus Gründen der Abwärtskompatibilität für die Anwendung erforderlich ist. --> <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> </requestedPrivileges> </security> </trustInfo> <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <application> <!-- Eine Liste der Windows-Versionen, unter denen diese Anwendung getestet und für die sie entwickelt wurde. Wenn Sie die Auskommentierung der entsprechenden Elemente aufheben, wird von Windows automatisch die kompatibelste Umgebung ausgewählt. --> <!-- Windows Vista --> <!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />--> <!-- Windows 7 --> <!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />--> <!-- Windows 8 --> <!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />--> <!-- Windows 8.1 --> <!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />--> <!-- Windows 10 --> <!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />--> </application> </compatibility> <!-- Gibt an, dass die Anwendung mit DPI-Werten kompatibel ist und von Windows nicht automatisch auf höhere DPI-Werte skaliert wird. WPF-Anwendungen (Windows Presentation Foundation) sind automatisch mit DPI-Werten kompatibel und müssen sich nicht anmelden. Für Windows Forms-Anwendungen für .NET Framework 4.6, die sich für diese Einstellung anmelden, muss auch die Einstellung "'EnableWindowsFormsHighDpiAutoResizing" in der "app.config" auf "true" festgelegt werden. --> <!-- <application xmlns="urn:schemas-microsoft-com:asm.v3"> <windowsSettings> <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware> </windowsSettings> </application> --> <!-- Designs für allgemeine Windows-Steuerelemente und -Dialogfelder (Windows XP und höher) aktivieren --> <!-- <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> --> </assembly>
Last updated: 2018-03-30

cforge: ./trunk/cforge/cforge/cforge.csproj Bash bash (Bash)
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{4FEA909F-B6AB-49EF-9EEA-9AED5C2E7792}</ProjectGuid> <OutputType>Exe</OutputType> <RootNamespace>cforge</RootNamespace> <AssemblyName>cforge</AssemblyName> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup> <StartupObject>cforge.Program</StartupObject> </PropertyGroup> <PropertyGroup> <ApplicationIcon>icon.ico</ApplicationIcon> </PropertyGroup> <PropertyGroup> <ApplicationManifest>app.manifest</ApplicationManifest> </PropertyGroup> <ItemGroup> <Reference Include="IronPython, Version=2.7.8.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL"> <HintPath>..\packages\IronPython-2.7.8\Net45\IronPython.dll</HintPath> </Reference> <Reference Include="IronPython.Modules, Version=2.7.8.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL"> <HintPath>..\packages\IronPython-2.7.8\Net45\IronPython.Modules.dll</HintPath> </Reference> <Reference Include="IronPython.SQLite, Version=2.7.8.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL"> <HintPath>..\packages\IronPython-2.7.8\Net45\IronPython.SQLite.dll</HintPath> </Reference> <Reference Include="IronPython.Wpf, Version=2.7.8.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL"> <HintPath>..\packages\IronPython-2.7.8\Net45\IronPython.Wpf.dll</HintPath> </Reference> <Reference Include="Microsoft.Dynamic, Version=1.2.0.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL"> <HintPath>..\packages\IronPython-2.7.8\Net45\Microsoft.Dynamic.dll</HintPath> </Reference> <Reference Include="Microsoft.Scripting, Version=1.2.0.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL"> <HintPath>..\packages\IronPython-2.7.8\Net45\Microsoft.Scripting.dll</HintPath> </Reference> <Reference Include="Microsoft.Scripting.Metadata, Version=1.2.0.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL"> <HintPath>..\packages\IronPython-2.7.8\Net45\Microsoft.Scripting.Metadata.dll</HintPath> </Reference> <Reference Include="Microsoft.VisualStudio.CodeCoverage.Shim, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <HintPath>..\packages\DynamicLanguageRuntime.1.2.1\lib\net45\Microsoft.VisualStudio.CodeCoverage.Shim.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> <Reference Include="Microsoft.CSharp" /> <Reference Include="System.Data" /> <Reference Include="System.Net.Http" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="Helper.cs" /> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Resources.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> <DependentUpon>Resources.resx</DependentUpon> </Compile> </ItemGroup> <ItemGroup> <None Include="App.config" /> <None Include="app.manifest" /> <None Include="packages.config" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="icon.ico" /> <EmbeddedResource Include="license.txt" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="Resources.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.cs</LastGenOutput> </EmbeddedResource> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <PropertyGroup> <PostBuildEvent></PostBuildEvent> </PropertyGroup> <PropertyGroup> <PreBuildEvent></PreBuildEvent> </PropertyGroup> </Project>
Last updated: 2018-08-09

cforge: ./trunk/cforge/cforge/Properties/AssemblyInfo.cs Bash bash (Bash)
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die einer Assembly zugeordnet sind. [assembly: AssemblyTitle("cforge")] [assembly: AssemblyDescription("The cforge tool for CODESYS Forge")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("cforge")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly // für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. [assembly: ComVisible(false)] // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird [assembly: Guid("4fea909f-b6ab-49ef-9eea-9aed5c2e7792")] // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: // // Hauptversion // Nebenversion // Buildnummer // Revision // // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
Last updated: 2018-03-17

cforge: ./trunk/cforge/cforge/CreatePackage.bat Bash bash (Bash)
REM Create Package from package source folder set zip="C:\Program Files\7-Zip\7z.exe" set folder=%1 set name=%2 IF NOT EXIST %zip% ECHO "7zip not found, Package cannot be created!" IF NOT EXIST %zip% goto failed IF NOT EXIST %folder% goto failed IF EXIST "%name%" del "%name%" cd "%folder%" %zip% a -tzip "%name%" . -r :failed
Last updated: 2018-07-13

cforge: ./trunk/cforge/cforge/Makefile Bash bash (Bash)
OUTPUT=bin/Debug/cforge.exe PACKAGE=../../cforge.package all: ${OUTPUT} bin/Debug/cforge.exe: cforge.csproj # cross build a visual studio project %.exe: xbuild $< # prepared, but doesn't work, yet %.package: ${OUTPUT} mono ${OUTPUT} --build $$(dirname $@)/$$(basename $@ .package)
Last updated: 2018-08-09

cforge: ./trunk/cforge/cforge/bin/Debug/cforge.exe.config Bash bash (Bash)
<?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> </startup> </configuration>
Last updated: 2018-07-13

cforge: ./trunk/cforge/cforge/App.config Bash bash (Bash)
<?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> </startup> </configuration>
Last updated: 2018-03-17

cforge: ./trunk/cforge/cforge/Package/CFORGE/Setup.bat Bash bash (Bash)
set TOOL_DIR=%~d0%~p0 %TOOL_DIR%/cforge.exe --setup regedit /S Uninstall.reg regedit /S Setup.reg
Last updated: 2020-07-13

cforge: ./trunk/cforge/cforge/license.txt Bash bash (Bash)
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. This project makes use of the following 3rd party nuget packages: This list was generated with this command: PM > Get-Package | Select-Object Id,LicenseUrl Id LicenseUrl -- ---------- DynamicLanguageRuntime https://github.com/IronLanguages/dlr/blob/master/LICENSE IronPython https://github.com/IronLanguages/ironpython2/blob/master/LICENSE Currently all used packages are using Apache 2.0 license.
Last updated: 2018-03-20

cforge: ./trunk/cforge/cforge/Helper.cs Bash bash (Bash)
using IronPython.Hosting; using Microsoft.CSharp.RuntimeBinder; using Microsoft.Scripting.Hosting; using Microsoft.Scripting.Runtime; using Microsoft.Win32; using System; using System.Collections.Generic; using System.Diagnostics; using System.Dynamic; using System.IO; using System.Linq; using System.Net; using System.Reflection; using System.Security.Principal; using System.Text; using System.Threading.Tasks; namespace cforge { /// <summary> /// Misc helper classes for all kinds of stuff /// </summary> class Helper { #region Registry /// <summary> /// Function to check if URL Handler for cforge tool is installed /// </summary> /// <returns>true, if yes. false, if not</returns> public static bool CheckRegistryProtocol() { RegistryKey cforge = Registry.ClassesRoot.OpenSubKey("cforge"); if (cforge == null) { return false; } return true; } public static void RegisterProtocol(bool bVerbose) { try { String fullpath = GetCFORGEAssemblyPath(); RegistryKey cforgekey = Registry.ClassesRoot.OpenSubKey("cforge"); cforgekey = Registry.ClassesRoot.CreateSubKey("cforge", true); cforgekey.SetValue("", "URL:cforge Protocol"); cforgekey.SetValue("URL Protocol", ""); RegistryKey cforgeshell = cforgekey.CreateSubKey("shell"); RegistryKey shellopen = cforgeshell.CreateSubKey("open"); RegistryKey opencommand = shellopen.CreateSubKey("command"); opencommand.SetValue("", "\"" + fullpath + "\" \"%1\""); Console.WriteLine("[INFO] Installed URL Handler for cforge tool. \r\n\tPath is: " + fullpath); } catch (Exception ex) { Console.WriteLine("Exception while adding the registry key. Perhaps you are not admin?"); Console.WriteLine(ex.ToString()); } } internal static void ShowLicenseInfo() { Console.WriteLine("License information "); Console.WriteLine(""); Console.Write(Resources.license); Console.WriteLine(""); } #endregion #region SystemPath public static void AddToSystemPath(bool bVerbose) { string strPath = System.Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.Machine); string[] split = strPath.Split(new Char[] { ';' }); String path = Path.GetDirectoryName(GetCFORGEAssemblyPath()); String strNewSystemPath = strPath + ";" + path; if (!split.Contains(path)) { System.Environment.SetEnvironmentVariable("Path", strNewSystemPath, EnvironmentVariableTarget.Machine); } } #endregion public static bool EasyAttachEnabled() { try { String path = GetCFORGEAssemblyPath(); String Debugfile = Path.Combine(Path.GetDirectoryName(path), "debug"); if (File.Exists(Debugfile)) return true; } catch { } return false; } /// <summary> /// Function to retrieve the location of the currenty assembly (cforge.exe). /// This should be located in the CODESYS installation subfolder "CFORGE" /// </summary> /// <returns>full path to cforge.exe</returns> private static String GetCFORGEAssemblyPath() { String path = System.Reflection.Assembly.GetExecutingAssembly().Location; return path; } private static bool IsCODESYSPathInstallation() { String path = GetCFORGEAssemblyPath(); if (path.Contains("bin") && (path.Contains("Debug") || path.Contains("Release"))) return false; return true; } /// <summary> /// Function to retrieve the CODESYS AP_ROOT (this is where "Common" etc. folders are) /// </summary> /// <returns>full path to AP ROOT</returns> private static String GetCODESYSRoot() { if (IsCODESYSPathInstallation()) { // twice up from cforge.exe (if installed in CODESYS) String path = GetCFORGEAssemblyPath(); path = Directory.GetParent(path).FullName; return Directory.GetParent(path).FullName; } // for now return a normal installation path for CODESYS return @"C:\Program Files (x86)\3S CODESYS\CODESYS\"; } /// <summary> /// Function to retrieve the "ScriptLib" Path inside CODESYS. We just take the last one, probably this is the newest one /// </summary> /// <returns>full path to ScriptLib version folder</returns> private static String GetCODESYSScriptingLibPath() { String path = Path.Combine(GetCODESYSRoot(), "ScriptLib"); String version = Directory.EnumerateDirectories(path).Last(); path = Path.Combine(path, version); return path; } /// <summary> /// Function to retrieve the CFORGE Script path (this is where the IronPython scripts should reside) /// </summary> /// <returns>full path to CFORGE Scripts</returns> private static String GetCFORGEScriptPath() { if (IsCODESYSPathInstallation()) { // <AP_ROOT>\CFORGE\Scripts String path = GetCODESYSRoot(); return Path.Combine(path, "CFORGE", "Scripts"); } String localscriptpath = System.AppDomain.CurrentDomain.BaseDirectory; localscriptpath = Directory.GetParent(localscriptpath).FullName; localscriptpath = Directory.GetParent(localscriptpath).FullName; localscriptpath = Directory.GetParent(localscriptpath).FullName; return Path.Combine(localscriptpath,"Package", "CFORGE", "Scripts"); } /// <summary> /// Function to enumerate all IronPython scripts to exend cforge.exe inside Scripts folder /// </summary> /// <returns>List of IPY scripts</returns> public static List<String> GetAllScripts() { List<string> liScripts = new List<string>(); try { String path = GetCFORGEScriptPath(); foreach (String file in Directory.EnumerateFiles(path)) { if (Path.GetExtension(file).ToLowerInvariant() == ".py") { String shortfilename = Path.GetFileNameWithoutExtension(file); liScripts.Add(shortfilename); } } } catch(Exception e) { Console.WriteLine("[EXCEPTION] GetAllScripts: " + e.Message); } return liScripts; } public static bool IsUserElevated() { using (var curIdent = WindowsIdentity.GetCurrent()) { var principal = new WindowsPrincipal(curIdent); return principal.IsInRole(WindowsBuiltInRole.Administrator); } } public static void RunElevated(String args) { String strAssemblyPath = GetCFORGEAssemblyPath(); try { Process p = new Process(); p.StartInfo.FileName = strAssemblyPath; p.StartInfo.Arguments = args; p.StartInfo.Verb = "runas"; p.Start(); p.WaitForExit(); } catch(Exception ex) { Console.WriteLine("[EXCEPTION] RunElevated: " + ex.Message); } } #region Scripting public static void ExecuteIPyScript(String command, String[] args, bool bVerbose) { String scriptfile = Path.Combine(GetCFORGEScriptPath(), command + ".py"); Console.WriteLine(); Console.WriteLine("[INFO] Executing: " + scriptfile); Console.WriteLine(); if (!File.Exists(scriptfile)) { Console.WriteLine(); Console.WriteLine("[ERROR] Cannot execute command: no such file or directory: " + scriptfile); Console.WriteLine(); return; } //ScriptEngine engine = Python.CreateEngine(); ScriptEngine engine = IronPython.Hosting.Python.CreateEngine(new Dictionary<string, object> { { "Debug", ScriptingRuntimeHelpers.True } }); Debug.Assert(engine.Runtime.Setup.DebugMode); String strScriptingPath = GetCODESYSScriptingLibPath(); try { dynamic sys = Python.GetSysModule(engine); sys.argv[0] = scriptfile; foreach (string arg in args) { sys.argv.Add(arg); } sys.path.Add(GetCFORGEScriptPath()); sys.path.Add(strScriptingPath); var source = engine.CreateScriptSourceFromFile(scriptfile); source.Execute(); //Console.WriteLine("Script finished"); } catch (IronPython.Runtime.Exceptions.SystemExitException ex) { Console.WriteLine(); Console.WriteLine("[INFO] command " + command + ".py exited: "); ExceptionOperations eo = engine.GetService<ExceptionOperations>(); string error = "[INFO] " + eo.FormatException(ex); Console.WriteLine(error); } catch (Exception ex) { Console.WriteLine(); Console.WriteLine("[Exception] command " + command + ".py caused an exception: " ); ExceptionOperations eo = engine.GetService<ExceptionOperations>(); string error = eo.FormatException(ex); Console.WriteLine(error); } } public static void ShowUsageIPyScript(string command, bool v) { String scriptfile = Path.Combine(GetCFORGEScriptPath(), command + ".py"); if (!File.Exists(scriptfile)) { Console.WriteLine("[ERROR] Cannot execute command: no such file or directory: " + scriptfile); return; } ScriptRuntime runtime; runtime = Python.CreateRuntime(); Python.GetEngine(runtime); try { dynamic script = runtime.UseFile(scriptfile); var help = script.cforge_usage(); foreach (var item in help) { String cmd = "--" + command + " " + item[0].ToString(); cmd = cmd.PadRight(32) + item[1]; Console.WriteLine(cmd); } } catch { // we silently ignore errors in this script, as we only want to show the usage! //Console.WriteLine(("--" + command).PadRight(32) + ""); } } #endregion } }
Last updated: 2018-08-09

cforge: ./trunk/cforge/cforge/Resources.resx Bash bash (Bash)
<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <data name="BuildTime" xml:space="preserve"> <value>$WCNOW$</value> </data> <data name="CurrentSVNRevision" xml:space="preserve"> <value>$WCREV$</value> </data> <data name="HasLocalModifications" xml:space="preserve"> <value>$WCMODS?(local modifications detected): $</value> </data> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="license" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>license.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value> </data> </root>
Last updated: 2018-04-23

cforge: ./trunk/cforge/cforge/Resources.Designer.cs Bash bash (Bash)
//------------------------------------------------------------------------------ // <auto-generated> // Dieser Code wurde von einem Tool generiert. // Laufzeitversion:4.0.30319.42000 // // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn // der Code erneut generiert wird. // </auto-generated> //------------------------------------------------------------------------------ namespace cforge { using System; /// <summary> /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. /// </summary> // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("cforge.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Sucht eine lokalisierte Zeichenfolge, die $WCNOW$ ähnelt. /// </summary> internal static string BuildTime { get { return ResourceManager.GetString("BuildTime", resourceCulture); } } /// <summary> /// Sucht eine lokalisierte Zeichenfolge, die $WCREV$ ähnelt. /// </summary> internal static string CurrentSVNRevision { get { return ResourceManager.GetString("CurrentSVNRevision", resourceCulture); } } /// <summary> /// Sucht eine lokalisierte Zeichenfolge, die $WCMODS?(local modifications detected): $ ähnelt. /// </summary> internal static string HasLocalModifications { get { return ResourceManager.GetString("HasLocalModifications", resourceCulture); } } /// <summary> /// Sucht eine lokalisierte Zeichenfolge, die Apache License ///Version 2.0, January 2004 ///http://www.apache.org/licenses/ /// ///TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION /// ///1. Definitions. /// ///&quot;License&quot; shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. /// ///&quot;Licensor&quot; shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. /// ///&quot;Legal Entity&quot; shall mean the union of the acting entity and all other entities that c [Rest der Zeichenfolge wurde abgeschnitten]&quot;; ähnelt. /// </summary> internal static string license { get { return ResourceManager.GetString("license", resourceCulture); } } } }
Last updated: 2018-04-23

cforge: ./trunk/cforge/packages/IronPython-2.7.8/Net45/DLLs/IronPython.SQLite.xml Bash bash (Bash)
<?xml version="1.0"?> <doc> <assembly> <name>IronPython.SQLite</name> </assembly> <members> <member name="T:Community.CsharpSqlite.Sqlite3.LockingStrategy"> <summary> Basic locking strategy for Console/Winform applications </summary> </member> <member name="T:Community.CsharpSqlite.Sqlite3.MediumTrustLockingStrategy"> <summary> Locking strategy for Medium Trust. It uses the same trick used in the native code for WIN_CE which doesn't support LockFileEx as well. </summary> </member> <member name="F:Community.CsharpSqlite.Sqlite3.etRADIX"> * The rest are extensions, not normally found in printf() */ </member> <member name="F:Community.CsharpSqlite.Sqlite3.SQLITE_OK"> * beginning-of-error-codes */ </member> <member name="F:Community.CsharpSqlite.Sqlite3.SQLITE_CONFIG_SINGLETHREAD"> * previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ </member> <member name="T:Community.CsharpSqlite.Sqlite3.sqlite3_module"> * The methods above are in version 1 of the sqlite_module object. Those </member> <member name="M:Community.CsharpSqlite.Sqlite3.sqlite3GetToken(System.String,System.Int32,System.Int32@)"> * x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */ </member> </members> </doc>
Last updated: 2018-07-16

cforge: ./trunk/cforge/packages/IronPython-2.7.8/Net45/DLLs/IronPython.Wpf.xml Bash bash (Bash)
<?xml version="1.0"?> <doc> <assembly> <name>IronPython.Wpf</name> </assembly> <members> <member name="T:IronPython.Modules.Wpf"> <summary> Provides helpers for interacting with Windows Presentation Foundation applications. </summary> </member> <member name="M:IronPython.Modules.Wpf.LoadComponent(IronPython.Runtime.CodeContext,System.Object,System.String)"> <summary> Loads XAML from the specified XmlReader and returns the deserialized object. Any event handlers are bound to methods defined in the provided module. Any named objects are assigned to the object. The provided object is expected to be the same type as the root of the XAML element. </summary> </member> <member name="M:IronPython.Modules.Wpf.LoadComponent(IronPython.Runtime.CodeContext,System.Object,System.IO.Stream)"> <summary> Loads XAML from the specified XmlReader and returns the deserialized object. Any event handlers are bound to methods defined in the provided module. Any named objects are assigned to the object. The provided object is expected to be the same type as the root of the XAML element. </summary> </member> <member name="M:IronPython.Modules.Wpf.LoadComponent(IronPython.Runtime.CodeContext,System.Object,System.Xml.XmlReader)"> <summary> Loads XAML from the specified XmlReader and returns the deserialized object. Any event handlers are bound to methods defined in the provided module. Any named objects are assigned to the object. The provided object is expected to be the same type as the root of the XAML element. </summary> </member> <member name="M:IronPython.Modules.Wpf.LoadComponent(IronPython.Runtime.CodeContext,System.Object,System.IO.TextReader)"> <summary> Loads XAML from the specified XmlReader and returns the deserialized object. Any event handlers are bound to methods defined in the provided module. Any named objects are assigned to the object. The provided object is expected to be the same type as the root of the XAML element. </summary> </member> <member name="M:IronPython.Modules.Wpf.LoadComponent(IronPython.Runtime.CodeContext,System.Object,System.Xaml.XamlXmlReader)"> <summary> Loads XAML from the specified XmlReader and returns the deserialized object. Any event handlers are bound to methods defined in the provided module. Any named objects are assigned to the object. The provided object is expected to be the same type as the root of the XAML element. </summary> </member> </members> </doc>
Last updated: 2018-07-16

cforge: ./trunk/cforge/packages/IronPython-2.7.8/Net45/IKVM.Reflection.License.txt Bash bash (Bash)
Copyright (C) 2002, 2003, 2004 Jeroen Frijters This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jeroen Frijters jeroen@frijters.net
Last updated: 2018-07-16

<< < 1 2 3 4 5 6 .. 3434 > >> (Page 4 of 3434)

Showing results of 85844

Sort by relevance or date