· 7 years ago · Mar 15, 2018, 02:18 AM
1class fbIncCreator
2{
3 public static void Main(string[] args)
4 {
5 var show_help = false;
6 string xmlFilePath = null;
7 string appId = null, secretKey = null, canvasUrl = null, requiredPermissions = null;
8 Dictionary<string, string> _stringMapping;
9 ArgumentMode mode = ArgumentMode.kXmlMode;
10 bool argValid = ParseArguments(args, ref xmlFilePath, ref appId, ref secretKey, ref canvasUrl, ref requiredPermissions, ref show_help, ref mode);
11 if (argValid)
12 {
13 if (mode == ArgumentMode.kXmlMode)
14 {
15 XmlModeFileCreator fc = new XmlModeFileCreator(xmlFilePath, Paths.kfbincphpOutputFilePath, Paths.kfbincphpTemplateFilePath);
16 fc.CreateFile();
17 }
18 else if (mode == ArgumentMode.kAttributesMode)
19 {
20 _stringMapping = populateStringMapping(appId,secretKey,canvasUrl,requiredPermissions);
21 AttributesModeFileCreator fc = new AttributesModeFileCreator(_stringMapping);
22 fc.CreateFile();
23 }
24 }
25
26 }
27
28
29 private static Dictionary<string, string> populateStringMapping(string appId, string secretKey, string canvasUrl, string requiredPermissions)
30 {
31 Dictionary<string, string> _stringMapping = new Dictionary<string, string>();
32 _stringMapping.Add(ReplacebleAppParamStrings.kReplacebleAppIdString, appId);
33 _stringMapping.Add(ReplacebleAppParamStrings.kReplacebleSecretKeyString, secretKey);
34 _stringMapping.Add(ReplacebleAppParamStrings.kReplacebleCanvasUrlString, canvasUrl);
35 _stringMapping.Add(ReplacebleAppParamStrings.kReplaceblePermissionString, requiredPermissions);
36 return _stringMapping;
37 }