public IEnumerable <IConnector> Create(IMechanicsService _mechanics) { IEnumerable <IConnector> conn = null; if (right != null) { if (right.ContentItem.VersionRecord == null) { right.ContentItem.ContentManager.Create(right); } conn = _mechanics.CreateConnector(left, right, ConnectorType, IgnorePermissions); } else { conn = _mechanics.CreateConnector(left, RightContentItemId, ConnectorType, IgnorePermissions); } if (transform != null) { foreach (var c in conn) { transform(c); } } return(conn); }
public FeedRegistrationViewHandler( IFeedManager feedManager, IMechanicsService mechanics ) { _feedManager = feedManager; _mechanics = mechanics; }
public ChoiceListFinderDriver( IOrchardServices services, IMechanicsService mechanics ) { _mechanics = mechanics; T = NullLocalizer.Instance; Services = services; }
public static ContentTypePartDefinition ConnectorPartDefinition(this IMechanicsService mechanics, string connectorType) { var connector = ConnectorTypeDefinition(mechanics, connectorType); if (connector == null) { return(null); } return(connector.Parts.FirstOrDefault(p => p.PartDefinition.Name == "ConnectorPart")); }
public static ConnectorTypePartSettings ConnectorSettings(this IMechanicsService mechanics, string connectorType) { var part = ConnectorPartDefinition(mechanics, connectorType); if (part == null) { return(null); } return(part.Settings.TryGetModel <ConnectorTypePartSettings>()); }
/// <summary> /// Loads right item by Id and creates the connector /// </summary> /// <param name="mechanics"></param> /// <param name="leftId"></param> /// <param name="rightId"></param> /// <param name="connectorType"></param> /// <returns></returns> public static IEnumerable <IConnector> CreateConnector(this IMechanicsService mechanics, IContent leftItem, int rightId, string connectorType, bool ignorePermissions = false) { var rightItem = mechanics.Services.ContentManager.Get(rightId); if (rightItem == null) { throw new Exception(String.Format("Failed to create connector: Right Item not found with Id: {0}", rightId)); } return(mechanics.CreateConnector(leftItem, rightItem, connectorType, ignorePermissions)); }
public MechanicsCommands( IContentManager contentManager, IMembershipService membershipService, IMechanicsService mechanics, IOrchardServices services) { _contentManager = contentManager; _membershipService = membershipService; _mechanics = mechanics; Services = services; }
public MechanicsCommands( IContentManager contentManager, IMembershipService membershipService, IMechanicsService mechanics, IOrchardServices services) { _contentManager = contentManager; _membershipService = membershipService; _mechanics = mechanics; Services= services; }
public MechanicsDisplay( IOrigamiService origami, IShapeFactory shapeFactory, IMechanicsService mechanics ) { _origami = origami; Shape = _shapeFactory = shapeFactory; T = NullLocalizer.Instance; Logger = NullLogger.Instance; _mechanics = mechanics; }
public SocketQueryFactory( IOrchardServices services, IMechanicsService mechanics, SocketEndpoint left, IEnumerable <ConnectorPart> draftedConnectors = null ) { Services = services; _mechanics = mechanics; _socket = left; _draftedConnectors = draftedConnectors; Logger = NullLogger.Instance; }
/// <summary> /// Flushes /// </summary> /// <param name="iContentManager"></param> public void Flush(IMechanicsService _mechanics) { foreach (var removal in Removed.ToList()) // Casting to list so we can remove from it during the loop { _mechanics.DeleteConnector(Socket.Left.ContentItem, removal.Key, removal.Value); Removed.Remove(removal.Key); } foreach (var builder in Pending.ToList()) // Casting to list so we can remove from it during the loop { builder.Create(_mechanics); Pending.Remove(builder); } // Reset lazy _lazyCount = new Lazy <int>(_Count); Current = null; }
public IEnumerable<IConnector> Create(IMechanicsService _mechanics) { IEnumerable<IConnector> conn = null; if (right != null) { if (right.ContentItem.VersionRecord==null) { right.ContentItem.ContentManager.Create(right); } conn = _mechanics.CreateConnector(left, right, ConnectorType, IgnorePermissions); } else { conn = _mechanics.CreateConnector(left, RightContentItemId, ConnectorType, IgnorePermissions); } if (transform != null) { foreach (var c in conn) { transform(c); } } return conn; }
public DefaultSocketHandler(IMechanicsService mechanics, IOrchardServices services) { _mechanics = mechanics; Services = services; T = NullLocalizer.Instance; }
public ContentRolesBasedAuthorizationServiceEventHandler(IMechanicsService relationsService, IRoleService roleService) { _relationsService = relationsService; _roleService = roleService; }
public static ContentTypeDefinition ConnectorTypeDefinition(this IMechanicsService mechanics, string connectorType) { return(mechanics.ConnectorTypeDefinitions().FirstOrDefault(def => def.Name == connectorType)); }
public SocketFactory(IMechanicsService mechanics) { _mechanics = mechanics; }