当前位置: 首页>>代码示例>>C#>>正文


C# FileChooserDialog.SetPosition方法代码示例

本文整理汇总了C#中Gtk.FileChooserDialog.SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# FileChooserDialog.SetPosition方法的具体用法?C# FileChooserDialog.SetPosition怎么用?C# FileChooserDialog.SetPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.FileChooserDialog的用法示例。


在下文中一共展示了FileChooserDialog.SetPosition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnSaveAs

        void OnSaveAs(object sender, EventArgs e)
        {
            var fc=
                new FileChooserDialog("Choose the file to save",
                    _thisDialog,
                    FileChooserAction.Save,
                    "Cancel",ResponseType.Cancel,
                    "Save",ResponseType.Accept);

            fc.SetPosition (WindowPosition.Center);
            if (fc.Run() == (int)ResponseType.Accept)
            {
                _fileName = fc.Filename;
                System.IO.File.WriteAllText (_fileName, textview1.Buffer.Text);
            }

            //Don't forget to call Destroy() or the FileChooserDialog window won't get closed.
            fc.Destroy();
        }
开发者ID:jdpillon,项目名称:ArduinoLadder,代码行数:19,代码来源:SourceDialog.cs

示例2: OnOpen

        void OnOpen(object sender, EventArgs e)
        {
            var fc=
                new FileChooserDialog("Choose the file to open",
                    this,
                    FileChooserAction.Open,
                    "Cancel",ResponseType.Cancel,
                    "Open",ResponseType.Accept);

            fc.SetPosition (WindowPosition.Center);
            if (fc.Run() == (int)ResponseType.Accept)
            {
                if (!AppController.Instance.Surface.IsEmpty ()) {
                    string fileName = Process.GetCurrentProcess ().MainModule.FileName.Replace (".vshost", "");
                    ProcessStartInfo info = new ProcessStartInfo (fileName);
                    info.UseShellExecute = false;
                    info.Arguments = fc.Filename;
                    Process processChild = Process.Start (info);
                } else {
                    AppController.Instance.FileName = fc.Filename;
                    var saved = ConfigManager.Read<PrimitivesSurface> (AppController.Instance.FileName);
                    AppController.Instance.ResetSurface ();
                    AppController.Instance.ReloadSurface (saved);
                    _grid.Surface = AppController.Instance.Surface;
                    _grid.Surface.QueueDraw ();
                }
            }
            //Don't forget to call Destroy() or the FileChooserDialog window won't get closed.
            fc.Destroy();
        }
开发者ID:jdpillon,项目名称:ArduinoLadder,代码行数:30,代码来源:AppWindow.cs

示例3: OnSaveAs

        void OnSaveAs(object sender, EventArgs e)
        {
            var fc=
                new FileChooserDialog("Enter the file to save",
                    this,
                    FileChooserAction.Save,
                    "Cancel",ResponseType.Cancel,
                    "Save",ResponseType.Accept);

            fc.SetPosition (WindowPosition.Center);
            if (fc.Run() == (int)ResponseType.Accept)
            {
                AppController.Instance.FileName = fc.Filename;
                ConfigManager.Write<PrimitivesSurface> (AppController.Instance.Surface, AppController.Instance.FileName);
            }
            //Don't forget to call Destroy() or the FileChooserDialog window won't get closed.
            fc.Destroy();
        }
开发者ID:jdpillon,项目名称:ArduinoLadder,代码行数:18,代码来源:AppWindow.cs

示例4: OnExportToPng

        void OnExportToPng(object sender, EventArgs e)
        {
            var fc=
                new FileChooserDialog("Enter the file to save",
                    this,
                    FileChooserAction.Save,
                    "Cancel",ResponseType.Cancel,
                    "Save",ResponseType.Accept);

            fc.SetPosition (WindowPosition.Center);
            if (fc.Run() == (int)ResponseType.Accept)
            {
                _grid.ExportToPng (fc.Filename);
                Process.Start (fc.Filename);
            }
            //Don't forget to call Destroy() or the FileChooserDialog window won't get closed.
            fc.Destroy();
        }
开发者ID:jdpillon,项目名称:ArduinoLadder,代码行数:18,代码来源:AppWindow.cs


注:本文中的Gtk.FileChooserDialog.SetPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。