partial void Cancel(Foundation.NSObject sender)
        {
            NSExtensionItem outputItem  = new NSExtensionItem();
            var             outputItems = new[] { outputItem };

            ExtensionContext.CompleteRequest(outputItems, null);
        }
Example #2
0
        public override void ViewDidLoad()
        {
            NSExtensionItem item = ExtensionContext.InputItems[0];

            if (item.Attachments.Length <= 10)
            {
                PathList = new List <string>();

                foreach (NSItemProvider itemProvider in item.Attachments)
                {
                    var type = itemProvider.Description.Split('"');
                    if (itemProvider.HasItemConformingTo(type[1]))
                    {
                        itemProvider.LoadItem(type[1], null, (url, error) =>
                        {
                            if (url != null)
                            {
                                var a = ((NSUrl)(url));
                                PathList.Add(a.AbsoluteString);
                            }
                        });
                    }
                }
            }
        }
        public void CompleteRequest(NSDictionary itemData)
        {
            Debug.WriteLine("BW LOG, itemData: " + itemData);

            var resultsProvider = new NSItemProvider(itemData, UTType.PropertyList);
            var resultsItem     = new NSExtensionItem {
                Attachments = new NSItemProvider[] { resultsProvider }
            };
            var returningItems = new NSExtensionItem[] { resultsItem };

            if (itemData != null)
            {
                _googleAnalyticsService.TrackExtensionEvent("AutoFilled", _context.ProviderType);
            }
            else
            {
                _googleAnalyticsService.TrackExtensionEvent("Closed", _context.ProviderType);
            }

            _googleAnalyticsService.Dispatch(() =>
            {
                NSRunLoop.Main.BeginInvokeOnMainThread(() =>
                {
                    Resolver.ResetResolver();
                    ExtensionContext?.CompleteRequest(returningItems, null);
                });
            });
        }
Example #4
0
        private void ShowAppExtension(ExtensionPageViewModel extensionPageViewModel)
        {
            var itemProvider  = new NSItemProvider(new NSDictionary(), Core.Constants.UTTypeAppExtensionSetup);
            var extensionItem = new NSExtensionItem
            {
                Attachments = new NSItemProvider[] { itemProvider }
            };
            var activityViewController = new UIActivityViewController(new NSExtensionItem[] { extensionItem }, null)
            {
                CompletionHandler = (activityType, completed) =>
                {
                    extensionPageViewModel.EnabledExtension(completed && activityType == iOSCoreHelpers.AppExtensionId);
                }
            };
            var modal = UIApplication.SharedApplication.KeyWindow.RootViewController.ModalViewController;

            if (activityViewController.PopoverPresentationController != null)
            {
                activityViewController.PopoverPresentationController.SourceView = modal.View;
                var frame = UIScreen.MainScreen.Bounds;
                frame.Height /= 2;
                activityViewController.PopoverPresentationController.SourceRect = frame;
            }
            modal.PresentViewController(activityViewController, true, null);
        }
        public override void LoadView()
        {
            base.LoadView();

            NSExtensionItem item = ExtensionContext.InputItems.First();

            Console.WriteLine("Attachments {0}", item);
        }
        public override void BeginRequestWithExtensionContext(NSExtensionContext context)
        {
            var attachment = new NSItemProvider(NSBundle.MainBundle.GetUrlForResource("blockerList", "json"));

            var item = new NSExtensionItem
            {
                Attachments = new[] { attachment }
            };

            context.CompleteRequest(new[] { item }, null);
        }
        public void CompleteRequest(NSDictionary itemData)
        {
            ServiceContainer.Reset();

            Debug.WriteLine("BW LOG, itemData: " + itemData);
            var resultsProvider = new NSItemProvider(itemData, UTType.PropertyList);
            var resultsItem     = new NSExtensionItem {
                Attachments = new NSItemProvider[] { resultsProvider }
            };
            var returningItems = new NSExtensionItem[] { resultsItem };

            NSRunLoop.Main.BeginInvokeOnMainThread(() => ExtensionContext?.CompleteRequest(returningItems, null));
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Enable the Cancel button, disable the Done button
            CancelButton.Enabled = true;
            DoneButton.Enabled   = false;

            // Verify that we have a valid NSExtensionItem
            NSExtensionItem imageItem = ExtensionContext.InputItems [0];

            if (imageItem == null)
            {
                return;
            }

            // Verify that we have a valid NSItemProvider
            NSItemProvider imageItemProvider = imageItem.Attachments [0];

            if (imageItemProvider == null)
            {
                return;
            }

            // Look for an image inside the NSItemProvider
            if (!imageItemProvider.HasItemConformingTo(UTType.Image))
            {
                return;
            }

            imageItemProvider.LoadItem(UTType.Image, null, (NSObject image, NSError error) => {
                UIImage img;

                // This is true when you call extension from Photo's ActivityViewController
                var url = image as NSUrl;
                if (url != null)
                {
                    img = UIImage.LoadFromData(NSData.FromUrl(url));
                    InitWithImage(img);
                    return;
                }

                // This is true when you call extension from Main App
                img = image as UIImage;
                if (img != null)
                {
                    InitWithImage(img);
                    return;
                }
            });
        }
        partial void OnDoneClicked(UIBarButtonItem sender)
        {
            // Create the NSExtensionItem and NSItemProvider in which we return the image
            var extensionItem = new NSExtensionItem {
                AttributedTitle = new NSAttributedString("Inverted Image"),
                Attachments     = new [] {
                    new NSItemProvider(ImageView.Image, UTType.Image)
                }
            };

            ExtensionContext.CompleteRequest(new [] {
                extensionItem
            }, null);
        }
Example #10
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Enable the Cancel button, disable the Done button
            CancelButton.Enabled = true;
            DoneButton.Enabled   = false;

            // Verify that we have a valid NSExtensionItem
            NSExtensionItem imageItem = ExtensionContext.InputItems [0];

            if (imageItem == null)
            {
                return;
            }

            // Verify that we have a valid NSItemProvider
            NSItemProvider imageItemProvider = imageItem.Attachments [0];

            if (imageItemProvider == null)
            {
                return;
            }

            // Look for an image inside the NSItemProvider
            if (!imageItemProvider.HasItemConformingTo(UTType.Image))
            {
                return;
            }

            imageItemProvider.LoadItem(UTType.Image, null, (NSObject image, NSError error) => {
                if (image == null)
                {
                    return;
                }

                // Invert the image, enable the Done button
                InvokeOnMainThread(() => {
                    // Invert the image
                    UIImage invertedImage = InvertedImage((UIImage)image);

                    // Set the inverted image in the UIImageView
                    ImageView.Image    = invertedImage;
                    DoneButton.Enabled = true;
                });
            });
        }
Example #11
0
        private void PassSelectedItemsToApp()
        {
            NSExtensionItem firstItem = base.ExtensionContext.InputItems[0];

            var    itemsCount = firstItem.Attachments.Length;
            var    itemInd    = 0;
            string invokeArgs = string.Empty;

            if (itemsCount > 1)
            {
                UIAlertController alert = UIAlertController.Create("Steepshot", "You can post only one photo for the moment", UIAlertControllerStyle.Alert);
                PresentViewController(alert, true, () =>
                {
                    DispatchQueue.MainQueue.DispatchAfter(new DispatchTime(DispatchTime.Now, 5000000000), () =>
                    {
                        ExtensionContext.CompleteRequest(null, null);
                    });
                });
                base.DidSelectPost();
            }
            else
            {
                foreach (NSItemProvider itemProvider in firstItem.Attachments)
                {
                    if (itemProvider.HasItemConformingTo(UTType.Image))
                    {
                        itemProvider.LoadItemAsync(UTType.Image, null).ContinueWith((item) =>
                        {
                            var imageData = NSData.FromUrl((NSUrl)item.Result);
                            var image     = UIImage.LoadFromData(imageData);
                            var path      = SavePhotosToSharedStorage(image, itemInd);
                            invokeArgs   += string.IsNullOrEmpty(invokeArgs) ? path : $"%{path}";
                            if (++itemInd >= itemsCount)
                            {
                                InvokeOnMainThread(() =>
                                                   InvokeApp(invokeArgs));
                            }
                        });
                    }
                }
            }
        }
		public override void LoadView ()
		{
			base.LoadView ();

			// Show the URL of the item that was requested.
			NSExtensionItem item = ExtensionContext.InputItems.First ();
			NSItemProvider provider = item.Attachments[0];
			provider.LoadItem ("public.url", null, (arg1, arg2) =>
			{
				var url = (NSUrl)arg1;

				// See NSLogHelper for details on this vs Console.WriteLine
				ExtensionSamples.NSLogHelper.NSLog ($"ShareViewController - LoadView - {url}");

				BeginInvokeOnMainThread (() =>
				{
					TitleText.StringValue = url.ToString ();
				});
			});
		}
Example #13
0
        public void CompleteRequest(string id, NSDictionary itemData)
        {
            Debug.WriteLine("BW LOG, itemData: " + itemData);
            var resultsProvider = new NSItemProvider(itemData, UTType.PropertyList);
            var resultsItem     = new NSExtensionItem {
                Attachments = new NSItemProvider[] { resultsProvider }
            };
            var returningItems = new NSExtensionItem[] { resultsItem };

            NSRunLoop.Main.BeginInvokeOnMainThread(async() =>
            {
                if (!string.IsNullOrWhiteSpace(id) && itemData != null)
                {
                    var eventService = ServiceContainer.Resolve <IEventService>("eventService");
                    await eventService.CollectAsync(Bit.Core.Enums.EventType.Cipher_ClientAutofilled, id);
                }
                ServiceContainer.Reset();
                ExtensionContext?.CompleteRequest(returningItems, null);
            });
        }
Example #14
0
        public void OnShareClicked(UIBarButtonItem button)
        {
            UIActivityViewController activityViewController = new UIActivityViewController(new NSObject[] {
                ImageView.Image
            }, null);
            var popover = activityViewController.PopoverPresentationController;

            if (popover != null)
            {
                popover.BarButtonItem = ShareItem;
            }

            // Set a completion handler to handle what the UIActivityViewController returns
            activityViewController.SetCompletionHandler((activityType, completed, returnedItems, error) => {
                if (returnedItems == null ||
                    returnedItems.Length == 0)
                {
                    return;
                }

                NSExtensionItem extensionItem    = returnedItems [0];
                NSItemProvider imageItemProvider = extensionItem.Attachments [0];

                if (!imageItemProvider.HasItemConformingTo(UTType.Image))
                {
                    return;
                }

                imageItemProvider.LoadItem(UTType.Image, null, (item, loadError) => {
                    if (item != null && loadError == null)
                    {
                        InvokeOnMainThread(() => {
                            ImageView.Image = (UIImage)item;
                        });
                    }
                });
            });

            PresentViewController(activityViewController, true, null);
        }
Example #15
0
        public override void DidSelectPost()
        {
            if (ExtensionContext.InputItems != null)
            {
                NSExtensionItem item = ExtensionContext.InputItems[0];

                if (item.Attachments != null && item.Attachments.Length > 0)
                {
                    var    fileManager           = new NSFileManager();
                    var    appGroupContainer     = fileManager.GetContainerUrl("group.com.shareapp.ios");
                    var    appGroupContainerPath = appGroupContainer.Path;
                    string directoryPath         = Path.Combine(appGroupContainerPath, "DocPro");
                    Directory.Delete(directoryPath, true);
                    fileManager.CreateDirectory(directoryPath, true, null);
                    int count = 0;

                    foreach (NSItemProvider itemProvider in item.Attachments)
                    {
                        if (itemProvider.HasItemConformingTo(UTType.Image))
                        {
                            string tempPath = string.Empty;

                            try
                            {
                                itemProvider.LoadItem(UTType.Image, null, (NSObject itemObject, NSError error) =>
                                {
                                    NSData imgData = null;

                                    if (itemObject is UIImage)
                                    {
                                        using (imgData = ((UIImage)itemObject).AsPNG())
                                        {
                                            byte[] myByteArray = new byte[imgData.Length];
                                            Marshal.Copy(imgData.Bytes, myByteArray, 0, Convert.ToInt32(imgData.Length));

                                            var fileIOS = new FileIOS();
                                            fileIOS.WriteAllBytes("Teste123.png", myByteArray);
                                            tempPath = fileIOS.GetFilePath("Teste123.png");
                                        }
                                    }
                                    else if (itemObject is NSUrl)
                                    {
                                        NSUrl nsurl = (NSUrl)itemObject;
                                        var nsdata  = NSData.FromUrl(nsurl);
                                        if (nsdata != null)
                                        {
                                            var data = UIImage.LoadFromData(nsdata);

                                            string pngFilename = Path.Combine(directoryPath, $"Img{count}.png");
                                            count++;

                                            using (imgData = data.AsPNG())
                                            {
                                                //NSError err = null;
                                                //bool isSaved = imgData.Save(pngFilename, false, out err);
                                                bool isFileCreated = fileManager.CreateFile(pngFilename, imgData, (NSDictionary)null);
                                            }
                                        }
                                        //using (imgData = (Data).AsPNG())
                                        //{
                                        //    byte[] myByteArray = new byte[imgData.Length];
                                        //    Marshal.Copy(imgData.Bytes, myByteArray, 0, Convert.ToInt32(imgData.Length));

                                        //    var fileIOS = new FileIOS();
                                        //    fileIOS.WriteAllBytes("Teste123.png", myByteArray);
                                        //}
                                    }
                                });

                                //var alert2 = UIAlertController.Create("Funfou", tempPath, UIAlertControllerStyle.Alert);
                                //PresentViewController(alert2, true, () =>
                                //{
                                //    DispatchQueue.MainQueue.DispatchAfter(new DispatchTime(DispatchTime.Now, 5000000000), () =>
                                //    {
                                //        // Inform the host that we're done, so it un-blocks its UI. Note: Alternatively you could call super's -didSelectPost, which will similarly complete the extension context.
                                //    });
                                //});

                                UIApplication.SharedApplication.OpenUrl(new NSUrl("com.shareapp.test://"));
                            }
                            catch (Exception)
                            {
                            }
                        }
                    }
                }

                ExtensionContext.CompleteRequest(ExtensionContext.InputItems, null);
            }
        }
Example #16
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Forms.Init();

            if (!Resolver.IsSet)
            {
                SetIoc();
            }

            _lockService       = Resolver.Resolve <ILockService>();
            _deviceInfoService = Resolver.Resolve <IDeviceInfoService>();
            _pushHandler       = new iOSPushNotificationHandler(Resolver.Resolve <IPushNotificationListener>());
            _nfcDelegate       = new NFCReaderDelegate((success, message) => ProcessYubikey(success, message));
            var appIdService = Resolver.Resolve <IAppIdService>();

            var crashManagerDelegate = new HockeyAppCrashManagerDelegate(
                appIdService, Resolver.Resolve <IAuthService>());
            var manager = BITHockeyManager.SharedHockeyManager;

            manager.Configure("51f96ae568ba45f699a18ad9f63046c3", crashManagerDelegate);
            manager.CrashManager.CrashManagerStatus = BITCrashManagerStatus.AutoSend;
            manager.UserId = appIdService.AppId;
            manager.StartManager();
            manager.Authenticator.AuthenticateInstallation();
            manager.DisableMetricsManager = manager.DisableFeedbackManager = manager.DisableUpdateManager = true;

            LoadApplication(new App.App(
                                null,
                                Resolver.Resolve <IAuthService>(),
                                Resolver.Resolve <IConnectivity>(),
                                Resolver.Resolve <IDatabaseService>(),
                                Resolver.Resolve <ISyncService>(),
                                Resolver.Resolve <ISettings>(),
                                _lockService,
                                Resolver.Resolve <ILocalizeService>(),
                                Resolver.Resolve <IAppInfoService>(),
                                Resolver.Resolve <IAppSettingsService>(),
                                Resolver.Resolve <IDeviceActionService>()));

            // Appearance stuff

            var primaryColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f);
            var grayLight    = new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f);

            UINavigationBar.Appearance.ShadowImage = new UIImage();
            UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default);
            UIBarButtonItem.AppearanceWhenContainedIn(new Type[] { typeof(UISearchBar) }).TintColor = primaryColor;
            UIButton.AppearanceWhenContainedIn(new Type[] { typeof(UISearchBar) }).SetTitleColor(primaryColor,
                                                                                                 UIControlState.Normal);
            UIButton.AppearanceWhenContainedIn(new Type[] { typeof(UISearchBar) }).TintColor = primaryColor;
            UIStepper.Appearance.TintColor = grayLight;
            UISlider.Appearance.TintColor  = primaryColor;

            MessagingCenter.Subscribe <Xamarin.Forms.Application, ToolsExtensionPage>(
                Xamarin.Forms.Application.Current, "ShowAppExtension", (sender, page) =>
            {
                var itemProvider           = new NSItemProvider(new NSDictionary(), Core.Constants.UTTypeAppExtensionSetup);
                var extensionItem          = new NSExtensionItem();
                extensionItem.Attachments  = new NSItemProvider[] { itemProvider };
                var activityViewController = new UIActivityViewController(new NSExtensionItem[] { extensionItem }, null);
                activityViewController.CompletionHandler = (activityType, completed) =>
                {
                    page.EnabledExtension(completed && activityType == "com.8bit.bitwarden.find-login-action-extension");
                };

                var modal = UIApplication.SharedApplication.KeyWindow.RootViewController.ModalViewController;
                if (activityViewController.PopoverPresentationController != null)
                {
                    activityViewController.PopoverPresentationController.SourceView = modal.View;
                    var frame     = UIScreen.MainScreen.Bounds;
                    frame.Height /= 2;
                    activityViewController.PopoverPresentationController.SourceRect = frame;
                }

                modal.PresentViewController(activityViewController, true, null);
            });

            MessagingCenter.Subscribe <Xamarin.Forms.Application, bool>(Xamarin.Forms.Application.Current,
                                                                        "ListenYubiKeyOTP", (sender, listen) =>
            {
                if (_deviceInfoService.NfcEnabled)
                {
                    _nfcSession?.InvalidateSession();
                    _nfcSession?.Dispose();
                    _nfcSession = null;
                    if (listen)
                    {
                        _nfcSession = new NFCNdefReaderSession(_nfcDelegate, null, true);
                        _nfcSession.AlertMessage = AppResources.HoldYubikeyNearTop;
                        _nfcSession.BeginSession();
                    }
                }
            });

            UIApplication.SharedApplication.StatusBarHidden = false;
            UIApplication.SharedApplication.StatusBarStyle  = UIStatusBarStyle.LightContent;

            MessagingCenter.Subscribe <Xamarin.Forms.Application, bool>(Xamarin.Forms.Application.Current,
                                                                        "ShowStatusBar", (sender, show) =>
            {
                UIApplication.SharedApplication.SetStatusBarHidden(!show, false);
            });

            ZXing.Net.Mobile.Forms.iOS.Platform.Init();
            return(base.FinishedLaunching(app, options));
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            extensionContext = this.ExtensionContext;
            // Do any additional setup after loading the view.
            NSExtensionItem[] outputItem = extensionContext.InputItems;
            NSExtensionItem   item       = extensionContext.InputItems[0];
            NSItemProvider    provider   = item.Attachments[0]; //provider is null, no attachments

            enviado = false;

            string[] type = outputItem[0].Attachments[0].RegisteredTypeIdentifiers;



            foreach (string x in type)
            {
                if ("public.zip-archive".Contains(x))
                {
                    if (!enviado)
                    {
                        enviado = true;



                        var item2 = extensionContext.InputItems[0];

                        NSItemProvider prov = null;
                        if (item2 != null)
                        {
                            prov = item2.Attachments[0];
                        }
                        if (prov != null)
                        {
                            prov.LoadItem(UTType.ZipArchive, null, (NSObject url, NSError error) =>
                            {
                                if (url == null)
                                {
                                    return;
                                }
                                NSUrl newUrl = (NSUrl)url;

                                InvokeOnMainThread(() =>
                                {
                                    //String encode1 = System.Web.HttpUtility.UrlEncode("thirdpartyappurlscheme://?param=" + rece);

                                    NSUrl request = new NSUrl("aclara-mtu-programmer://?script_path=" + newUrl);

                                    try
                                    {
                                        bool isOpened = UIApplication.SharedApplication.OpenUrl(request);

                                        if (isOpened == false)
                                        {
                                            UIApplication.SharedApplication.OpenUrl(new NSUrl("aclara-mtu-programmer://?script_path=" + newUrl));
                                        }
                                        extensionContext.CompleteRequest(new NSExtensionItem[0], null);
                                    }
                                    catch (Exception ex)
                                    {
                                        Debug.WriteLine("Cannot open url: {0}, Error: {1}", request.AbsoluteString, ex.Message);
                                        var alertView = new UIAlertView("Error", ex.Message, null, "OK", null);

                                        alertView.Show();
                                    }
                                });
                            });
                        }
                    }
                }


                if ("public.xml".Contains(x))
                {
                    if (!enviado)
                    {
                        enviado = true;



                        var item2 = extensionContext.InputItems[0];

                        NSItemProvider prov = null;
                        if (item2 != null)
                        {
                            prov = item2.Attachments[0];
                        }
                        if (prov != null)
                        {
                            prov.LoadItem(UTType.XML, null, (NSObject url, NSError error) =>
                            {
                                if (url == null)
                                {
                                    return;
                                }
                                NSUrl newUrl = (NSUrl)url;


                                byte[] uploadData = (NSData.FromUrl((NSUrl)newUrl).ToArray());


                                // From byte array to string
                                string s = System.Text.Encoding.UTF8.GetString(uploadData, 0, uploadData.Length);


                                s = WebUtility.UrlEncode(s);

                                InvokeOnMainThread(() =>
                                {
                                    //String encode1 = System.Web.HttpUtility.UrlEncode("thirdpartyappurlscheme://?param=" + rece);

                                    NSUrl request = new NSUrl("aclara-mtu-programmer://?script_path=" + s.ToString());

                                    try
                                    {
                                        bool isOpened = UIApplication.SharedApplication.OpenUrl(request);

                                        if (isOpened == false)
                                        {
                                            UIApplication.SharedApplication.OpenUrl(new NSUrl("aclara-mtu-programmer://?script_path=" + s.ToString()));
                                        }
                                        extensionContext.CompleteRequest(new NSExtensionItem[0], null);
                                    }
                                    catch (Exception ex)
                                    {
                                        Debug.WriteLine("Cannot open url: {0}, Error: {1}", request.AbsoluteString, ex.Message);
                                        var alertView = new UIAlertView("Error", ex.Message, null, "OK", null);

                                        alertView.Show();
                                    }
                                });
                            });
                        }
                    }
                }



                if ("public.data".Contains(x))
                {
                    if (!enviado)
                    {
                        enviado = true;


                        var item2 = extensionContext.InputItems[0];

                        NSItemProvider prov = null;
                        if (item2 != null)
                        {
                            prov = item2.Attachments[0];
                        }
                        if (prov != null)
                        {
                            prov.LoadItem(UTType.Data, null, (NSObject url, NSError error) =>
                            {
                                if (url == null)
                                {
                                    return;
                                }
                                NSUrl newUrl = (NSUrl)url;

                                InvokeOnMainThread(() =>
                                {
                                    //String encode1 = System.Web.HttpUtility.UrlEncode("thirdpartyappurlscheme://?param=" + rece);

                                    NSUrl request = new NSUrl("aclara-mtu-programmer://?script_path=" + newUrl.ToString());

                                    try
                                    {
                                        bool isOpened = UIApplication.SharedApplication.OpenUrl(request);

                                        if (isOpened == false)
                                        {
                                            UIApplication.SharedApplication.OpenUrl(new NSUrl("aclara-mtu-programmer://?script_path=" + newUrl.ToString()));
                                        }
                                        extensionContext.CompleteRequest(new NSExtensionItem[0], null);
                                    }
                                    catch (Exception ex)
                                    {
                                        Debug.WriteLine("Cannot open url: {0}, Error: {1}", request.AbsoluteString, ex.Message);
                                        var alertView = new UIAlertView("Error", ex.Message, null, "OK", null);

                                        alertView.Show();
                                    }
                                });
                            });
                        }
                    }
                }



                if ("public.file-url".Contains(x))
                {
                    if (!enviado)
                    {
                        enviado = true;

                        string value = outputItem[0].AttributedContentText.Value.ToString();

                        String encode1 = System.Net.WebUtility.UrlEncode(value);

                        extensionContext.CompleteRequest(new NSExtensionItem[0], null);

                        UIApplication.SharedApplication.OpenUrl(new NSUrl("aclara-mtu-programmer://?script_path=" + encode1));
                    }
                }
            }
        }
		partial void Close (NSObject sender)
		{
			var outputItem = new NSExtensionItem ();
			var outputItems = new[] { outputItem };
			ExtensionContext.CompleteRequest (outputItems, null);
		}
		partial void OnDoneClicked (UIBarButtonItem sender)
		{
			// Create the NSExtensionItem and NSItemProvider in which we return the image
			NSExtensionItem extensionItem = new NSExtensionItem {
				AttributedTitle = new NSAttributedString ("Inverted Image"),
				Attachments = new NSItemProvider[] {
					new NSItemProvider (ImageView.Image, UTType.Image)
				}
			};
			ExtensionContext.CompleteRequest(new NSExtensionItem[] {
				extensionItem
			}, null);
		}