Ejemplo n.º 1
0
 /// <summary>
 /// 真正创建标签
 /// </summary>
 /// <param name="tag"></param>
 /// <param name="resource"></param>
 /// <param name="relationCreatedCallback"></param>
 /// <param name="tagCreatedCallback"></param>
 void dispatcher_RelationCreated(Tag tag, Resource resource, RelationCreatedResponseHandler callback)
 {
     RelationCreatedResponseEArgs e = new RelationCreatedResponseEArgs();
     //首先将tag加入后台的数据库,并从后台的数据库中获得tagID参数。
     coronaService.AddTag(tag,resource);
     //其次完成回调部分。
     if ((tag.TagID != null) && (resource.ResourceID != null))
     {
         e.TagID = tag.TagID;
         e.ResrcID = resource.ResourceID;
         e.TagName = tag.TagName;
     }
     else
     {
     }
     if (callback != null)
         callback(e);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 真正创建标签
        /// </summary>
        /// <param name="tag"></param>
        /// <param name="resource"></param>
        /// <param name="relationCreatedCallback"></param>
        /// <param name="tagCreatedCallback"></param>
        void dispatcher_RelationCreated(Tag tag, Resource resource, RelationCreatedResponseHandler callback)
        {
            RelationCreatedResponseEArgs e = new RelationCreatedResponseEArgs();

            //首先将tag加入后台的数据库,并从后台的数据库中获得tagID参数。
            coronaService.AddTag(tag, resource);
            //其次完成回调部分。
            if ((tag.TagID != null) && (resource.ResourceID != null))
            {
                e.TagID   = tag.TagID;
                e.ResrcID = resource.ResourceID;
                e.TagName = tag.TagName;
            }
            else
            {
            }
            if (callback != null)
            {
                callback(e);
            }
        }
Ejemplo n.º 3
0
 void ShowRelation(RelationCreatedResponseEArgs e)
 {
     recieve="The relation between" + "<Resource>" + e.ResrcID + "<Tag>" + e.TagID + "has been created";
     notrecieved = false;
 }
Ejemplo n.º 4
0
        private void RelationCreatedCallBack(RelationCreatedResponseEArgs e)
        {
            foreach (TagItem item in ViewData.TagCollection)
            {
                if (e.TagID == item.Tag.TagID)
                    item.State = TagItemState.RelatedImmediate;
            }

            foreach (ResourceItem item in ViewData.ResourceCollection)
            {
                if (e.ResrcID == item.Resource.ResourceID)
                    item.Resource.TagNames.Add(e.TagName);
            }
        }
Ejemplo n.º 5
0
 void ShowRelation(RelationCreatedResponseEArgs e)
 {
     System.Console.WriteLine("The relation between" + "<Resource>" + e.ResrcID + "<Tag>" + e.TagID + "has been created");
 }