コード例 #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());
 }
コード例 #4
0
 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
ファイル: UpdateProxy.cs プロジェクト: kapiya/Warewolf
        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);
            }
        }
コード例 #7
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);
        }
コード例 #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);
        }
コード例 #10
0
        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();
コード例 #13
0
 public void Save(IPluginSource source) => UpdateManagerProxy.SavePluginSource(source, GlobalConstants.ServerWorkspaceID);
コード例 #14
0
ファイル: PluginProvider.cs プロジェクト: jcambert/jcReactive
 public PluginProvider(IPluginSource source)
 {
     Contract.Requires(source != null);
     this.source = source;
 }
コード例 #15
0
 public ICollection <IPluginConstructor> GetConstructors(IPluginSource source, INamespaceItem ns)
 {
     return(_queryProxy.PluginConstructors(source, ns).ToList());
 }
コード例 #16
0
 public void Save(IPluginSource source)
 {
     _updateRepository.Save(source);
 }
コード例 #17
0
 public void EditSource(IPluginSource selectedSource)
 {
     _shell.EditResource(selectedSource);
 }
コード例 #18
0
 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);
 }