예제 #1
0
        /// <summary>
        /// Create test form
        /// </summary>
        /// <param name="identifier">form identifier</param>
        /// <returns>test form</returns>
        /// 
        private static Form CreateDockForm(Guid identifier, DBTableControl dbTables, SQLTable x_tbl, TableDockingForm pParentForm, wRect wrect, ViewXml xViewXml,NavigationButtons.Navigation xnav)
        {
            if (identifier == new Guid(guid.gDocking_TableGrid_Form.ToByteArray()))
            {
                DataTable_Form result = new DataTable_Form(dbTables, x_tbl, DataTable_Form.DataTable_Form_ENUM.EDIT_OR_DELETE, pParentForm);
                result.Bounds = new Rectangle(wrect.Left, wrect.Top, wrect.Width, wrect.Height);
                return result;
            }
            else if (identifier == new Guid(guid.gDocking_EditTable_Form.ToByteArray()))
            {
                EditTable_Form result = new EditTable_Form(dbTables, x_tbl, pParentForm,SetControls,false,xnav);
                result.Bounds = new Rectangle(wrect.Left, wrect.Top, wrect.Width, wrect.Height);
                return result;
            }
            else if (identifier == new Guid(guid.gDocking_CreateView_Form.ToByteArray()))
            {
                CreateView_Form result = new CreateView_Form(dbTables, x_tbl, pParentForm, xnav);
                result.Bounds = new Rectangle(wrect.Left, wrect.Top, wrect.Width, wrect.Height);
                return result;
            }
            else
            {
                for (int i = 0; i < guid.MaxTableViews; i++)
                {
                    if (identifier == new Guid(guid.gDocking_TableView_Form[i].ToByteArray()))
                    {
                        TableView_Form result = new TableView_Form(i, dbTables, x_tbl, pParentForm, xViewXml);
                        result.Bounds = new Rectangle(wrect.Left, wrect.Top, wrect.Width, wrect.Height);
                        return result;
                    }
                }
            }

            throw new InvalidOperationException();
        }
예제 #2
0
파일: xml.cs 프로젝트: dstrucl/Tangenta40
 internal void Set_wRect(wRect wRect, Form myForm)
 {
     wRect.formWindowState= myForm.WindowState;
     if (myForm.WindowState== FormWindowState.Normal)
     {
         wRect.Left = myForm.Left;
         wRect.Top = myForm.Top;
         wRect.Width = myForm.Width;
         wRect.Height = myForm.Height;
     }
 }
예제 #3
0
파일: xml.cs 프로젝트: dstrucl/Tangenta40
        internal static void Set_wRect(wRect wrect, XmlDocument xmlDoc, XmlElement element)
        {
            XmlAttribute attrFormWindowState= xmlDoc.CreateAttribute(wRect.const_FormWindowState);
            attrFormWindowState.Value = wrect.GetWindowCountryString(wrect.formWindowState);
            element.Attributes.Append(attrFormWindowState);

            XmlAttribute attrLeft = xmlDoc.CreateAttribute(wRect.const_Left);
            attrLeft.Value = wrect.Left.ToString();
            element.Attributes.Append(attrLeft);

            XmlAttribute attrTop = xmlDoc.CreateAttribute(wRect.const_Top);
            attrTop.Value = wrect.Left.ToString();
            element.Attributes.Append(attrTop);

            XmlAttribute attrWidth = xmlDoc.CreateAttribute(wRect.const_Width);
            attrWidth.Value = wrect.Width.ToString();
            element.Attributes.Append(attrWidth);

            XmlAttribute attrHeight = xmlDoc.CreateAttribute(wRect.const_Height); ;
            attrHeight.Value = wrect.Height.ToString();
            element.Attributes.Append(attrHeight);
        }
예제 #4
0
파일: xml.cs 프로젝트: dstrucl/Tangenta40
 public xml(string Folder, string RootName,Form MainForm)
 {
     wrect = new wRect(DefWindowPos.MainForm_Left, DefWindowPos.MainForm_Top, DefWindowPos.MainForm_Width, DefWindowPos.MainForm_Height);
     const_Root = RootName;
     int l = Folder.Length;
     if (l > 0)
     {
         if (Folder[l - 1] == '\\')
         {
             StaticXml.m_XMLFile = Folder + const_Root + ".xml";
         }
         else
         {
             StaticXml.m_XMLFile = Folder + "\\" + const_Root + ".xml";
         }
     }
     else
     {
         StaticXml.m_XMLFile = null;
         MessageBox.Show(lngRPM.s_XMLFolderIsNotDefined.s, lngRPM.s_Warning.s, MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
예제 #5
0
파일: xml.cs 프로젝트: dstrucl/Tangenta40
 internal static void Get_wRect(ref wRect wrect, XmlAttributeCollection attrcollection)
 {
     foreach (XmlAttribute attr in attrcollection)
     {
         if (attr.Name.Equals(wRect.const_FormWindowState))
         {
             wrect.formWindowState= wrect.SetFormWindowState(attr.Value);
         }
         else if (attr.Name.Equals(wRect.const_Left))
         {
             wrect.Left = Convert.ToInt32(attr.Value);
         }
         else if (attr.Name.Equals(wRect.const_Top))
         {
             wrect.Top = Convert.ToInt32(attr.Value);
         }
         else if (attr.Name.Equals(wRect.const_Width))
         {
             wrect.Width = Convert.ToInt32(attr.Value);
         }
         else if (attr.Name.Equals(wRect.const_Height))
         {
             wrect.Height = Convert.ToInt32(attr.Value);
         }
     }
 }