コード例 #1
0
        /// <summary>
        /// Configure a control with the configuration node path
        /// </summary>
        /// <param name="object_guid"></param>
        /// <param name="config_path"></param>
        public void ConfigureControl(String control_guid, params String[] config_path)
        {
            CtrlStruct cStr = getCtrlStruct(control_guid);

            JToken jConfig = cStr.config;

            foreach (String cfg_node in config_path)
            {
                jConfig = jConfig[cfg_node];
            }
            object o = cStr.ctrl;

            set_properties(ref o, jConfig);
        }
コード例 #2
0
        /// <summary>
        /// Destroy current view with her controls
        /// </summary>
        public void Free()
        {
            FLAG_VISTA_ACTIVA = 2;

            recursively_remove_controls(mainControl());

            while (ctrls.Keys.Count > 0)
            {
                CtrlStruct ctrlstr = ctrls.Values.ElementAt(0);
                RemoveControl(ctrlstr.control_name);
            }

            vars.Clear();
        }
コード例 #3
0
        /// <summary>
        /// Remove all controls from controls struct with that guid
        /// </summary>
        /// <param name="control_guid"></param>
        public void RemoveControl(String control_guid)
        {
            if (ctrls.Keys.Contains(control_guid))
            {
                // get first control with that guid
                CtrlStruct cstr = ctrls[control_guid];

                // clear vars
                cstr.vars.Clear();

                // remove it from parent control
                if (cstr.ctrl is Form)
                {
                    ((Form)cstr.ctrl).Close();
                }
                cstr.ctrl.Dispose();
                // remove from controls struct
                ctrls.Remove(control_guid);
            }
        }
コード例 #4
0
        /// <summary>
        /// Remove all controls from controls struct with that guid
        /// </summary>
        /// <param name="control_guid"></param>
        public void RemoveControl(String control_guid)
        {
            if (ctrls.Keys.Contains(control_guid))
            {
                // get first control with that guid
                CtrlStruct cstr = ctrls[control_guid];

                // clear vars
                cstr.vars.Clear();

                // remove it from parent control
                Control cparent = cstr.ctrl.Parent;
                if (cparent != null)
                {
                    cparent.Controls.Remove(cstr.ctrl);
                }

                // remove from controls struct
                ctrls.Remove(control_guid);
            }
        }