예제 #1
0
        public ICollection <INamespaceItem> FetchNamespacesWithJsonRetunrs(IPluginSource source)
        {
            var serializer     = new Dev2JsonSerializer();
            var comsController = CommunicationControllerFactory.CreateController("FetchPluginNameSpaces");

            comsController.AddPayloadArgument(nameof(source), serializer.SerializeToBuilder(source));
            comsController.AddPayloadArgument("fetchJson", new StringBuilder(true.ToString()));
            var workspaceId = Connection.WorkspaceID;
            var payload     = comsController.ExecuteCommand <ExecuteMessage>(Connection, workspaceId);

            if (payload == null || payload.HasError)
            {
                if (!Connection.IsConnected)
                {
                    ShowServerDisconnectedPopup();
                    return(new List <INamespaceItem>());
                }
                if (payload != null)
                {
                    throw new WarewolfSupportServiceException(payload.Message.ToString(), null);
                }
                throw new WarewolfSupportServiceException(ErrorResource.ServiceDoesNotExist, null);
            }
            return(serializer.Deserialize <List <INamespaceItem> >(payload.Message));
        }
예제 #2
0
        public IList <IPluginAction> PluginActionsWithReturns(IPluginSource source, INamespaceItem ns)
        {
            var serializer     = new Dev2JsonSerializer();
            var comsController = CommunicationControllerFactory.CreateController("FetchPluginActionsWithReturnsTypes");
            var pluginActions  = GetPluginActions(source, ns, comsController, serializer);

            return(pluginActions);
        }
예제 #3
0
 public static List <Type> GetModulesWithAllDependencies(this IPluginSource plugInSource)
 {
     return(plugInSource
            .GetModules()
            .SelectMany(DinazorModule.FindDependedModuleTypesRecursivelyIncludingGivenModule)
            .Distinct()
            .ToList());
 }
 public bool Equals(IPluginSource other)
 {
     // ReSharper disable once PossibleNullReferenceException
     return(string.Equals(Name, other.Name) &&
            string.Equals(Path, other.Path) &&
            string.Equals(ConfigFilePath, other.ConfigFilePath) &&
            string.Equals(FileSystemAssemblyName, other.FileSystemAssemblyName) &&
            string.Equals(GACAssemblyName, other.GACAssemblyName));
 }
예제 #5
0
        public bool Equals(IPluginSource other)
        {
            var equals = true;

            equals &= string.Equals(Name, other.Name);
            equals &= string.Equals(Path, other.Path);
            equals &= string.Equals(ConfigFilePath, other.ConfigFilePath);
            equals &= string.Equals(FileSystemAssemblyName, other.FileSystemAssemblyName);
            equals &= string.Equals(GACAssemblyName, other.GACAssemblyName);
            return(equals);
        }
예제 #6
0
        public void SavePluginSource(IPluginSource source, Guid serverWorkspaceID)
        {
            var con            = Connection;
            var comsController = CommunicationControllerFactory.CreateController("SavePluginSource");
            var serialiser     = new Dev2JsonSerializer();

            comsController.AddPayloadArgument("PluginSource", serialiser.SerializeToBuilder(source));
            var output = comsController.ExecuteCommand <IExecuteMessage>(con, GlobalConstants.ServerWorkspaceID);

            if (output.HasError)
            {
                throw new WarewolfSaveException(output.Message.ToString(), null);
            }
        }
        /// <summary>
        /// Adds a plugin source to the repository.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <exception cref="System.ArgumentNullException">source</exception>
        /// <exception cref="System.ArgumentException">Source already added</exception>
        public void AddPluginSource(IPluginSource source)
        {
            if (source == null)
            throw new ArgumentNullException("source");

              if (this.sources.Contains(source))
            throw new ArgumentException(Resources.SourceAlreadyAdded);

              source.PluginAdded += this.OnPluginAdded;
              source.PluginRemoved += this.OnPluginRemoved;

              this.sources.Add(source);

              this.log.Debug(Resources.SourceAdded, source.GetType().FullName);
        }
예제 #8
0
        /// <summary>
        /// Removes a plugin source from the repository.
        /// </summary>
        /// <param name="source">The source.</param>
        public void RemovePluginSource(IPluginSource source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            if (!this.sources.Contains(source))
            {
                throw new ArgumentException(Resources.UnknownSource);
            }

            this.sources.Remove(source);
            source.PluginAdded   -= this.OnPluginAdded;
            source.PluginRemoved -= this.OnPluginRemoved;

            this.log.Debug(Resources.SourceRemoved, source.GetType().FullName);
        }
예제 #9
0
        /// <summary>
        /// Adds a plugin source to the repository.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <exception cref="System.ArgumentNullException">source</exception>
        /// <exception cref="System.ArgumentException">Source already added</exception>
        public void AddPluginSource(IPluginSource source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            if (this.sources.Contains(source))
            {
                throw new ArgumentException(Resources.SourceAlreadyAdded);
            }

            source.PluginAdded   += this.OnPluginAdded;
            source.PluginRemoved += this.OnPluginRemoved;

            this.sources.Add(source);

            this.log.Debug(Resources.SourceAdded, source.GetType().FullName);
        }
        public IList <IPluginConstructor> PluginConstructors(IPluginSource source, INamespaceItem ns)
        {
            Dev2JsonSerializer serializer = new Dev2JsonSerializer();
            var comsController            = CommunicationControllerFactory.CreateController("FetchPluginConstructors");

            comsController.AddPayloadArgument("source", serializer.SerializeToBuilder(source));
            comsController.AddPayloadArgument("namespace", serializer.SerializeToBuilder(ns));
            var workspaceId = Connection.WorkspaceID;
            var result      = comsController.ExecuteCommand <ExecuteMessage>(Connection, workspaceId);

            if (result == null || result.HasError)
            {
                if (!Connection.IsConnected)
                {
                    ShowServerDisconnectedPopup();
                    return(new List <IPluginConstructor>());
                }
                if (result != null)
                {
                    throw new WarewolfSupportServiceException(result.Message.ToString(), null);
                }
                throw new WarewolfSupportServiceException(ErrorResource.ServiceDoesNotExist, null);
            }
            var pluginConstructors = serializer.Deserialize <List <IPluginConstructor> >(result.Message.ToString());

            if (DataListSingleton.ActiveDataList != null)
            {
                if (DataListSingleton.ActiveDataList.ComplexObjectCollection != null)
                {
                    var objectCollection = DataListSingleton.ActiveDataList.ComplexObjectCollection;
                    pluginConstructors.AddRange(objectCollection.Select(objectItemModel => new PluginConstructor()
                    {
                        ConstructorName  = objectItemModel.Name,
                        IsExistingObject = true
                    }));
                }
            }

            return(pluginConstructors);
        }
예제 #11
0
        IList <IPluginAction> GetPluginActions(IPluginSource source, INamespaceItem ns, ICommunicationController comsController, Dev2JsonSerializer serializer)
        {
            comsController.AddPayloadArgument(nameof(source), serializer.SerializeToBuilder(source));
            comsController.AddPayloadArgument("namespace", serializer.SerializeToBuilder(ns));
            var workspaceId = Connection.WorkspaceID;
            var result      = comsController.ExecuteCommand <ExecuteMessage>(Connection, workspaceId);

            if (result == null || result.HasError)
            {
                if (!Connection.IsConnected)
                {
                    ShowServerDisconnectedPopup();
                    return(new List <IPluginAction>());
                }
                if (result != null)
                {
                    throw new WarewolfSupportServiceException(result.Message.ToString(), null);
                }
                throw new WarewolfSupportServiceException(ErrorResource.ServiceDoesNotExist, null);
            }

            return(serializer.Deserialize <List <IPluginAction> >(result.Message.ToString()));
        }
예제 #12
0
 public ICollection <IPluginConstructor> GetConstructors(IPluginSource source, INamespaceItem value) => _queryProxy.PluginConstructors(source, value).ToList();
 public void Save(IPluginSource source) => UpdateManagerProxy.SavePluginSource(source, GlobalConstants.ServerWorkspaceID);
예제 #14
0
 public PluginProvider(IPluginSource source)
 {
     Contract.Requires(source != null);
     this.source = source;
 }
 public ICollection <IPluginConstructor> GetConstructors(IPluginSource source, INamespaceItem ns)
 {
     return(_queryProxy.PluginConstructors(source, ns).ToList());
 }
 public void Save(IPluginSource source)
 {
     _updateRepository.Save(source);
 }
예제 #17
0
 public void EditSource(IPluginSource selectedSource)
 {
     _shell.EditResource(selectedSource);
 }
 public ICollection <INamespaceItem> GetNameSpaces(IPluginSource source)
 {
     return(_queryProxy.FetchNamespaces(source));
 }
예제 #19
0
 public ICollection <INamespaceItem> GetNameSpacesWithJsonRetunrs(IPluginSource source) => _queryProxy.FetchNamespacesWithJsonRetunrs(source);
예제 #20
0
        /// <summary>
        /// Removes a plugin source from the repository.
        /// </summary>
        /// <param name="source">The source.</param>
        public void RemovePluginSource(IPluginSource source)
        {
            if (source == null)
            throw new ArgumentNullException("source");

              if (!this.sources.Contains(source))
            throw new ArgumentException(Resources.UnknownSource);

              this.sources.Remove(source);
              source.PluginAdded -= this.OnPluginAdded;
              source.PluginRemoved -= this.OnPluginRemoved;

              this.log.Debug(Resources.SourceRemoved, source.GetType().FullName);
        }
예제 #21
0
 public ICollection <IPluginAction> GetActionsWithReturns(IPluginSource source, INamespaceItem ns) => _queryProxy.PluginActionsWithReturns(source, ns).Where(a => a.Method != "GetType").ToList();
예제 #22
0
 public bool Equals(IPluginSource other) => string.Equals(Name, other.Name) &&
 string.Equals(Path, other.Path) &&
 string.Equals(ConfigFilePath, other.ConfigFilePath) &&
 string.Equals(FileSystemAssemblyName, other.FileSystemAssemblyName) &&
 string.Equals(GACAssemblyName, other.GACAssemblyName);
예제 #23
0
 public void Save(IPluginSource toDbSource)
 {
     _updateRepository.Save(toDbSource);
 }