Beispiel #1
0
        public void AddBindingList(string Lib, string Obj)
        {
            string  pageName   = Lib + "/" + Obj + " Binding Directory";
            OpenTab currentTab = EditorContains(pageName);

            //Close tab if it already exists.
            if (currentTab != null)
            {
                switch (currentTab.getSide())
                {
                case OpenTab.TAB_SIDE.Left:
                    editortabsleft.TabPages.RemoveAt(currentTab.getIndex());
                    break;

                case OpenTab.TAB_SIDE.Right:
                    editortabsright.TabPages.RemoveAt(currentTab.getIndex());
                    break;
                }
            }

            TabPage tabPage = new TabPage(pageName);

            tabPage.ImageIndex = 1;
            BindingDirectory bnddirlist = new BindingDirectory(Lib, Obj);

            bnddirlist.BringToFront();
            bnddirlist.Dock = DockStyle.Fill;
            tabPage.Controls.Add(bnddirlist);
            editortabsleft.TabPages.Add(tabPage);

            SwitchToTab(OpenTab.TAB_SIDE.Left, editortabsleft.TabPages.Count - 1);
        }
Beispiel #2
0
        public void AddSourceEditor(RemoteSource SourceInfo, Language Language = Language.None)
        {
            string pageName = "";

            switch (SourceInfo.GetFS())
            {
            case FileSystem.QSYS:
                pageName = SourceInfo.GetLibrary() + "/" + SourceInfo.GetObject() + "(" + SourceInfo.GetName() + ")";
                break;

            case FileSystem.IFS:
                pageName = SourceInfo.GetName() + "." + SourceInfo.GetExtension();
                break;
            }

            OpenTab currentTab = EditorContains(pageName);

            if (File.Exists(SourceInfo.GetLocalFile()))
            {
                //Close tab if it already exists.
                if (currentTab != null)
                {
                    switch (currentTab.getSide())
                    {
                    case OpenTab.TAB_SIDE.Left:
                        editortabsleft.TabPages.RemoveAt(currentTab.getIndex());
                        break;

                    case OpenTab.TAB_SIDE.Right:
                        editortabsright.TabPages.RemoveAt(currentTab.getIndex());
                        break;
                    }
                }

                TabPage tabPage = new TabPage(pageName);
                tabPage.ImageIndex  = 0;
                tabPage.ToolTipText = pageName;
                SourceEditor srcEdit = new SourceEditor(SourceInfo.GetLocalFile(), Language, SourceInfo.GetRecordLength());
                srcEdit.SetReadOnly(!SourceInfo.IsEditable());
                srcEdit.BringToFront();
                srcEdit.Dock = DockStyle.Fill;
                srcEdit.Tag  = SourceInfo;

                tabPage.Tag = SourceInfo;
                tabPage.Controls.Add(srcEdit);
                editortabsleft.TabPages.Add(tabPage);

                SwitchToTab(OpenTab.TAB_SIDE.Left, editortabsleft.TabPages.Count - 1);
            }
            else
            {
                MessageBox.Show("There was an error opening the local member. '" + SourceInfo.GetLocalFile() + "' does not exist");
            }
        }
Beispiel #3
0
        public SourceEditor GetTabEditor(OpenTab Tab)
        {
            switch (Tab.getSide())
            {
            case OpenTab.TAB_SIDE.Left:
                return((SourceEditor)editortabsleft.TabPages[Tab.getIndex()].Controls[0]);

            case OpenTab.TAB_SIDE.Right:
                return((SourceEditor)editortabsright.TabPages[Tab.getIndex()].Controls[0]);
            }
            return(null);
        }
Beispiel #4
0
        private void moveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            switch (RightClickedTab.getSide())
            {
            case OpenTab.TAB_SIDE.Left:
                editortabsright.TabPages.Add(editortabsleft.TabPages[RightClickedTab.getIndex()]);
                break;

            case OpenTab.TAB_SIDE.Right:
                editortabsleft.TabPages.Add(editortabsright.TabPages[RightClickedTab.getIndex()]);
                break;
            }
        }
Beispiel #5
0
        private void AddMemberEditor(Member MemberInfo, ILELanguage Language = ILELanguage.None)
        {
            string  pageName   = MemberInfo.GetLibrary() + "/" + MemberInfo.GetObject() + "(" + MemberInfo.GetMember() + ")";
            OpenTab currentTab = EditorContains(pageName);

            if (File.Exists(MemberInfo.GetLocalFile()))
            {
                //Close tab if it already exists.
                if (currentTab != null)
                {
                    switch (currentTab.getSide())
                    {
                    case OpenTab.TAB_SIDE.Left:
                        editortabsleft.TabPages.RemoveAt(currentTab.getIndex());
                        break;

                    case OpenTab.TAB_SIDE.Right:
                        editortabsright.TabPages.RemoveAt(currentTab.getIndex());
                        break;
                    }
                }

                TabPage tabPage = new TabPage(pageName);
                tabPage.ImageIndex  = 0;
                tabPage.ToolTipText = MemberInfo.GetLibrary() + "/" + MemberInfo.GetObject() + "(" + MemberInfo.GetMember() + ")";
                SourceEditor srcEdit = new SourceEditor(MemberInfo.GetLocalFile(), Language, MemberInfo.GetRecordLength());
                srcEdit.SetReadOnly(!MemberInfo.IsEditable());
                srcEdit.BringToFront();
                srcEdit.Dock = DockStyle.Fill;
                srcEdit.Tag  = MemberInfo;

                tabPage.Tag = MemberInfo;
                tabPage.Controls.Add(srcEdit);
                editortabsleft.TabPages.Add(tabPage);

                SwitchToTab(OpenTab.TAB_SIDE.Left, editortabsleft.TabPages.Count - 1);
            }
            else
            {
                MessageBox.Show("There was an error opening the local member. '" + MemberInfo.GetLocalFile() + "' does not exist");
            }
        }
Beispiel #6
0
        private void AddFileEditor(string FilePath, Language Language)
        {
            string  pageName   = Path.GetFileName(FilePath);
            OpenTab currentTab = EditorContains(pageName);

            if (File.Exists(FilePath))
            {
                if (currentTab != null)
                {
                    switch (currentTab.getSide())
                    {
                    case OpenTab.TAB_SIDE.Left:
                        editortabsleft.TabPages.RemoveAt(currentTab.getIndex());
                        break;

                    case OpenTab.TAB_SIDE.Right:
                        editortabsright.TabPages.RemoveAt(currentTab.getIndex());
                        break;
                    }
                }

                TabPage tabPage = new TabPage(pageName);
                tabPage.ImageIndex  = 0;
                tabPage.ToolTipText = pageName;
                SourceEditor srcEdit = new SourceEditor(FilePath, Language);
                srcEdit.BringToFront();
                srcEdit.Dock = DockStyle.Fill;
                srcEdit.Tag  = null;

                tabPage.Tag = null;
                tabPage.Controls.Add(srcEdit);
                editortabsleft.TabPages.Add(tabPage);

                SwitchToTab(OpenTab.TAB_SIDE.Left, editortabsleft.TabPages.Count - 1);
            }
        }