public bool CloseSolution() { if (this.CurrentSelectedSolutionClosing != null) { this.CurrentSelectedSolutionClosing((object)this, new SolutionEventArgs(this.CurrentSelectedSolution)); } if (Services.ProjectOperations.CurrentSelectedSolution == null) { return(true); } if (!Services.Workbench.CloseAll(false)) { return(false); } if (Services.Workspace.Items.Count != 0) { Services.Workspace.CloseWorkspaceItem(Services.Workspace.Items[0], true); } if (this.CurrentSelectedSolutionClosed != null) { this.CurrentSelectedSolutionClosed((object)this, new SolutionEventArgs(this.CurrentSelectedSolution)); } try { CSCocosHelp.ClearResurceCache(); } catch (Exception ex) { LogConfig.Logger.Error((object)"Clear resource cache failed.", ex); } Services.ProjectOperations.CurrentSelectedSolution = (Solution)null; return(true); }
public static GameProjectLoadResult LoadProject(GameProjectData objectData) { GameProjectLoadResult result; if (objectData == null || objectData.ObjectData == null) { result = null; } else { GameProjectLoadResult gameProjectLoadResult = new GameProjectLoadResult(); Dictionary <int, VisualObject> dictionary = new Dictionary <int, VisualObject>(); CSCocosHelp.RefreshLayoutSystemState(false); BaseRecorder.IsCreateDefaultRecorder = false; gameProjectLoadResult.RootObject = GameProjectLoader.ConvertObject(objectData.ObjectData, gameProjectLoadResult, dictionary); gameProjectLoadResult.RootObject.CanEdit = true; CSCocosHelp.RefreshLayoutSystemState(true); BaseRecorder.IsCreateDefaultRecorder = true; GameProjectLoader.RefreshObjectsRecorder(gameProjectLoadResult.RootObject); if (objectData.Animation != null) { gameProjectLoadResult.TimelineAction = GameProjectLoader.ConvertTimeLineAction(objectData.Animation, gameProjectLoadResult.RootObject, dictionary); } result = gameProjectLoadResult; } return(result); }
protected override void OnDelete() { this.DeleteFile(this.imageFile); this.DeleteFile(this.BaseDirectory); this.DeleteFile(this.plistFileInfo); base.OnDelete(); CSCocosHelp.RemovePlistFileFromCache(this.GetResourceData().Path); }
public string Serialize(PublishInfo info, IProjectFile projFile) { FilePath destinationFilePath = (FilePath)info.DestinationFilePath; string sourceFilePath = info.SourceFilePath; string des = (string)destinationFilePath.ChangeExtension(".csb"); string itemDirectory = (string)Services.ProjectOperations.CurrentSelectedSolution.ItemDirectory; return(CSCocosHelp.ConvertToBinProto(des, sourceFilePath, itemDirectory)); }
protected override void OnDelete() { base.OnDelete(); if (this.packedprojects != null) { this.packedprojects = (Set <Project>)null; } CSCocosHelp.RemovePngFileFromCache(this.GetResourceData().Path); }
public string Serialize(PublishInfo info, IProjectFile projFile) { FilePath filePath = info.DestinationFilePath; string sourceFilePath = info.SourceFilePath; string des = filePath.ChangeExtension(".csb"); string res = Services.ProjectOperations.CurrentSelectedSolution.ItemDirectory; return(CSCocosHelp.ConvertToBinByFlat(des, sourceFilePath, res)); }
HashSet <ResourceData> IPublishProcesser.Process(ResourceData resourceData) { HashSet <ResourceData> resourceDataSet = new HashSet <ResourceData>(); resourceDataSet.Add(resourceData); CSVectorString tmxMapImageArray = CSCocosHelp.GetTmxMapImageArray((string)ProjectsService.Instance.GetFullPath(resourceData)); string directoryName = Path.GetDirectoryName(resourceData.Path); foreach (string path2 in tmxMapImageArray) { string path = Path.Combine(directoryName, path2); ResourceData resourceData1 = new ResourceData(resourceData.Type, path); resourceDataSet.Add(resourceData1); } return(resourceDataSet); }
List <string> ICompositeResourceProcesser.GetMatchedImages(string filePath) { CSVectorString tmxMapImageArray = CSCocosHelp.GetTmxMapImageArray(filePath); string directoryName = Path.GetDirectoryName(filePath); List <string> list = new List <string>(); if (tmxMapImageArray == null) { return(null); } foreach (FilePath current in tmxMapImageArray) { string item = current.ToAbsolute(directoryName); list.Add(item); } return(list); }
protected override void OnRefresh() { bool isValid = this.IsValid; if (isValid) { CSCocosHelp.ReloadPlistFileToCache(this.FullPath); this.ReloadSubResources(); } foreach (ResourceItem resourceItem in (Collection <ResourceItem>) this.Items) { resourceItem.Refresh(true); } if (isValid) { return; } for (int index = this.Items.Count - 1; index >= 0; --index) { this.Items.RemoveAt(index); } }
protected override void OnRefresh() { CSCocosHelp.ReloadPngFileToCache(this.FullPath); base.OnRefresh(); }
public void SetResourcePath(string path) { CSCocosHelp.SetResourcePath(path); }