Наследование: ModulesAdminPage
Пример #1
0
 public static void LoadViewContextVariables(ViewContext viewContext, IContext context,
                                     Modules.IModuleCatalogService moduleCatalog, Modules.IModuleFactory moduleFactory)
 {
     viewContext.ViewData[Razor.XrcWebViewPageExtension.VIEWDATA_XRCCONTEXT] = context;
     viewContext.ViewData[Razor.XrcWebViewPageExtension.VIEWDATA_IMODULEFACTORY] = moduleFactory;
     viewContext.ViewData[Razor.XrcWebViewPageExtension.VIEWDATA_IMODULECATALOGSERVICE] = moduleCatalog;
 }
Пример #2
0
        public RazorView(Modules.IModuleFactory moduleFactory, Modules.IModuleCatalogService moduleCatalog,
					Pages.Providers.IPageProviderService pageProviderService)
        {
            _moduleCatalog = moduleCatalog;
            _moduleFactory = moduleFactory;
            _pageProviderService = pageProviderService;
        }
Пример #3
0
        public ModulesResponse Post(Modules request)
        {
            if (request.Module.Id > 0)
              {
            Bm2s.Data.Common.BLL.User.Module item = Datas.Instance.DataStorage.Modules[request.Module.Id];
            item.Code = request.Module.Code;
            item.Description = request.Module.Description;
            item.EndingDate = request.Module.EndingDate;
            item.Id = request.Module.Id;
            item.Name = request.Module.Name;
            item.StartingDate = request.Module.StartingDate;
            Datas.Instance.DataStorage.Modules[request.Module.Id] = item;
              }
              else
              {
            Bm2s.Data.Common.BLL.User.Module item = new Data.Common.BLL.User.Module()
            {
              Code = request.Module.Code,
              Description = request.Module.Description,
              EndingDate = request.Module.EndingDate,
              Id = request.Module.Id,
              Name = request.Module.Name,
              StartingDate = request.Module.StartingDate
            };

            Datas.Instance.DataStorage.Modules.Add(item);
            request.Module.Id = item.Id;
              }

              ModulesResponse response = new ModulesResponse();
              response.Modules.Add(request.Module);
              return response;
        }
Пример #4
0
 public void Compile(Modules.Module moduleDefinition)
 {
     foreach (var element in moduleDefinition.Elements)
     {
         Compile(element, moduleDefinition.Name);
     }
 }
        /// <summary>
        /// 保存或更新数据
        /// </summary>
        /// <param name="data">中奖号码记录</param>
        public bool SaveOrUpdate(Modules.LoanData data)
        {
            string sql_count = "select count(1) from Numbers where Cycle = @Cycle";

            string sql_insert = "insert into Numbers values(@Cycle, @RunDate, @Number1, @Number2, @Number3, @Number4, @Number5, @Number6, @BlueNumber)";

            System.Data.SQLite.SQLiteParameter param_count = new System.Data.SQLite.SQLiteParameter("@Cycle", data.Cycle);

            System.Data.SQLite.SQLiteParameter[] param_insert = new System.Data.SQLite.SQLiteParameter[]
            {
                new System.Data.SQLite.SQLiteParameter("@Cycle", data.Cycle),
                new System.Data.SQLite.SQLiteParameter("@RunDate", data.RunDate),
                new System.Data.SQLite.SQLiteParameter("@Number1", data.Number1),
                new System.Data.SQLite.SQLiteParameter("@Number2", data.Number2),
                new System.Data.SQLite.SQLiteParameter("@Number3", data.Number3),
                new System.Data.SQLite.SQLiteParameter("@Number4", data.Number4),
                new System.Data.SQLite.SQLiteParameter("@Number5", data.Number5),
                new System.Data.SQLite.SQLiteParameter("@Number6", data.Number6),
                new System.Data.SQLite.SQLiteParameter("@BlueNumber", data.BlueNumber),
            };

            int count = DbProvider.ExecuteSalacr<int>(sql_count, param_count);
            if (count == 0)
            {
                int iResult = DbProvider.ExecuteNonQuery(sql_insert, param_insert);
                return iResult == 1 ? true : false;
            }
            else
            {
                return true;
            }
        }
Пример #6
0
 public XValue Parse(string expression, Type returnType, Modules.ModuleDefinitionList modules, PageParameterList parameters)
 {
     string script;
     if (TryExtractScript(expression, out script))
         return new XValue(returnType, new ScriptExpressionMock(script, returnType));
     else
         return new XValue(returnType, Convert.ChangeType(expression, returnType, System.Globalization.CultureInfo.InvariantCulture));
 }
		public IModules GetModules()
		{
			var initializer = new Mock<InitializeModules>();
			initializer.Setup(foo => foo.AddModule(It.IsAny<string>(), It.IsAny<string>())).Returns(new ModuleTest());
			var modules = new Modules();
			modules.AddNewModule(Module_Name, Module_Type, Module_Serie, Module_IP, Module_Port, GetChanelsValid());
			return modules;
		}
        public void RegisterModule(Modules.FeatureExtractionModule module)
        {
            if (module == null)
            {
                throw new ArgumentNullException("module");
            }

            Modules.Add(module);
        }
Пример #9
0
        public ModulesResponse Delete(Modules request)
        {
            Bm2s.Data.Common.BLL.User.Module item = Datas.Instance.DataStorage.Modules[request.Module.Id];
              item.EndingDate = DateTime.Now;
              Datas.Instance.DataStorage.Modules[item.Id] = item;

              ModulesResponse response = new ModulesResponse();
              response.Modules.Add(request.Module);
              return response;
        }
Пример #10
0
 public XValue Parse(string expression, Type returnType, Modules.ModuleDefinitionList modules, PageParameterList parameters)
 {
     string script;
     if (TryExtractScript(expression, out script))
         return new XValue(returnType, ParseScript(script, modules, parameters));
     else
     {
         object value = ConvertEx.ChangeType(expression, returnType, CultureInfo.InvariantCulture);
         return new XValue(returnType, value);
     }
 }
Пример #11
0
        public Renamer(IDeobfuscatorContext deobfuscatorContext, IEnumerable<IObfuscatedFile> files, RenamerFlags flags)
        {
            RenamerFlags = flags;

            modules = new Modules(deobfuscatorContext);
            isDelegateClass = new DerivedFrom(delegateClasses);
            mergeStateHelper = new MergeStateHelper(memberInfos);

            foreach (var file in files)
                modules.add(new Module(file));
        }
Пример #12
0
 public ExplorerItem(Permission permission, Modules module = Modules.Default) : this(module)
 {
     if (permission != null)
     {
         this.CanSee = permission.CanSee;
         this.CanEdit = permission.CanEdit;
         this.CanAdd = permission.CanAdd;
         this.CanDelete = permission.CanDelete;
     }
     ClickedCommand = new DelegateCommand<Object>(this.ClickedCommandExecuted, this.ClickedCommandCanExecute);
 }
 ///<summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">A  BoxModuleFactoryPrx</param>
 /// <param name="propertyClassIceId">A  string</param>
 /// <param name="propertyFunctionsIceIds">A  string[]</param>
 /// <param name="identifier">A  string</param>
 public PropertyBoxModuleI(BoxModuleFactoryPrx factory, string propertyClassIceId, string[] propertyFunctionsIceIds, Ice.ObjectAdapter adapter, Ice.Identity myIdentity, Modules.PropertyBoxModuleFactoryCreatorI.ValueFromPrx valueFromPrx, PropertyValue defaultValue)
 {
     this.factory = factory;
     this.propertyClassIceId = propertyClassIceId;
     this.propertyFunctionsIceIds = propertyFunctionsIceIds;
     this.myProxy = BoxModulePrxHelper.uncheckedCast(adapter.add(this,myIdentity));
     this.adapter = adapter;
     this.valueFromPrx = valueFromPrx;
     this.defaultValue = defaultValue;
     this.setProperty("value",defaultValue);
 }
Пример #14
0
        private void agTags_Callback(object sender, Modules.ActiveForums.Controls.CallBackEventArgs e)
        {
            try
            {
                if (!(e.Parameters[4] == ""))
                {
                    string sAction = e.Parameters[4].Split(':')[0];

                    switch (sAction.ToUpper())
                    {
                        case "DELETE":
                            {
                                int TagId = Convert.ToInt32(e.Parameters[4].Split(':')[1]);
                                if (SimulateIsNumeric.IsNumeric(TagId))
                                {
                                    DataProvider.Instance().Tags_Delete(PortalId, ModuleId, TagId);
                                }
                                break;
                            }
                        case "SAVE":
                            {
                                string[] sParams = e.Parameters[4].Split(':');
                                string TagName = sParams[1].Trim();
                                int TagId = 0;
                                if (sParams.Length > 2)
                                {
                                    TagId = Convert.ToInt32(sParams[2]);
                                }
                                if (!(TagName == string.Empty))
                                {
                                    DataProvider.Instance().Tags_Save(PortalId, ModuleId, TagId, TagName, 0, 0, 0, -1, false, -1, -1);
                                }



                                break;
                            }
                    }

                }
                agTags.DefaultParams = string.Empty;
                int PageIndex = Convert.ToInt32(e.Parameters[0]);
                int PageSize = Convert.ToInt32(e.Parameters[1]);
                string SortColumn = e.Parameters[2].ToString();
                string Sort = e.Parameters[3].ToString();
                agTags.Datasource = DataProvider.Instance().Tags_List(PortalId, ModuleId, false, PageIndex, PageSize, Sort, SortColumn, -1, -1);
                agTags.Refresh(e.Output);
            }
            catch (Exception ex)
            {

            }

        }
Пример #15
0
 public void Add(Modules.Publishing.Models.PublishingLog item)
 {
     _publishingLogProvider.Add(item);
     try
     {
         SendLog(item);
     }
     catch (Exception e)
     {
         Kooboo.HealthMonitoring.Log.LogException(e);
     }
 }
        public UIControllerData.Result<Modules.Profiles.DataContracts.UpdatePasswordData> ChangePassword(string token, Modules.Profiles.DataContracts.UpdatePasswordData passwordData)
        {
            var userSession = Authenticate.UserSession(token);

            if (userSession.Success)
                return Modules.Profiles.EntityContact.ChangePassword(userSession.Object, passwordData).ToUIControllerResult();
            else
            {
                WebOperationContext.Current.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.Unauthorized; // 401
                return new io.Data.Return<Modules.Profiles.DataContracts.UpdatePasswordData>(io.Constants.SUCCESS, userSession.Message, "", null).ToUIControllerResult();
            }
        }
Пример #17
0
		private void agTemplates_ItemBound(object sender, Modules.ActiveForums.Controls.ItemBoundEventArgs e)
		{
			string sValue = string.Empty;
			try
			{
				sValue = GetSharedResource("[RESX:" + Convert.ToString(Enum.Parse(typeof(Templates.TemplateTypes), e.Item[1].ToString())) + "]");
			}
			catch (Exception ex)
			{
				sValue = e.Item[1].ToString();
			}
			e.Item[1] = sValue;
		}
Пример #18
0
        public ModulesResponse Get(Modules request)
        {
            ModulesResponse response = new ModulesResponse();
              List<Bm2s.Data.Common.BLL.User.Module> items = new List<Data.Common.BLL.User.Module>();
              if (!request.Ids.Any())
              {
            items.AddRange(Datas.Instance.DataStorage.Modules.Where(item =>
              (string.IsNullOrWhiteSpace(request.Code) || item.Code.ToLower().Contains(request.Code.ToLower())) &&
              (string.IsNullOrWhiteSpace(request.Name) || item.Name.ToLower().Contains(request.Name.ToLower())) &&
              (!request.Date.HasValue || (request.Date >= item.StartingDate && (!item.EndingDate.HasValue || request.Date < item.EndingDate.Value)))
              ));
              }
              else
              {
            items.AddRange(Datas.Instance.DataStorage.Modules.Where(item => request.Ids.Contains(item.Id)));
              }

              var collection = (from item in items
                        select new Bm2s.Poco.Common.User.Module()
                        {
                          Code = item.Code,
                          Description = item.Description,
                          EndingDate = item.EndingDate,
                          Id = item.Id,
                          Name = item.Name,
                          StartingDate = item.StartingDate
                        }).AsQueryable().OrderBy(request.Order, !request.DescendingOrder);

              response.ItemsCount = collection.Count();
              if (request.PageSize > 0)
              {
            response.Modules.AddRange(collection.Skip((request.CurrentPage - 1) * request.PageSize).Take(request.PageSize));
              }
              else
              {
            response.Modules.AddRange(collection);
              }

              try
              {
            response.PagesCount = collection.Count() / response.Modules.Count + (collection.Count() % response.Modules.Count > 0 ? 1 : 0);
              }
              catch
              {
            response.PagesCount = 1;
              }

              return response;
        }
Пример #19
0
        public Database(string typeName, string server, string name, string connectionString)
        {
            this.typeName = typeName;
            this.server = server;
            this.name = name;
            this.connectionString = connectionString;
            connection = new OdbcConnection(this.connectionString);

            _tables = new Tables(this);
            _views = new Views(this);
            _sequences = new Sequences(this);
            _storedprocedures = new StoredProcedures(this);
            _functions = new Functions(this);
            _modules = new Modules(this);
            _mqts = new MQTS(this);
        }
 private void cbAdmin_Callback(object sender, Modules.ActiveForums.Controls.CallBackEventArgs e)
 {
     if (!(CurrentUserType == CurrentUserTypes.Anon) && !(CurrentUserType == CurrentUserTypes.Auth))
     {
         UserProfileController upc = new UserProfileController();
         UserController uc = new UserController();
         UserProfileInfo upi = uc.GetUser(PortalId, ForumModuleId, UID).Profile;
         if (upi != null)
         {
             upi.RewardPoints = Convert.ToInt32(e.Parameters[1]);
             upi.UserCaption = e.Parameters[2].ToString();
             upi.SignatureDisabled = Convert.ToBoolean(e.Parameters[3]);
             upi.AvatarDisabled = Convert.ToBoolean(e.Parameters[4]);
             upi.TrustLevel = Convert.ToInt32(e.Parameters[5]);
             upi.AdminWatch = Convert.ToBoolean(e.Parameters[6]);
             upi.AttachDisabled = Convert.ToBoolean(e.Parameters[7]);
             upc.Profiles_Save(upi);
         }
     }
 }
Пример #21
0
        public Renamer(IDeobfuscatorContext deobfuscatorContext, IEnumerable<IObfuscatedFile> files)
        {
            RenameNamespaces = true;
            RenameTypes = true;
            RenameProperties = true;
            RenameEvents = true;
            RenameFields = true;
            RenameMethods = true;
            RenameMethodArgs = true;
            RenameGenericParams = true;
            RestoreProperties = true;
            RestorePropertiesFromNames = true;
            RestoreEvents = true;
            RestoreEventsFromNames = true;

            modules = new Modules(deobfuscatorContext);
            isDelegateClass = new DerivedFrom(delegateClasses);
            mergeStateHelper = new MergeStateHelper(memberInfos);

            foreach (var file in files)
                modules.add(new Module(file));
        }
Пример #22
0
        public static void LogException(Modules Module, string Method, Exception excp,string title)
        {
            try
            {
                if (excp != null)
                {
                    string Message = excp.Message;
                    string StackTrace = excp.StackTrace;
                    string InnerMessage = null;
                    if (excp.InnerException != null)
                    {
                        InnerMessage = excp.InnerException.Message;
                    }

                    bool result = false;

                    DataAccessManager dam = new DataAccessManager();
                    string[,] paramArray = {
                        {"@Module", Module.ToString()},
                        {"@Method", Method},
                        {"@Message", Message},
                        {"@StackTrace", StackTrace},
                        {"@InnerMessage", InnerMessage}

                        };
                    dam.ExecuteNonQuery(CommandType.StoredProcedure, "InsertExceptionLog", paramArray);

                    ExceptionMessageShow exception1 = new ExceptionMessageShow(title,Message);
                    exception1.ShowExceptionMessage();
                }
            }
            catch (Exception ex)
            {
                ExceptionMessageShow exception1 = new ExceptionMessageShow(title,ex.Message.ToString());
                exception1.ShowExceptionMessage();
            }
        }
Пример #23
0
        private void agFilters_Callback(object sender, Modules.ActiveForums.Controls.CallBackEventArgs e)
        {
            try
            {
                if (!(e.Parameters[4] == ""))
                {
                    string sAction = e.Parameters[4].Split(':')[0];
                    int FilterId = Convert.ToInt32(e.Parameters[4].Split(':')[1]);
                    switch (sAction.ToUpper())
                    {
                        case "DELETE":
                            if (SimulateIsNumeric.IsNumeric(FilterId))
                            {
                                DataProvider.Instance().Filters_Delete(PortalId, ModuleId, FilterId);
                            }
                            break;
                        case "DEFAULTS":
                            DataProvider.Instance().Filters_DeleteByModuleId(PortalId, ModuleId);
                            Utilities.ImportFilter(PortalId, ModuleId);
                            break;
                    }

                }
                int PageIndex = Convert.ToInt32(e.Parameters[0]);
                int PageSize = Convert.ToInt32(e.Parameters[1]);
                string SortColumn = e.Parameters[2].ToString();
                string Sort = e.Parameters[3].ToString();
                agFilters.Datasource = DataProvider.Instance().Filters_List(PortalId, ModuleId, PageIndex, PageSize, Sort, SortColumn);
                agFilters.Refresh(e.Output);
            }
            catch (Exception ex)
            {

            }

        }
Пример #24
0
 public static short IsValidCode(ComboBox cbo, Modules module, bool All)
 {
     short statusCode = 0;
     if (All && cbo.Text == "--ALL--")
     {
     }
     else if (!string.IsNullOrEmpty(cbo.Text) && !Common.IsCodeExists(cbo.Text, module))
     {
         statusCode = 1;
         Common.ShowInvlaidCodeMessage(cbo, module);
     }
     else if (string.IsNullOrEmpty(cbo.Text))
     {
         if (cbo.Items.Count > 0)
         {
             cbo.SelectedIndex = 0;
         }
     }
     return statusCode;
 }
Пример #25
0
 private void Dev_Load(object sender, EventArgs e)
 {
     Modules.ClientDLLAdress = Modules.GetModule("csgo", Modules.ClientDLLName);
     Modules.EngineDLLAdress = Modules.GetModule("csgo", Modules.EngineDLLName);
     Modules.ShaderAPIAdress = Modules.GetModule("csgo", Modules.ShaderAPIName);
 }
Пример #26
0
        public CoverageResult GetCoverageResult()
        {
            CalculateCoverage();

            Modules modules = new Modules();

            foreach (var result in _results)
            {
                Documents documents = new Documents();
                foreach (var doc in result.Documents)
                {
                    foreach (var line in doc.Lines)
                    {
                        if (documents.TryGetValue(doc.Path, out Classes classes))
                        {
                            if (classes.TryGetValue(line.Class, out Methods methods))
                            {
                                if (methods.TryGetValue(line.Method, out Lines lines))
                                {
                                    documents[doc.Path][line.Class][line.Method].Add(line.Number, new LineInfo {
                                        Hits = line.Hits, IsBranchPoint = line.IsBranchTarget
                                    });
                                }
                                else
                                {
                                    documents[doc.Path][line.Class].Add(line.Method, new Lines());
                                    documents[doc.Path][line.Class][line.Method].Add(line.Number, new LineInfo {
                                        Hits = line.Hits, IsBranchPoint = line.IsBranchTarget
                                    });
                                }
                            }
                            else
                            {
                                documents[doc.Path].Add(line.Class, new Methods());
                                documents[doc.Path][line.Class].Add(line.Method, new Lines());
                                documents[doc.Path][line.Class][line.Method].Add(line.Number, new LineInfo {
                                    Hits = line.Hits, IsBranchPoint = line.IsBranchTarget
                                });
                            }
                        }
                        else
                        {
                            documents.Add(doc.Path, new Classes());
                            documents[doc.Path].Add(line.Class, new Methods());
                            documents[doc.Path][line.Class].Add(line.Method, new Lines());
                            documents[doc.Path][line.Class][line.Method].Add(line.Number, new LineInfo {
                                Hits = line.Hits, IsBranchPoint = line.IsBranchTarget
                            });
                        }
                    }
                }

                modules.Add(result.ModulePath, documents);
                InstrumentationHelper.RestoreOriginalModule(result.ModulePath, _identifier);
            }

            return(new CoverageResult
            {
                Identifier = _identifier,
                Modules = modules
            });
        }
Пример #27
0
        private static async Task NewsModul(Modules modules, Module module)
        {
            await DataAccess.AddOrReplaceModuleData(modules, module.NewsSources.Count == 0?await GetNewsByCategory(module) : await GetNewsBySource(module));

            Debug.WriteLine("News Module geladen");
        }
Пример #28
0
        private static async void TimeModul(Modules modules, Module module)
        {
            await DataAccess.AddOrReplaceModuleData(modules, new Sun.Sun(module));

            Debug.WriteLine("Zeit Module geladen");
        }
Пример #29
0
 bool ICollection <IEntityModule> .Remove(IEntityModule item)
 {
     return(Modules.Remove(item));
 }
Пример #30
0
    /// <summary>
    /// this is used to set a certain module into the time table
    /// the reason for containing the whole entire class is so that
    /// people can reference each item accordingly
    ///
    /// this is also going to be used in manual mode
    /// </summary>
    /// <param name="Module"></param>the object module that is being delt with currently
    /// <param name="x"></param>the column
    /// <param name="y"></param>the row
    public void AddItem(Modules sModule, int GroupIndex, int SetIndex, ref Table inTable)
    {
        DateTime Start = sModule.Group[GroupIndex].Sets[SetIndex].StartTime;
        DateTime End   = sModule.Group[GroupIndex].Sets[SetIndex].EndTime;


        int NumPer = GetNumPeriods(Start, End);
        int x      = GetX(sModule.Group[GroupIndex].Sets[SetIndex].Day);

        for (int i = 0; i < NumPer; i++)
        {
            int y = GetY(sModule.Group[GroupIndex].Sets[SetIndex].StartTime.AddHours(i));
            if (sTable[x, y].sTable != (sModule.Name + " (" + sModule.Group[GroupIndex].Sets[SetIndex].type[0] + ")" + "#" + sModule.Group[GroupIndex].Sets[SetIndex].venue) && (sTable[x, y].sTable != null))//check for clashes
            {
                //if (KryptonMessageBox.Show(sModule.Name + "G" + (GroupIndex + 1).ToString() + "(" + sModule.Group[GroupIndex].Sets[SetIndex].type + ") Clashes on " + sModule.Group[GroupIndex].Sets[i].Day + " " + TimeHead[y] +
                //                " with\n" + sTable[x, y].sTable + ". \nWould you like to replace it?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes)
                //{
                //    #region replace clash item
                //    if (sTable[x, y].EventType != "personal")
                //    {
                //        Deselect(x, y);//need to first deselect the other flag before selecting the new flag
                //    }
                //    string sline = sModule.Name;
                //    //Program.frmMainInstance.gb.TimeTable.sTable[x, y].EventType = "tuks";
                //    sTable[x, y].sTable = sline + " (" + sModule.Group[GroupIndex].Sets[SetIndex].type[0] + ")" + "#" + sModule.Group[GroupIndex].Sets[SetIndex].venue;
                //    sTable[x, y].sCode = sline;
                //    sTable[x, y].sType = sModule.Group[GroupIndex].Sets[SetIndex].type[0].ToString();
                //    sTable[x, y].BkColour = sModule.BkColour;
                //    sTable[x, y].FgColour = sModule.FgColour;
                //    sTable[x, y].TextFont = sModule.TextFont;
                //    sTable[x, y].iModule = sModule;
                //    sTable[x, y].iGroupIndex = GroupIndex;
                //    sTable[x, y].iSetIndex = SetIndex;
                //    sModule.Group[GroupIndex].Sets[SetIndex].ItemFlag = true;
                //    #endregion

                //}
                //else
                //{
                //    #region remove
                //    sModule.Group[GroupIndex].Sets[SetIndex].ItemFlag = false;
                //    #endregion
                //}
            }
            else
            {
                #region add without clash
                //if there is no clash then just add the item
                string sline = sModule.Name;
                inTable.sTable[x, y].EventType = "tuks"; //*2
                sTable[x, y].sTable            = sline + " (" + sModule.Group[GroupIndex].Sets[SetIndex].type[0] + ")" + "#" + sModule.Group[GroupIndex].Sets[SetIndex].venue;
                sTable[x, y].sCode             = sline;
                sTable[x, y].sType             = sModule.Group[GroupIndex].Sets[SetIndex].type[0].ToString();
                sTable[x, y].BkColour          = sModule.BkColour;
                sTable[x, y].FgColour          = sModule.FgColour;
                sTable[x, y].TextFont          = sModule.TextFont;
                sTable[x, y].iModule           = sModule;
                sTable[x, y].iGroupIndex       = GroupIndex;
                sTable[x, y].iSetIndex         = SetIndex;
                sModule.Group[GroupIndex].Sets[SetIndex].ItemFlag = true;
                #endregion
            }
        }
        sModule.UpdateGroupCheck();
    }
Пример #31
0
 public override int GetHashCode()
 {
     return(Name.GetHashCode() ^ Id.GetHashCode() ^ Priority.GetHashCode() ^ Threads.GetHashCode() ^ Modules.GetHashCode() ^ StartTime.GetHashCode());
 }
Пример #32
0
 /// <summary>
 /// When overriden in a derived class, configure the onboard display controller to fulfil the requirements of a display using the RGB sockets.
 /// If doing this requires rebooting, then the method must reboot and not return.
 /// If there is no onboard display controller, then NotSupportedException must be thrown.
 /// </summary>
 /// <param name="displayModel">Display model name.</param>
 /// <param name="width">Display physical width in pixels, ignoring the orientation setting.</param>
 /// <param name="height">Display physical height in lines, ignoring the orientation setting.</param>
 /// <param name="orientationDeg">Display orientation in degrees.</param>
 /// <param name="timing">The required timings from an LCD controller.</param>
 protected internal abstract void OnOnboardControllerDisplayConnected(string displayModel, int width, int height, int orientationDeg, Modules.Module.DisplayModule.TimingRequirements timing);
Пример #33
0
 /// <summary>
 /// Adds a module.
 /// </summary>
 public void AddModule(IModule module)
 {
     Modules.Add(module);
 }
Пример #34
0
        private void ReadDirStream()
        {
            byte[]            dir           = CompoundDocument.DecompressPart(Document.Storage.SubStorage["VBA"].DataStreams["dir"]);
            MemoryStream      ms            = new MemoryStream(dir);
            BinaryReader      br            = new BinaryReader(ms);
            ExcelVbaReference currentRef    = null;
            string            referenceName = "";
            ExcelVBAModule    currentModule = null;
            bool terminate = false;

            while (br.BaseStream.Position < br.BaseStream.Length && terminate == false)
            {
                ushort id   = br.ReadUInt16();
                uint   size = br.ReadUInt32();
                switch (id)
                {
                case 0x01:
                    SystemKind = (eSyskind)br.ReadUInt32();
                    break;

                case 0x02:
                    Lcid = (int)br.ReadUInt32();
                    break;

                case 0x03:
                    CodePage = (int)br.ReadUInt16();
                    break;

                case 0x04:
                    Name = GetString(br, size);
                    break;

                case 0x05:
                    Description = GetUnicodeString(br, size);
                    break;

                case 0x06:
                    HelpFile1 = GetString(br, size);
                    break;

                case 0x3D:
                    HelpFile2 = GetString(br, size);
                    break;

                case 0x07:
                    HelpContextID = (int)br.ReadUInt32();
                    break;

                case 0x08:
                    LibFlags = (int)br.ReadUInt32();
                    break;

                case 0x09:
                    MajorVersion = (int)br.ReadUInt32();
                    MinorVersion = (int)br.ReadUInt16();
                    break;

                case 0x0C:
                    Constants = GetUnicodeString(br, size);
                    break;

                case 0x0D:
                    uint sizeLibID = br.ReadUInt32();
                    var  regRef    = new ExcelVbaReference();
                    regRef.Name = referenceName;
                    regRef.ReferenceRecordID = id;
                    regRef.Libid             = GetString(br, sizeLibID);
                    uint   reserved1 = br.ReadUInt32();
                    ushort reserved2 = br.ReadUInt16();
                    References.Add(regRef);
                    break;

                case 0x0E:
                    var projRef = new ExcelVbaReferenceProject();
                    projRef.ReferenceRecordID = id;
                    projRef.Name          = referenceName;
                    sizeLibID             = br.ReadUInt32();
                    projRef.Libid         = GetString(br, sizeLibID);
                    sizeLibID             = br.ReadUInt32();
                    projRef.LibIdRelative = GetString(br, sizeLibID);
                    projRef.MajorVersion  = br.ReadUInt32();
                    projRef.MinorVersion  = br.ReadUInt16();
                    References.Add(projRef);
                    break;

                case 0x0F:
                    ushort modualCount = br.ReadUInt16();
                    break;

                case 0x13:
                    ushort cookie = br.ReadUInt16();
                    break;

                case 0x14:
                    LcidInvoke = (int)br.ReadUInt32();
                    break;

                case 0x16:
                    referenceName = GetUnicodeString(br, size);
                    break;

                case 0x19:
                    currentModule      = new ExcelVBAModule();
                    currentModule.Name = GetUnicodeString(br, size);
                    Modules.Add(currentModule);
                    break;

                case 0x1A:
                    currentModule.streamName = GetUnicodeString(br, size);
                    break;

                case 0x1C:
                    currentModule.Description = GetUnicodeString(br, size);
                    break;

                case 0x1E:
                    currentModule.HelpContext = (int)br.ReadUInt32();
                    break;

                case 0x21:
                case 0x22:
                    break;

                case 0x2B:          //Modul Terminator
                    break;

                case 0x2C:
                    currentModule.Cookie = br.ReadUInt16();
                    break;

                case 0x31:
                    currentModule.ModuleOffset = br.ReadUInt32();
                    break;

                case 0x10:
                    terminate = true;
                    break;

                case 0x30:
                    var extRef  = (ExcelVbaReferenceControl)currentRef;
                    var sizeExt = br.ReadUInt32();
                    extRef.LibIdExternal = GetString(br, sizeExt);

                    uint   reserved4 = br.ReadUInt32();
                    ushort reserved5 = br.ReadUInt16();
                    extRef.OriginalTypeLib = new Guid(br.ReadBytes(16));
                    extRef.Cookie          = br.ReadUInt32();
                    break;

                case 0x33:
                    currentRef = new ExcelVbaReferenceControl();
                    currentRef.ReferenceRecordID = id;
                    currentRef.Name  = referenceName;
                    currentRef.Libid = GetString(br, size);
                    References.Add(currentRef);
                    break;

                case 0x2F:
                    var contrRef = (ExcelVbaReferenceControl)currentRef;
                    contrRef.ReferenceRecordID = id;

                    var sizeTwiddled = br.ReadUInt32();
                    contrRef.LibIdTwiddled = GetString(br, sizeTwiddled);
                    var r1 = br.ReadUInt32();
                    var r2 = br.ReadUInt16();

                    break;

                case 0x25:
                    currentModule.ReadOnly = true;
                    break;

                case 0x28:
                    currentModule.Private = true;
                    break;

                default:
                    break;
                }
            }
        }
Пример #35
0
        public void Merge(Modules modules)
        {
            foreach (KeyValuePair <string, Documents> module in modules)
            {
                if (!Modules.Keys.Contains(module.Key))
                {
                    Modules.Add(module.Key, module.Value);
                }
                else
                {
                    foreach (KeyValuePair <string, Classes> document in module.Value)
                    {
                        if (!Modules[module.Key].ContainsKey(document.Key))
                        {
                            Modules[module.Key].Add(document.Key, document.Value);
                        }
                        else
                        {
                            foreach (KeyValuePair <string, Methods> @class in document.Value)
                            {
                                if (!Modules[module.Key][document.Key].ContainsKey(@class.Key))
                                {
                                    Modules[module.Key][document.Key].Add(@class.Key, @class.Value);
                                }
                                else
                                {
                                    foreach (KeyValuePair <string, Method> method in @class.Value)
                                    {
                                        if (!Modules[module.Key][document.Key][@class.Key].ContainsKey(method.Key))
                                        {
                                            Modules[module.Key][document.Key][@class.Key].Add(method.Key, method.Value);
                                        }
                                        else
                                        {
                                            foreach (KeyValuePair <int, int> line in method.Value.Lines)
                                            {
                                                if (!Modules[module.Key][document.Key][@class.Key][method.Key].Lines.ContainsKey(line.Key))
                                                {
                                                    Modules[module.Key][document.Key][@class.Key][method.Key].Lines.Add(line.Key, line.Value);
                                                }
                                                else
                                                {
                                                    Modules[module.Key][document.Key][@class.Key][method.Key].Lines[line.Key] += line.Value;
                                                }
                                            }

                                            foreach (BranchInfo branch in method.Value.Branches)
                                            {
                                                Branches   branches   = Modules[module.Key][document.Key][@class.Key][method.Key].Branches;
                                                BranchInfo branchInfo = branches.FirstOrDefault(b => b.EndOffset == branch.EndOffset && b.Line == branch.Line && b.Offset == branch.Offset && b.Ordinal == branch.Ordinal && b.Path == branch.Path);
                                                if (branchInfo == null)
                                                {
                                                    branches.Add(branch);
                                                }
                                                else
                                                {
                                                    branchInfo.Hits += branch.Hits;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #36
0
            /// <summary>
            /// Load a mod .dll given its metadata at runtime. Doesn't load the mod content.
            /// If required, loads the mod after all of its dependencies have been loaded.
            /// </summary>
            /// <param name="meta">Metadata of the mod to load.</param>
            /// <param name="callback">Callback to be executed after the mod has been loaded. Executed immediately if meta == null.</param>
            public static void LoadModDelayed(EverestModuleMetadata meta, Action callback)
            {
                if (Flags.IsDisabled || !Flags.SupportRuntimeMods)
                {
                    Logger.Log(LogLevel.Warn, "loader", "Loader disabled!");
                    return;
                }

                if (meta == null)
                {
                    callback?.Invoke();
                    return;
                }

                if (Modules.Any(module => module.Metadata.Name == meta.Name))
                {
                    Logger.Log(LogLevel.Warn, "loader", $"Mod {meta.Name} already loaded!");
                    return;
                }

                if (PermanentBlacklist.TryGetValue(meta.Name, out Version minver) && meta.Version < minver)
                {
                    Logger.Log(LogLevel.Warn, "loader", $"Mod {meta} permanently blacklisted by Everest!");
                    return;
                }

                Tuple <string, Version, string, Version> conflictRow = PermanentConflictlist.FirstOrDefault(row =>
                                                                                                            (meta.Name == row.Item1 && meta.Version < row.Item2 && (_Modules.FirstOrDefault(other => other.Metadata.Name == row.Item3)?.Metadata.Version ?? _VersionInvalid) < row.Item4) ||
                                                                                                            (meta.Name == row.Item3 && meta.Version < row.Item4 && (_Modules.FirstOrDefault(other => other.Metadata.Name == row.Item1)?.Metadata.Version ?? _VersionInvalid) < row.Item2)
                                                                                                            );

                if (conflictRow != null)
                {
                    throw new Exception($"CONFLICTING MODS: {conflictRow.Item1} VS {conflictRow.Item3}");
                }


                foreach (EverestModuleMetadata dep in meta.Dependencies)
                {
                    if (!DependencyLoaded(dep))
                    {
                        Logger.Log(LogLevel.Info, "loader", $"Dependency {dep} of mod {meta} not loaded! Delaying.");
                        lock (Delayed) {
                            Delayed.Add(Tuple.Create(meta, callback));
                        }
                        return;
                    }
                }

                foreach (EverestModuleMetadata dep in meta.OptionalDependencies)
                {
                    if (!DependencyLoaded(dep) && (enforceOptionalDependencies || Everest.Modules.Any(module => module.Metadata?.Name == dep.Name)))
                    {
                        Logger.Log(LogLevel.Info, "loader", $"Optional dependency {dep} of mod {meta} not loaded! Delaying.");
                        lock (Delayed) {
                            Delayed.Add(Tuple.Create(meta, callback));
                        }
                        return;
                    }
                }

                callback?.Invoke();

                LoadMod(meta);
            }
Пример #37
0
 public bool IsPartialRequest()
 {
     return(!(Modules.IsNullOrEmpty() && Controllers.IsNullOrEmpty() && Actions.IsNullOrEmpty()));
 }
Пример #38
0
        public static long NoOfCodeExists(string code, Modules Table)
        {
            string[,] paramArray = {
                                        {"@Code",code},
                                        {"@TableName",Table.ToString()},
                                        {"@Active","0"}

                                   };
            DataAccessManager dam = new DataAccessManager();
            return Convert.ToInt64(dam.ExecuteScalar(CommandType.StoredProcedure, "IsCodeExists", paramArray));
        }
Пример #39
0
 void login_ViewModelEvent(Modules.Base.Enumerations.AlertID errorID, string message)
 {
     lbError.Text = message;
 }
Пример #40
0
        /// <summary>
        /// Creates a new Package object by loading and parsing the data
        /// contained in the XmlDocument. The Package object can then be
        /// further edited or exported.
        /// </summary>
        /// <param name="doc">The XmlDocument that was generated by a previous call to Save.</param>
        public Package(XmlDocument doc)
            : this()
        {
            XmlNode node;


            //
            // Load the readme.
            //
            if (doc.SelectSingleNode("//Readme") != null)
            {
                Readme = doc.SelectSingleNode("//Readme").InnerText;
            }

            //
            // Load the modules from the document.
            //
            node = doc.SelectSingleNode("//ArenaPackage/Files");
            if (node != null)
            {
                foreach (XmlNode f in node.ChildNodes)
                {
                    Files.Add(new File(f));
                }
            }

            //
            // Load the modules from the document.
            //
            node = doc.SelectSingleNode("//ArenaPackage/Modules");
            if (node != null)
            {
                foreach (XmlNode m in node.ChildNodes)
                {
                    Modules.Add(new Module(m));
                }
            }

            //
            // Load the pages from the document.
            //
            node = doc.SelectSingleNode("//ArenaPackage/Pages");
            if (node != null)
            {
                foreach (XmlNode p in node.ChildNodes)
                {
                    Pages.Add(new PageInstance(p));
                }
            }

            //
            // Load the Package Information.
            //
            node = doc.SelectSingleNode("//ArenaPackage/Info");
            if (node != null)
            {
                _Info = new PackageInfo(node);
            }
            else
            {
                _Info = new PackageInfo();
            }

            //
            // Load the migration information.
            //
            node = doc.SelectSingleNode("//ArenaPackage/Migration");
            if (node != null)
            {
                if (node.Attributes["_source"] != null)
                {
                    MigrationSource = node.Attributes["_source"].Value;
                }

                if (!String.IsNullOrEmpty(node.InnerText))
                {
                    _Migration = Convert.FromBase64String(node.InnerText);
                }
            }

            _XmlPackage = doc;
        }
Пример #41
0
 IEnumerator <IEntityModule> IEnumerable <IEntityModule> .GetEnumerator()
 {
     return(Modules.GetEnumerator());
 }
Пример #42
0
 public ISequenceTypeModuleInstance GetFactory(ISequence sequence)
 {
     return(Modules.GetRepository <ISequenceTypeModuleInstance>().GetAll().Cast <ISequenceTypeModuleInstance>().FirstOrDefault(x => x.CreateSequence().GetType() == sequence.GetType()));
 }
 public void ButtonClick()
 {
     textNote.font = AllLanguages.listFontLangB[Modules.indexLanguage];
     Modules.PlayAudioClipFree(Modules.audioButton);
     if (codeItem == 0)//coin (xu ly in app purchase)
     {
         //print("Buy coin");
         Purchaser.Instance.BuyProductID(Modules.listProductID[0]);
     }
     else if (codeItem == 1)//key (xu ly in app purchase)
     {
         //print("Buy key");
         Purchaser.Instance.BuyProductID(Modules.listProductID[1]);
     }
     else if (codeItem == 2)//neu la skis
     {
         int cost = Modules.IntParseFast(textCost.text);
         if (Modules.totalCoin >= cost)//neu du tien
         {
             if (Modules.totalSkis < Modules.maxHoverboard)
             {
                 Modules.totalSkis++;
                 Modules.totalCoin -= cost;
                 Modules.SaveCoin();
                 textCoin.text = Modules.totalCoin.ToString();
                 Modules.SaveSkis();
                 textNote.text = AllLanguages.shopTotal[Modules.indexLanguage] + " " + Modules.totalSkis.ToString();
             }
             else
             {
                 textNote.text  = AllLanguages.shopMaxNumber[Modules.indexLanguage];
                 textNote.color = colorNotCoin;
                 Invoke("ReturnValueTotal", 1f);
             }
         }
         else//neu khong du tien
         {
             textNote.text  = AllLanguages.shopNotEnough[Modules.indexLanguage];
             textNote.color = colorNotCoin;
             Invoke("ReturnValueTotal", 1f);
         }
     }
     else if (codeItem == 3)//neu la mystery
     {
         int cost = Modules.IntParseFast(textCost.text);
         if (Modules.totalCoin >= cost)//neu du tien
         {
             Modules.totalCoin -= cost;
             Modules.SaveCoin();
             textCoin.text           = Modules.totalCoin.ToString();
             Modules.nextPageOpenBox = "ShopItems";
             Modules.containOpenBox.SetActive(true);
             Modules.containShopItem.SetActive(false);
             Modules.containOpenBox.transform.Find("MainCamera").GetComponent <PageOpenMysteryBox>().CallStart();
         }
         else//neu khong du tien
         {
             textNote.text  = AllLanguages.shopNotEnough[Modules.indexLanguage];
             textNote.color = colorNotCoin;
             Invoke("ReturnValueTotal", 1f);
         }
     }
     else if (codeItem == 4)//neu la headStart
     {
         int cost = Modules.IntParseFast(textCost.text);
         if (Modules.totalCoin >= cost)//neu du tien
         {
             if (Modules.totalHeadStart < Modules.maxHeadstart)
             {
                 Modules.totalHeadStart++;
                 Modules.totalCoin -= cost;
                 Modules.SaveCoin();
                 textCoin.text = Modules.totalCoin.ToString();
                 Modules.SaveHeadStart();
                 textNote.text = AllLanguages.shopTotal[Modules.indexLanguage] + " " + Modules.totalHeadStart.ToString();
             }
             else
             {
                 textNote.text  = AllLanguages.shopMaxNumber[Modules.indexLanguage];
                 textNote.color = colorNotCoin;
                 Invoke("ReturnValueTotal", 1f);
             }
         }
         else//neu khong du tien
         {
             textNote.text  = AllLanguages.shopNotEnough[Modules.indexLanguage];
             textNote.color = colorNotCoin;
             Invoke("ReturnValueTotal", 1f);
         }
     }
     else if (codeItem == 5)//neu la scoreBooster
     {
         int cost = Modules.IntParseFast(textCost.text);
         if (Modules.totalCoin >= cost)//neu du tien
         {
             if (Modules.totalScoreBooster < Modules.maxScorebooster)
             {
                 Modules.totalScoreBooster++;
                 Modules.totalCoin -= cost;
                 Modules.SaveCoin();
                 textCoin.text = Modules.totalCoin.ToString();
                 Modules.SaveScoreBooster();
                 textNote.text = AllLanguages.shopTotal[Modules.indexLanguage] + " " + Modules.totalScoreBooster.ToString();
             }
             else
             {
                 textNote.text  = AllLanguages.shopMaxNumber[Modules.indexLanguage];
                 textNote.color = colorNotCoin;
                 Invoke("ReturnValueTotal", 1f);
             }
         }
         else//neu khong du tien
         {
             textNote.text  = AllLanguages.shopNotEnough[Modules.indexLanguage];
             textNote.color = colorNotCoin;
             Invoke("ReturnValueTotal", 1f);
         }
     }
 }
Пример #44
0
 public Module GetModule(long moduleEid)
 {
     return(Modules.FirstOrDefault(m => m.Eid == moduleEid));
 }
Пример #45
0
        private static async Task QuoteModul(Modules modules)
        {
            await DataAccess.AddOrReplaceModuleData(modules, await GetQuoteOfDay());

            Debug.WriteLine("Spruch Module geladen");
        }
Пример #46
0
 public Module FindModuleByCategoryFlag(CategoryFlags cf)
 {
     return(Modules.FirstOrDefault(m => m.IsCategory(cf)));
 }
Пример #47
0
        private static async Task JokeModul(Modules modules)
        {
            await DataAccess.AddOrReplaceModuleData(modules, await JokeHelper.GetJoke());

            Debug.WriteLine("Joke Module geladen");
        }
Пример #48
0
 public sealed override Module[] GetModules(bool getResourceModules) => Modules.ToArray();
Пример #49
0
 public ModuleApiDescriptionModel GetOrAddModule(string rootPath, string remoteServiceName)
 {
     return(Modules.GetOrAdd(rootPath, () => ModuleApiDescriptionModel.Create(rootPath, remoteServiceName)));
 }
Пример #50
0
 public ConsoleApplicationServerServerApplication(ISecurityStrategyBase securityStrategyBase)
     : base(securityStrategyBase)
 {
     ApplicationName = @"SecuritySystemExample";
     Modules.Add(new SecuritySystemExampleModule());
 }
Пример #51
0
        /// <summary>
        /// Builds a table with all the user fields and returns the string.
        /// </summary>
        /// <returns>An HTML string.</returns>
        public string GetUserFields(bool isSelfInfo)
        {
            //tal vez esta función no deba ir aqui...
            string          retval             = "<div id='tabNav'><ul>";
            string          tabBody            = "";
            int             currentIdDataGroup = 0;
            List <DataDesc> dataDescList       = Data.Data.GetDataDesc();

            foreach (DataDesc dataDesc in dataDescList)
            {
                foreach (UserData userData in userDataList)
                {
                    if (userData.IdData == dataDesc.IdData)
                    {
                        if (!String.IsNullOrEmpty(userData.Value))
                        {
                            dataDesc.Value = userData.Value;
                        }
                    }
                }
                if (dataDesc.IdDataGroup != currentIdDataGroup)
                {
                    if (currentIdDataGroup != 0)
                    {
                        tabBody += "</table></div>";
                    }
                    tabBody           += "<div id='tab" + dataDesc.IdDataGroup + "'><table width='70%' align='center'>";
                    currentIdDataGroup = dataDesc.IdDataGroup;
                    DataGroup dataGroup = new DataGroup(dataDesc.IdDataGroup);
                    retval += "<li><a href='#tab" + dataDesc.IdDataGroup + "'>" + dataGroup.Name + "</a></li>";
                }
                if (dataDesc.Kind != Data.Data.LABEL)
                {
                    bool canBeShown = false;
                    if (dataDesc.InvisibleToSelf == 1)
                    {
                        if (isSelfInfo)
                        {
                            if (Modules.Permission(SessionHandler.Modules, Modules.USER_ADMINISTRATION))
                            {
                                canBeShown = true;
                            }
                        }
                    }
                    else
                    {
                        canBeShown = true;
                    }
                    if (canBeShown)
                    {
                        string fieldName = dataDesc.Name;
                        if (dataDesc.Required == 1)
                        {
                            fieldName = "<span class='required'>" + fieldName + "</span>";
                        }
                        string valueFromRequest = HttpContext.Current.Request.Form["data_" + dataDesc.IdData];
                        //if (dataDesc.Value == "") dataDesc.Value = valueFromRequest;
                        if (!String.IsNullOrEmpty(valueFromRequest))
                        {
                            dataDesc.Value = valueFromRequest;
                        }
                        tabBody += "<tr><td width='30%'>" + fieldName + ":</td><td width='70%'>" + dataDesc.GetFieldHTML() + "</td></tr>";
                    }
                }
                else
                {
                    tabBody += "<tr><td colspan='2'>" + dataDesc.GetFieldHTML() + "</td></tr>";
                }
            }
            if (!String.IsNullOrEmpty(tabBody))
            {
                tabBody += "</table></div>";
            }
            return(retval + "</ul>" + tabBody + "</div>");
        }
Пример #52
0
        public override void SetData(byte[] data)
        {
            try
            {
                if (data == null)
                {
                    return;
                }
                if (data[0] != Definitions.Device.Bqms.Head)
                {
                    return;
                }
                if (data[1] != Definitions.Device.Bqms.Id[0] || data[2] != Definitions.Device.Bqms.Id[1])
                {
                    return;
                }

                var canId = (Definitions.Device.Bqms.CanId)BitConverter.ToInt32(data, 3);
                switch (canId)
                {
                case Definitions.Device.Bqms.CanId.StringVCT:
                    Voltage = BitConverter.ToInt16(data, 7) * 0.1;
                    Current = (double)ExBitConverter.ToInt24(data, 9) * 0.1;
                    if (data[12] == 0)
                    {
                        var temperature = BitConverter.ToInt16(data, 13);
                        if (temperature == 0x7fff)
                        {
                            AmbientTemperature = null;
                        }
                        else
                        {
                            AmbientTemperature = temperature * 0.1;
                        }
                    }
                    else
                    {
                        RippleCurrent = BitConverter.ToInt16(data, 13) * 0.1;
                    }
                    return;

                case Definitions.Device.Bqms.CanId.StringGain:
                    VoltageGain   = data[8];
                    CurrentGain   = data[9];
                    CurrentOffset = (sbyte)data[10] * 0.1;
                    break;

                case Definitions.Device.Bqms.CanId.StartMeasureResistance:
                    IsMeasuring = true;
                    return;

                case Definitions.Device.Bqms.CanId.EndMeasureResistance:
                    IsMeasuring = false;
                    return;

                case Definitions.Device.Bqms.CanId.Version:
                    Version = $"{(int)data[7]}.{(int)data[8]}";
                    return;

                case Definitions.Device.Bqms.CanId.CellVoltagePeriod:
                    CellVoltagePeriod = BitConverter.ToInt16(data, 8);
                    return;

                case Definitions.Device.Bqms.CanId.CellResistancePeriod:
                    CellResistancePeriod = BitConverter.ToInt16(data, 8);
                    return;

                case Definitions.Device.Bqms.CanId.Discharge:
                    DisChargeCurrentDetect  = (double)ExBitConverter.ToInt24(data, 8) * 0.1;
                    DisChargeCurrentRelease = (double)ExBitConverter.ToInt24(data, 11) * 0.1;
                    return;

                case Definitions.Device.Bqms.CanId.UnitMax:
                    UnitMax = (int)data[8];
                    return;

                case Definitions.Device.Bqms.CanId.Deadband:
                    VoltageDeadband        = (double)data[8] * 0.1;
                    CurrentDeadband        = (double)data[9] * 0.1;
                    TemperatureDeadband    = (double)data[10] * 0.1;
                    RippleCurrentDeadband  = (double)data[11] * 0.1;
                    CellVoltageDeadband    = (double)data[12] * 0.01;
                    CellResistanceDeadband = (double)data[13] * 0.01;
                    break;

                case Definitions.Device.Bqms.CanId.OutContract:
                    var dryContactBitArray = new BitArray(new byte[2] {
                        data[7], data[8]
                    });
                    for (int i = 0; i < DryContact.Count(); i++)
                    {
                        if (dryContactBitArray.Count <= i)
                        {
                            DryContact[i] = false;
                        }
                        else
                        {
                            DryContact[i] = dryContactBitArray[i];
                        }
                    }

                    var inputSignalBitArray = new BitArray(new byte[1] {
                        data[9]
                    });
                    for (int i = 0; i < InputSignal.Count(); i++)
                    {
                        if (inputSignalBitArray.Count <= i)
                        {
                            InputSignal[i] = false;
                        }
                        else
                        {
                            InputSignal[i] = inputSignalBitArray[i];
                        }
                    }
                    var ledBitArray = new BitArray(new byte[1] {
                        data[10]
                    });
                    for (int i = 0; i < Led.Count(); i++)
                    {
                        if (ledBitArray.Count <= i)
                        {
                            Led[i] = false;
                        }
                        else
                        {
                            Led[i] = ledBitArray[i];
                        }
                    }
                    break;

                default:
                    break;
                }

                canId = (Definitions.Device.Bqms.CanId)(BitConverter.ToInt32(data, 3) & 0xFFFFFF00);

                int moduleNumber = data[3];
                if (moduleNumber < 1)
                {
                    return;
                }
                CellModel cell = null;

                switch (canId)
                {
                case Definitions.Device.Bqms.CanId.ChannelCount:
                    var channelModule = Modules.SingleOrDefault(r => r.Id == moduleNumber);
                    if (channelModule != null)
                    {
                        channelModule.ChannelCount = data[7];
                    }
                    break;

                case Definitions.Device.Bqms.CanId.VoltagePhaseCompensation:
                    var module            = Modules.SingleOrDefault(r => r.Id == moduleNumber);
                    var voltageOffset     = BitConverter.ToInt16(data, 8) * 0.001;
                    var phaseCompensation = ExBitConverter.ToInt24(data, 10) * 0.001;
                    if (module == null)
                    {
                        module = new ModuleModel
                        {
                            Id                = moduleNumber,
                            BankId            = Id,
                            VoltageOffset     = voltageOffset,
                            PhaseCompensation = phaseCompensation,
                            UpdateTime        = DateTime.Now
                        };
                        AddModule(module);
                    }
                    else
                    {
                        module.VoltageOffset     = voltageOffset;
                        module.PhaseCompensation = phaseCompensation;
                        module.UpdateTime        = DateTime.Now;
                    }
                    return;

                case Definitions.Device.Bqms.CanId.CellVoltage:
                    for (int i = 0; i < 4; i++)
                    {
                        var voltage = BitConverter.ToInt16(data, i * 2 + 7) * 0.001;
                        cell = Cells.SingleOrDefault(r => r.ModuleNumber == moduleNumber && r.Channel == i + 1);
                        if (cell == null)
                        {
                            cell = new CellModel
                            {
                                ModuleNumber = moduleNumber,
                                Channel      = i + 1,
                                Voltage      = voltage,
                                UpdateTime   = DateTime.Now
                            };
                            AddCell(cell);
                        }
                        else
                        {
                            cell.Voltage    = voltage;
                            cell.UpdateTime = DateTime.Now;
                        }

                        var tempModule = Modules.SingleOrDefault(r => r.Id == moduleNumber);
                        if (tempModule != null)
                        {
                            tempModule.Voltages[i] = voltage;
                        }
                    }
                    return;

                case Definitions.Device.Bqms.CanId.CellTemperature:
                    for (int i = 0; i < 4; i++)
                    {
                        double?temperature = BitConverter.ToInt16(data, i * 2 + 7);
                        if (temperature == 0x7FFF)
                        {
                            temperature = null;
                        }
                        else
                        {
                            temperature *= 0.1;
                        }
                        cell = Cells.SingleOrDefault(r => r.ModuleNumber == moduleNumber && r.Channel == i + 1);
                        if (cell == null)
                        {
                            AddCell(new CellModel
                            {
                                ModuleNumber = moduleNumber,
                                Channel      = i + 1,
                                Temperature  = temperature,
                                UpdateTime   = DateTime.Now
                            });
                        }
                        else
                        {
                            cell.Temperature = temperature;
                            cell.UpdateTime  = DateTime.Now;
                        }
                    }
                    return;

                case Definitions.Device.Bqms.CanId.CellResistance:
                    var    channel    = data[7];
                    double?resistance = ExBitConverter.ToInt24(data, 8);

                    if (resistance == 0x7FFFFF)
                    {
                        resistance = null;
                    }
                    else
                    {
                        resistance *= 0.001;
                    }
                    double resistanceOffset = BitConverter.ToInt16(data, 11) * 0.01;
                    cell = Cells.SingleOrDefault(r => r.ModuleNumber == moduleNumber && r.Channel == channel);
                    if (cell == null)
                    {
                        AddCell(new CellModel
                        {
                            ModuleNumber                = moduleNumber,
                            Channel                     = channel,
                            Resistance                  = resistance,
                            ResistanceOffset            = resistanceOffset,
                            MeasureResistanceUpdateTime = DateTime.Now,
                            UpdateTime                  = DateTime.Now
                        });
                    }
                    else
                    {
                        cell.Resistance                  = resistance;
                        cell.ResistanceOffset            = resistanceOffset;
                        cell.MeasureResistanceUpdateTime = DateTime.Now;
                        cell.UpdateTime                  = DateTime.Now;
                    }
                    return;

                case Definitions.Device.Bqms.CanId.ResistanceOffset:
                    for (int i = 0; i < 4; i++)
                    {
                        var offset = BitConverter.ToInt16(data, i * 2 + 7) * 0.01;
                        cell = Cells.SingleOrDefault(r => r.ModuleNumber == moduleNumber && r.Channel == i + 1);
                        if (cell == null)
                        {
                            cell = new CellModel
                            {
                                ModuleNumber     = moduleNumber,
                                Channel          = i + 1,
                                ResistanceOffset = offset,
                                UpdateTime       = DateTime.Now
                            };
                            AddCell(cell);
                        }
                        else
                        {
                            cell.ResistanceOffset = offset;
                            cell.UpdateTime       = DateTime.Now;
                        }
                    }
                    return;

                case Definitions.Device.Bqms.CanId.TestMeasure:
                    var receiveChannel = (byte)((data[8] >> 4) & 0x0F);
                    cell = Cells.SingleOrDefault(r => r.ModuleNumber == moduleNumber && r.Channel == receiveChannel);
                    var receiveGain = (byte)(data[8] & 0x0F);
                    if (cell == null)
                    {
                        cell = new CellModel
                        {
                            ModuleNumber = moduleNumber,
                            Channel      = receiveChannel,
                            Gain         = receiveGain,
                            UpdateTime   = DateTime.Now,
                            TestMeasureResistanceUpdateTime = DateTime.Now
                        };

                        if (data[7] == 0x01)
                        {
                            cell.ImpedanceVoltage = (double)ExBitConverter.ToInt24(data, 9) * 0.001;
                            cell.impedanceCurrent = (double)ExBitConverter.ToInt24(data, 12) * 0.001;
                        }
                        else
                        {
                            cell.Phase      = (double)ExBitConverter.ToInt24(data, 9) * 0.001;
                            cell.Resistance = (double)ExBitConverter.ToInt24(data, 12) * 0.001;
                        }
                        AddCell(cell);
                    }
                    else
                    {
                        cell.Gain = receiveGain;
                        if (data[7] == 0x01)
                        {
                            cell.ImpedanceVoltage = (double)ExBitConverter.ToInt24(data, 9) * 0.001;
                            cell.impedanceCurrent = (double)ExBitConverter.ToInt24(data, 12) * 0.001;
                        }
                        else
                        {
                            cell.Phase      = (double)ExBitConverter.ToInt24(data, 9) * 0.001;
                            cell.Resistance = (double)ExBitConverter.ToInt24(data, 12) * 0.001;
                        }
                        cell.UpdateTime = DateTime.Now;
                        cell.TestMeasureResistanceUpdateTime = DateTime.Now;
                    }
                    return;

                default:
                    break;
                }

                return;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return;
            }
        }
Пример #53
0
 public static short IsValidCode(ComboBox cbo, Modules module)
 {
     return IsValidCode(cbo, module, false);
 }
Пример #54
0
        private static void MainThread()
        {
            if (Modules.IsModuleRunning(Modules.ClientDLLName))
            {
                AimBotController Aim = new AimBotController();
                while (true)
                {
                    if (CLocalPlayer.IsPlaying)
                    {
                        for (int i = 0; i <= EngineClient.MaxPlayer; i++)
                        {
                            int EntBase = CylMem.ReadInt(Modules.ClientDLLAdress + Offsets.signatures.dwEntityList + i * 0x10);
                            if (EntBase == 0)
                            {
                                continue;
                            }
                            if (CEntityPlayer.isDormant(EntBase))
                            {
                                continue;
                            }
                            if (CEntityPlayer.isDead(EntBase))
                            {
                                continue;
                            }
                            if (CEntityPlayer.Team(EntBase) == Teams.NONE || CEntityPlayer.Team(EntBase) == Teams.SPECTATOR)
                            {
                                continue;
                            }
                            if (CEntityPlayer.WeaponName(EntBase) == "NONE")
                            {
                                continue;
                            }
                            Aimbot.ConfigureAimbot(EntBase, Aim);
                            GlowESP.RunGlowESPPanorama(EntBase);
                            Chams.RunChamsPanorama(EntBase);
                            EngineRadar.RunRadarPanorama(EntBase);
                        }
                        BunnyHop.RunBunnyHopPanorama();
                        AutoPistol.RunAutoPistolPanorama();
                        Triggerbot.RunTriggerBotPanorama();
                        NoFlash.RunNoFlashPanorama();
                        NoHands.RunNoHandsPanorama();
                        DamageIndicator.RunDamageIndicatorPanorama();
                        RemoveScope.RunRemoveScopePanorama();
                        ViewModelFOV.RunViewModelFOV();
                        RecoilControlSystem.RunRCSPanorama();
                        GrenadeTrajectory.RunGPRJPanorama();
                        NoSmoke.RunNoSmokePanorama();
                        Aimbot.RunAimbotPanorama(Aim);

                        #region Performance Settings
                        if (CheatPerf == PerformanceTimes.VHIGH)
                        {
                        }
                        else
                        {
                            Thread.Sleep((int)CheatPerf);
                        }
                        #endregion
                    }
                }
            }
        }
Пример #55
0
 public static void ShowInvlaidCodeMessage(ComboBox cbo, Modules module)
 {
     MessageBox.Show(string.Format("Error ! Invalid {0} Code" + Environment.NewLine + "Please Select a Valid {0} Code.", module.ToString()), module.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error);
     cbo.Focus();
     if (cbo.Items.Count > 0)
         cbo.SelectedIndex = 0;
     cbo.Focus();
 }
Пример #56
0
 IEnumerator IEnumerable.GetEnumerator()
 {
     return(Modules.GetEnumerator());
 }
 public FEModuleViewModel GetModule(string name)
 {
     return(Modules.FirstOrDefault(m => m.Name == name));
 }
Пример #58
0
        /// <summary>
        /// Retrieves and returns the current Data Fields list.
        /// </summary>
        /// <returns>An HTML including the data fields list.</returns>
        public static string GetDataFieldsList()
        {
            string retval        = "";
            string className     = "";
            int    total         = 0;
            string dataGroupList = "";

            retval = "<table width='60%' align='center'><tr><td><ul id='dataGroups' style='list-style-type: none; margin: 0; padding: 0; width: 100%'>";

            string[] idDataGroupList = Common.CSVToArray(Common.GetBDList("IdDataGroup", "SELECT IdDataGroup, Name FROM DataGroup ORDER BY GroupSequence", false));
            foreach (string idDataGroup in idDataGroupList)
            {
                if (!String.IsNullOrEmpty(idDataGroup))
                {
                    DataGroup dataGroup = new DataGroup(Convert.ToInt32(idDataGroup));
                    dataGroupList = Common.StrAdd(dataGroupList, ",", "#idDG_" + dataGroup.IdDataGroup);
                    retval       += "<li id='idGroup_" + dataGroup.IdDataGroup + "'><span class='moveIcon'><img src='images/move.png' /></span><div class='cellTitle' align='center' style='height: 32px;'>" + dataGroup.Name + "</div>";
                    retval       += "<ul id='idDG_" + dataGroup.IdDataGroup + "' class='dragEnabledConn' style='list-style-type: none; margin: 0; padding: 8; width: 100%'>";

                    string[] idDataList = Common.CSVToArray(Common.GetBDList("IdData", "SELECT IdData, Name FROM DataDesc WHERE IdDataGroup = " + idDataGroup + " ORDER BY FieldSequence", false));
                    foreach (string idData in idDataList)
                    {
                        try
                        {
                            DataDesc dataDesc = new DataDesc(Convert.ToInt32(idData));
                            className = Common.SwitchClass(className);
                            retval   += "<li id='idDI_" + dataDesc.IdData + "' class='" + className + "' style='height: 32px'><span class='moveIcon'><img src='images/move.png' /></span><span onClick='editField(" + idData + ");' style='margin-left: 30px;'>" + dataDesc.Name + " (" + Data.FriendlyName(dataDesc.Kind) + ")" + (dataDesc.Inactive == 1 ? " <i>" + Text.Inactive + "</i>" : "") + "</span></li>";
                            total++;
                        }
                        catch (Exception ex) { }
                    }
                    retval += "</ul>";
                    retval += "<div align='right'>";
                    if (Modules.PermissionOr(SessionHandler.Modules, Modules.EDIT_FIELDS + "," + Modules.DATAFIELDS_ADMINISTRATION))
                    {
                        retval += DrawInput.InputButton("editGrp_" + dataGroup.IdDataGroup, Text.Edit, "", "editGroup(" + dataGroup.IdDataGroup + ", '" + dataGroup.Name + "'); return false;", "background-image: url(./images/edit.png); background-repeat: no-repeat; height: 30px; padding-left: 30px;", "");
                    }
                    if (Modules.PermissionOr(SessionHandler.Modules, Modules.DELETE_FIELDS + "," + Modules.DATAFIELDS_ADMINISTRATION))
                    {
                        retval += DrawInput.InputButton("deleteGrp_" + dataGroup.IdDataGroup, Text.Delete, "", "deleteGroup(" + dataGroup.IdDataGroup + "); return false;", "background-image: url(./images/delete.png); background-repeat: no-repeat; height: 30px; padding-left: 30px;", "");
                    }
                    retval += "</div></li>";
                }
            }
            retval += "</ul>";

            if (!String.IsNullOrEmpty(dataGroupList))
            {
                retval += "<script type='text/javascript'>";
                retval += "$('" + dataGroupList + "').sortable({ connectWith: '.dragEnabledConn', placeholder: 'sort-placeholder', handle: '.moveIcon', stop: function(event, ui) { invalidateList($(this).attr('id'), $(this).sortable('toArray')); }, receive: function(event, ui) { invalidateList($(this).attr('id'), $(this).sortable('toArray')); } }).disableSelection();";
                retval += "$('#dataGroups').sortable({ handle: '.moveIcon', stop: function(event, ui) { invalidateList($(this).attr('id'), $(this).sortable('toArray')); } }).disableSelection();";
                retval += "</script>";
            }

            //Footer
            retval += "<div align='center' class='pagination'>";
            retval += "<div align='left' style='width: 100%; display: inline-block;'>" + Common.StrLang(Text.ShowingXofY, total.ToString() + "," + total.ToString()) + " " + Text.Field_s + "</div>";
            retval += "</div></td></tr></table>";

            return(retval);
        }
Пример #59
0
 public static GroupPermission GetPagePermissionsByPage(Modules module)
 {
     var allPermissions = GetPermisssions();
     var permission = allPermissions.FirstOrDefault(a => a.PageId == (int)module);
     if (permission != null)
         return permission;
     else
         return new GroupPermission { Edit = false, Read = false, Write = false };
 }
Пример #60
0
 public ITiming GetDefaultSequenceTiming()
 {
     return(Modules.GetManager <ITimingModuleInstance, TimingModuleManagement>().GetDefault());
 }