コード例 #1
0
		} // func TryGetStyleNode

		private static GeometryInfo CreateGeometryInfo(XConfigNode x)
		{
			return new GeometryInfo(
				x.GetAttribute<string>("name"),
				x.GetAttribute<string>("path"),
				x.GetAttribute<string>("rect")
			);
		} // func CreateGeometryInfo
コード例 #2
0
        }         // proc

        private void LoadScript(XConfigNode cur, LuaFileScript[] scriptRemove)
        {
            // Id des Scripts
            var scriptId = cur.GetAttribute <string>("id");

            if (String.IsNullOrEmpty(scriptId))
            {
                throw new ArgumentNullException("@id", "ScriptId is expected.");
            }

            // Lese den Dateinamen
            string sFileName = cur.GetAttribute <string>("filename");

            if (String.IsNullOrEmpty(sFileName))
            {
                throw new ArgumentNullException("@filename", "Dateiname nicht gefunden.");
            }

            // Lese die Parameter der Scriptdatei
            var forceDebugMode = cur.GetAttribute <bool>("debug");
            var encoding       = cur.GetAttribute <Encoding>("encoding");

            LuaScript     script     = FindScript(scriptId);
            LuaFileScript fileScript = script as LuaFileScript;

            if (fileScript == null)             // script noch nicht vorhanden --> also legen wir es mal an
            {
                if (script != null)
                {
                    throw new ArgumentException(String.Format("Script '{0}' schon vorhanden.", scriptId));
                }
                FileInfo fi = new FileInfo(sFileName);
                if (!fi.Exists)
                {
                    throw new ArgumentException(String.Format("Datei '{0}' nicht gefunden.", fi.FullName));
                }

                new LuaFileScript(this, scriptId, fi, encoding, forceDebugMode);
            }
            else
            {
                fileScript.Encoding = encoding;
                fileScript.SetDebugMode(forceDebugMode);

                scriptRemove[Array.IndexOf(scriptRemove, fileScript)] = null;

                fileScript.Log.Info("Refreshed.");
            }
        }         // LoadScript
コード例 #3
0
ファイル: DirectoryFileService.cs プロジェクト: twdes/odette
		} // OnBeginReadConfiguration

		protected override void OnEndReadConfiguration(IDEConfigLoading config)
		{
			base.OnEndReadConfiguration(config);

			// read the attributes
			var x = new XConfigNode(Server.Configuration[config.ConfigNew.Name], config.ConfigNew);

			this.destinationId = x.GetAttribute<string>("destination").ToUpper();
			this.priority = x.GetAttribute<int>("priority");

			this.fileNameFilter = x.GetAttribute<string>("inFilter").Split(new char[] { ' ', ';' }, StringSplitOptions.RemoveEmptyEntries);

			// set directories
			this.directoryIn = x.GetAttribute<DirectoryInfo>("in");
			this.directoryOut = x.GetAttribute<DirectoryInfo>("out");
		} // proc OnEndReadConfiguration