-
Notifications
You must be signed in to change notification settings - Fork 635
/
Configurations.cs
452 lines (349 loc) · 15.9 KB
/
Configurations.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
using System;
using System.Collections.Generic;
using System.Linq;
using Dynamo.Properties;
using Dynamo.Utilities;
namespace Dynamo.Configuration
{
/// <summary>
/// This class contains properties that are used in Dynamo.
/// </summary>
public class Configurations
{
#region Dynamo Universal Constants
/// <summary>
/// User interface culture
/// </summary>
public static readonly string FallbackUiCulture = "en-US";
/// <summary>
/// Name of backup folder
/// </summary>
public static readonly string BackupFolderName = "backup";
/// <summary>
/// Name of XML attribute which contains target file path.
/// </summary>
public static readonly string FilePathAttribName = "TargetXmlFilePath";
/// <summary>
/// Default width of Double Slider
/// </summary>
public static readonly double DoubleSliderTextBoxWidth = 55.0;
/// <summary>
/// Default width of Integer Slider
/// </summary>
public static readonly double IntegerSliderTextBoxWidth = 30.0;
/// <summary>
/// Const string of Autodesk
/// </summary>
public static readonly string AutodeskAsString = "Autodesk";
/// <summary>
/// Const string of Dynamo
/// </summary>
public static readonly string DynamoAsString = "Dynamo";
/// <summary>
/// Const string for Dynamo Node Help Docs
/// </summary>
public static readonly string DynamoNodeHelpDocs = "NodeHelpSharedDocs";
/// <summary>
/// Const used for zoom-to-fit calculations for nodes and groups in the workspace.
/// </summary>
public static readonly double ZoomToFitPaddingFactor = 3.5;
/// <summary>
/// Const used to define the interaction or hit area thickness for connectors in the workspace.
/// </summary>
public static readonly double ConnectorBaseThickness = 3;
/// <summary>
/// Const defining the scaling factor for adjusting connector stroke thickness based on zoom level.
/// </summary>
public const double ConnectorZoomScalingFactor = 2.0;
#endregion
#region Usage Reporting Error Message
/// <summary>
/// Link to Dynamo site
/// </summary>
public static string DynamoSiteLink = "http://dynamobim.org/";
/// <summary>
/// Link to Dynamo wiki
/// </summary>
public static string DynamoWikiLink = "https://github.com/DynamoDS/Dynamo/wiki";
/// <summary>
/// Link to Dynamo forum
/// </summary>
public static string DynamoBimForum = "http://dynamobim.org/forums/forum/dyn/";
/// <summary>
/// DynamoTeam email
/// </summary>
public static string DynamoTeamEmail = "mailto:[email protected]";
/// <summary>
/// Link to Dynamo video tutorials
/// </summary>
public static string DynamoVideoTutorials = "http://dynamobim.org/learn/#161";
/// <summary>
/// Link to Dynamo dictionary
/// </summary>
public static string DynamoDictionary = "http://dictionary.dynamobim.com/2/";
/// <summary>
/// Link to Dynamo primer
/// </summary>
public static string DynamoPrimer = "http://primer2.dynamobim.org/";
/// <summary>
/// Link to Dynamo download page
/// </summary>
public static string DynamoDownloadLink = "http://dynamobim.org/download/";
/// <summary>
/// Link to Dynamo's github repo
/// </summary>
public static string GitHubDynamoLink = "https://github.com/DynamoDS/Dynamo";
/// <summary>
/// Link to Dynamo's issues on github
/// </summary>
public static string GitHubBugReportingLink = "https://github.com/DynamoDS/Dynamo/issues/new";
#endregion
#region Canvas Configurations
//public static readonly double Minimum
/// <summary>
/// Generic Constants
/// </summary>
public static readonly double PortHeightInPixels = 34;
/// <summary>
/// Canvas Control
/// </summary>
public static readonly double ZoomIncrement = 0.05;
/// <summary>
/// Global zoom threshold level for node overlay to apply (zoom-in/out behavior)
/// </summary>
public static readonly double ZoomThreshold = 0.4;
/// <summary>
/// Global zoom threshold for renaming Nodes and Notes
/// </summary>
public static readonly double ZoomDirectEditThreshold = 0.5;
#endregion
#region Tab Bar Configurations
/// <summary>
/// Count of tabs before clipping
/// </summary>
public static readonly int MinTabsBeforeClipping = 6;
/// <summary>
/// Default width of Tab control menu
/// </summary>
public static readonly int TabControlMenuWidth = 20;
/// <summary>
/// Default width of tab
/// </summary>
public static readonly int TabDefaultWidth = 225;
/// <summary>
/// Minimum width of tab in the extensions side bar
/// </summary>
public static readonly int ExtensionsSideBarTabMinWidth = 150;
#endregion
#region Information Bubble
/// <summary>
/// Maximal opacity of bubble
/// </summary>
internal static double MaxOpacity = 0.95;
#region Preview Bubble
internal static double PreviewTextFontSize = 10;
internal static double PreviewMaxWidth = 500;
internal static double PreviewMinWidth = 40;
internal static double PreviewMinHeight = 30;
internal static double PreviewDefaultMaxWidth = 300;
internal static double PreviewDefaultMaxHeight = 200;
internal static double PreviewCondensedMaxWidth = 300;
internal static double PreviewCondensedMaxHeight = 200;
internal static double PreviewCondensedMinWidth = 40;
internal static double PreviewCondensedMinHeight = 0;
internal static double PreviewCondensedContentMaxWidth = PreviewCondensedMaxWidth - 10;
internal static double PreviewCondensedContentMaxHeight = PreviewCondensedMaxHeight - 17;
internal static double PreviewArrowWidth = 12;
internal static double PreviewArrowHeight = 6;
#endregion
#region Error Bubble
internal static double ErrorFrameStrokeThickness = 1;
internal static double ErrorMaxWidth = 300;
internal static double ErrorMaxHeight = 200;
internal static double ErrorContentMaxWidth = ErrorMaxWidth - 10;
internal static double ErrorContentMaxHeight = ErrorMaxHeight - 16;
internal static double ErrorCondensedMaxWidth = 75;
internal static double ErrorCondensedMinWidth = 25;
internal static double ErrorCondensedMaxHeight = 50;
internal static double ErrorCondensedMinHeight = 25;
internal static double ErrorCondensedContentMaxWidth = ErrorCondensedMaxWidth - 10;
internal static double ErrorCondensedContentMaxHeight = ErrorCondensedMaxHeight - 16;
internal static double ErrorTextFontSize = 13;
internal static Thickness ErrorContentMargin = new Thickness(5, 5, 5, 12);
internal static double ErrorArrowWidth = 12;
internal static double ErrorArrowHeight = 6;
#endregion
#region Node Tooltip
internal static double NodeTooltipFrameStrokeThickness = 1;
internal static double NodeTooltipMaxWidth = 200;
internal static double NodeTooltipMaxHeight = 200;
internal static double NodeTooltipContentMaxWidth = NodeTooltipMaxWidth - 10;
internal static double NodeTooltipContentMaxHeight = NodeTooltipMaxHeight - 16;
internal static double NodeTooltipTextFontSize = 11;
internal static Thickness NodeTooltipContentMarginLeft = new Thickness(11, 5, 5, 5);
internal static Thickness NodeTooltipContentMarginRight = new Thickness(5, 5, 11, 5);
internal static Thickness NodeTooltipContentMarginBottom = new Thickness(5, 5, 5, 11);
internal static double NodeTooltipArrowWidth_BottomConnecting = 12;
internal static double NodeTooltipArrowHeight_BottomConnecting = 6;
internal static double NodeTooltipArrowWidth_SideConnecting = 6;
internal static double NodeTooltipArrowHeight_SideConnecting = 12;
internal static double ToolTipTargetGapInPixels = 3.0;
internal static double NodeButtonHeight = 32; // Height of node button.
internal static double BottomPanelHeight = 48; // Height of black bottom panel with 2 buttons: Run & Canсel.
internal static int MaxLengthTooltipCode = 35; // Max length of field code in tooltip, it's near copy icon.
internal static string NoDescriptionAvailable = Resources.NoDescriptionAvailable;
#endregion
#region Library Item Tooltip
internal static double LibraryTooltipFrameStrokeThickness = 1;
internal static double LibraryTooltipMaxWidth = 400;
internal static double LibraryTooltipMaxHeight = 200;
internal static double LibraryTooltipContentMaxWidth = LibraryTooltipMaxWidth - 10;
internal static double LibraryTooltipContentMaxHeight = LibraryTooltipMaxHeight - 17;
internal static double LibraryTooltipTextFontSize = 11;
internal static Thickness LibraryTooltipContentMargin = new Thickness(12, 5, 5, 5);
internal static double LibraryTooltipArrowHeight = 12;
internal static double LibraryTooltipArrowWidth = 6;
#endregion
#endregion
#region CodeBlockNode
/// <summary>
/// Code Block outputs have a condensed port height
/// </summary>
public static readonly double CodeBlockOutputPortHeightInPixels = 16.345;
/// <summary>
/// Maximal port name length of CodeBlock
/// </summary>
public static readonly int CBNMaxPortNameLength = 24;
/// <summary>
/// Highlighting File
/// </summary>
public static readonly string HighlightingFile =
"DesignScript.Resources.SyntaxHighlighting.xshd";
#endregion
#region Externally Visible Strings
#region Legacy XML sessionTraceData serialization
internal static readonly string SessionTraceDataXmlTag = "SessionTraceData";
#endregion
#region Bindings Json serialization
internal static readonly string BindingsTag = "Bindings";
internal static readonly string BingdingTag = "Binding";
internal static readonly string NodeIdAttribName = "NodeId";
internal static readonly string CallSiteID = "CallSiteID";
#endregion
#endregion
#region NodeView
/// <summary>
/// Start ZIndex for nodes is set to 3, because 1 is for groups, 2 is for connectors.
/// </summary>
internal static readonly int NodeStartZIndex = 3;
#endregion
#region Preview Control Settings
internal static readonly double MaxExpandedPreviewWidth = 280.0;
internal static readonly double MaxExpandedPreviewHeight = 310.0;
internal static readonly double MaxCondensedPreviewWidth = 280.0;
internal static readonly double MaxCondensedPreviewHeight = 64.0;
internal static readonly double DefCondensedContentWidth = 33.0;
internal static readonly double DefCondensedContentHeight = 28.0;
#endregion
#region Icon Resources Strings
internal const string SmallIconPostfix = ".Small";
internal const string LargeIconPostfix = ".Large";
internal const string IconResourcesDLL = ".customization.dll";
internal const string DefaultIcon = "DefaultIcon";
internal const string DefaultCustomNodeIcon = "DefaultCustomNode";
internal const string DefaultAssembly = "DynamoCore";
#endregion
#region Class button
internal const int MaxRowNumber = 2;
internal const int MaxLengthRowClassButtonTitle = 9; // How many characters can be in one row.
internal const string TwoDots = "..";
#endregion
#region LibraryView
internal const double MinWidthLibraryView = 204;
internal static string TopResult = Resources.TopResult;
internal const string CategoryGroupCreate = "Create";
internal const string CategoryGroupAction = "Actions";
internal const string CategoryGroupQuery = "Query";
internal const string CategoryDelimiterString = ".";
internal const string ShortenedCategoryDelimiter = "-";
internal const string CategoryDelimiterWithSpaces = " - ";
internal const string ClassesDefaultName = "Classes";
internal const string ElementTypeShorthandCategory = "CTGRY";
internal const string ElementTypeShorthandPackage = "PKG";
internal const string ElementTypeShorthandImportedDll = "DLL";
#endregion
#region ClassInformationView
internal static string MoreButtonTextFormat = Resources.MoreButtonTextFormat;
internal static string HeaderCreate = Resources.HeaderCreate;
internal static string HeaderAction = Resources.HeaderAction;
internal static string HeaderQuery = Resources.HeaderQuery;
#endregion
#region InCanvasSearch
internal const double InCanvasSearchTextBoxHeight = 40.0;
#endregion
#region Backup
/// <summary>
/// Default backup file name prefix
/// </summary>
public static string BackupFileNamePrefix = "backup";
#endregion
#region Locale info and constants
/// <summary>
/// Supported locales as a list
/// </summary>
internal static readonly List<string> SupportedLocaleList = new List<string>() { "Default", "en-US", "cs-CZ", "de-DE", "es-ES", "fr-FR", "it-IT", "ja-JP", "ko-KR", "pl-PL", "pt-BR", "ru-RU", "zh-CN", "zh-TW" };
/// <summary>
/// Supported languages and locales as a dictionary in the current thread locale
/// </summary>
public static Dictionary<string, string> SupportedLocaleDic
{
get
{
// Dynamically create a dictionary mapping languages and locales in the current thread locale
// This is done so that Preferences Panel could display the languages selections using the current locale
return Properties.Resources.DynamoLanguages_noxlate.Split(',').
Zip(SupportedLocaleList, (k, v) => (k, v)).ToDictionary(x => x.k, x => x.v);
}
}
/// <summary>
/// Host units, used to scale background grid graphic element
/// </summary>
internal enum Units
{
Millimeters,
Centimeters,
Meters,
Kilometers,
Feet,
Inches,
Miles
}
/// <summary>
/// Supported Host units and their conversion to dynamo units
/// Used in graphic helpers scaling (grid, axes)
/// </summary>
internal static Dictionary<Units, double> SupportedUnits
{
get
{
return new Dictionary<Units, double>
{
{ Units.Millimeters, 1 },
{ Units.Centimeters, 10 },
{ Units.Meters, 1000 },
{ Units.Kilometers, 100000 },
{ Units.Feet, 1 },
{ Units.Inches, 10 },
{ Units.Miles, 1000 },
};
}
}
#endregion
#region Notifications Constants
/// <summary>
/// Request timeOut for notifications service
/// </summary>
public const int NotificationsDefaultTimeOut = 10000;
#endregion
}
}