Esempio n. 1
0
 private void starButton1_ClickButton(object sender, EventArgs e)
 {
     BrowseFile.ShowDialog();
     foreach (var f in BrowseFile.FileNames)
     {
         var nf = new VFile();
         nf.FullPath = f;
         Files.Add(nf);
     }
     SyncUI();
 }
 private void starButton5_ClickButton(object sender, EventArgs e)
 {
     BrowseFile.ShowDialog();
     foreach (var f in BrowseFile.FileNames)
     {
         var af = new AnimFrame();
         af.RawFrame = new Bitmap(f);
         EditAnim.Frames.Add(af);
     }
     SyncFrames();
     SyncAnimBox();
 }
Esempio n. 3
0
        public MainViewModel(IBitmapService bitmapService, IFilePicker filePicker)
        {
            BrowseFile = ReactiveCommand
                         .CreateFromObservable(() => filePicker.Pick("Select an image", new[] { ".png", ".jpg" })
                                               .Where(file => file != null)
                                               .SelectMany(x => Observable.FromAsync(() => ToBytes(x))));
            Rotate = ReactiveCommand.CreateFromTask(() => bitmapService.Create(Source, Angle), BrowseFile.Any());

            source      = BrowseFile.ToProperty(this, x => x.Source);
            destination = Rotate.ToProperty(this, x => x.Destination);
            Angle       = 90f;

            isLoading = Rotate.IsExecuting.ToProperty(this, x => x.IsLoading);
        }
Esempio n. 4
0
        public Section1ViewModel(IBitmapService bitmapService, IFilePicker filePicker, IDialogService dialogService)
        {
            BrowseFile = ReactiveCommand
                         .CreateFromObservable(() => Pick(filePicker));
            Rotate = ReactiveCommand.CreateFromTask(() => bitmapService.Create(Source, Angle), BrowseFile.Any());
            Rotate.ShowExceptions(dialogService);

            source      = BrowseFile.ToProperty(this, x => x.Source);
            destination = Rotate.ToProperty(this, x => x.Destination);
            Angle       = 90f;

            isLoading = Rotate.IsExecuting.ToProperty(this, x => x.IsLoading);

            this.WhenAnyValue(x => x.Url)
            .Subscribe(s => MessageBus.Current.SendMessage(new UrlMessage(s)));
        }
Esempio n. 5
0
        private void loadSceneToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UpdateTick.Enabled = false;
            while (render)
            {
            }
            UpdateTick.Enabled    = false;
            BrowseFile.DefaultExt = ".graph";
            BrowseFile.ShowDialog();
            var ng = new SceneGraph();

            ng.Load(BrowseFile.FileName);
            EditGraph = ng;
            SyncUI();
            UpdateTick.Enabled = true;
        }
        private void starButton4_ClickButton(object sender, EventArgs e)
        {
            BrowseFile.ShowDialog();
            var f = BrowseFile.FileName;

            if (new System.IO.FileInfo(f).Exists == false)
            {
                return;
            }
            ClassIcon     = new Bitmap(f);
            ClassIcon     = new Bitmap(ClassIcon, new Size(IconBox.Width, IconBox.Height));
            IconBox.Image = ClassIcon;

            IconBox.Invalidate();
            Invalidate();
        }
        protected void UploadFile()
        {
            string folderPath = Server.MapPath("~/Files/Payments/");

            //Check whether Directory (Folder) exists.
            if (!Directory.Exists(folderPath))
            {
                //If Directory (Folder) does not exists. Create it.
                Directory.CreateDirectory(folderPath);
            }

            //Save the File to the Directory (Folder).
            BrowseFile.SaveAs(folderPath + Path.GetFileName(BrowseFile.FileName));

            ////Display the success message.
            //lblMessage.Text = Path.GetFileName(FileUpload1.FileName) + " has been uploaded.";
        }
Esempio n. 8
0
        private void starButton5_ClickButton(object sender, EventArgs e)
        {
            BrowseFile.ShowDialog();

            var path = BrowseFile.FileName;

            path = path.ToLower();
            path = path.Replace(".vfs", "");
            path = path.Replace(".toc", "");

            VirtualFileSystem ofs = new VirtualFileSystem();

            ofs.ReadToc(path + ".toc");
            Files.Clear();
            foreach (var entry in ofs.Enteries)
            {
                var nf = new VFile();
                nf.FullPath = entry.Path + ":" + entry.Name;
                Files.Add(nf);
            }
            SyncUI();
        }
Esempio n. 9
0
        private void loadPayloadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UpdateTick.Enabled = false;
            while (render)
            {
            }
            UpdateTick.Enabled    = false;
            BrowseFile.DefaultExt = ".toc";
            BrowseFile.ShowDialog();
            VirtualFileSystem gfs = new VirtualFileSystem();

            gfs.ReadToc(BrowseFile.FileName);
            Console.WriteLine("Read Toc");
            EditGraph = gfs.GetGraph("Universe Root");

            //var ng = new SceneGraph();
            //ng.Load(BrowseFile.FileName);
            //EditGraph = ng;

            SyncUI();
            UpdateTick.Enabled = true;
        }
Esempio n. 10
0
        private void SMLoadScript_Click(object sender, EventArgs e)
        {
            BrowseFile.ShowDialog();

            var nf = new FileInfo(BrowseFile.FileName);

            if (nf.Extension == ".cs")
            {
                var gs = new GraphScript();
                gs.ScriptFile = BrowseFile.FileName;
                var sn = SceneTree.SelectedNode;
                if (sn == null)
                {
                    return;
                }
                var gn = NodeMap[sn];
                if (gn == null)
                {
                    return;
                }
                //gn.Nodes.Add(gs);

                var sb = gs.Script.Class as ScriptBase;
                sb.Name = nf.Name.Replace(nf.Extension, "");
                gn.Nodes.Add(sb);
                sb.Node = gn;
                Console.WriteLine(gn.Name);

                Main.SyncUI();

                NewScriptNode = gn;
            }
            else
            {
                MessageBox.Show("File must be a .cs file.");
                return;
            }
        }
Esempio n. 11
0
        public PdfExportDialog(GameManager manager, ITranslations translations) : base(translations, "PdfExportDialog.ui", "pdfexportbox")
        {
            pdfExporter            = new PdfExporter(translations);
            this.manager           = manager;
            games_spinbutton.Value = 10;
            checkbox_logic.Active  = checkbox_calculation.Active = checkbox_verbal.Active = true;

            // Use defaults from Preferences
            switch ((GameDifficulty)Preferences.Get <int> (Preferences.DifficultyKey))
            {
            case GameDifficulty.Easy:
                rb_easy.Active = rb_easy.HasFocus = true;
                break;

            case GameDifficulty.Medium:
                rb_medium.Active = rb_medium.HasFocus = true;
                break;

            case GameDifficulty.Master:
                rb_master.Active = rb_master.HasFocus = true;
                break;
            }
            // File selection
            string def_file;

            def_file = System.IO.Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
                // Translators: default file name used when exporting PDF files (keep the pdf extension please)
                Catalog.GetString("games.pdf"));

            file = new BrowseFile(hbox_file, def_file, true);

            FileFilter[] filters = new FileFilter [2];
            filters[0] = new FileFilter();
            filters[0].AddPattern("*.pdf");
            filters[0].Name = Catalog.GetString("PDF files");

            filters[1] = new FileFilter();
            filters[1].AddPattern("*.*");
            filters[1].Name = Catalog.GetString("All files");

            file.Filters = filters;

            ListStore    layout_store = new ListStore(typeof(string), typeof(int));             // DisplayName, index to array
            CellRenderer layout_cell  = new CellRendererText();

            layout_combo.Model = layout_store;
            layout_combo.PackStart(layout_cell, true);
            layout_combo.SetCellDataFunc(layout_cell, ComboBoxCellFunc);

            int [] per_side = pdfExporter.PagesPerSide;

            for (int i = 0; i < per_side.Length; i++)
            {
                layout_store.AppendValues(per_side[i].ToString(), per_side[i]);
            }

            // Default value
            TreeIter iter;
            bool     more = layout_store.GetIterFirst(out iter);

            while (more)
            {
                if ((int)layout_store.GetValue(iter, COLUMN_VALUE) == DEF_SIDEVALUE)
                {
                    layout_combo.SetActiveIter(iter);
                    break;
                }
                more = layout_store.IterNext(ref iter);
            }
        }
Esempio n. 12
0
 private void Browse()
 {
     PathVariable = BrowseFile.ChooseFile();
     RaisePropertyChanged("PathVariable");
 }