コード例 #1
0
 public void ShowPreferencePanel(Foundation.NSObject sender)
 {
     // Is preference controller null?
     if (preferenceController == null)
     {
         preferenceController = new PreferenceController();
         Preference prefWindow = preferenceController.Window;
         nfloat     x, y;
         if (NSApplication.SharedApplication.MainWindow != null)
         {
             x = NSApplication.SharedApplication.MainWindow.Frame.X + NSApplication.SharedApplication.MainWindow.Frame.Width + 20;
             y = NSApplication.SharedApplication.MainWindow.Frame.Y;
         }
         else
         {
             x = 100;
             y = 500;
         }
         prefWindow.SetFrame(new CGRect(x, y, prefWindow.Frame.Width, prefWindow.Frame.Height), false);
     }
     Console.WriteLine("Showing {0}", preferenceController);
     preferenceController.ShowWindow(this);
 }
コード例 #2
0
ファイル: AppController.cs プロジェクト: yingfangdu/BNR
 public void ShowPreferencePanel(Foundation.NSObject sender)
 {
     // Is preference controller null?
     if (preferenceController == null) {
         preferenceController = new PreferenceController();
         Preference prefWindow = preferenceController.Window;
         nfloat x, y;
         if (NSApplication.SharedApplication.MainWindow != null) {
             x = NSApplication.SharedApplication.MainWindow.Frame.X + NSApplication.SharedApplication.MainWindow.Frame.Width + 20;
             y = NSApplication.SharedApplication.MainWindow.Frame.Y;
         }
         else {
             x = 100;
             y = 500;
         }
         prefWindow.SetFrame(new CGRect(x, y, prefWindow.Frame.Width, prefWindow.Frame.Height), false);
     }
     Console.WriteLine("Showing {0}", preferenceController);
     preferenceController.ShowWindow(this);
 }