internal override bool setSpecialPropertyFromJSON(string property, JObject json, core core)
		{
			result rm;

			if (property == "result")
			{

                if (json.Kind == JObjectKind.Array)
				{
					SimpleJSONImportableList list = new SimpleJSONImportableList(typeof(ResultModel));

					foreach(JObject jrow in json.ArrayValue)
					{
						rm = getResultFromJObject(jrow, core);
						list.Add(rm);
					}

					result = list;
				}
				else
				{
					result = getResultFromJObject(json, core);
				}
				return true;
			}

			return base.setSpecialPropertyFromJSON(property, json, core);
		}
		private objects.result getResultFromJObject(JObject json, core core)
		{
			objects.result _result = new objects.result();
			_result.setPropertiesFromSimpleJSON(json, core);

			ResultModel _data = null;

			if (json.Kind != JObjectKind.Object)
			{
				_data = new ResultModel();
				_data.error.message = "Unexpected result format.";
			}
			else if (!json.ObjectValue.ContainsKey("component"))
			{
				_data = new ResultModel();
				_data.error.message = "Missing required component name.";
			}
			else
			{
				_data = ResultModel.getByComponentName(json.ObjectValue["component"].StringValue);
				if (json.ObjectValue.ContainsKey("data"))
				{
					_data.setPropertiesFromSimpleJSON(json.ObjectValue["data"], core);
				}
			}
			
			_result.data = _data;
			
			return _result;
		}
Esempio n. 3
0
    public void nextTurn()
    {
        GameObject mouseMGR = GameObject.Find("MouseManager");

        mouseMGR.GetComponent <mouseManager>().turnOffEnergy();

        GameObject mainCanvas    = GameObject.FindGameObjectWithTag("mainCanvas");
        Transform  turnDisplayer = mainCanvas.transform.Find("turnPanel/turnText");
        Text       turnText      = turnDisplayer.GetComponent <Text>();

        core playerCore = GameObject.Find("playerCore(Clone)").GetComponent <core>();
        core enemyCore  = GameObject.Find("enemyCore(Clone)").GetComponent <core>();

        if (ebusy == true)
        {
            ecreationTime -= 1;
        }

        if (pbusy == true)
        {
            pcreationTime -= 1;
        }


        if (turn == "player")
        {
            turnText.text = "Turn : Enemy";
            turn          = "enemy";
            enableEnemyMenu();
            GameObject   enemy = GameObject.Find("enemyPlayer");
            GameObject[] units = enemy.GetComponent <enemy>().enemyUnits;

            for (int i = 0; i < units.Length; i++)
            {
                if (units[i] != null)
                {
                    units[i].GetComponent <unit>().energy = units[i].GetComponent <unit>().defaultEnergy;
                }
            }
        }
        else
        {
            turnText.text = "Turn : Player";
            turn          = "player";
            enablePlayerMenu();
            GameObject   player = GameObject.Find("game");
            GameObject[] units  = player.GetComponent <player>().unitObjects;

            for (int i = 0; i < units.Length; i++)
            {
                if (units[i] != null)
                {
                    Debug.Log(units[i]);
                    units[i].GetComponent <unit>().energy = units[i].GetComponent <unit>().defaultEnergy;
                }
            }
        }

        GameObject.Find("hexTile_0_0").GetComponent <Hex>().turnOffAllLights();
    }
Esempio n. 4
0
 /// <summary>Creates a new <code>Message</code>.</summary>
 /// <param name="channel"><code>Channel</code> to which this <code>Message</code>
 /// belongs.</param>
 /// <param name="msgno">Message number of the BEEP message.</param>
 /// <param name="data"><code>InputDataStream</code> containing the payload of the
 /// message.</param>
 /// <param name="messageType">Message type of the BEEP message.</param>
 /// <seealso cref="InputDataStream"></seealso>
 /// <seealso cref="Channel"></seealso>
 internal MessageImpl(ChannelImpl channel, int msgno, InputDataStream data, core.MessageType messageType)
 {
     this.channel = channel;
     this.msgno = msgno;
     this.ansno = -1;
     this.data = data;
     this.messageType = messageType;
 }
 public ctrlCommit(core.git.Repositorio.CommitShortInfo _c)
 {
     InitializeComponent();
     CommitInfo = _c;
     this.Loaded += ctrlCommit_Loaded;
     this.BotonCommit.MouseLeftButtonDown += BotonCommit_MouseLeftButtonDown;
     this.lblFecha.MouseLeftButtonDown += BotonCommit_MouseLeftButtonDown;
 }
Esempio n. 6
0
		public virtual void ReceiveMSG(core.IMessageMSG message)
#endif
		{
			log.trace("receiveMSG: entry");
			lock (this)
			{
				queue.Add(message);
				System.Threading.Monitor.Pulse(this);
			}
		}
Esempio n. 7
0
        public string parse_blocks(core cr)
        {
            StringBuilder sb = new StringBuilder();

            foreach (nano_node nd in _doc.root.nodes)
            {
                parse_block(sb, cr, nd);
            }
            return(sb.ToString());
        }
Esempio n. 8
0
        static void TestAll()
        {
            var tests = new core();

            tests.Bisect();
            tests.CF();
            tests.Life();
            tests.Factorial();
            tests.FibFor();
            tests.Printf();
            tests.Sieve();
            tests.Sort();
        }
Esempio n. 9
0
        public bool check_exists(config.query qry, core cr, Dictionary <string, object> flds = null)
        {
            if (qry.queries.Count > 1)
            {
                for (int n = 0; n < qry.queries.Count - 1; n++)
                {
                    exec(qry.queries[n]);
                }
            }
            DataTable dt = dt_table(cr.parse(qry.queries[qry.queries.Count() - 1], flds));

            return(dt != null && dt.Rows.Count > 0);
        }
Esempio n. 10
0
        public void AESEncryptTest()
        {
            core c = new core();

            string source   = "a quick brown fox jumps over the lazy dog.";
            string password = "******";

            byte[] passwordBytes = UTF8Encoding.UTF8.GetBytes(password);
            byte[] sourceBytes   = UTF8Encoding.UTF8.GetBytes(source);

            byte[] encryptedBytes = c.encrypt(sourceBytes, passwordBytes);
            //string encryptedString = UTF8Encoding.UTF8.GetString(encryptedBytes);

            byte[] decryptedBytes  = c.decrypt(encryptedBytes, passwordBytes);
            string decryptedString = UTF8Encoding.UTF8.GetString(decryptedBytes);

            Assert.AreEqual(source, decryptedString);
        }
Esempio n. 11
0
        protected void parse_block(StringBuilder sb, core cr, nano_node nd)
        {
            string html = cr.config.get_html_block(nd.name).content;

            // childs
            StringBuilder sbc = new StringBuilder();

            if (html.IndexOf("{@childs@}") >= 0)
            {
                foreach (nano_node nd2 in nd.nodes)
                {
                    parse_block(sbc, cr, nd2);
                }
                html = html.Replace("{@childs@}", sbc.Length > 0 ? sbc.ToString() : "");
            }

            // attrs
            int n = html.IndexOf("{@");

            while (n >= 0)
            {
                int n2 = html.IndexOf("@}", n + 2); if (n2 >= 0)
                {
                    string attr = html.Substring(n + 2, n2 - n - 2), name = "", content = "";
                    int    nif = attr.IndexOf("::");
                    if (nif > 0)
                    {
                        content = attr.Substring(nif + 2); name = attr.Substring(0, nif);
                    }
                    else
                    {
                        name = attr;
                    }

                    string val = nd.get_attr(name, name == "text");
                    html = html.Replace("{@" + attr + "@}", content != "" ? (val != "" ? content.Replace("#value#", val) : "") : val);
                }
                n = html.IndexOf("{@", n + 2);
            }

            sb.Append(html);
        }
Esempio n. 12
0
        public string exec_qry(config.query qry, core cr, Dictionary <string, object> flds = null, bool getidentity = false)
        {
            string res = null;

            if (qry.tp == config.query.tp_query.do_while)
            {
                foreach (DataRow dr in dt_table(qry.text_do).Rows)
                {
                    res = exec(cr.parse(qry.text_while, flds, dr), getidentity);
                }
            }
            else
            {
                foreach (string txt in qry.queries)
                {
                    res = exec(cr.parse(txt, flds), getidentity);
                }
            }
            return(res);
        }
Esempio n. 13
0
 static void Log_NewMessage(core.Models.MessageLogModel message)
 {
     Console.WriteLine(message.Message);
 }
Esempio n. 14
0
 public frm_main(core c)
 {
     _c = c; InitializeComponent();
 }
Esempio n. 15
0
			public virtual void changeState(SessionImpl s, core.SessionState newState)
			{
				if (!((newState == core.SessionState.SESSION_STATE_CLOSED) || (newState == core.SessionState.SESSION_STATE_ABORTED)))
				{
					throw new BEEPException("Illegal session state transition");
				}
				
				s.state = newState;
			}
Esempio n. 16
0
		public virtual void Start(
			core.controls.VisualControlStartingKind startingKind = core.controls.VisualControlStartingKind.StartingNew,
			object data = null
		) {

		}
Esempio n. 17
0
 /// <summary>
 /// Adds this component to the call Queue of the specified core object.
 /// Use core.executeQueuedComponents() to call this queued component on the server.
 /// </summary>
 /// <param name="core">The core instance to queue this component to.</param>
 /// <param name="callback">An optional callback handler that will be called when the server responds.</param>
 public void queueWith(core core, Action <results.App.checkSession> callback = null)
 {
     core.queueComponent(COMPONENT_NAME, this, wrapCallback(callback));
 }
Esempio n. 18
0
 /// <summary>
 /// Adds this component to the call Queue of the specified core object.
 /// Use core.executeQueuedComponents() to call this queued component on the server.
 /// </summary>
 /// <param name="core">The core instance to queue this component to.</param>
 /// <param name="callback">An optional callback handler that will be called when the server responds.</param>
 public void queueWith(core core, Action <results.App.getHostLicense> callback = null)
 {
     core.queueComponent(COMPONENT_NAME, this, wrapCallback(callback));
 }
Esempio n. 19
0
 /// <summary>
 /// Adds this component to the call Queue of the specified core object.
 /// Use core.executeQueuedComponents() to call this queued component on the server.
 /// </summary>
 /// <param name="core">The core instance to queue this component to.</param>
 /// <param name="callback">An optional callback handler that will be called when the server responds.</param>
 public void queueWith(core core, Action <results.Gateway.getDatetime> callback = null)
 {
     core.queueComponent(COMPONENT_NAME, this, wrapCallback(callback));
 }
Esempio n. 20
0
 /// <summary>
 /// Calls this component on the server.
 /// </summary>
 /// <param name="core">The core instance to call this component with.</param>
 /// <param name="callback">An optional callback handler that will be called when the server responds.</param>
 public void callWith(core core, Action <results.Medal.getList> callback = null)
 {
     core.callComponent(COMPONENT_NAME, this, wrapCallback(callback));
 }
Esempio n. 21
0
 /// <summary>
 /// Adds this component to the call Queue of the specified core object.
 /// Use core.executeQueuedComponents() to call this queued component on the server.
 /// </summary>
 /// <param name="core">The core instance to queue this component to.</param>
 /// <param name="callback">An optional callback handler that will be called when the server responds.</param>
 public void queueWith(core core, Action <results.Medal.unlock> callback = null)
 {
     core.queueComponent(COMPONENT_NAME, this, wrapCallback(callback));
 }
Esempio n. 22
0
 internal Frame(core.MessageType messageType, ChannelImpl channel, int msgno, bool last, long seqno, int size, int ansno)
 {
     this.messageType = messageType;
     this.channel = channel;
     this.msgno = msgno;
     this.last = last;
     this.seqno = seqno;
     this.size = size;
     this.ansno = ansno;
 }
Esempio n. 23
0
 internal static string GetMessageTypeString(core.MessageType type)
 {
     return types[(int)type];
 }
Esempio n. 24
0
    void MouseOverCore(GameObject ourHitObject)
    {
        if (Input.GetMouseButtonDown(0))
        {
            if (selectedUnit != null)
            {
                core         hitCore     = ourHitObject.GetComponent <core>();
                GameObject   hitCoreTile = GameObject.Find("hexTile_" + hitCore.x + "_" + hitCore.y);
                GameObject   hitUnitTile = GameObject.Find("hexTile_" + selectedUnit.GetComponent <unit>().x + "_" + selectedUnit.GetComponent <unit>().y);
                GameObject[] neighbours  = hitUnitTile.GetComponent <Hex>().GetNeighbours();


                for (int i = 0; i < neighbours.Length; i++)
                {
                    if (neighbours[i] == hitCoreTile)
                    {
                        checker = 1;
                    }
                }

                if (checker == 0)
                {
                    return;
                }

                checker = 0;

                GameObject gameO    = GameObject.Find("game");
                string     whosTurn = gameO.GetComponent <gameController>().turn;
                Debug.Log(ourHitObject.GetComponent <core>().coreName);
                Debug.Log(whosTurn);
                if (ourHitObject.GetComponent <core>().coreName != whosTurn)
                {
                    ourHitObject.GetComponent <core>().health -= 1;

                    //all this is to turn off the lives on screen
                    GameObject coreCanvas        = GameObject.FindGameObjectWithTag("core");
                    Transform  playerCoreHealth1 = coreCanvas.transform.Find("playerCoreHealth1");
                    Transform  playerCoreHealth2 = coreCanvas.transform.Find("playerCoreHealth2");
                    Transform  playerCoreHealth3 = coreCanvas.transform.Find("playerCoreHealth3");

                    Transform enemyCoreHealth1 = coreCanvas.transform.Find("enemyCoreHealth1");
                    Transform enemyCoreHealth2 = coreCanvas.transform.Find("enemyCoreHealth2");
                    Transform enemyCoreHealth3 = coreCanvas.transform.Find("enemyCoreHealth3");

                    if (ourHitObject.GetComponent <core>().health == 2 && whosTurn == "enemy")
                    {
                        playerCoreHealth3.gameObject.SetActive(false);
                    }
                    if (ourHitObject.GetComponent <core>().health == 1 && whosTurn == "enemy")
                    {
                        playerCoreHealth2.gameObject.SetActive(false);
                    }
                    if (ourHitObject.GetComponent <core>().health == 0 && whosTurn == "enemy")
                    {
                        playerCoreHealth1.gameObject.SetActive(false);
                    }

                    if (ourHitObject.GetComponent <core>().health == 2 && whosTurn == "player")
                    {
                        enemyCoreHealth3.gameObject.SetActive(false);
                    }
                    if (ourHitObject.GetComponent <core>().health == 1 && whosTurn == "player")
                    {
                        enemyCoreHealth2.gameObject.SetActive(false);
                    }
                    if (ourHitObject.GetComponent <core>().health == 0 && whosTurn == "player")
                    {
                        enemyCoreHealth1.gameObject.SetActive(false);
                    }


                    //if health == 0, game over, player 1 wins
                    if (ourHitObject.GetComponent <core>().health == 0 && whosTurn == "player")
                    {
                        GameObject mainCanvas    = GameObject.FindGameObjectWithTag("mainCanvas");
                        Transform  gameOverText  = mainCanvas.transform.Find("GameOver/playerWins");
                        Transform  gameOverPanel = mainCanvas.transform.Find("GameOver");
                        Transform  preventsClick = mainCanvas.transform.Find("preventsClick");
                        Text       winText       = gameOverText.GetComponent <Text>();

                        preventsClick.gameObject.SetActive(true);
                        gameOverPanel.gameObject.SetActive(true);
                        winText.text = "Player 1 wins";
                    }
                    //if health == 0, game over, player 2 wins
                    else if (ourHitObject.GetComponent <core>().health == 0 && whosTurn == "enemy")
                    {
                        GameObject mainCanvas    = GameObject.FindGameObjectWithTag("mainCanvas");
                        Transform  gameOverText  = mainCanvas.transform.Find("GameOver/playerWins");
                        Transform  gameOverPanel = mainCanvas.transform.Find("GameOver");
                        Transform  preventsClick = mainCanvas.transform.Find("preventsClick");
                        Text       winText       = gameOverText.GetComponent <Text>();
                        preventsClick.gameObject.SetActive(true);
                        gameOverPanel.gameObject.SetActive(true);
                        winText.text = "Player 2 wins";
                    }



                    GameObject unit = selectedUnit.gameObject;

                    if (whosTurn == "player")
                    {
                        GameObject[] units = GameObject.Find("game").GetComponent <player>().unitObjects;
                        for (int i = 0; i < units.Length; i++)
                        {
                            if (units[i] == unit)
                            {
                                GameObject.Find("hexTile_0_0").GetComponent <Hex>().turnOffAllLights();
                                GameObject onTile = GameObject.Find("hexTile_" + units[i].GetComponent <unit>().x + "_" + units[i].GetComponent <unit>().y);
                                Debug.Log(onTile);
                                unit.GetComponent <unit>().dead    = true;
                                unit.GetComponent <unit>().x       = 999;
                                unit.GetComponent <unit>().y       = 999;
                                onTile.GetComponent <Hex>().status = "Free";
                                units[i] = null;
                                MeshRenderer onTileLight = onTile.GetComponentInChildren <MeshRenderer>();
                                onTileLight.material.color = Color.white;
                                unit.transform.position    = new Vector3(-999f, -999f, -999f);
                            }
                        }
                    }

                    if (whosTurn == "enemy")
                    {
                        GameObject[] units = GameObject.Find("enemyPlayer").GetComponent <enemy>().enemyUnits;
                        for (int i = 0; i < units.Length; i++)
                        {
                            if (units[i] == unit)
                            {
                                GameObject.Find("hexTile_0_0").GetComponent <Hex>().turnOffAllLights();
                                GameObject onTile = GameObject.Find("hexTile_" + units[i].GetComponent <unit>().x + "_" + units[i].GetComponent <unit>().y);
                                Debug.Log(onTile);
                                unit.GetComponent <unit>().dead    = true;
                                unit.GetComponent <unit>().x       = 999;
                                unit.GetComponent <unit>().y       = 999;
                                onTile.GetComponent <Hex>().status = "Free";
                                units[i] = null;
                                MeshRenderer onTileLight = onTile.GetComponentInChildren <MeshRenderer>();
                                onTileLight.material.color = Color.white;
                                unit.transform.position    = new Vector3(-999f, -999f, -999f);
                            }
                        }
                    }

                    selectedUnit = null;
                    return;
                }
            }
        }
    }
Esempio n. 25
0
			public virtual void changeState(SessionImpl s, core.SessionState newState)
			{
				throw new BEEPException("Illegal session state transition");
			}
Esempio n. 26
0
    protected override void OnPreInit(EventArgs e)
    {
        // check user
        string u_name = ""; int u_id = -1;

        if (User.Identity.IsAuthenticated)
        {
            FormsIdentity             id     = (FormsIdentity)User.Identity;
            FormsAuthenticationTicket ticket = id.Ticket;
            u_name = ticket.Name.Split(new char[] { '|' })[0];
            u_id   = int.Parse(ticket.Name.Split(new char[] { '|' })[1]);
        }

        try {
            // core
            bool reload_cfg = false;
            if (Cache["core_obj"] == null)
            {
                log.log_info("reload core");
                core cr = new core(base_path);
                reload_cfg        = true;
                Cache["core_obj"] = cr;
            }

            // configs
            _core = (core)Cache["core_obj"];
            //_core.base_url = this.base_url;
            foreach (string key in _core.config_keys)
            {
                if (Cache[key] == null)
                {
                    reload_cfg = true; break;
                }
            }
            reload_cfg = true;
            if (reload_cfg)
            {
                log.log_info("reload config docs");
                _core.reset_configs();

                // docs
                Dictionary <string, xml_doc> docs = new Dictionary <string, xml_doc>();
                Directory.EnumerateFiles(_core.app_setting("settings-folder")).ToList().ForEach(f => {
                    string doc_key = strings.rel_path(base_path, f), vars_key = Path.GetFileNameWithoutExtension(f).ToLower();
                    log.log_info("load xml config doc: " + doc_key + " - " + f);
                    docs.Add(string.Format("{0};{1};{2}", doc_key, vars_key, f), Path.GetExtension(f) != _core.app_setting("enc-ext-xml") ? new xml_doc(f)
            : new xml_doc(cry.xml_decrypt(f, _core.app_setting("pwdcr-xml"))));
                });

                // vars
                foreach (KeyValuePair <string, xml_doc> d in docs)
                {
                    try {
                        string[] keys = d.Key.Split(new char[] { ';' });
                        string   doc_key = keys[0], vars_key = keys[1], f = keys[2];
                        log.log_info("load vars doc: " + doc_key + " - " + f);
                        _core.load_base_config(d.Value, doc_key, vars_key);
                    } catch (Exception ex) { string err = ex.Message; }
                }

                // docs
                foreach (KeyValuePair <string, xml_doc> d in docs)
                {
                    try {
                        string[] keys = d.Key.Split(new char[] { ';' });
                        string   doc_key = keys[0], vars_key = keys[1], f = keys[2];
                        log.log_info("load config doc: " + doc_key + " - " + f);
                        _core.load_config(d.Value, doc_key, db_conn, new Dictionary <string, object>()
                        {
                            { "user_id", u_id }
                        }, vars_key);
                        if (Cache[doc_key] == null)
                        {
                            Cache.Insert(doc_key, true, new System.Web.Caching.CacheDependency(f));
                        }
                    } catch (Exception ex) { string err = ex.Message; }
                }

                Cache["core_obj"] = _core;
            }
        } catch (Exception ex) { throw ex; }

        // carico il config page
        string ap = abs_path, base_dir = Path.GetDirectoryName(HttpContext.Current.Server.MapPath(ap))
        , pn = Path.GetFileNameWithoutExtension(ap), xml = Path.Combine(base_dir, pn + ".xml")
        , xml_enc = Path.Combine(base_dir, pn + "." + _core.app_setting("enc-ext-xml")), dck = strings.rel_path(base_path, xml);

        xml_doc dp = null;

        if (Cache[dck] != null)
        {
            dp = (xml_doc)Cache[dck];
        }
        else
        {
            dp = File.Exists(xml) ? new xml_doc(xml) : (File.Exists(xml_enc) ?
                                                        new xml_doc(cry.xml_decrypt(xml_enc, _core.app_setting("pwdcr-xml"))) : null);
            if (dp != null)
            {
                Cache.Insert(dck, dp, new System.Web.Caching.CacheDependency(xml));
            }
        }

        if (dp != null)
        {
            _core.reset_page_config(); _core.load_page_config(dp, dck, db_conn, new Dictionary <string, object>()
            {
                { "user_id", u_id }
            });
        }

        // conn to db
        db_reconn();
    }
Esempio n. 27
0
 /// <summary>
 /// Calls this component on the server.
 /// </summary>
 /// <param name="core">The core instance to call this component with.</param>
 /// <param name="callback">An optional callback handler that will be called when the server responds.</param>
 public void callWith(core core, Action <results.Gateway.getVersion> callback = null)
 {
     core.callComponent(COMPONENT_NAME, this, wrapCallback(callback));
 }
Esempio n. 28
0
 /// <summary>
 /// Calls this component on the server.
 /// </summary>
 /// <param name="core">The core instance to call this component with.</param>
 /// <param name="callback">An optional callback handler that will be called when the server responds.</param>
 public void callWith(core core, Action <results.App.startSession> callback = null)
 {
     core.callComponent(COMPONENT_NAME, this, wrapCallback(callback));
 }
Esempio n. 29
0
        static void Main()
        {
            db_provider conn = null;

            try {
                // init
                _c = new core(AppDomain.CurrentDomain.BaseDirectory);

                // configs

                // docs
                Dictionary <string, xml_doc> docs = new Dictionary <string, xml_doc>();
                Directory.EnumerateFiles(_c.app_setting("settings-folder")).ToList().ForEach(f => {
                    string doc_key = strings.rel_path(_c.base_path, f), vars_key = Path.GetFileNameWithoutExtension(f).ToLower();
                    log.log_info("load xml config doc: " + doc_key + " - " + f);
                    docs.Add(string.Format("{0};{1};{2}", doc_key, vars_key, f), new xml_doc(f));
                });

                // vars
                foreach (KeyValuePair <string, xml_doc> d in docs)
                {
                    string[] keys = d.Key.Split(new char[] { ';' });
                    string   doc_key = keys[0], vars_key = keys[1], f = keys[2];
                    log.log_info("load vars doc: " + doc_key + " - " + f);
                    _c.load_base_config(d.Value, doc_key, vars_key);
                }

                // conn
                conn = open_conn();

                // docs
                foreach (KeyValuePair <string, xml_doc> d in docs)
                {
                    string[] keys = d.Key.Split(new char[] { ';' });
                    string   doc_key = keys[0], vars_key = keys[1], f = keys[2];
                    log.log_info("load config doc: " + doc_key + " - " + f);
                    _c.load_config(d.Value, doc_key, conn, vars_key: vars_key);
                }

                // opened client
                conn.close_conn(); conn = null;

                // data providers
                //string l = "";
                //foreach (DataRow dr in DbProviderFactories.GetFactoryClasses().Rows)
                //  l += "\n - " + string.Join(", ", dr.Table.Columns.Cast<DataColumn>().Select(
                //    col => dr[col.ColumnName] != DBNull.Value ? col.ColumnName + ": " + dr[col.ColumnName].ToString() : ""));

                // test
                //try {
                //  string cmd = @"C:\_todd\git\dn\dn_client\bin\Debug\att\1340_queries.sql.sql";
                //  Process.Start(new System.Diagnostics.ProcessStartInfo("cmd", "/c \"" + cmd + "\"") {
                //    RedirectStandardOutput = true, UseShellExecute = false, CreateNoWindow = true
                //  });
                //  Process.Start(new System.Diagnostics.ProcessStartInfo("explorer", "\"" + cmd + "\"") {
                //    RedirectStandardOutput = true, UseShellExecute = false, CreateNoWindow = true
                //  });
                //  return;
                //} catch (Exception ex) { MessageBox.Show(ex.Message); }

                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new frm_main(_c));
            } catch (Exception ex) {
                MessageBox.Show(ex.Message, "Attenzione!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                if (conn != null)
                {
                    conn.close_conn();
                }
            }
        }
Esempio n. 30
0
		public VisualControl(core.controls.VisualControlInfo vci) : this()
		{
			VisualControlInfo = vci;
		}
 public Allmethod(core _c)
 {
     c = _c;
 }
Esempio n. 32
0
 private void Log_NewMessage(core.Models.MessageLogModel message)
 {
     GCore.Log.Write(message);
 }
Esempio n. 33
0
 public void disableColumn(core.domain.Track.Property columnName)
 {
     this.addDisabledColumn(columnName.ToString());
 }
 /// <summary>
 /// Logs a referral event to the server and opens the URL.
 /// </summary>
 /// <param name="core">The core instance used to log the referral.</param>
 /// <param name="open_in_new_tab">This is WebGL specific. If true, the user will be prompted to load the URL in a new browser tab. This is necessary to get around popup blockers.</param>
 /// <param name="callback">An optional callback action to call when the URL has been loaded.</param>
 public void openUrlWith(core core, bool open_in_new_tab = false, Action <LoaderResult> callback = null)
 {
     _doOpenUrlWith(COMPONENT_NAME, core, open_in_new_tab, callback);
 }
Esempio n. 35
0
 static void Main(string[] args)
 {
     Console.WriteLine("Hello World!");
     core cpu = new core();
 }
Esempio n. 36
0
 public DataTable dt_qry(config.query qry, core cr, Dictionary <string, object> flds = null)
 {
     return(dt_table(cr.parse(qry.text, flds)));
 }
 /// <summary>
 /// Adds this component to the call Queue of the specified core object.
 /// Use core.executeQueuedComponents() to call this queued component on the server.
 /// </summary>
 /// <param name="core">The core instance to queue this component to.</param>
 /// <param name="callback">An optional callback handler that will be called when the server responds.</param>
 public void queueWith(core core, Action <results.ScoreBoard.postScore> callback = null)
 {
     core.queueComponent(COMPONENT_NAME, this, wrapCallback(callback));
 }
 /// <summary>
 /// Calls this component on the server.
 /// </summary>
 /// <param name="core">The core instance to call this component with.</param>
 /// <param name="callback">An optional callback handler that will be called when the server responds.</param>
 public void callWith(core core, Action <results.ScoreBoard.getScores> callback = null)
 {
     core.callComponent(COMPONENT_NAME, this, wrapCallback(callback));
 }
Esempio n. 39
0
			public virtual void  changeState(SessionImpl s, core.SessionState newState)
			{
				if (newState == core.SessionState.SESSION_STATE_ABORTED)
				{
					log.info("Error aborting, session already in a closed state.");
				}
				else if (newState == core.SessionState.SESSION_STATE_CLOSE_PENDING)
				{
					log.info("Error changing state to close pending, session already in a closed state.");
				}
				else
				{
					throw new BEEPException("Illegal session state transition (" + newState + ")");
				}
			}
Esempio n. 40
0
 public Allquery(core _c)
 {
     c = _c;
 }
Esempio n. 41
0
		internal virtual void changeState(core.SessionState newState)
		{
			lock (this)
			{
				try
				{
					ops[(int)state].changeState(this, newState);
				}
				catch (BEEPException e)
				{
					Console.Error.WriteLine(e.ToString());
					throw e;
				}
				
				if (log.isDebugEnabled())
				{
					log.debug("State changed to " + newState);
				}
			}
		}
Esempio n. 42
0
 /// <summary>
 /// Adds this component to the call Queue of the specified core object.
 /// Use core.executeQueuedComponents() to call this queued component on the server.
 /// </summary>
 /// <param name="core">The core instance to queue this component to.</param>
 /// <param name="callback">An optional callback handler that will be called when the server responds.</param>
 public void queueWith(core core, Action <results.Event.logEvent> callback = null)
 {
     core.queueComponent(COMPONENT_NAME, this, wrapCallback(callback));
 }
Esempio n. 43
0
 public config(core cr)
 {
     _core = cr;
 }
Esempio n. 44
0
 public void fadeOutColumn(core.domain.Track.Property columnName)
 {
     this.addFadedColumn(columnName.ToString());
 }
 public override void Load(odm.core.INvtSession session, string chanToken, string profileToken, core.Account account, core.IVideoInfo videoInfo) {
     Current = States.Common;
 }