示例#1
0
        public static void initTreeInfo()
        {
            if (Constants.treeInfo == null)
            {
                try
                {
                    Dictionary <string, List <string> > info = new Dictionary <string, List <string> >();
                    FileStream   file   = new FileStream(Constants.TREE_INFO_PATH, FileMode.OpenOrCreate);
                    StreamReader reader = new StreamReader(file);
                    string       line   = reader.ReadLine();
                    string[]     tempArr;
                    while (line != null)
                    {
                        tempArr = line.Split(new char[] { ' ' });
                        if (tempArr.Length > 0)
                        {
                            List <string> tempList = new List <string>(tempArr);
                            tempList.RemoveAt(0);
                            info[tempArr[0]] = tempList;

                            line = reader.ReadLine();
                            CadPlugin.logToEditor(tempArr[0]);
                        }
                    }
                    Constants.treeInfo = info;
                    reader.Close();
                }
                catch (System.Exception ex)
                {
                    CadPlugin.logToEditor(ex.ToString());
                }
            }
        }
示例#2
0
        public static bool checkOutOfTime()
        {
            DateTime time         = DateTime.Now;
            long     registerTime = (long)Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\CadPlugin", "regTime", 0);
            TimeSpan timePast     = new TimeSpan(time.Ticks - registerTime);

            if (timePast.Days >= 365)
            {
                string tip = "\n 你所使用的插件已过期,请联系作者:[email protected] QQ:104979306";
                Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog(tip);
                CadPlugin.logToEditor("\n 你所使用的插件已过期,请联系作者:[email protected] QQ:104979306");
                return(true);
            }
            return(false);
        }