コード例 #1
0
        /// #NAME#: #DESCRIPTION#
        public void f_Abrir_ventana_principal()
        {
            //INI CODE PRCGUID: Abrir ventana principal

            String ventana = (Config_str_nullable("-ventana") != "") ? Config_str("-ventana") : Input_str("-ventana");

            CView cventana = vm.getFirstView(ventana);

            if (cventana != null)
            {
                try
                {
                    cventana.mainControl().Show();
                }
                catch (Exception exc)
                {
                    errors.warning = exc.Message;
                    vm.freeView(cventana.Name);

                    cventana = vm.AddView(ventana);
                    cventana.mainControl().Show();
                }
            }
            else
            {
                cventana = vm.AddView(ventana);
                cventana.mainControl().Show();
            }
            //END CODE PRCGUID: Abrir ventana principal
        }
コード例 #2
0
        CView.CtrlStruct fireCtrl_str; // Controls struct who fire the event
        #endregion

        #region initialize

        /// <summary>
        /// Load all information from UI to work with
        /// </summary>
        /// <param name="viewManager"></param>
        /// <param name="eventDesc"></param>
        public CLogic(CSystem csystem, CViewsManager views_manager, CEventDesc eventDesc)
        {
            sys        = csystem;
            vm         = views_manager;
            Globals    = sys.Globals;
            errors     = sys.ProgramErrors;
            debug      = sys.ProgramDebug;
            event_desc = eventDesc;
            if (event_desc != null)
            {
                view = (event_desc.View_Guid != "") ? vm.getFirstView_byGuid(event_desc.View_Guid) : null;
                if (view != null)
                {
                    mainCtrl     = view.mainControl();
                    fireCtrl_str = view.getCtrlStruct(eventDesc.Control_Name);
                }
                fireCtrl = (Control)event_desc.fireCtrl;
                args     = event_desc.args;
            }
            MainView = ((view != null) && (Globals.get_str(dGLOBALS.MAIN_VIEW) == view.Name)) ? view : vm.getFirstView(Globals.get_str(dGLOBALS.MAIN_VIEW));
        }
コード例 #3
0
        /// <summary>
        /// Copy from relative path, create folders in destinity if not exists
        /// </summary>
        /// <param name="target_path"></param>
        /// <param name="source_full_path"></param>
        /// <param name="source_relative_path"></param>
        private void copy_from_relative_path(String target_path, FileInfo source_full_path, String source_relative_path)
        {
            String target_full_path = target_path;

            foreach (String folder in source_relative_path.Split(new char[] { '\\' }, StringSplitOptions.RemoveEmptyEntries))
            {
                if ((!folder.EndsWith(".cs")) && (!folder.EndsWith(".resx")))
                {
                    target_full_path = Path.Combine(target_full_path, folder);
                    if (!Directory.Exists(target_full_path))
                    {
                        Directory.CreateDirectory(target_full_path);
                    }
                }
            }
            target_full_path = Path.Combine(target_full_path, source_full_path.Name);

            #region Insert into VS project file

            String view_name = source_relative_path.Replace(".cs", "").Replace("\\", ".").Substring(1);
            source_relative_path = dEXPORTCODE.VS_PJ_UI_PATH + source_relative_path;
            // Add node if not founded else remove from pj_compile list
            if (!pj_views_compile_items.ContainsKey(source_relative_path))
            {
                #region Add View map file
                if (source_relative_path.EndsWith(dEXPORTCODE.VIEW_MAP_CS_SUFIX))
                {
                    XmlNode      xnode = x_pj.CreateNode(XmlNodeType.Element, dEXPORTCODE.VS_PJ_ITEM_COMPILE, null);
                    XmlAttribute xatt  = x_pj.CreateAttribute(dEXPORTCODE.VS_PJ_ATT_INCLUDE);
                    xatt.Value = source_relative_path;
                    xnode.Attributes.Append(xatt);
                    x_item_group.AppendChild(xnode);
                    changes_in_pj = true;
                }
                #endregion
                #region Add Designer file
                else if (source_relative_path.EndsWith(dEXPORTCODE.VS_PJ_DESIGNER_SUF))
                {
                    XmlNode xsubnode       = x_pj.CreateNode(XmlNodeType.Element, dEXPORTCODE.VS_PJ_ITEM_COMPILE_DEP, null);
                    XmlNode xsubnode_value = x_pj.CreateNode(XmlNodeType.Text, dEXPORTCODE.VS_PJ_ITEM_COMPILE_DEP, null);
                    xsubnode_value.Value = source_full_path.Name.Replace(dEXPORTCODE.VS_PJ_DESIGNER_SUF, ".cs");
                    xsubnode.AppendChild(xsubnode_value);
                    XmlNode      xnode = x_pj.CreateNode(XmlNodeType.Element, dEXPORTCODE.VS_PJ_ITEM_COMPILE, null);
                    XmlAttribute xatt  = x_pj.CreateAttribute(dEXPORTCODE.VS_PJ_ATT_INCLUDE);
                    xatt.Value = source_relative_path;
                    xnode.Attributes.Append(xatt);
                    xnode.AppendChild(xsubnode);
                    x_item_group.AppendChild(xnode);
                    changes_in_pj = true;
                }
                #endregion
                #region Add View code file
                else if (source_relative_path.EndsWith(".cs"))
                {
                    CView   tview          = new CView(new CGlobals(APP_PATH), view_name);
                    XmlNode xsubnode       = x_pj.CreateNode(XmlNodeType.Element, dEXPORTCODE.VS_PJ_ITEM_COMPILE_SUBTYPE, null);
                    XmlNode xsubnode_value = x_pj.CreateNode(XmlNodeType.Text, dEXPORTCODE.VS_PJ_ITEM_COMPILE_SUBTYPE, null);
                    xsubnode_value.Value = (tview.mainControl() is System.Windows.Forms.Form) ? "Form" : "UserControl";
                    xsubnode.AppendChild(xsubnode_value);
                    XmlNode      xnode = x_pj.CreateNode(XmlNodeType.Element, dEXPORTCODE.VS_PJ_ITEM_COMPILE, null);
                    XmlAttribute xatt  = x_pj.CreateAttribute(dEXPORTCODE.VS_PJ_ATT_INCLUDE);
                    xatt.Value = source_relative_path;
                    xnode.Attributes.Append(xatt);
                    xnode.AppendChild(xsubnode);
                    x_item_group.AppendChild(xnode);
                    changes_in_pj = true;
                }
                #endregion
            }
            else
            {
                pj_views_compile_items.Remove(source_relative_path);
            }
            #endregion

            File.Copy(source_full_path.FullName, target_full_path, true);
        }