zhangtaotao il y a 6 ans
Parent
commit
1715531090

+ 2 - 2
WeChatCore/Common/CommonMethodCallBackHandlers.cs

@@ -74,8 +74,8 @@ namespace WeChatCore.Common
         {
             if (SendMsgCompleted != null)
                 SendMsgCompleted.Invoke(e);
-            else
-                throw new Exception("未实现方法CommonMethodCallBackHandlers.SendMsgCompleted");
+            //else
+            //    throw new Exception("未实现方法CommonMethodCallBackHandlers.SendMsgCompleted");
         }
     }
 }

+ 17 - 0
WeChatCore/Entity/MemberListItemEntity.cs

@@ -160,6 +160,7 @@ namespace WeChatCore.Entity
             set
             {
                 _DisplayNameDef = value;
+                RaisePropertyChanged(() => DisplayNameDef);
             }
         }
         private string _HeadUrlDef = string.Empty;
@@ -177,6 +178,22 @@ namespace WeChatCore.Entity
                 RaisePropertyChanged(() => ImageSource);
             }
         }
+        private List<MsgEntity> _MsgList = new List<MsgEntity>();
+        /// <summary>
+        /// 消息贮存
+        /// </summary>
+        [JsonIgnore]
+        public List<MsgEntity> MsgList
+        {
+            get
+            {
+                return _MsgList;
+            }
+            set
+            {
+                _MsgList = value;
+            }
+        }
         /// <summary>
         /// 能否自动回复
         /// </summary>

+ 14 - 1
WeChatCore/Entity/MsgEntity.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.ComponentModel.Composition;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -11,6 +12,7 @@ namespace WeChatCore.Entity
     /// <summary>
     /// 消息实体
     /// </summary>
+    [PartCreationPolicy(CreationPolicy.NonShared)]
     public class MsgEntity
     {
         /// <summary>
@@ -57,10 +59,21 @@ namespace WeChatCore.Entity
         /// 消息是否已读
         /// </summary>
         public bool HasRead { get; set; }
+        private FlowDocument _Document = new FlowDocument();
         /// <summary>
         /// 流文档显示
         /// </summary>
-        public FlowDocument Document { get; set; }
+        public FlowDocument Document
+        {
+            get
+            {
+                return _Document;
+            }
+            set
+            {
+                _Document = value;
+            }
+        }
         /// <summary>
         /// 是否设置自动回复
         /// </summary>

+ 1 - 0
WeChatCore/WeChatCore.csproj

@@ -45,6 +45,7 @@
     <Reference Include="PresentationCore" />
     <Reference Include="PresentationFramework" />
     <Reference Include="System" />
+    <Reference Include="System.ComponentModel.Composition" />
     <Reference Include="System.Core" />
     <Reference Include="System.Web" />
     <Reference Include="System.Windows" />

+ 1 - 0
WeChatCore/WeiChat.cs

@@ -502,6 +502,7 @@ namespace WeChatCore
                     me.MsgContent = ali.Content;
                     me.MsgOwerType = MsgOwerTypeEnum.AccepterMsg;
                     me.IsCanAutoReply = Mlie.IsCanAutoReply;
+
                     #region 储存消息
 
                     if (ali.MsgType == 34)