void dispatcher_ResourceAdded(string rescPath, ResrcAddedResponseHandler callback) { ResrcAddedResponseEArgs e = new ResrcAddedResponseEArgs(); //首先,进行系统内部搜索,看是否相应的资源已经存在。 Resource resc = coronaService.GetResource(rescPath); if (resc == null) { resc = rescControl.CreateResource(rescPath); coronaService.AddResource(resc); //其次,分析资源是否是系统可以识别的类型。如果是,以文件名作为标签名,自动添加标签。 rescControl.AnalyseResource(resc, coronaService); } e.resource = rescControl.WrapResource(resc); if (callback != null) callback(e); }
void dispatcher_ResourceAdded(string rescPath, ResrcAddedResponseHandler callback) { ResrcAddedResponseEArgs e = new ResrcAddedResponseEArgs(); //首先,进行系统内部搜索,看是否相应的资源已经存在。 Resource resc = coronaService.GetResource(rescPath); if (resc == null) { resc = rescControl.CreateResource(rescPath); coronaService.AddResource(resc); //其次,分析资源是否是系统可以识别的类型。如果是,以文件名作为标签名,自动添加标签。 rescControl.AnalyseResource(resc, coronaService); } e.resource = rescControl.WrapResource(resc); if (callback != null) { callback(e); } }
/*void ShowTags(SearchResponseEventArgs e) { System.Console.WriteLine(e.Test); }*/ void ShowResourceID(ResrcAddedResponseEArgs e) { recieve = "<Resource> " + e.ResrcID + " has been added."; notrecieved = false; }
private void resourceAddedCallBack(ResrcAddedResponseEArgs e) { Boolean isExist=false; if (e.resource != null) { foreach (ResourceItem resc in resources) { if (resc.Resource.ResourceName==e.resource.ResourceName) { isExist = true; } } if (isExist == false) { ResourceItem tmpResc = new ResourceItem(); tmpResc.Resource = e.resource; resources.Add(tmpResc); } else { isExist = false; } } else { } }