Beispiel #1
0
        public Icon GetFileIcon(string fileName, IconSize size)
        {
            var ws    = new NSWorkspace();
            var image = ws.IconForFileType(Path.GetExtension(fileName));

            return(new Icon(new IconHandler(image)));
        }
Beispiel #2
0
        partial void ContactEmail(NSObject sender)
        {
            NSWorkspace workSpace     = NSWorkspace.SharedWorkspace;
            String      mailtoAddress = String.Format("mailto:{0}?Subject={1}&body={2}",
                                                      "*****@*****.**", "Expired", "Support");

            workSpace.OpenUrl(NSUrl.FromString(mailtoAddress));
        }
Beispiel #3
0
        public static NSWorkspace GetWorkspace()
        {
            if (_ws == null)
            {
                _ws = new NSWorkspace();
            }

            return(_ws);
        }
Beispiel #4
0
		public Icon GetStaticIcon (StaticIconType type, IconSize size)
		{
			var ws = new NSWorkspace();
			string code;
			switch (type)
			{
			case StaticIconType.OpenDirectory: code = "ofld"; break;
			default:
			case StaticIconType.CloseDirectory: code = "ofld"; break;
			}
			var image = ws.IconForFileType(code);
			return new Icon(new IconHandler(image));	
		}
        public Icon GetStaticIcon(StaticIconType type, IconSize size)
        {
            var    ws = new NSWorkspace();
            string code;

            switch (type)
            {
            case StaticIconType.OpenDirectory: code = "ofld"; break;

            default:
            case StaticIconType.CloseDirectory: code = "ofld"; break;
            }
            var image = ws.IconForFileType(code);

            return(new Icon(Widget.Generator, new IconHandler(image)));
        }
Beispiel #6
0
        public static bool IsIVPNAppIsRunning(out NSRunningApplication runningApplication)
        {
            runningApplication = null;

            NSWorkspace workspace = new NSWorkspace();

            foreach (var application in workspace.RunningApplications)
            {
                if (application.LocalizedName == "IVPN" &&
                    application.ProcessIdentifier != NSProcessInfo.ProcessInfo.ProcessIdentifier)
                {
                    runningApplication = application;
                    return(true);
                }
            }

            return(false);
        }
Beispiel #7
0
        public Icon GetStaticIcon(StaticIconType type, IconSize size)
        {
            var    ws = new NSWorkspace();
            string code;

            switch (type)
            {
            case StaticIconType.OpenDirectory:
                code = "ofld";
                break;

            case StaticIconType.CloseDirectory:
                code = "ofld";
                break;

            default:
                throw new NotSupportedException();
            }
            var image = ws.IconForFileType(code);

            return(new Icon(new IconHandler(image)));
        }
 public void OpenContainingFolder(string fileName)
 {
     NSUrl[] fileUrls = { NSUrl.FromFilename(fileName) };
     var ws = new NSWorkspace();
     ws.ActivateFileViewer(fileUrls);
 }
Beispiel #9
0
		public Icon GetFileIcon (string fileName, IconSize size)
		{
			var ws = new NSWorkspace();
			var image = ws.IconForFileType(Path.GetExtension(fileName));
			return new Icon(new IconHandler(image));	
		}