Esempio n. 1
0
        // The following private methods are
        // delegates used by the previous method

        private void AddPageFetchedDelegate(string remote_url, string [] warnings)
        {
            SyncingFolder = "";

            // Create a local plugin for succesfully added projects, so
            // so the user can easily use the same host again
            if (SelectedPluginIndex == 0)
            {
                SparklePlugin new_plugin;
                Uri           uri = new Uri(remote_url);

                try {
                    string address = remote_url.Replace(uri.AbsolutePath, "");

                    new_plugin = SparklePlugin.Create(uri.Host, address, address, "", "", "/path/to/project");

                    if (new_plugin != null)
                    {
                        Plugins.Insert(1, new_plugin);
                        SparkleLogger.LogInfo("Controller", "Added plugin for " + uri.Host);
                    }
                } catch {
                    SparkleLogger.LogInfo("Controller", "Failed adding plugin for " + uri.Host);
                }
            }

            ChangePageEvent(PageType.Finished, warnings);

            Program.Controller.FolderFetched    -= AddPageFetchedDelegate;
            Program.Controller.FolderFetchError -= AddPageFetchErrorDelegate;
            Program.Controller.FolderFetching   -= SyncingPageFetchingDelegate;
        }