7
7
using Umbraco . Cms . Core . Cache ;
8
8
using Umbraco . Cms . Core . Events ;
9
9
using Umbraco . Cms . Core . Models ;
10
+ using Umbraco . Cms . Core . Models . Entities ;
10
11
using Umbraco . Cms . Core . Notifications ;
11
12
using Umbraco . Cms . Core . Services ;
12
13
using Umbraco . Cms . Core . Strings ;
@@ -70,7 +71,6 @@ public override IEnumerable<uSyncAction> ExportAll(string folder, HandlerSetting
70
71
return actions ;
71
72
}
72
73
73
-
74
74
/// <summary>
75
75
/// Relations that by default we exclude, if the exlude setting is used,then it will override these values
76
76
/// and they will be included if not explicity set;
@@ -103,67 +103,12 @@ protected override string GetItemName(IRelationType item)
103
103
protected override string GetItemFileName ( IRelationType item )
104
104
=> GetItemAlias ( item ) . ToSafeAlias ( shortStringHelper ) ;
105
105
106
- // private void RelationService_SavedRelation(IRelationService sender, Umbraco.Core.Events.SaveEventArgs<IRelation> e)
107
- // {
108
- // if (uSync8BackOffice.eventsPaused) return;
109
-
110
- // lock (saveLock)
111
- // {
112
- // saveTimer.Stop();
113
- // saveTimer.Start();
114
-
115
- // // add each item to the save list (if we haven't already)
116
- // foreach (var item in e.SavedEntities)
117
- // {
118
- // if (!pendingSaveIds.Contains(item.RelationTypeId))
119
- // pendingSaveIds.Add(item.RelationTypeId);
120
- // }
121
- // }
122
- // }
123
-
124
- // private void SaveTimer_Elapsed(object sender, ElapsedEventArgs e)
125
- // {
126
- // lock (saveLock)
127
- // {
128
- // UpdateRelationTypes(pendingSaveIds);
129
- // pendingSaveIds.Clear();
130
- // }
131
- // }
132
-
133
- // private static Timer saveTimer;
134
- // private static List<int> pendingSaveIds;
135
- // private static object saveLock;
136
-
137
- // private void RelationService_DeletedRelation(IRelationService sender, Umbraco.Core.Events.DeleteEventArgs<IRelation> e)
138
- // {
139
- // if (uSync8BackOffice.eventsPaused) return;
140
-
141
- // var types = new List<int>();
142
-
143
- // foreach (var item in e.DeletedEntities)
144
- // {
145
- // if (!types.Contains(item.RelationTypeId))
146
- // types.Add(item.RelationTypeId);
147
- // }
148
-
149
- // UpdateRelationTypes(types);
150
- // }
151
-
152
- // private void UpdateRelationTypes(IEnumerable<int> types)
153
- // {
154
- // foreach (var type in types)
155
- // {
156
- // var relationType = relationService.GetRelationTypeById(type);
157
-
158
- // var attempts = Export(relationType, Path.Combine(rootFolder, this.DefaultFolder), DefaultConfig);
159
-
160
- // if (!(this.DefaultConfig.GuidNames && this.DefaultConfig.UseFlatStructure))
161
- // {
162
- // foreach (var attempt in attempts.Where(x => x.Success))
163
- // {
164
- // this.CleanUp(relationType, attempt.FileName, Path.Combine(rootFolder, this.DefaultFolder));
165
- // }
166
- // }
167
- // }
168
- // }
169
- }
106
+ protected override IEnumerable < IEntity > GetChildItems ( int parent )
107
+ {
108
+ if ( parent == - 1 )
109
+ return relationService . GetAllRelationTypes ( ) ;
110
+
111
+ return [ ] ;
112
+ }
113
+
114
+ }
0 commit comments