public static void SetFramework() { // this string file is the location of the xml file FileStream stream = new FileStream(ConfigFilePath, FileMode.Open); XPathDocument document = new XPathDocument(stream); XPathNavigator navi = document.CreateNavigator(); XPathItem Location = navi.SelectSingleNode("xml/AppSetting/FolderLocation"); XPathItem Browser = navi.SelectSingleNode("xml/AppSetting/Browser"); XPathItem Url = navi.SelectSingleNode("xml/AppSetting/Url"); XPathItem EnableReport = navi.SelectSingleNode("xml/AppSetting/EnableReport"); XPathItem EnableLog = navi.SelectSingleNode("xml/AppSetting/EnableLog"); XPathItem DataBaseConnectionString = navi.SelectSingleNode("xml/AppSetting/DataBaseConnectionString"); XPathItem AdminUsername = navi.SelectSingleNode("xml/AppSetting/AdminUsername"); XPathItem AdminPassword = navi.SelectSingleNode("xml/AppSetting/AdminPassword"); Settings.Location = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/" + Location.Value; Settings.AdminPassword = Browser.Value; Settings.Url = Url.Value; Settings.EnableReport = EnableReport.Value; Settings.EnableLog = EnableLog.Value; Settings.DataBaseConnectionString = DataBaseConnectionString.Value; Settings.AdminUsername = AdminUsername.Value; Settings.AdminPassword = AdminPassword.Value; Settings.Browser = (BrowserType)Enum.Parse(typeof(BrowserType), Browser.Value.ToString()); // This is a static method responsible for creating a folder structure for the entire framework FolderBuilder.BuildFolderStructure(); }
/// <summary> /// Create an ItemBuilder which allows you to create organizational items (keywords, folders and structure groups) quickly by passing in an Excel /// File with the data. Optionally - you can also pass in a secondary spreadsheet which allows you to provide further information about the items being created /// such as linked schemas, metadata information - etc. /// </summary> /// <param name="client">session-aware core service client</param> /// <param name="publicationName">name of the publication to create the item in ie '010 Schemas'</param> /// <param name="xlsxPath">The xlsx path of the file (if file in same directory as exe, pass "file-name.exe".</param> public ItemBuilder(SessionAwareCoreServiceClient client, string publicationName, string xlsxPath) { try { ExcelReader = new ExcelReader(xlsxPath); } catch (Exception e) { throw new Exception($"Something went wrong deserializing .xlsx file(s) {e.Message}"); } _publicationName = publicationName; FolderBuilder = new FolderBuilder(client); StructureGroupBuilder = new StructureGroupBuilder(client); KeywordBuilder = new KeywordBuilder(client); }
/// <summary> /// 获取文件夹结构(JSON) /// 格式: /// [ /// {nameLoc,pathSvr,pathRel,lenSvr,sizeSvr} /// {nameLoc,pathSvr,pathRel,lenSvr,sizeSvr} /// ] /// </summary> void fd_data() { string id = Request.QueryString["id"]; string cbk = Request.QueryString["callback"]; string json = "({\"value\":null})"; if (!string.IsNullOrEmpty(id)) { FolderBuilder fb = new FolderBuilder(); var data = JsonConvert.SerializeObject(fb.build(id)); data = this.Server.UrlEncode(data); data = data.Replace("+", "%20"); json = "({\"value\":\"" + data + "\"})"; } this.toContent(cbk + json); }
/// <summary> /// Create the folders from the xlsx file under the folder named passed as input. /// </summary> /// <param name="folderName">Name of the root folder to create the folders under. Leave empty to default to "Building Blocks".</param> public void CreateFolders(string folderName = null) { foreach (var folderPath in ExcelReader.PendingItems) { var folderWebdav = WebDavBase; folderWebdav += Constants.BuildingBlocks; // Add the folder subpath if passed in. folderWebdav += !string.IsNullOrEmpty(folderName) ? Constants.Slash + folderName : string.Empty; folderWebdav += Constants.Slash + folderPath; FolderBuilder.RootFolderWebDav = WebDavBase + folderName; FolderBuilder.CreatedFolderPath = folderPath; Console.WriteLine($"Creating folder at path {folderWebdav}"); FolderBuilder.GetOrCreateOrganizationalItem(folderWebdav); } }
void Awake() { screenDPI = Screen.dpi / 160; folderBuilder = gameObject.GetComponent<FolderBuilder>(); camera = GameObject.Find("Main Camera").camera; Objects = new List<GameObject>(); //Init Font menuFont = Resources.Load("Fonts/HelveticaNeue") as Font; //set standard font size fontSize = 90; //Init Textures homeIcon = Resources.Load("Icons/Play_Icons/previous-36") as Texture2D; companyIcon = Resources.Load("Icons/Company_Icons/ISCRisk-36") as Texture2D; backgroundImage = Resources.Load("Backgrounds/MenuBackgrounds/MenuBackgrounds/Orange") as Texture2D; settingsIconSprite = Resources.Load("Icons/Create_Icons/SettingsIcon") as Sprite; fireIconSprite = Resources.Load("Icons/Create_Icons/FireIcon") as Sprite; plusIconSprite = Resources.Load("Icons/Create_Icons/PlusIcon") as Sprite; saveIconSprite = Resources.Load("Icons/Create_Icons/SaveIcon") as Sprite; backIconSprite = Resources.Load("Icons/Create_Icons/CrossIcon") as Sprite; background = new GameObject(); background.isStatic = true; background.layer = 8; background.name = "Background"; background.AddComponent<GUITexture>(); backgroundTexture = background.GetComponent<GUITexture>(); backgroundTexture.pixelInset = new Rect(0, 0, Screen.width, Screen.height); backgroundTexture.texture = backgroundImage; }
// Use this for initialization void Start() { instance = this; folderManager = this.GetComponent<FolderManager>(); MainCamera = GameObject.Find("Main Camera").camera; exampleProjects = new List<DirectoryInfo>(); exampleProjects.Add(CreateFolder); foreach(DirectoryInfo folder in folderManager.GetExamples()) exampleProjects.Add(folder); }