Пример #1
0
        private void CreateNewProject(object sender, EventArgs EventArguments)
        {
            DialogResult ResultMessageBox = System.Windows.Forms.MessageBox.Show(
                "Sollen die Änderungen gespeichert werden bevor ein neues Projekt erstellt wird?",
                "RSSFeedDesigner",
                MessageBoxButtons.YesNoCancel,
                MessageBoxIcon.Question);

            switch (ResultMessageBox)
            {
            case DialogResult.Cancel:
                break;

            case DialogResult.Yes:
                SaveProject(sender, EventArguments);
                goto case DialogResult.No;
                break;

            case DialogResult.No:
                VirtualFile = new YB.VirtualRSSXmlFile();
                dataGrid_RSSFeed.SelectAll();
                DeleteRows(sender, EventArguments);
                break;
            }
        }
Пример #2
0
        static string[] New(string[] Parameters)
        {
            List <string> Output = new List <string>();

            VirtualRSSFile1 = new VirtualRSSXmlFile();
            Output.Add("Info");
            Output.Add("New Projekt was created!");
            return(Output.ToArray());
        }
Пример #3
0
        private void LoadProject(object sender, EventArgs EventArguments)
        {
            DialogResult ResultMessageBox = System.Windows.Forms.MessageBox.Show(
                "Sollen die Änderungen gespeichert werden bevor ein anderes Projekt geladen wird?",
                "RSSFeedDesigner",
                MessageBoxButtons.YesNoCancel,
                MessageBoxIcon.Question);

            switch (ResultMessageBox)
            {
            case DialogResult.Cancel:
                break;

            case DialogResult.Yes:
                SaveProject(sender, EventArguments);
                goto case DialogResult.No;
                break;

            case DialogResult.No:
                VirtualFile = new YB.VirtualRSSXmlFile();
                dataGrid_RSSFeed.SelectAll();
                DeleteRows(sender, EventArguments);
                System.Windows.Forms.OpenFileDialog LoadDialog = new OpenFileDialog();
                LoadDialog.CheckFileExists = true;
                DialogResult ResultSaveDialog = LoadDialog.ShowDialog();
                switch (ResultSaveDialog)
                {
                case System.Windows.Forms.DialogResult.OK:
                    string FilePath = LoadDialog.FileName;
                    VirtualFile = YB.VirtualRSSXmlFile.Load(FilePath);
                    break;
                }
                foreach (YB.VirtualRSSXmlFile.item Item in VirtualFile.ItemList)
                {
                    AddNewLine(sender, EventArguments);
                    this.dataGrid_RSSFeed[0, (dataGrid_RSSFeed.Rows.Count - 2)].Value = Item.Title;
                    this.dataGrid_RSSFeed[1, (dataGrid_RSSFeed.Rows.Count - 2)].Value = Item.Link;
                    this.dataGrid_RSSFeed[2, (dataGrid_RSSFeed.Rows.Count - 2)].Value = Item.Description;
                }

                break;
            }
        }
Пример #4
0
        static string[] Load(string[] Parameters)
        {
            List <string> Output   = new List <string>();
            string        FilePath = Program.ArrayToString(Parameters, 1);

            if (File.Exists(FilePath))
            {
                VirtualRSSFile1 = VirtualRSSXmlFile.Load(FilePath);

                Output.Add("Info");
                Output.Add("File \"" + FilePath + "\" was loaded.");
                Program.FilePath = FilePath;
            }
            else
            {
                Output.Add("Error");
                Output.Add("File \"" + FilePath + "\" can not be found.");
            }
            return(Output.ToArray());
        }
Пример #5
0
        public WindowMain()
        {
            InitializeComponent();
            VirtualFile = new YB.VirtualRSSXmlFile();
            FilePath    = "";


            this.dataGrid_RSSFeed.CellEndEdit += new DataGridViewCellEventHandler(this.SynchronizeToVirtualRSSXmlFile);
            this.dataGrid_RSSFeed.Sorted      += new EventHandler(this.SynchronizeToVirtualRSSXmlFile);
            this.FormClosing += new FormClosingEventHandler(this.CloseWindow);
            this.DropDownMenuItem_Quit.Click   += new EventHandler(this.QuitProgram);
            this.DropDownMenuItem_New.Click    += new EventHandler(this.CreateNewProject);
            this.DropDownMenuItem_Load.Click   += new EventHandler(this.LoadProject);
            this.DropDownMenuItem_Save.Click   += new EventHandler(this.SaveProject);
            this.DropDownMenuItem_SaveAs.Click += new EventHandler(this.SaveAsProject);

            this.DropDownMenuItem_FeedInformation.Click += new EventHandler(this.FeedInformation);
            this.DropDownMenuItem_NewLine.Click         += new EventHandler(this.AddNewLine);
            this.DropDownMenuItem_DeleteLine.Click      += new EventHandler(this.DeleteRows);
        }
Пример #6
0
        internal void LoadProject(System.IO.FileInfo FilePath)
        {
            VirtualFile = new YB.VirtualRSSXmlFile();
            dataGrid_RSSFeed.SelectAll();
            DeleteRows();

            if (FilePath == null)
            {
                System.Windows.Forms.OpenFileDialog LoadDialog = new OpenFileDialog();
                LoadDialog.CheckFileExists = true;
                if (LoadDialog.ShowDialog() == DialogResult.OK)
                {
                    this.FilePath = new System.IO.FileInfo(LoadDialog.FileName);
                }
                else
                {
                    return;
                }
            }
            else
            {
                this.FilePath = FilePath;
            }
            VirtualFile = YB.VirtualRSSXmlFile.Load(this.FilePath.ToString());
            if (VirtualFile == null)
            {
                System.Windows.Forms.MessageBox.Show("Die Angegebene Datei kann nicht mit dem XmlLinQ-Modul gelesen werden!", "RSSFeed Designer", MessageBoxButtons.OK, MessageBoxIcon.Error);
                CreateNewProject();
            }
            else
            {
                foreach (YB.VirtualRSSXmlFile.item Item in VirtualFile.ItemList)
                {
                    AddNewLine();
                    this.dataGrid_RSSFeed[0, (dataGrid_RSSFeed.Rows.Count - 2)].Value = Item.Title;
                    this.dataGrid_RSSFeed[1, (dataGrid_RSSFeed.Rows.Count - 2)].Value = Item.Link;
                    this.dataGrid_RSSFeed[2, (dataGrid_RSSFeed.Rows.Count - 2)].Value = Item.Description;
                }
            }
        }
Пример #7
0
        public WindowMain()
        {
            InitializeComponent();
            VirtualFile = new YB.VirtualRSSXmlFile();
            FilePath    = null;


            this.dataGrid_RSSFeed.CellEndEdit += new DataGridViewCellEventHandler(this.DataGrid_RSSFeed_CellEndEdit);
            this.dataGrid_RSSFeed.Sorted      += new EventHandler(this.DataGrid_RSSFeed_Sorted);
            this.FormClosing += new FormClosingEventHandler(this.FormClosing_Click);
            this.DropDownMenuItem_Quit.Click   += new EventHandler(this.DropDownMenuItem_Quit_Click);
            this.DropDownMenuItem_New.Click    += new EventHandler(this.DropDownMenuItem_New_Click);
            this.DropDownMenuItem_Load.Click   += new EventHandler(this.DropDownMenuItem_Load_Click);
            this.DropDownMenuItem_Save.Click   += new EventHandler(this.DropDownMenuItem_Save_Click);
            this.DropDownMenuItem_SaveAs.Click += new EventHandler(this.DropDownMenuItem_SaveAs_Click);

            this.DropDownMenuItem_FeedInformation.Click += new EventHandler(this.DropDownMenuItem_FeedInformation_Click);
            this.DropDownMenuItem_NewLine.Click         += new EventHandler(this.DropDownMenuItem_NewLine_Click);
            this.DropDownMenuItem_DeleteLine.Click      += new EventHandler(this.DropDownMenuItem_DeleteLine_Click);

            this.DropDownMenuItem_Info.Click += new EventHandler(this.DropDownMenuItem_Info_Click);
        }
Пример #8
0
 private void CreateNewProject()
 {
     VirtualFile = new YB.VirtualRSSXmlFile();
     dataGrid_RSSFeed.SelectAll();
     DeleteRows();
 }