Beispiel #1
0
        public Editor()
        {
            InitializeComponent();
            TheEditor = this;

            MemberCache.Import();
            SetUpPanels();

            this.Text += ' ' + Program.getVersion() + " (" + IBMi.CurrentSystem.GetValue("alias") + ")";
            if (!IBMi.IsConnected())
            {
                this.Text += " - Offline Mode";
            }

            if (IBMi.IsConnected())
            {
                if (IBMi.CurrentSystem.GetValue("lastOffline") == "true")
                {
                    DialogResult result = MessageBox.Show("Looks like your last session was in Offline Mode. Would you like the launch the SPF Push tool?", "Notice", MessageBoxButtons.YesNo, MessageBoxIcon.Information);

                    if (result == DialogResult.Yes)
                    {
                        new PushWindow().ShowDialog();
                    }
                }
            }
            IBMi.CurrentSystem.SetValue("lastOffline", (IBMi.IsConnected() == false).ToString().ToLower());
        }
Beispiel #2
0
        private void IFSBrowser_Load(object sender, EventArgs e)
        {
            Boolean  exists;
            TreeNode node;

            if (IBMi.IsConnected())
            {
                new Thread((ThreadStart) delegate
                {
                    exists = IBMi.DirExists(RootDirectory);
                    this.Invoke((MethodInvoker) delegate
                    {
                        if (exists)
                        {
                            node                    = new TreeNode(RootDirectory, new[] { new TreeNode("Loading..", 2, 2) });
                            node.Tag                = RootDirectory;
                            node.ImageIndex         = 0;
                            node.SelectedImageIndex = 0;
                            files.Nodes.Add(node);
                        }
                        else
                        {
                            files.Nodes.Add(new TreeNode("Home directory (" + RootDirectory + ") does not exist.", 3, 3));
                        }
                    });
                }).Start();
            }
            else
            {
                files.Nodes.Add(new TreeNode("IFS Browsing only works when connected to the remote system.", 3, 3));
            }
        }
Beispiel #3
0
        public Editor()
        {
            InitializeComponent();
            TheEditor = this;

            MemberCache.Import();

            this.Text += ' ' + Program.getVersion() + " (" + IBMi.CurrentSystem.GetValue("alias") + ")";
            if (!IBMi.IsConnected())
            {
                this.Text += " - Offline Mode";
            }

            if (IBMi.IsConnected())
            {
                if (IBMi.CurrentSystem.GetValue("lastOffline") == "true")
                {
                    DialogResult result = MessageBox.Show("Looks like your last session was in Offline Mode. Would you like the launch the SPF Push tool?", "Notice", MessageBoxButtons.YesNo, MessageBoxIcon.Information);

                    if (result == DialogResult.Yes)
                    {
                        new Forms.PushWindow().ShowDialog();
                    }
                }
            }

            IBMi.CurrentSystem.SetValue("lastOffline", (IBMi.IsConnected() == false).ToString().ToLower());

            DarkMode = (Program.Config.GetValue("darkmode") == "true");

            if (DarkMode)
            {
                dockingPanel.Theme = new VS2015DarkTheme();
            }
            else
            {
                dockingPanel.Theme = new VS2015LightTheme();
            }

            ApplyControlTheme(toolStrip);
            ApplyControlTheme(menuStrip);
            ApplyControlTheme(statusStrip);

            if (File.Exists(Program.PanelsXML))
            {
                dockingPanel.LoadFromXml(Program.PanelsXML, new DeserializeDockContent(GetContentFromPersistString));
            }
            else
            {
                AddTool(new UserTools.UserToolList(), DockState.DockLeft, true);
            }

            AddTool(new UserTools.Welcome(), DockState.Document, true);

            Tasklist = new UserTools.TaskList();

            AddTool(Tasklist, DockState.DockBottomAutoHide, true);

            dockingPanel.ActiveContentChanged += DockingPanel_ActiveContentChanged;
        }
Beispiel #4
0
 private void PushWindow_Load(object sender, EventArgs e)
 {
     if (!IBMi.IsConnected())
     {
         MessageBox.Show("The SPF Push tool does not work in Offline Mode.");
         this.Close();
     }
 }
Beispiel #5
0
        public void Reload()
        {
            Boolean       exists;
            TreeNode      node;
            List <string> DirList = new List <string>();

            files.Nodes.Clear();
            if (IBMi.IsConnected())
            {
                new Thread((ThreadStart) delegate
                {
                    DirList.Add(IBMi.CurrentSystem.GetValue("homeDir"));
                    foreach (string dir in IBMi.CurrentSystem.GetValue("IFS_LINKS").Split('|'))
                    {
                        if (dir.Trim() != "")
                        {
                            DirList.Add(dir);
                        }
                    }

                    foreach (string dir in DirList)
                    {
                        if (dir.Trim() != "")
                        {
                            if (dir.Trim() == "")
                            {
                                continue;
                            }

                            exists = IBMi.DirExists(dir);
                            this.Invoke((MethodInvoker) delegate
                            {
                                if (exists)
                                {
                                    node                    = new TreeNode(dir, new[] { new TreeNode("Loading..", 2, 2) });
                                    node.Tag                = dir;
                                    node.ImageIndex         = 0;
                                    node.SelectedImageIndex = 0;
                                    files.Nodes.Add(node);
                                }
                                else
                                {
                                    files.Nodes.Add(new TreeNode("Directory '" + dir + "' was not located.", 3, 3));
                                }
                            });
                        }
                    }
                }).Start();
            }
            else
            {
                files.Nodes.Add(new TreeNode("IFS Browsing only works when connected to the remote system.", 3, 3));
            }
        }
Beispiel #6
0
        public Editor()
        {
            InitializeComponent();
            TheEditor = this;

            MemberCache.Import();

            this.Text += ' ' + Program.getVersion() + " (" + IBMi.CurrentSystem.GetValue("alias") + ")";
            if (!IBMi.IsConnected())
            {
                this.Text += " - Offline Mode";
            }

            if (IBMi.IsConnected())
            {
                if (IBMi.CurrentSystem.GetValue("lastOffline") == "true")
                {
                    DialogResult result = MessageBox.Show("Looks like your last session was in Offline Mode. Would you like the launch the SPF Push tool?", "Notice", MessageBoxButtons.YesNo, MessageBoxIcon.Information);

                    if (result == DialogResult.Yes)
                    {
                        new Forms.PushWindow().ShowDialog();
                    }
                }
            }

            IBMi.CurrentSystem.SetValue("lastOffline", (IBMi.IsConnected() == false).ToString().ToLower());

            if (Program.Config.GetValue("darkmode") == "true")
            {
                dockingPanel.Theme = new VS2015DarkTheme();
            }
            else
            {
                dockingPanel.Theme = new VS2015LightTheme();
            }

            AddTool(new UserTools.Welcome());
            AddTool(new UserTools.UserToolList(), DockState.DockLeft);

            OutlineView = new UserTools.OutlineView();
            AddTool(OutlineView, DockState.DockRightAutoHide);
        }
Beispiel #7
0
        private void create_Click(object sender, EventArgs e)
        {
            bool isValid = true;

            lib.Text = lib.Text.Trim();
            spf.Text = spf.Text.Trim();

            if (!IBMiUtils.IsValueObjectName(lib.Text))
            {
                isValid = false;
            }
            if (!IBMiUtils.IsValueObjectName(spf.Text))
            {
                isValid = false;
            }

            if (isValid)
            {
                if (IBMi.IsConnected())
                {
                    string cmd = "CRTSRCPF FILE(" + lib.Text + "/" + spf.Text + ") RCDLEN(" + rcdLen.Value.ToString() + ") CCSID(" + ccsid.Text + ")";
                    if (IBMi.RemoteCommand(cmd) == false)
                    {
                        Editor.TheEditor.AddTool("Member Browse", new MemberBrowse(lib.Text, spf.Text));
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show(lib.Text.Trim() + "/" + spf.Text.Trim() + " not created.");
                    }
                }
                else
                {
                    Directory.CreateDirectory(IBMiUtils.GetLocalDir(lib.Text, spf.Text));
                    Editor.TheEditor.AddTool("Member Browse", new MemberBrowse(lib.Text, spf.Text));
                }
            }
            else
            {
                MessageBox.Show("SPF information not valid.");
            }
        }
Beispiel #8
0
        private void IFSBrowser_Load(object sender, EventArgs e)
        {
            Boolean  exists;
            TreeNode node;

            if (IBMi.IsConnected())
            {
                new Thread((ThreadStart) delegate
                {
                    foreach (string dir in DirList)
                    {
                        if (dir.Trim() == "")
                        {
                            continue;
                        }

                        exists = IBMi.DirExists(dir);
                        this.Invoke((MethodInvoker) delegate
                        {
                            if (exists)
                            {
                                node                    = new TreeNode(dir, new[] { new TreeNode("Loading..", 2, 2) });
                                node.Tag                = dir;
                                node.ImageIndex         = 0;
                                node.SelectedImageIndex = 0;
                                files.Nodes.Add(node);
                            }
                            else
                            {
                                files.Nodes.Add(new TreeNode("Directory '" + dir + "' was not located.", 3, 3));
                            }
                        });
                    }
                }).Start();
            }
            else
            {
                files.Nodes.Add(new TreeNode("IFS Browsing only works when connected to the remote system.", 3, 3));
            }
        }
Beispiel #9
0
        private void create_Click(object sender, EventArgs e)
        {
            Boolean isValid = true;
            string  Command = "", Local;

            if (!IBMiUtils.IsValueObjectName(lib.Text))
            {
                isValid = false;
            }
            if (!IBMiUtils.IsValueObjectName(spf.Text))
            {
                isValid = false;
            }
            if (!IBMiUtils.IsValueObjectName(mbr.Text))
            {
                isValid = false;
            }

            if (isValid)
            {
                _lib  = lib.Text.Trim();
                _spf  = spf.Text.Trim();
                _mbr  = mbr.Text.Trim();
                _type = (type.Text.Trim() == "" ? "*NONE" : type.Text.Trim());
                if (IBMi.IsConnected())
                {
                    _text = (text.Text.Trim() == "" ? "*BLANK" : "'" + text.Text.Trim() + "'");

                    Command = "ADDPFM FILE(" + _lib + "/" + _spf + ") MBR(" + _mbr + ") TEXT(" + _text + ") SRCTYPE(" + _type + ")";
                    if (IBMi.RemoteCommand(Command)) //No error
                    {
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Member not created.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
                else
                {
                    if (_type == "*NONE")
                    {
                        _type = "";
                    }
                    Local = IBMiUtils.GetLocalFile(_lib, _spf, _mbr, _type);

                    if (!File.Exists(Local))
                    {
                        File.Create(Local).Close();
                        created = true;
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Local member not created as already exists.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
            }
            else
            {
                MessageBox.Show("Provided member information not valid.", "Invalid member.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }