Exemplo n.º 1
0
            public override void OnClick(SourceGrid2.PositionEventArgs e)
            {
                base.OnClick(e);
                ImportsGrid g = (ImportsGrid)e.Grid;

                g.FileDialog(e);
            }
Exemplo n.º 2
0
            public override void OnClick(SourceGrid2.PositionEventArgs e)
            {
                base.OnClick(e);
                ItemsGrid g = (ItemsGrid)e.Grid;

                Item x = (Item)(g[e.Position.Row, 0].Tag);

                g.MainModel.Edit(x);
            }
Exemplo n.º 3
0
            public override void OnClick(SourceGrid2.PositionEventArgs e)
            {
                base.OnClick(e);
                ItemsGrid g = (ItemsGrid)e.Grid;

                if (MessageBox.Show(g, Properties.Resources.DeleteQ, Properties.Resources.DeleteQTitle, MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    Item x = (Item)(g[e.Position.Row, 0].Tag);
                    g.Items.Remove(x);
                }
            }
Exemplo n.º 4
0
            public override void OnClick(SourceGrid2.PositionEventArgs e)
            {
                base.OnClick(e);
                ImportsGrid g = (ImportsGrid)e.Grid;

                int i = e.Position.Row - 1;

                if (i < g.Rows.Count - 2)
                {
                    g.Imports.RemoveAt(i);
                    g.Rows.Remove(e.Position.Row);
                }
            }
Exemplo n.º 5
0
        private void BrowseOutlookFolders_Click(object sender, SourceGrid2.PositionEventArgs e)
        {
            try
            {
                // display the Outlook PickFolder dialog
                MAPIFolder folder = syncMgr.AppOutlook.Session.PickFolder();

                if (folder == null)
                {
                    // they clicked cancel or something. do nothing
                }
                else
                {
                    // make sure they've specified a valid task folder
                    if (folder.DefaultItemType == OlItemType.olTaskItem)
                    {
                        // update the grid
                        gridProjects[e.Position.Row, col_SyncFolder].Value =
                            Utils.GetShortOutlookFolderName(folder.FolderPath);

                        gridProjects[e.Position.Row, col_SyncFolderFull].Value =
                            folder.FolderPath.Replace("\\\\", "");

                        // add an event handler for the selected folder if not present
                        syncMgr.AddSingleFolderEventHandler(folder, true);

                        // remove the folder from ingored folder list, if appropriate
                        if (syncMgr.Settings.IgnoredFolders.Contains(folder.FolderPath))
                        {
                            syncMgr.Settings.IgnoredFolders.Remove(folder.FolderPath);
                        }

                        // TODO: prompt the user if they would like to move existing tasks
                        //       for this project to the new folder and if so, move them.
                    }
                    else
                    {
                        MessageBox.Show(this, "Please select a Task Item folder.", "Invalid Folder",
                                        MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    }
                }
            }
            catch (System.Exception ex)
            {
                ErrorHandler.PublishError(ex, syncMgr.Logger);
            }
        }
Exemplo n.º 6
0
            public override void OnClick(SourceGrid2.PositionEventArgs e)
            {
                base.OnClick(e);
                ItemsGrid g = (ItemsGrid)e.Grid;

                Item x = (Item)(g[e.Position.Row, 0].Tag);
                int  n = g.Items.IndexOf(x);

                if (n == g.Items.Count - 1)
                {
                    n--;
                }
                if (n >= 0 && n < g.Items.Count - 1)
                {
                    g.Items.ExchangeOrder(g.Items[n], g.Items[n + 1]);
                }
            }
Exemplo n.º 7
0
        public void CommitEdit(SourceGrid2.PositionEventArgs e)
        {
            Cell   cell = (Cell)this[e.Position.Row, 3];
            string dll  = cell.Value as string;

            if (dll != null && dll != "" && Path.GetExtension(dll) != ".dll" && Path.GetExtension(dll) != ".exe")
            {
                dll += ".dll";
            }
            if (e.Position.Row == Rows.Count - 1 && dll != null && dll != "")
            {
                cell.Value = null;
                Rows.Insert(Rows.Count - 1);
                Imports.Add(dll);
            }
            this[e.Position.Row - 1] = dll;
        }
Exemplo n.º 8
0
            public override void OnClick(SourceGrid2.PositionEventArgs e)
            {
                base.OnClick(e);
                ItemsGrid g = (ItemsGrid)e.Grid;

                ParForm      f = (g[e.Position.Row, 2].Tag) as ParForm;
                FunctionItem x = (FunctionItem)(g[e.Position.Row, 0].Tag);

                if (f != null)
                {
                    if (f.IsDisposed)
                    {
                        f = new ParForm(((ItemsGrid)e.Grid).MainModel);
                        f.Reset(x);
                    }
                    f.Show();
                    f.BringToFront();
                }
            }
Exemplo n.º 9
0
        public void FileDialog(SourceGrid2.PositionEventArgs e)
        {
            if (e.Position.Row < Rows.Count - 1)
            {
                fileDialog.FileName = Imports[e.Position.Row - 1];
            }
            else
            {
                fileDialog.FileName = "";
            }

            bool global = !Path.IsPathRooted(fileDialog.FileName);

            string globalPath = Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName);

            if (global)
            {
                fileDialog.FileName = Path.Combine(globalPath, "");
            }

            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                string file = fileDialog.FileName;

                if (file.Contains(globalPath))
                {
                    file = Path.GetFileName(file);
                }

                if (e.Position.Row == Rows.Count - 1)
                {
                    Rows.Insert(Rows.Count - 1);
                    Imports.Add(file);
                }
                this[e.Position.Row - 1] = file;
            }
        }