Ejemplo n.º 1
1
 //exactly same as x.browser
 private static void UpdateManifest(IList<Services.Data.ExtensionManifestDataModel> found, IExtensionManifest ext)
 {
     if (found != null && found.Count() > 0)
     {
         ext.IsExtEnabled = found.First().IsExtEnabled;
         ext.LaunchInDockPositions = (ExtensionInToolbarPositions)found.First().LaunchInDockPositions;
         ext.FoundInToolbarPositions = (ExtensionInToolbarPositions)found.First().FoundInToolbarPositions;
     }
 }
Ejemplo n.º 2
0
        public _Template(IExtensionManifest extensionManifest)
        {
            this.InitializeComponent();

            ExtensionManifest = extensionManifest;

            layoutRoot.DataContext = this;
        }
Ejemplo n.º 3
0
        public void Load(IExtensionManifest extensionManifest) {
            UniqueID = extensionManifest.UniqueID;
            Title = extensionManifest.Title;
            Path = extensionManifest.Path;
            IconUrl = extensionManifest.IconUrl;
            Publisher = extensionManifest.Publisher;
            Version = extensionManifest.Version;
            IsExtEnabled = extensionManifest.IsExtEnabled;
            IsUWPExtension = extensionManifest.IsUWPExtension;
            CanUninstall = extensionManifest.CanUninstall;

            FoundInToolbarPositions = extensionManifest.FoundInToolbarPositions;
            LaunchInDockPositions = extensionManifest.LaunchInDockPositions;
            AppExtensionUniqueID = extensionManifest.AppExtensionUniqueID;

            IconUrl = extensionManifest.IconUrl;
            IconBitmap = extensionManifest.IconBitmap;
        }
Ejemplo n.º 4
0
 public ExtensionManifest(IExtensionManifest data)
 {
     this.Abstract = data.Abstract;
     this.AssemblyName = data.AssemblyName;
     this.CanUninstall = data.CanUninstall;
     this.ContentControl = data.ContentControl;
     this.DisplayName = data.DisplayName;
     this.FoundInToolbarPositions = data.FoundInToolbarPositions;
     this.IconUrl = data.IconUrl;
     this.IsExtEnabled = data.IsExtEnabled;
     this.LaunchInDockPositions = data.LaunchInDockPositions;
     this.Publisher = data.Publisher;
     this.Title = data.Title;
     this.UniqueID = data.UniqueID;
     this.Version = data.Version;
     this.Path = data.Path;
     this.IsUWPExtension = data.IsUWPExtension;
     this.AppExtensionUniqueID = data.AppExtensionUniqueID;
     this.IconBitmap = data.IconBitmap; // <==== this could lead to a leak, investigate this
 }
Ejemplo n.º 5
0
 public void UpdateExtension(IExtensionManifest manifest) {
     var found = _extensions.Where(x => x.Manifest.UniqueID == manifest.UniqueID).FirstOrDefault();
     //if (found != null) {
         found.Manifest.IsExtEnabled = manifest.IsExtEnabled;
         found.Manifest.LaunchInDockPositions = manifest.LaunchInDockPositions;
         found.Manifest.FoundInToolbarPositions = manifest.FoundInToolbarPositions;
     //}
 }
Ejemplo n.º 6
0
        public IExtension CreateInstance(IExtensionManifest md)
        {

            var found = _extensions.Where(x => x.Manifest.UniqueID == md.UniqueID).FirstOrDefault();

            if (found.Extension == null)
            {
                var newElExt = new Services.ThirdParty._Template(found.Manifest);
                newElExt.SendMessage += DoSendMessage;

                if (md.LaunchInDockPositions == ExtensionInToolbarPositions.Left || md.LaunchInDockPositions == ExtensionInToolbarPositions.Right)
                    newElExt.Width = found.Manifest.Size > 0 ? found.Manifest.Size : 350;
                else newElExt.Height = found.Manifest.Size > 0 ? found.Manifest.Size : 200;

                found.Extension = newElExt;
            }

            if (found.Extension != null && found.IsShowingExtensionPanel) return null;

            found.IsShowingExtensionPanel = true;

            return found.Extension;
        }
Ejemplo n.º 7
0
 public async Task<IExtensionManifest> Install(IExtensionManifest extension)
 {
     if (extension == null) return null;
     //await validate(string.Empty, extension);
     //OnInstallExtension?.Invoke(extension, EventArgs.Empty);
     //extension.SendMessage += DoSendMessage;
     _extensions.Add(new ExtensionLite() { Extension = null, Manifest = extension, ExtensionType = ExtensionType.UIComponentLazy });
     //OnDidInstallExtension?.Invoke(extension, EventArgs.Empty);
     return extension;
 }