找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1553|回复: 0

[分享] MyXData.cs

[复制链接]

已领礼包: 859个

财富等级: 财运亨通

发表于 2014-5-4 15:08:17 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections;
  4. using System.Linq;
  5. using System.Text;

  6. using Autodesk.AutoCAD.ApplicationServices;
  7. using Autodesk.AutoCAD.DatabaseServices;
  8. using Autodesk.AutoCAD.EditorInput;
  9. using Autodesk.AutoCAD.Geometry;
  10. using Autodesk.AutoCAD.Runtime;
  11. using DNA;

  12. /*Copyright © CHINA 2008

  13. AutoCAD version:AutoCAD 2006
  14. Description:   

  15. To use XDataCore.dll:

  16. 1. Start AutoCAD and open a new drawing.
  17. 2. Type netload and select XDataCore.dll.
  18. 3. Execute the Test command.*/


  19. namespace MyXData.Core
  20. {
  21.     public class XData
  22.     {
  23.         public ObjectId Id
  24.         {
  25.             get
  26.             {
  27.                 return this.id;
  28.             }
  29.         }

  30.         public XData(ObjectId id)
  31.         {
  32.             this.id = id;
  33.             this.Initial();
  34.         }

  35.         public bool HasXData()//判断实体是否有扩展数据
  36.         {
  37.             //Entity ent = Tools.GetEntity(this.id);
  38.             //ResultBuffer buffer = ent.XData;

  39.             //if (buffer == null)
  40.             //{
  41.             //    return false;
  42.             //}
  43.             //else
  44.             //{
  45.             //    return true;
  46.             //}

  47.             if (appName2values == null)
  48.             {
  49.                 return false;
  50.             }
  51.             else
  52.             {
  53.                 return true;
  54.             }
  55.         }

  56.         //扩展数据是否更新完毕
  57.         public bool IsXDataUpdate
  58.         {
  59.             get
  60.             {
  61.                 return !isChanged;
  62.             }
  63.         }

  64.         //这里存在一个小问题
  65.         //如果appname已经存在,且有相同的param数据,该如何处理
  66.         //这里只是在原有数据的基础上添加,而不考虑重复问题
  67.         //如果将来出现问题,可以考虑将该appname对应的扩展数据先清空,然后再添加数据
  68.         public void CreateXData(string appName, string param, string value)//根据appname创建一个新的xdata,和HasXData一起配合使用
  69.         {
  70.             //clearXData(appName);//清空appname对应的扩展数据--待定
  71.             //-----------------------------------------------
  72.             //ResultBuffer buffer = new ResultBuffer();

  73.             //buffer.Add(new TypedValue((int)DxfCode.ExtendedDataRegAppName, appName));
  74.             //buffer.Add(new TypedValue((int)DxfCode.ExtendedDataAsciiString, param));
  75.             //buffer.Add(new TypedValue((int)DxfCode.ExtendedDataAsciiString, value));
  76.             //id.SetXData(appName, buffer);

  77.             //Initial();
  78.             //-----------------------------------------
  79.             //if (appName2values.ContainsKey(param))
  80.             //{

  81.             //}
  82.             //else
  83.             //{
  84.             //    Dictionary<string, string> dic = new Dictionary<string, string>();
  85.             //    dic.Add(param, value);

  86.             //    appName2values.Add(param, dic);
  87.             //    isChanged = true;
  88.             //}

  89.             //----------------------------
  90.             if (appName == null || param == null)
  91.             {
  92.                 return;
  93.             }

  94.             if (appName2values == null)
  95.             {
  96.                 appName2values = new Dictionary<string, Dictionary<string, string>>();
  97.             }

  98.             if (appName2values.ContainsKey(appName))
  99.             {
  100.                 if (!appName2values[appName].ContainsKey(param))
  101.                 {
  102.                     appName2values[appName].Add(param, value);
  103.                     isChanged = true;
  104.                 }
  105.             }
  106.             else
  107.             {
  108.                 appName2values.Add(appName, new Dictionary<string, string>());
  109.                 appName2values[appName].Add(param, value);
  110.                 isChanged = true;
  111.             }
  112.         }

  113.         public void CreateXData(string appName, Dictionary<string, string> dic)//根据字典添加扩展数据值对,如果有参数名重复的,则不添加到原有的数据中  
  114.         {
  115.             if (appName2values == null)
  116.             {
  117.                 appName2values = new Dictionary<string, Dictionary<string, string>>();
  118.             }

  119.             if (dic == null || dic.Count == 0 || appName == null)
  120.             {
  121.                 return;
  122.             }

  123.             string[] keys = new string[appName2values.Keys.Count];
  124.             appName2values.Keys.CopyTo(keys, 0);

  125.             foreach (string str in keys)
  126.             {
  127.                 if (dic.ContainsKey(str))
  128.                 {
  129.                     dic.Remove(str);
  130.                 }
  131.             }

  132.             if (!appName2values.ContainsKey(appName))
  133.             {
  134.                 appName2values.Add(appName, new Dictionary<string, string>());
  135.             }

  136.             foreach (KeyValuePair<string, string> kp in dic)
  137.             {
  138.                 appName2values[appName].Add(kp.Key, kp.Value);
  139.             }

  140.             isChanged = true;
  141.         }

  142.         public void UpdateXData()//更新扩展数据
  143.         {
  144.             if (isChanged)
  145.             {
  146.                 //下面2行代码锁住文档
  147.                 DocumentLock docLock = Autodesk.AutoCAD.ApplicationServices.Application.

  148.               DocumentManager.MdiActiveDocument.LockDocument();

  149.                 Document doc = Application.DocumentManager.MdiActiveDocument;

  150.                 Transaction tr = doc.TransactionManager.StartTransaction();
  151.                 using (tr)
  152.                 {
  153.                     DBObject obj = tr.GetObject(this.id, OpenMode.ForWrite);
  154.                     ResultBuffer rb = new ResultBuffer();
  155.                     foreach (KeyValuePair<string, Dictionary<string, string>> kp in this.appName2values)
  156.                     {
  157.                         rb.Add(new TypedValue((int)DxfCode.ExtendedDataRegAppName, kp.Key));
  158.                         foreach (KeyValuePair<string, string> pair in kp.Value)
  159.                         {
  160.                             rb.Add(new TypedValue((int)DxfCode.ExtendedDataAsciiString, pair.Key));
  161.                             rb.Add(new TypedValue((int)DxfCode.ExtendedDataAsciiString, pair.Value));
  162.                         }

  163.                         obj.XData = rb;//替换对应appname的扩展数据
  164.                         rb = new ResultBuffer();
  165.                     }

  166.                     rb.Dispose();
  167.                     tr.Commit();
  168.                 }
  169.                 isChanged = false;

  170.                 //PurgeDatabase(doc.Database);//作为实验,看是否能够清除多余的appname,(暂时不考虑,如果出现问题在考虑这个问题)

  171.                 docLock.Dispose();
  172.             }
  173.         }

  174.         public static int PurgeDatabase(Database db)
  175.         {
  176.             int idCount = 0;
  177.             Transaction tr = db.TransactionManager.StartTransaction();
  178.             using (tr)
  179.             {
  180.                 // Create the list of objects to "purge"
  181.                 ObjectIdCollection idsToPurge = new ObjectIdCollection();
  182.                 // Add all the Registered Application names
  183.                 RegAppTable rat = (RegAppTable)tr.GetObject(db.RegAppTableId, OpenMode.ForRead);
  184.                 foreach (ObjectId raId in rat)
  185.                 {
  186.                     if (raId.IsValid)
  187.                     {
  188.                         idsToPurge.Add(raId);
  189.                     }
  190.                 }
  191.                 // Call the Purge function to filter the list
  192.                 db.Purge(idsToPurge);
  193.                 Document doc = Application.DocumentManager.MdiActiveDocument;
  194.                 Editor ed = doc.Editor;
  195.                 //ed.WriteMessage("\nRegistered applications being purged: ");
  196.                 //// Erase each of the objects we've been allowed to
  197.                 foreach (ObjectId id in idsToPurge)
  198.                 {
  199.                     DBObject obj = tr.GetObject(id, OpenMode.ForWrite);
  200.                     // Let's just add to me "debug" code to list the registered applications we're erasing
  201.                     RegAppTableRecord ratr = obj as RegAppTableRecord;
  202.                     if (ratr != null)
  203.                     {
  204.                         ed.WriteMessage("\"{0}\" ", ratr.Name);
  205.                     }
  206.                     obj.Erase();
  207.                 }
  208.                 // Return the number of objects erased
  209.                 // (i.e. purged)
  210.                 idCount = idsToPurge.Count;
  211.                 tr.Commit();
  212.             }
  213.             return idCount;
  214.         }

  215.         public void ClearXData(string appName)//根据appname删除扩展数据
  216.         {
  217.             if (IsAppExist(appName))
  218.             {
  219.                 if (this.appName2values.ContainsKey(appName))
  220.                 {
  221.                     //Document doc = Application.DocumentManager.MdiActiveDocument;

  222.                     //Transaction tr = doc.TransactionManager.StartTransaction();
  223.                     //using (tr)
  224.                     //{
  225.                     //    DBObject obj = tr.GetObject(this.id, OpenMode.ForWrite);
  226.                     //    ResultBuffer rb = new ResultBuffer();
  227.                     //    rb.Add(new TypedValue((int)DxfCode.ExtendedDataRegAppName, appName));

  228.                     //    obj.XData = rb;

  229.                     //    rb.Dispose();
  230.                     //    tr.Commit();
  231.                     //}

  232.                     ////ResultBuffer rb = new ResultBuffer();
  233.                     ////rb.Add(new TypedValue((int)DxfCode.ExtendedDataRegAppName, appName));
  234.                     ////ReplaceXData(rb);

  235.                     ////isChanged = false;//防止调用update更新

  236.                     //另外的一种方法
  237.                     appName2values[appName].Clear();
  238.                     //appName2values.Remove(appName);
  239.                     isChanged = true;

  240.                     UpdateXData();
  241.                     appName2values.Remove(appName);
  242.                 }
  243.             }
  244.         }

  245.         public void ClearAllXData()//删除所有的扩展数据
  246.         {
  247.             //Document doc = Application.DocumentManager.MdiActiveDocument;

  248.             //Transaction tr = doc.TransactionManager.StartTransaction();
  249.             //using (tr)
  250.             //{
  251.             //    DBObject obj = tr.GetObject(this.id, OpenMode.ForWrite);
  252.             //    ResultBuffer rb = new ResultBuffer();
  253.             //    foreach (KeyValuePair<string, Dictionary<string, string>> kp in this.appName2values)
  254.             //    {
  255.             //        rb.Add(new TypedValue((int)DxfCode.ExtendedDataRegAppName, kp.Key));
  256.             //        obj.XData = rb;
  257.             //        rb = new ResultBuffer();
  258.             //    }

  259.             //    isChanged = false;//防止update更新

  260.             //    rb.Dispose();
  261.             //    tr.Commit();
  262.             //}            
  263.             if (appName2values.Count != 0)
  264.             {
  265.                 string[] keys = new string[appName2values.Keys.Count];
  266.                 appName2values.Keys.CopyTo(keys, 0);

  267.                 foreach (string str in keys)
  268.                 {
  269.                     appName2values[str].Clear();
  270.                     //appName2values.Remove(str);
  271.                 }

  272.                 isChanged = true;
  273.             }
  274.         }

  275.         public bool AddXData(string param, string value)//添加参数--值对
  276.         {
  277.             bool isSuccesful = true;
  278.             if (appName2values[currentAppName].ContainsKey(param))
  279.             {
  280.                 isSuccesful = false;
  281.                 Tools.WriteMessage("\n该参数已经存在\n");
  282.             }
  283.             else
  284.             {
  285.                 isSuccesful = true;
  286.                 appName2values[currentAppName].Add(param, value);
  287.                 isChanged = true;
  288.             }

  289.             return isSuccesful;

  290.         }

  291.         public bool DeleteXData(string param)//删除扩展数据
  292.         {
  293.             bool isSuccesful = true;

  294.             if (appName2values[currentAppName].ContainsKey(param))
  295.             {
  296.                 isSuccesful = true;
  297.                 appName2values[currentAppName].Remove(param);
  298.                 isChanged = true;
  299.             }
  300.             else
  301.             {
  302.                 isSuccesful = false;
  303.             }

  304.             return isSuccesful;
  305.         }

  306.         public bool InsertXData(string beforParam, string param, string value)
  307.         {
  308.             bool isSuccesful = true;
  309.             if (beforParam == param)
  310.             {
  311.                 isSuccesful = false;
  312.             }
  313.             else if (appName2values[currentAppName].ContainsKey(param))
  314.             {
  315.                 isSuccesful = false;
  316.             }
  317.             else
  318.             {
  319.                 Dictionary<string, string> dic = new Dictionary<string, string>();
  320.                 foreach (KeyValuePair<string, string> kp in appName2values[currentAppName])
  321.                 {
  322.                     dic.Add(kp.Key, kp.Value);
  323.                     if (kp.Key == beforParam)
  324.                     {
  325.                         dic.Add(param, value);
  326.                     }
  327.                 }

  328.                 //ResultBuffer rb = BuildResultBuffer(currentAppName, dic);//构造buffer
  329.                 //ReplaceXData(rb);//直接更新

  330.                 //在这里存在更新问题,
  331.                 //是在appname2values更新后再update
  332.                 //还是直接更新?
  333.                 appName2values[currentAppName] = dic;
  334.                 isSuccesful = true;
  335.                 isChanged = true;
  336.             }

  337.             return isSuccesful;
  338.         }

  339.         public bool ModifyXData(string param, string value)//修改参数--值对
  340.         {
  341.             bool isSuccesful = true;
  342.             if (appName2values[currentAppName].ContainsKey(param))
  343.             {
  344.                 appName2values[currentAppName][param] = value;
  345.                 isSuccesful = true;
  346.                 isChanged = true;
  347.             }
  348.             else
  349.             {
  350.                 isSuccesful = false;
  351.                 Tools.WriteMessage("\n该参数不存在\n");
  352.             }

  353.             return isSuccesful;
  354.         }

  355.         public bool ModifyParam(string originParam, string resultParam)//修改参数名称
  356.         {
  357.             bool isSuccesful = true;
  358.             bool isFind = false;

  359.             //另外的一种在foreach中修改集合
  360.             Dictionary<string, string> dic = this.appName2values[this.currentAppName];
  361.             //string[] keys = new string[dic.Keys.Count];
  362.             //dic.Keys.CopyTo(keys, 0);

  363.             Dictionary<string, string> dicTmp = new Dictionary<string, string>();
  364.             //foreach (string key in keys)
  365.             //{
  366.             //}

  367.             foreach (KeyValuePair<string, string> kp in this.appName2values[currentAppName])
  368.             {
  369.                 if (originParam == kp.Key || originParam == null)
  370.                 {
  371.                     isFind = true;
  372.                     dicTmp.Add(resultParam, kp.Value);
  373.                 }
  374.                 else
  375.                 {
  376.                     isFind = false;
  377.                     dicTmp.Add(kp.Key, kp.Value);
  378.                 }
  379.             }

  380.             if (!isFind)
  381.             {
  382.                 isSuccesful = false;
  383.                 dicTmp.Clear();
  384.             }
  385.             else
  386.             {
  387.                 this.appName2values[currentAppName] = dicTmp;
  388.                 isSuccesful = true;
  389.                 isChanged = true;
  390.                 dic.Clear();
  391.             }

  392.             return isSuccesful;
  393.         }

  394.         public string GetXData(string param)
  395.         {
  396.             string value = null;
  397.             if (appName2values[currentAppName].ContainsKey(param))
  398.             {
  399.                 value = appName2values[currentAppName][param];
  400.             }
  401.             else
  402.             {
  403.                 Tools.WriteMessage("\n该参数不存在\n");
  404.             }

  405.             return value;
  406.         }


  407.         public void PrintXDataList()//本方法只考虑扩展数据配对的情况,即在除掉appname之后,扩展数据应为偶数个
  408.         {

  409.             if (appName2values == null)
  410.             {
  411.                 Tools.WriteMessage("\n该实体不存在扩展数据\n");
  412.             }
  413.             else
  414.             {
  415.                 Tools.WriteMessage("\n*-----------*--------------^-------------*-----------*\n");
  416.                 foreach (KeyValuePair<string, Dictionary<string, string>> kp in this.appName2values)
  417.                 {
  418.                     Tools.WriteMessage(string.Format("\n****扩展数据注册应用程序名称:{0}\n", kp.Key));
  419.                     foreach (KeyValuePair<string, string> pair in kp.Value)
  420.                     {
  421.                         Tools.WriteMessage(string.Format("\n参数={0}, 值={1}\n", pair.Key, pair.Value));
  422.                     }
  423.                 }
  424.             }
  425.         }

  426.         public void PrintXData(string appName)
  427.         {
  428.             if (IsAppExist(appName))
  429.             {
  430.                 Tools.WriteMessage(string.Format("\n****扩展数据注册应用程序名称:{0}\n", appName));
  431.                 foreach (KeyValuePair<string, string> pair in appName2values[appName])
  432.                 {
  433.                     Tools.WriteMessage(string.Format("\n参数={0}, 值={1}\n", pair.Key, pair.Value));
  434.                 }
  435.             }
  436.             else
  437.             {
  438.                 Tools.WriteMessage("\n不存在该注册应用程序名称\n");
  439.             }
  440.         }

  441.         public void setCurrentAppName(string appName)
  442.         {
  443.             this.currentAppName = appName;//前提假设该appname已经存在,因此必须配合registerappp 或者 isappexist一起使用
  444.         }

  445.         public string getCurrentAppName()
  446.         {
  447.             return this.currentAppName;
  448.         }

  449.         public static void RegisterApp(string appName)//注册应用程序名称
  450.         {
  451.             DocumentLock docLock = Autodesk.AutoCAD.ApplicationServices.Application.

  452.               DocumentManager.MdiActiveDocument.LockDocument();

  453.             using (Transaction trans = Application.DocumentManager.MdiActiveDocument.TransactionManager.StartTransaction())
  454.             {

  455.                 Database workingdatabase = HostApplicationServices.WorkingDatabase;

  456.                 RegAppTable appTbl = trans.GetObject(workingdatabase.RegAppTableId, OpenMode.ForWrite) as RegAppTable;

  457.                 if (!appTbl.Has(appName))
  458.                 {
  459.                     RegAppTableRecord appTblRcd = new RegAppTableRecord();
  460.                     appTblRcd.Name = appName;
  461.                     appTbl.Add(appTblRcd);

  462.                     trans.AddNewlyCreatedDBObject(appTblRcd, true);
  463.                 }

  464.                 trans.Commit();
  465.             }

  466.             docLock.Dispose();

  467.         }

  468.         public static bool IsAppExist(string appName)//判断应用程序名称是否存在
  469.         {
  470.             bool isExist = true;
  471.             using (Transaction trans = Application.DocumentManager.MdiActiveDocument.TransactionManager.StartTransaction())
  472.             {

  473.                 Database workingdatabase = HostApplicationServices.WorkingDatabase;

  474.                 SymbolTable table = (SymbolTable)trans.GetObject(workingdatabase.RegAppTableId,
  475.                     Autodesk.AutoCAD.DatabaseServices.OpenMode.ForRead, false);
  476.                 if (!table.Has(appName))
  477.                 {
  478.                     isExist = false;
  479.                 }
  480.                 else
  481.                 {
  482.                     isExist = true;
  483.                 }
  484.                 trans.Commit();
  485.             }

  486.             return isExist;
  487.         }

  488.         private ResultBuffer BuildResultBuffer(string appName, Dictionary<string, string> dic)
  489.         {
  490.             if (dic.Count == 0)
  491.             {
  492.                 return null;
  493.             }
  494.             else
  495.             {
  496.                 ResultBuffer rb = new ResultBuffer();
  497.                 rb.Add(new TypedValue((int)DxfCode.ExtendedDataRegAppName, appName));

  498.                 foreach (KeyValuePair<string, string> kp in dic)
  499.                 {
  500.                     rb.Add(new TypedValue((int)DxfCode.ExtendedDataAsciiString, kp.Key));
  501.                     rb.Add(new TypedValue((int)DxfCode.ExtendedDataAsciiString, kp.Value));
  502.                 }

  503.                 return rb;
  504.             }
  505.         }

  506.         private void ReplaceXData(ResultBuffer rb)
  507.         {
  508.             if (rb != null)
  509.             {
  510.                 Document doc = Application.DocumentManager.MdiActiveDocument;

  511.                 Transaction tr = doc.TransactionManager.StartTransaction();
  512.                 using (tr)
  513.                 {
  514.                     DBObject obj = tr.GetObject(this.id, OpenMode.ForWrite);
  515.                     string appName = rb.AsArray()[0].Value.ToString();
  516.                     if (appName2values.ContainsKey(appName))
  517.                     {
  518.                         obj.XData = rb;
  519.                     }
  520.                     tr.Commit();
  521.                 }
  522.             }
  523.         }

  524.         private void Initial()
  525.         {
  526.             Entity ent = Tools.GetEntity(this.id);

  527.             ResultBuffer buffer = ent.XData;
  528.             if (buffer != null)
  529.             {
  530.                 this.currentAppName = buffer.AsArray()[0].Value.ToString();//将第一个appname设置为当前

  531.                 TypedValue[] bufferArray = buffer.AsArray();

  532.                 ArrayList pos = new ArrayList();
  533.                 ScanBufferArray(bufferArray, ref pos); //扫描扩展数据,得到appname的位置集合               

  534.                 string lastAppName = null;
  535.                 appName2values = new Dictionary<string, Dictionary<string, string>>();
  536.                 Dictionary<string, string> ht = new Dictionary<string, string>();
  537.                 int start = 0, end = 0;

  538.                 int currentAppPos = 0;
  539.                 while (currentAppPos <= pos.Count - 1)
  540.                 {
  541.                     lastAppName = (string)bufferArray[(int)pos[currentAppPos]].Value;

  542.                     if (currentAppPos == pos.Count - 1)
  543.                     {
  544.                         start = (int)pos[currentAppPos];
  545.                         end = bufferArray.Length;
  546.                     }
  547.                     else
  548.                     {
  549.                         start = (int)pos[currentAppPos];
  550.                         end = (int)pos[currentAppPos + 1];
  551.                     }

  552.                     ht = BuildPairs(bufferArray, start, end);
  553.                     appName2values.Add(lastAppName, ht);
  554.                     ht = new Dictionary<string, string>();
  555.                     currentAppPos++;
  556.                 }

  557.             }
  558.             else
  559.             {
  560.                 this.appName2values = null;
  561.                 this.currentAppName = null;
  562.                 this.isChanged = false;
  563.             }

  564.         }

  565.         private void ScanBufferArray(TypedValue[] bufferArray, ref ArrayList pos)
  566.         {
  567.             pos = new ArrayList();

  568.             for (int i = 0; i < bufferArray.Length; i++)
  569.             {
  570.                 if (bufferArray.TypeCode == (int)DxfCode.ExtendedDataRegAppName)
  571.                 {
  572.                     pos.Add(i);
  573.                 }
  574.             }
  575.         }

  576.         private Dictionary<string, string> BuildPairs(TypedValue[] bufferArray, int start, int end)
  577.         {
  578.             Dictionary<string, string> ht = new Dictionary<string, string>();

  579.             int pairCount = end - start - 1;

  580.             if (pairCount == 1)
  581.             {

  582.                 ht.Add(bufferArray[start + 1].Value.ToString(), "null");//将null改变为"null",不知道是否合适?
  583.             }
  584.             else if (pairCount % 2 == 0)
  585.             {
  586.                 for (int i = start + 1; i < end; i += 2)
  587.                 {
  588.                     ht.Add(bufferArray.Value.ToString(), bufferArray[i + 1].Value.ToString());
  589.                 }

  590.             }
  591.             else if (pairCount % 2 != 0)
  592.             {
  593.                 int i = 0;//初始化
  594.                 for (i = start + 1; i < end - 1; i += 2)
  595.                 {
  596.                     ht.Add(bufferArray.Value.ToString(), bufferArray[i + 1].Value.ToString());
  597.                 }

  598.                 ht.Add(bufferArray.Value.ToString(), "null");
  599.             }

  600.             return ht;
  601.         }

  602.         public ICollection GetAppNames()
  603.         {
  604.             return appName2values.Keys;
  605.         }

  606.         public Dictionary<string, string> GetParamsWithAppName(string appName)
  607.         {
  608.             if (appName2values.ContainsKey(appName))
  609.             {
  610.                 return (Dictionary<string, string>)appName2values[appName];
  611.             }
  612.             else
  613.             {
  614.                 return null;
  615.             }
  616.         }

  617.         private ObjectId id;
  618.         private string currentAppName = null;
  619.         private Dictionary<string, Dictionary<string, string>> appName2values = null;
  620.         private bool isChanged = false;

  621.     }
  622. }

论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-7-1 04:56 , Processed in 0.186834 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表