Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public FeedRegistrationViewHandler(
     IFeedManager feedManager,
     IMechanicsService mechanics
     )
 {
     _feedManager = feedManager;
     _mechanics   = mechanics;
 }
 public FeedRegistrationViewHandler(
     IFeedManager feedManager,
     IMechanicsService mechanics
     )
 {
     _feedManager = feedManager;
     _mechanics = mechanics;
 }
Esempio n. 4
0
 public ChoiceListFinderDriver(
     IOrchardServices services,
     IMechanicsService mechanics
     )
 {
     _mechanics = mechanics;
     T          = NullLocalizer.Instance;
     Services   = services;
 }
Esempio n. 5
0
        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"));
        }
Esempio n. 6
0
        public static ConnectorTypePartSettings ConnectorSettings(this IMechanicsService mechanics, string connectorType)
        {
            var part = ConnectorPartDefinition(mechanics, connectorType);

            if (part == null)
            {
                return(null);
            }
            return(part.Settings.TryGetModel <ConnectorTypePartSettings>());
        }
Esempio n. 7
0
        /// <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));
        }
Esempio n. 8
0
 public MechanicsCommands(
     IContentManager contentManager,
     IMembershipService membershipService,
     IMechanicsService mechanics,
     IOrchardServices services)
 {
     _contentManager    = contentManager;
     _membershipService = membershipService;
     _mechanics         = mechanics;
     Services           = services;
 }
Esempio n. 9
0
 public MechanicsCommands(
     IContentManager contentManager,
     IMembershipService membershipService,
     IMechanicsService mechanics,
     IOrchardServices services)
 {
     _contentManager = contentManager;
     _membershipService = membershipService;
     _mechanics = mechanics;
     Services= services;
 }
Esempio n. 10
0
 public MechanicsDisplay(
     IOrigamiService origami,
     IShapeFactory shapeFactory,
     IMechanicsService mechanics
     )
 {
     _origami = origami;
     Shape = _shapeFactory = shapeFactory;
     T = NullLocalizer.Instance;
     Logger = NullLogger.Instance;
     _mechanics = mechanics;
 }
Esempio n. 11
0
 public MechanicsDisplay(
     IOrigamiService origami,
     IShapeFactory shapeFactory,
     IMechanicsService mechanics
     )
 {
     _origami   = origami;
     Shape      = _shapeFactory = shapeFactory;
     T          = NullLocalizer.Instance;
     Logger     = NullLogger.Instance;
     _mechanics = mechanics;
 }
Esempio n. 12
0
 public SocketQueryFactory(
     IOrchardServices services,
     IMechanicsService mechanics,
     SocketEndpoint left,
     IEnumerable <ConnectorPart> draftedConnectors = null
     )
 {
     Services           = services;
     _mechanics         = mechanics;
     _socket            = left;
     _draftedConnectors = draftedConnectors;
     Logger             = NullLogger.Instance;
 }
Esempio n. 13
0
 /// <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;
 }
Esempio n. 14
0
 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;
 }
Esempio n. 15
0
 public DefaultSocketHandler(IMechanicsService mechanics, IOrchardServices services)
 {
     _mechanics = mechanics;
     Services = services;
     T = NullLocalizer.Instance;
 }
 public ContentRolesBasedAuthorizationServiceEventHandler(IMechanicsService relationsService, IRoleService roleService)
 {
     _relationsService = relationsService;
     _roleService      = roleService;
 }
 public ContentRolesBasedAuthorizationServiceEventHandler(IMechanicsService relationsService, IRoleService roleService)
 {
     _relationsService = relationsService;
     _roleService = roleService;
 }
Esempio n. 18
0
 public DefaultSocketHandler(IMechanicsService mechanics, IOrchardServices services)
 {
     _mechanics = mechanics;
     Services   = services;
     T          = NullLocalizer.Instance;
 }
Esempio n. 19
0
 public static ContentTypeDefinition ConnectorTypeDefinition(this IMechanicsService mechanics, string connectorType)
 {
     return(mechanics.ConnectorTypeDefinitions().FirstOrDefault(def => def.Name == connectorType));
 }
Esempio n. 20
0
 public SocketFactory(IMechanicsService mechanics)
 {
     _mechanics = mechanics;
 }
Esempio n. 21
0
 public SocketFactory(IMechanicsService mechanics) {
     _mechanics = mechanics;
 }