Beispiel #1
0
 public void SetAccessLevel(string charName, BoardAccessLevel level)
 {
     if (level == BoardAccessLevel.Read)
     {
         ReaderList.Add(charName.ToLower());
     }
     if (level == BoardAccessLevel.Moderate)
     {
         ModeratorList.Add(charName.ToLower());
     }
     if (level == BoardAccessLevel.Write)
     {
         WriterList.Add(charName.ToLower());
     }
 }
Beispiel #2
0
 /// <summary>
 /// 获取数据
 /// </summary>
 public void GetDate()
 {
     try
     {
         List <SeatManage.ClassModel.AMS_Advertisement> modelList = SeatManage.Bll.AdvertisementOperation.GetAdList(null, SeatManage.EnumType.AdType.ReaderAd);
         ReaderList.Clear();
         foreach (SeatManage.ClassModel.AMS_Advertisement model in modelList)
         {
             SeatManage.ClassModel.ReaderAdvertInfo view = SeatManage.ClassModel.ReaderAdvertInfo.ToModel(model.AdContent);
             view.AdContent = model.AdContent;
             view.ID        = model.ID;
             ReaderList.Add(view);
         }
     }
     catch (Exception ex)
     {
         ErrorMessage = ex.Message;
         SeatManage.SeatManageComm.WriteLog.Write("获取学校通知失败" + ex.Message);
     }
 }
Beispiel #3
0
        public void Initialization()
        {
            ReaderList.Clear();

            string filePath = (AppDomain.CurrentDomain.BaseDirectory) + @"\obj";

            ReaderList.Add(new RakunNodeFor());

            ReaderList.Add(new RakunNodeValue()
            {
                ModuleName = "HIGH"
            });
            ReaderList.Add(new RakunNodeValue()
            {
                ModuleName = "LOW"
            });

            if (System.IO.Directory.Exists(filePath) == false)
            {
                System.IO.Directory.CreateDirectory(filePath);
            }

            System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(filePath);

            foreach (System.IO.FileInfo f in di.GetFiles())
            {
                if (System.IO.Path.GetExtension(f.FullName) == ".rkn")
                {
                    AddRakunReader(f.FullName);
                }
            }
            RaisePropertyChanged("ReaderList");


            //TestApplacation();
        }
Beispiel #4
0
        public void AddRakunReader(string path)
        {
            if (System.IO.Path.GetFileNameWithoutExtension(path) == "IF Equal")
            {
                System.IO.StreamReader file = new System.IO.StreamReader(path);

                RakunNodeIf reader = new RakunNodeIf();
                reader.ModuleName = System.IO.Path.GetFileNameWithoutExtension(path);
                reader.readXML(file.ReadToEnd());
                ReaderList.Add(reader);

                file.Close();
            }
            else if (System.IO.Path.GetFileNameWithoutExtension(path) == "IF Smaller")
            {
                System.IO.StreamReader file = new System.IO.StreamReader(path);

                RakunNodeIf reader = new RakunNodeIf();
                reader.ModuleName = System.IO.Path.GetFileNameWithoutExtension(path);
                reader.readXML(file.ReadToEnd());
                ReaderList.Add(reader);

                file.Close();
            }
            else if (System.IO.Path.GetFileNameWithoutExtension(path) == "IF Bigger")
            {
                System.IO.StreamReader file = new System.IO.StreamReader(path);

                RakunNodeIf reader = new RakunNodeIf();
                reader.ModuleName = System.IO.Path.GetFileNameWithoutExtension(path);
                reader.readXML(file.ReadToEnd());
                ReaderList.Add(reader);

                file.Close();
            }
            else if (System.IO.Path.GetFileNameWithoutExtension(path) == "IF Diffrent")
            {
                System.IO.StreamReader file = new System.IO.StreamReader(path);

                RakunNodeIf reader = new RakunNodeIf();
                reader.ModuleName = System.IO.Path.GetFileNameWithoutExtension(path);
                reader.readXML(file.ReadToEnd());
                ReaderList.Add(reader);

                file.Close();
            }
            else if (System.IO.Path.GetFileNameWithoutExtension(path) == "IF Diffrent")
            {
                System.IO.StreamReader file = new System.IO.StreamReader(path);

                RakunNodeIf reader = new RakunNodeIf();
                reader.ModuleName = System.IO.Path.GetFileNameWithoutExtension(path);
                reader.readXML(file.ReadToEnd());
                ReaderList.Add(reader);

                file.Close();
            }
            else if (System.IO.Path.GetFileNameWithoutExtension(path) == "Value")
            {
                System.IO.StreamReader file = new System.IO.StreamReader(path);

                RakunNodeInput reader = new RakunNodeInput();
                reader.ModuleName = System.IO.Path.GetFileNameWithoutExtension(path);
                reader.readXML(file.ReadToEnd());
                ReaderList.Add(reader);
                inputNode = reader;

                file.Close();
            }
            else
            {
                System.IO.StreamReader file = new System.IO.StreamReader(path);

                RakunWin32.Logic.RakunNodeModule reader = new Logic.RakunNodeModule();
                reader.ModuleName = System.IO.Path.GetFileNameWithoutExtension(path);
                reader.readXML(file.ReadToEnd());
                ReaderList.Add(reader);

                file.Close();
            }
        }
Beispiel #5
0
 /// <summary>
 /// 注册数据读执行者
 /// </summary>
 /// <param name="item"></param>
 public void RegistReader(AbstractReader item)
 {
     ReaderList.Add(item);
 }