public static Application LoadApplication(this IPlan plan, ModuleName name) { var desc = plan.TargetDescriptions[name]; var t = plan.LoadAsync(name, CancellationToken.None).Result; t.Item2.ThrowIfFailed(desc); return t.Item1; }
public DependingOnConstraint(string name) { ModuleName moduleName; if (ModuleName.TryParse(name, out moduleName)) _dependency = moduleName; else throw new ArgumentException(string.Format("The string {0} is not a valid module name.", name)); }
public static Task<Application> LoadAsync(this IPlan plan, ModuleName name) { return plan.LoadAsync(name, CancellationToken.None).ContinueWith(tt => { var result = tt.Result; result.Item2.ThrowIfFailed(plan.TargetDescriptions[name]); return result.Item1; }); }
public VersionConflictException(ModuleName existingModule, ModuleName newModule, ModuleName offendingModule) { _existingModule = existingModule; _newModule = newModule; _offendingModule = offendingModule; Data["ExistingModule"] = existingModule; Data["NewModule"] = newModule; Data["OffendingModule"] = offendingModule; }
public ILBreakpoint(Debugger debugger, ModuleName module, uint token, uint offset, Func<IILBreakpoint, bool> cond) { this.debugger = debugger; this.module = module; this.token = token; this.offset = offset; this.cond = cond ?? condAlwaysTrue; this.isEnabled = true; }
public bool IsAllowGruppo(string nome, ModuleName module) { var modulo = GeModuloByName(module); if (modulo != null) { var gruppo = (modulo.Gruppi.Where(item => item.NomeAssembly == nome)).SingleOrDefault(); return gruppo != null; } else return false; }
public LoadingWindow(UIElement parent, ModuleName ctype, string TicketNo, string AssetNo, int Amount) { _parent = parent; _ctype = ctype; _ValidationNo = TicketNo; _AssetNo = AssetNo; _Amount = Amount; InitializeComponent(); ImageBrush myBrush = new ImageBrush(); myBrush.ImageSource = new BitmapImage(new Uri("pack://application:,,,/Resources/back.jpg", UriKind.Absolute)); //Window.GetWindow(Parent). this.Owner = Window.GetWindow(parent); this.Background = myBrush; }
public bool TryGetModule(ModuleName moduleName, out Module module) { Task<ITarget> target; if(_taskMap.TryGetValue(moduleName, out target)) { module = target.Result.Module; return true; } else { module = null; return false; } }
internal ManualTargetDescription([NotNull] ModuleName moduleName, [NotNull] ISource source, [CanBeNull] string fileName, [NotNull] IEnumerable<ModuleName> dependencies, [CanBeNull] IEnumerable<Message> buildMessages = null) { if (moduleName == null) throw new ArgumentNullException("moduleName"); if (source == null) throw new ArgumentNullException("source"); if (dependencies == null) throw new ArgumentNullException("dependencies"); _moduleName = moduleName; _source = source; _fileName = fileName; _dependencies = new DependencySet(moduleName); _dependencies.AddRange(dependencies); if (buildMessages != null) _buildMessages = new List<Message>(buildMessages); }
public LoadingWindow(UIElement parent, ModuleName ctype,Action act_body, bool LoadOnlyDB) { _parent = parent; _ctype = ctype; _act_body = act_body; _LoadOnlyDB = LoadOnlyDB; InitializeComponent(); lblStatus.SetValue(System.Windows.Controls.Label.ContentProperty, "Retrieving data from database..."); ImageBrush myBrush = new ImageBrush(); myBrush.ImageSource = new BitmapImage(new Uri("pack://application:,,,/Resources/back.jpg", UriKind.Absolute)); //Window.GetWindow(Parent). this.Owner = UIExtensionMethods.GetWindowOwner(parent); this.Background = myBrush; pgBar.IsIndeterminate = false; pgBar.Maximum = 100; pgBar.Minimum = 0; }
public LoadingWindow(UIElement parent, ModuleName ctype, IList<int> Installations, Action afterAction) { _parent = parent; _ctype = ctype; _Installations = Installations; _afterAction = afterAction; InitializeComponent(); lblStatus.SetValue(System.Windows.Controls.Label.ContentProperty, "Current Meters"); ImageBrush myBrush = new ImageBrush(); myBrush.ImageSource = new BitmapImage(new Uri("pack://application:,,,/Resources/back.jpg", UriKind.Absolute)); //Window.GetWindow(Parent). this.Owner = UIExtensionMethods.GetWindowOwner(parent); this.Background = myBrush; pgBar.IsIndeterminate = false; pgBar.Maximum = Installations.Count; pgBar.Minimum = 0; SleepTime = Convert.ToInt32(BMC.Common.ConfigurationManagement.ConfigManager.Read("DBRefreshInterval")); }
public static IBmcCashDispenser GetDispenser(UIElement parent, ModuleName ctype) { try { if (BMC.Transport.Settings.IsGloryCDEnabled) { LogManager.WriteLog("Cash Dispenser Type : Glory", LogManager.enumLogLevel.Info); return new GloryCashDispenser(parent, ctype); } else { LogManager.WriteLog("Cash Dispenser Type Not Found", LogManager.enumLogLevel.Info); return null; } } catch (Exception ex) { return null; } }
public void WrapImported() { // referenced module var refdMod = new ModuleName("refd", new Version()); var refd = SymbolStore.Create(); var a = SymbolStore.Create(); var b = Symbol.CreateReference(EntityRef.Command.Create("c"), NoSourcePosition.Instance); a.Declare("b", b); var nsa = new MergedNamespace(a); refd.Declare("a", Symbol.CreateNamespace(nsa, NoSourcePosition.Instance)); // referencing module var external = SymbolStore.Create(conflictUnionSource: refd.Select(_exportFromModule(refdMod))); var mlv = ModuleLevelView.Create(external); Symbol syma; Assert.IsTrue(mlv.TryGet("a", out syma), "external symbol is accessible"); // retrive namespace NamespaceSymbol nssyma; Assert.That(syma, Is.InstanceOf<NamespaceSymbol>(), "symbol a"); Assert.IsTrue(syma.TryGetNamespaceSymbol(out nssyma), "looking up a results in a namespace symbol"); // retrieve referenced symbol Symbol symb; Assert.That(nssyma.Namespace.TryGet("b", out symb), Is.True, "external symbol a.b is accessible"); Assert.That(symb, Is.InstanceOf<ReferenceSymbol>(), "external symbol a.b"); Assert.That(symb, Is.SameAs(b)); // check that namespace is wrapped Assert.That(nssyma.Namespace,Is.InstanceOf<LocalNamespace>(),"namespace a when looked up locally"); var localns = (LocalNamespace) nssyma.Namespace; var symd = Symbol.CreateReference(EntityRef.Command.Create("e"),NoSourcePosition.Instance); localns.DeclareExports(new KeyValuePair<string, Symbol>("d",symd).Singleton()); Symbol symd2; Assert.That(nssyma.Namespace.TryGet("d",out symd2),Is.True,"Symbol a.d looked up locally"); Assert.That(symd2,Is.EqualTo(symd),"Symbol retrieved locally compared to the symbol declared"); Assert.That(nsa.TryGet("d",out symd2),Is.False,"Existence of symbol a.d looked up from referenced module"); }
public ModuloDTO GeModuloByName(ModuleName module) { int idModulo; switch (module) { case ModuleName.Contabilita: idModulo = 2; break; case ModuleName.Contratti: idModulo = 1; break; case ModuleName.Fornitori: idModulo = 4; break; case ModuleName.Pratiche: idModulo = 3; break; default: idModulo = 1; break; } return (GetAllModuli().Where(item => item.ID == idModulo)).SingleOrDefault(); }
public DebuggerModule(Debugger debugger, DnModule mod) { debugger.Dispatcher.VerifyAccess(); this.debugger = debugger; this.mod = mod; this.hashCode = mod.GetHashCode(); this.uniqueId = mod.UniqueId; this.name = mod.Name; this.address = mod.Address; this.size = mod.Size; var serMod = mod.SerializedDnModule; this.moduleName = new ModuleName(serMod.AssemblyFullName, serMod.ModuleName, serMod.IsDynamic, serMod.IsInMemory, serMod.ModuleNameOnly); }
public void PrintSlip(DataRow drFillDetails, string strFillType) { ValuetoWords objWords = new ValuetoWords(); VaultSlipXml xml = null; try { filename = "Print.txt"; filepath = System.Windows.Forms.Application.StartupPath + "\\" + filename; if (File.Exists(filepath)) { File.Delete(filepath); } outputfile = new FileStream(filepath, FileMode.OpenOrCreate, FileAccess.Write); writer = new StreamWriter(outputfile); writer.BaseStream.Seek(0, SeekOrigin.End); xml = new VaultSlipXml(writer); xml.ParseXmlFile(); ModuleName module = ModuleName.AttendantPay; string Type = string.Empty; // Header=0, //PrintedDate, //SiteName, //Vault_Name, //SerialNo, //Manufacturer, //Type, //Fill_User, //FillDate, //Initial_Balance, //Fill_Amount, //CurrentBalance, //Signature // required values for xml string sVersion = CommonDataAccess.GetVersion(); Double dAmount = Double.Parse(drFillDetails["FillAmount"].ToString()); if (dAmount < 0) { dAmount = dAmount * -1; } string AmtInWords = objWords.ConvertValueToWords(dAmount, CommonDataAccess.GetSettingValue("Region") == "US" ? "en-US" : CommonDataAccess.GetSettingValue("Region") == "UK" ? "en-GB" : CommonDataAccess.GetSettingValue("Region") == "IT" ? "it-IT" : "en-US"); // fill the values //xml[VaultSlipXmlFields.Header].Value = "Fill slip"; xml[VaultSlipXmlFields.PrintedDate].Value = DateTime.Now.ToString("dd-MMM-yyyy HH:mm:ss"); xml[VaultSlipXmlFields.SiteName].Value = Settings.SiteName; xml[VaultSlipXmlFields.Vault_Name].Value = drFillDetails["Name"].ToString(); xml[VaultSlipXmlFields.SerialNo].Value = drFillDetails["Serial_NO"].ToString(); xml[VaultSlipXmlFields.Manufacturer].Value = drFillDetails["Manufacturer_Name"].ToString(); xml[VaultSlipXmlFields.Type].Value = drFillDetails["Type_Prefix"].ToString(); xml[VaultSlipXmlFields.Fill_User].Value = SecurityHelper.CurrentUser.DisplayName; xml[VaultSlipXmlFields.FillDate].Value = DateTime.Parse(drFillDetails["CreatedDate"].ToString()).ToString("dd-MMM-yyyy HH:mm:ss"); xml[VaultSlipXmlFields.Fill_Amount].Value = CommonUtilities.GetCurrency(double.Parse(drFillDetails["FillAmount"].ToString())); if (strFillType != string.Empty) { xml[VaultSlipXmlFields.Fill_Type].Value = strFillType; } xml[VaultSlipXmlFields.Initial_Balance].Value = CommonUtilities.GetCurrency(double.Parse(drFillDetails["TotalAmountOnFill"].ToString())); xml[VaultSlipXmlFields.CurrentBalance].Value = CommonUtilities.GetCurrency(double.Parse(drFillDetails["CurrentBalance"].ToString())); xml[VaultSlipXmlFields.Signature].Value = string.Empty; xml.Write(); writer.Close(); _textSettings = xml.TextSettings; PrintSlippage(xml.TextSettings); } catch (Exception ex) { ExceptionManager.Publish(ex); } finally { if (xml != null) { xml.Dispose(); xml = null; } } }
public override bool TryGetApplication(ModuleName moduleName, out Application application) { if (_application == null || !_application.Module.Name.Equals(moduleName)) { application = null; return false; } else { application = _application; return true; } }
// ModuleName public override bool Walk(ModuleName node) { return(ShouldWalkWorker(node)); }
public void DoGen() { File.WriteAllText($"{ControllerDir}\\{ModelName}Controller.cs", GenerateController(), Encoding.UTF8); File.WriteAllText($"{VmDir}\\{ModelName}VM.cs", GenerateVM("CrudVM"), Encoding.UTF8); File.WriteAllText($"{VmDir}\\{ModelName}ListVM.cs", GenerateVM("ListVM"), Encoding.UTF8); File.WriteAllText($"{VmDir}\\{ModelName}BatchVM.cs", GenerateVM("BatchVM"), Encoding.UTF8); File.WriteAllText($"{VmDir}\\{ModelName}ImportVM.cs", GenerateVM("ImportVM"), Encoding.UTF8); File.WriteAllText($"{VmDir}\\{ModelName}Searcher.cs", GenerateVM("Searcher"), Encoding.UTF8); if (UI == UIEnum.LayUI) { File.WriteAllText($"{ViewDir}\\Index.cshtml", GenerateView("ListView"), Encoding.UTF8); File.WriteAllText($"{ViewDir}\\Create.cshtml", GenerateView("CreateView"), Encoding.UTF8); File.WriteAllText($"{ViewDir}\\Edit.cshtml", GenerateView("EditView"), Encoding.UTF8); File.WriteAllText($"{ViewDir}\\Delete.cshtml", GenerateView("DeleteView"), Encoding.UTF8); File.WriteAllText($"{ViewDir}\\Details.cshtml", GenerateView("DetailsView"), Encoding.UTF8); File.WriteAllText($"{ViewDir}\\Import.cshtml", GenerateView("ImportView"), Encoding.UTF8); File.WriteAllText($"{ViewDir}\\BatchEdit.cshtml", GenerateView("BatchEditView"), Encoding.UTF8); File.WriteAllText($"{ViewDir}\\BatchDelete.cshtml", GenerateView("BatchDeleteView"), Encoding.UTF8); } if (UI == UIEnum.React) { if (Directory.Exists($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}") == false) { Directory.CreateDirectory($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}"); } if (Directory.Exists($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}\\views") == false) { Directory.CreateDirectory($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}\\views"); } if (Directory.Exists($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}\\store") == false) { Directory.CreateDirectory($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}\\store"); } File.WriteAllText($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}\\views\\action.tsx", GenerateReactView("action"), Encoding.UTF8); File.WriteAllText($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}\\views\\details.tsx", GenerateReactView("details"), Encoding.UTF8); File.WriteAllText($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}\\views\\models.tsx", GenerateReactView("models"), Encoding.UTF8); File.WriteAllText($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}\\views\\other.tsx", GenerateReactView("other"), Encoding.UTF8); File.WriteAllText($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}\\views\\search.tsx", GenerateReactView("search"), Encoding.UTF8); File.WriteAllText($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}\\views\\table.tsx", GenerateReactView("table"), Encoding.UTF8); File.WriteAllText($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}\\store\\index.ts", GetResource("index.txt", "Spa.React.store").Replace("$modelname$", ModelName.ToLower()), Encoding.UTF8); File.WriteAllText($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}\\index.tsx", GetResource("index.txt", "Spa.React").Replace("$modelname$", ModelName.ToLower()), Encoding.UTF8); File.WriteAllText($"{MainDir}\\ClientApp\\src\\pages\\{ModelName.ToLower()}\\style.less", GetResource("style.txt", "Spa.React").Replace("$modelname$", ModelName.ToLower()), Encoding.UTF8); var index = File.ReadAllText($"{MainDir}\\ClientApp\\src\\pages\\index.ts"); if (index.Contains($"path: '/{ModelName.ToLower()}'") == false) { index = index.Replace("/**WTM**/", $@" , {ModelName.ToLower()}: {{ name: '{ModuleName.ToLower()}', path: '/{ModelName.ToLower()}', component: () => import('./{ModelName.ToLower()}').then(x => x.default) }} /**WTM**/ "); File.WriteAllText($"{MainDir}\\ClientApp\\src\\pages\\index.ts", index, Encoding.UTF8); } var menu = File.ReadAllText($"{MainDir}\\ClientApp\\src\\subMenu.json"); if (menu.Contains($@"""Path"": ""/{ModelName.ToLower()}""") == false) { var i = menu.LastIndexOf("}"); menu = menu.Insert(i + 1, $@" ,{{ ""Key"": ""{Guid.NewGuid().ToString()}"", ""Name"": ""{ModuleName.ToLower()}"", ""Icon"": ""menu-fold"", ""Path"": ""/{ModelName.ToLower()}"", ""Component"": ""{ModelName.ToLower()}"", ""Action"": [], ""Children"": [] }} "); File.WriteAllText($"{MainDir}\\ClientApp\\src\\subMenu.json", menu, Encoding.UTF8); } } }
/// <inheritdoc/> public override bool TryGetOwningModule(string fileName, out ModuleName moduleName) { return(m_modulesByName.TryGetValue(fileName, out moduleName)); }
public void RelativeDependency() { const string pathFound = "stack/found.pxs"; const string pathLost = "stack/lost.pxs"; using (MockFile(pathFound, "name found;references{lost}")) using (MockFile(pathLost, "name lost;")) { var emptyCount = Sam.TargetDescriptions.Count; var desc = Sam.AssembleAsync( Source.FromString(@"name finder;references{""./stack/found.pxs""};"), CancellationToken.None).Result; Assert.That(desc, Is.Not.Null); Assert.That(desc.BuildMessages, Is.Empty, "Should not have build (error) messages"); Assert.That(desc.Name, Is.EqualTo(new ModuleName("finder", new Version(0, 0)))); // Does the primary module depend on lost and found? var foundModuleName = new ModuleName("found", new Version(0, 0)); var lostModuleName = new ModuleName("lost", new Version(0, 0)); Assert.That(desc.Dependencies.Count, Is.GreaterThanOrEqualTo(1), "Primary should have at least one dependency."); Assert.That(desc.Dependencies, Contains.Item(foundModuleName), string.Format("Primary is expected to depend on {0}.", foundModuleName)); // Does SAM contain the found module var foundTarget = Sam.TargetDescriptions.FirstOrDefault(td => td.Name.Equals(foundModuleName)); Assert.That(foundTarget, Is.Not.Null, string.Format("Expected a target description of {0} in SAM.", foundModuleName)); // ReSharper disable PossibleNullReferenceException Assert.That(foundTarget.BuildMessages, Is.Empty, string.Format("{0} should not have build (error) messages", foundModuleName)); // ReSharper restore PossibleNullReferenceException Assert.That(foundTarget.Dependencies, Contains.Item(lostModuleName), string.Format("found module expected to depend on {0}.", lostModuleName)); // does SAM contain the lost module? var lostTarget = Sam.TargetDescriptions.FirstOrDefault(td => td.Name.Equals(lostModuleName)); Assert.That(lostTarget, Is.Not.Null, string.Format("Expected a target description of {0} in SAM.", lostModuleName)); // ReSharper disable PossibleNullReferenceException Assert.That(lostTarget.BuildMessages, Is.Empty, string.Format("{0} should not have build (error) messages", lostModuleName)); // ReSharper restore PossibleNullReferenceException Assert.That(Sam.TargetDescriptions.Count,Is.EqualTo(emptyCount+3), "There should be exactly three new modules: finder, lost and found."); } }
/// <summary> /// Get relation data list data from db using class id /// First get relation data of a class object /// Second get meta data of relative table /// Third join relation data & metadata, then post to server /// </summary> /// <param name="classId"></param> /// <returns></returns> public static List <T> GetModuleDataList <T>(Class classData, int subRelationId = -1) { List <T> objectsList = null; try { ModuleName moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), typeof(T).Name); if (!_isServerConnected) { switch (moduleName) { case ModuleName.Employees: objectsList = (List <T>)Convert.ChangeType(_sqLiteCon.Table <Employees>().ToList(), typeof(List <T>)); break; case ModuleName.Participants: break; case ModuleName.Class: break; case ModuleName.Agendas: break; case ModuleName.LibraryThumbs: objectsList = (List <T>)Convert.ChangeType(_sqLiteCon.Table <LibraryThumbs>().ToList(), typeof(List <T>)); if (classData != null) { objectsList = objectsList.Where(s => (s as LibraryThumbs).ClassId == classData.ClassId).ToList(); } break; case ModuleName.BoardAnnotations: objectsList = (List <T>)Convert.ChangeType(_sqLiteCon.Table <BoardAnnotations>().ToList(), typeof(List <T>)); if (classData != null) { objectsList = objectsList.Where(s => (s as BoardAnnotations).ClassId == classData.ClassId).ToList(); } break; case ModuleName.ImageAnnotations: objectsList = (List <T>)Convert.ChangeType(_sqLiteCon.Table <ImageAnnotations>().ToList(), typeof(List <T>)); if (classData != null && subRelationId > 0) { objectsList = objectsList.Where(s => (s as ImageAnnotations).ClassId == classData.ClassId && (s as ImageAnnotations).BoardAnnotationId == subRelationId).ToList(); } else if (classData != null) { objectsList = objectsList.Where(s => (s as ImageAnnotations).ClassId == classData.ClassId).ToList(); } break; } } else { switch (moduleName) { case ModuleName.Employees: objectsList = (List <T>)Convert.ChangeType(_apiService.GetModuleDataList <Employees>(typeof(StorageObjects)), typeof(List <T>)); break; case ModuleName.Participants: break; case ModuleName.Class: break; case ModuleName.Agendas: break; case ModuleName.LibraryThumbs: objectsList = (List <T>)Convert.ChangeType(_apiService.GetModuleDataList <LibraryThumbs>(typeof(StorageObjects)), typeof(List <T>)); if (classData != null) { objectsList = objectsList.Where(s => (s as LibraryThumbs).ClassId == classData.ClassId).ToList(); } break; case ModuleName.BoardAnnotations: objectsList = (List <T>)Convert.ChangeType(_apiService.GetModuleDataList <BoardAnnotations>(typeof(StorageObjects)), typeof(List <T>)); if (classData != null) { objectsList = objectsList.Where(s => (s as BoardAnnotations).ClassId == classData.ClassId).ToList(); } break; case ModuleName.ImageAnnotations: objectsList = (List <T>)Convert.ChangeType(_apiService.GetModuleDataList <ImageAnnotations>(typeof(StorageObjects)), typeof(List <T>)); if (classData != null && subRelationId > 0) { objectsList = objectsList.Where(s => (s as ImageAnnotations).BoardAnnotationId == subRelationId).ToList(); } break; } } } catch (Exception ex) { App.InsertException(ex); } return(objectsList); }
public void PrintSlip(jackpotProcessInfoDTO jackpot) { JackpotXml xml = null; try { filename = "Print.txt"; filepath = System.Windows.Forms.Application.StartupPath + "\\" + filename; if (File.Exists(filepath)) { File.Delete(filepath); } outputfile = new FileStream(filepath, FileMode.OpenOrCreate, FileAccess.Write); writer = new StreamWriter(outputfile); writer.BaseStream.Seek(0, SeekOrigin.End); xml = new JackpotXml(writer); xml.ParseXmlFile(); ModuleName module = ModuleName.AttendantPay; string Type = string.Empty; string screenName = Settings.CAGE_ENABLED ? "PrintCageSlip|" : ""; switch (jackpot.jackpotTypeId) { case 1: Type = "AttendantPay Credit"; screenName += "AttendantPay Credit"; break; case 2: Type = "AttendantPay Jackpot"; screenName += "AttendantPay Jackpot"; break; case 3: Type = "Progressive"; screenName += "Progressive"; break; case 4: Type = "MANUAL CREDIT"; module = ModuleName.ManualAttendantPay; screenName += "MANUAL CREDIT"; break; case 5: Type = "MANUAL JACKPOT"; module = ModuleName.ManualAttendantPay; screenName += "MANUAL JACKPOT"; break; case 6: Type = "MANUAL PROGRESSIVE"; module = ModuleName.ManualAttendantPay; screenName += "MANUAL PROGRESSIVE"; break; default: Type = "Handpay"; screenName += "Handpay"; break; } // Modified by A.Vinod Kumar at 3:40 PM 17/01/12 // required values for xml string sVersion = CommonDataAccess.GetVersion(); double JAmt = Double.Parse(jackpot.hpjpAmount.ToString()) / 100; double jActualAmt = JAmt; if (JAmt < 0) { jActualAmt = (-1 * JAmt); } string JAmtInWords = objWords.ConvertValueToWords(jActualAmt, CommonDataAccess.GetSettingValue("Region") == "US" ? "en-US" : CommonDataAccess.GetSettingValue("Region") == "UK" ? "en-GB" : CommonDataAccess.GetSettingValue("Region") == "IT" ? "it-IT" : "en-US"); // fill the values xml[JackpotXmlFields.SiteName].Value = jackpot.siteNo; // Site Name xml[JackpotXmlFields.BMCVersion].Value = sVersion; // BMC Version xml[JackpotXmlFields.Type].Value = Type; // Type xml[JackpotXmlFields.Amount].Value = CommonUtilities.GetCurrency(JAmt); // Amount xml[JackpotXmlFields.AmountInWords].Value = JAmtInWords; // Amount in Words xml[JackpotXmlFields.TransactionDateTime].Value = jackpot.TransactionDate; // Transaction Date/Time xml[JackpotXmlFields.BarPosition].Value = jackpot.assetConfigNumber + "/" + jackpot.Slot; // Bar Position xml[JackpotXmlFields.SlotDenom].Value = jackpot.Denom.ToString(); // Slot Denomination xml[JackpotXmlFields.SiteID].Value = jackpot.siteId.ToString(); // Site Id xml[JackpotXmlFields.PrintedDate].Value = DateTime.Now.GetUniversalDateTimeFormat(); // Printed Date/Time xml[JackpotXmlFields.SequenceNo].Value = jackpot.sequenceNumber.ToString(); // Sequence No xml.Write(); writer.Close(); _textSettings = xml.TextSettings; PrintSlippage(xml.TextSettings); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = module, Audit_Screen_Name = screenName, Audit_Desc = Type, AuditOperationType = OperationType.ADD, Audit_Field = "Amount", Audit_New_Vl = xml[JackpotXmlFields.Amount].Value.ToString(), Audit_Slot = xml[JackpotXmlFields.BarPosition].Value }); } catch (Exception ex) { ExceptionManager.Publish(ex); } finally { if (xml != null) { xml.Dispose(); xml = null; } } }
public UI.Controls.Menu.SiteMapNode CreateMenuForCustomReport(HRM.Presentation.UI.Controls.Menu.XmlSiteMap sitemap, List <Rep_MasterModel> ListMaster, ModuleName module, string alias) { List <Rep_MasterModel> item = ListMaster.Where(m => m.ReportStoreModule == module.ToString()).ToList(); if (item != null && item.Count > 0) { //Add menu cha HRM.Presentation.UI.Controls.Menu.SiteMapNode node = new UI.Controls.Menu.SiteMapNode(); node.ControllerName = "Sys_CustomReport"; node.ActionName = "GeneralCustomReport"; node.HrmWebSite = "Hrm_Sys_Web"; //node.Alias = ConstantPathWeb.Hrm_Main_Web; node.RouteValues = sitemap.RootNode.ChildNodes.LastOrDefault().RouteValues; node.ImageUrl = "/Content/images/icons/submenu/menu/Att_ShiftTimeSheet.png"; node.Title = "Báo Cáo Động"; node.Visible = true; node.ChildNodes = new List <UI.Controls.Menu.SiteMapNode>(); foreach (var t in item) { HRM.Presentation.UI.Controls.Menu.SiteMapNode nodeitem = new UI.Controls.Menu.SiteMapNode(); nodeitem.ControllerName = "Sys_CustomReport"; nodeitem.ActionName = "GeneralCustomReport?id=" + t.ID; nodeitem.HrmWebSite = "Hrm_Sys_Web"; nodeitem.Alias = alias; //nodeitem.Alias = ConstantPathWeb.Hrm_Main_Web; nodeitem.Url = "#" + nodeitem.HrmWebSite + "/" + nodeitem.ControllerName + "/" + nodeitem.ActionName; nodeitem.RouteValues = sitemap.RootNode.ChildNodes.LastOrDefault().RouteValues; nodeitem.ImageUrl = "/Content/images/icons/submenu/menu/Att_ShiftTimeSheet.png"; nodeitem.Title = t.ReportName; nodeitem.Visible = true; node.ChildNodes.Add(nodeitem); } return(node); } return(null); }
abstract public void FadeIn(ModuleName name);
abstract public void FadeOut(ModuleName name);
public ImportDeclarationNode(SourceLocation location, DeclarationAccessibility accessibility, IEnumerable <DeclarationAnnotationNode> annotations, ModuleName imported, IEnumerable <ImportDirectiveNode> directives) : base(location, accessibility, annotations) { Imported = imported; Directives = directives?.ToList().AsReadOnly(); }
public ModuleData(ProjectData projectData, XmlNode xmlNode, XmlNode Elements) { XmlNode = xmlNode; Parent = projectData; Native = false; Name = xmlNode.Attributes["name"].Value; ClassicName = Name.Replace("/", "_").Replace(" ", "_").ToLower(); if (xmlNode.Attributes["xmi:id"] != null) { ID = xmlNode.Attributes["xmi:id"].Value; } else { ID = xmlNode.Attributes["xmi:idref"].Value; } NameDirectory = xmlNode.Attributes["name"].Value; NameDirectory = NameDirectory.Replace("/", "_"); NameDirectory = NameDirectory.ToLower(); Data = new Dictionary <string, object>(); Depends = new List <string>(); Depends.Add("base"); Depends.Add("board"); Documentation = ""; ListOfClass = new List <ClassData>(); ListOfMenu = new Dictionary <string, string>(); Menus = ""; Dashboard = ""; menu_count = 1; ModuleName = Utils.getExtra(xmlNode, "module", ClassicName)[0]; ModulePath = Utils.getExtra(xmlNode, "modulepath", ModuleName.Replace('.', '_'))[0]; foreach (XmlNode element in Elements.ChildNodes) { if (element.Attributes["name"] != null) { if (element.Attributes["xmi:idref"].Value.Equals(ID)) { if (element["properties"] != null) { Documentation = (element["properties"].Attributes["documentation"] != null) ? element["properties"].Attributes["documentation"].Value : "Gestion du module : " + Utils.firstCharUpper(Name.Replace("_", " ")); Alias = (element["properties"].Attributes["alias"] != null) ? element["properties"].Attributes["alias"].Value : Utils.firstCharUpper(Name.Replace("_", " ")); Menus = "<menuitem name=\"" + Alias + "\" id=\"menu_" + ClassicName + "\" web_icon=\"images/icon.png\" web_icon_hover=\"images/icon-hover.png\"/>"; Menus += "\r\n\t\t" + "<menuitem name=\"" + Alias + "\" parent=\"menu_" + ClassicName + "\" id=\"leftmenu_" + ClassicName + "\" sequence=\"" + menu_count.ToString() + "\"/>"; //Menus = "<menuitem name=\"" + Alias + "\" parent=\"menu_" + ClassicName + "\" id=\"leftmenu_" + ClassicName + "\" sequence=\"" + menu_count.ToString() + "\"/>"; if (!ListOfMenu.ContainsKey("default")) { ListOfMenu["default"] = "leftmenu_" + ClassicName; } ListOfMenu["leftmenu_" + ClassicName] = "leftmenu_" + ClassicName; menu_count++; //------------------------ Menus += "\r\n\t\t" + "<menuitem name=\"Rapports\" parent=\"menu_" + ClassicName + "\" id=\"leftmenu_rapport_" + ClassicName + "\" sequence=\"%sequence1%\"/>"; ListOfMenu["leftmenu_rapport_" + ClassicName] = "leftmenu_rapport_" + ClassicName; Menus += "\r\n\t\t" + "<menuitem name=\"" + Alias + "\" parent=\"leftmenu_rapport_" + ClassicName + "\" id=\"leftsubmenu_rapport_" + ClassicName + "\" sequence=\"%sequence2%\"/>"; ListOfMenu["leftsubmenu_rapport_" + ClassicName] = "leftsubmenu_rapport_" + ClassicName; } if (element["tags"] != null) { foreach (XmlNode tagNode in element["tags"].ChildNodes) { switch (tagNode.Attributes["name"].Value) { case "category": { Category = tagNode.Attributes["value"].Value; break; } case "menu": { /* * string[] menu = tagNode.Attributes["value"].Value.Split(new char[]{ ':' }); * * Menus += "\r\n\t\t" + "<menuitem name=\"" + menu[1].Trim() + "\" parent=\"menu_" + ClassicName + "\" id=\"leftmenu_" + menu[0].Trim() + "\" sequence=\"" + menu_count.ToString() + "\"/>"; * * if (!ListOfMenu.ContainsKey("default")) * { * ListOfMenu["default"] = "leftmenu_" + menu[0].Trim(); * } * * ListOfMenu["leftmenu_" + menu[0].Trim()] = "leftmenu_" + menu[0].Trim(); * * menu_count++; * */ break; } } } } } else if (element.Attributes["name"].Value.Equals("Class Model")) { if (element["model"].Attributes["package"].Value.Equals(ID)) { string ClassModelID = element.Attributes["xmi:idref"].Value; foreach (XmlNode subElementXmlNode in Elements.ChildNodes) { if (subElementXmlNode.Attributes["xmi:type"] != null) { if (subElementXmlNode.Attributes["xmi:type"].Value.Equals("uml:Class")) { if (subElementXmlNode["model"].Attributes["package"].Value.Equals(ClassModelID)) { ClassData classData = new ClassData(this, subElementXmlNode); ListOfClass.Add(classData); } } } } } } else if (xmlNode.Attributes["xmi:id"] == null) { if (element.Attributes["xmi:type"] != null) { if (element.Attributes["xmi:type"].Value.Equals("uml:Class")) { if (element["model"].Attributes["package"].Value.Equals(ID)) { ClassData classData = new ClassData(this, element); ListOfClass.Add(classData); } } } } } } if (!Menus.Equals("")) { Menus = Menus.Replace("%sequence1%", menu_count.ToString()); menu_count++; Menus = Menus.Replace("%sequence2%", menu_count.ToString()); menu_count++; } }
/// <summary> /// Parses compile time constants from the specified <paramref name = "offset" /> until it encounters an instruction that is not compile-time-constant. Returns the compile time values in the order they appear in the code (the "right" order). /// </summary> /// <param name = "instructions">The code to parse from.</param> /// <param name = "localVariableMapping">The local variable mapping to apply when confronted with index-instructions (e.g., <code>ldloci</code>)</param> /// <param name = "offset">The offset of the first possible compile time constant.</param> /// <param name="cache">The cache to use. See <see cref="StackContext"/> or <see cref="Module"/> on how to get one.</param> /// <param name="internalModule">The module that contains the instructions.</param> /// <returns>the compile time values in the order they appear in the code (the "right" order).</returns> public static CompileTimeValue[] ParseSequenceReverse(IList<Instruction> instructions, IDictionary<int, string> localVariableMapping, int offset, CentralCache cache, ModuleName internalModule) { var compileTimeValues = new LinkedList<CompileTimeValue>(); CompileTimeValue compileTimeValue; while (0 <= offset && TryParse(instructions[offset--], localVariableMapping, cache, internalModule, out compileTimeValue)) compileTimeValues.AddFirst(compileTimeValue); return compileTimeValues.ToArray(); }
/// <summary> /// Initializes a new instance of the <see cref="CashDispenserWorker"/> class. /// </summary> /// <param name="parent">The parent.</param> public CashDispenserWorker(UIElement parent, ModuleName moduleName) { this.ParentElement = parent; _moduleName = moduleName; }
public void DiamondDependency() { const string pathFound = "found.pxs"; const string pathLost = "lost.pxs"; const string pathBase = "base.pxs"; using (MockFile(pathFound, "name found;references{base}")) using (MockFile(pathLost, "name lost;references{base}")) using(MockFile(pathBase,"name base;")) { var desc = Sam.AssembleAsync( Source.FromString(@"name finder;references{lost,found};"), CancellationToken.None).Result; Assert.That(desc, Is.Not.Null); Assert.That(desc.BuildMessages, Is.Empty, "Should not have build (error) messages"); Assert.That(desc.Name, Is.EqualTo(new ModuleName("finder", new Version(0, 0)))); // Does the primary module depend on lost and found? var foundModuleName = new ModuleName("found", new Version(0, 0)); var lostModuleName = new ModuleName("lost", new Version(0, 0)); var baseModuelName = new ModuleName("base", new Version(0, 0)); Assert.That(desc.Dependencies.Count, Is.GreaterThanOrEqualTo(1), "Primary should have at least one dependency."); Assert.That(desc.Dependencies, Contains.Item(foundModuleName), string.Format("Primary is expected to depend on {0}.", foundModuleName)); Assert.That(desc.Dependencies, Contains.Item(lostModuleName), string.Format("Primary is expected to depend on {0}.", lostModuleName)); // Does SAM contain the found module? var foundTarget = Sam.TargetDescriptions.FirstOrDefault(td => td.Name.Equals(foundModuleName)); Assert.That(foundTarget, Is.Not.Null, string.Format("Expected a target description of {0} in SAM.", foundModuleName)); Debug.Assert(foundTarget != null); // Does found depend on base? // ReSharper disable PossibleNullReferenceException Assert.That(foundTarget.Dependencies, Contains.Item(baseModuelName), string.Format("{1} is expected to depend on {0}.", baseModuelName, foundModuleName)); Assert.That(foundTarget.BuildMessages, Is.Empty, string.Format("{0} should not have build (error) messages", foundModuleName)); // does SAM contain the lost module? var lostTarget = Sam.TargetDescriptions.FirstOrDefault(td => td.Name.Equals(lostModuleName)); Assert.That(lostTarget, Is.Not.Null, string.Format("Expected a target description of {0} in SAM.", lostModuleName)); Assert.That(lostTarget.BuildMessages, Is.Empty, string.Format("{0} should not have build (error) messages", lostModuleName)); // ReSharper restore PossibleNullReferenceException Assert.That(lostTarget.Dependencies, Contains.Item(baseModuelName), string.Format("{1} is expected to depend on {0}.", baseModuelName, lostTarget)); Assert.That(lostTarget.BuildMessages, Is.Empty, string.Format("{0} should not have build (error) messages", lostTarget)); } }
protected void Page_Load(object sender, EventArgs e) { if (StopProcessing) { return; } // Handle the pre-selection preselectedItem = QueryHelper.GetString(QueryParameterName, ""); if (preselectedItem.StartsWithCSafe("cms.", true)) { preselectedItem = preselectedItem.Substring(4); } uniMenu.HighlightItem = preselectedItem; // If element name is not set, use root module element string elemName = ElementName; if (String.IsNullOrEmpty(elemName)) { elemName = ModuleName.Replace(".", ""); } // Get the UI elements DataSet ds = UIElementInfoProvider.GetChildUIElements(ModuleName, elemName); if (!DataHelper.DataSourceIsEmpty(ds)) { FilterElements(ds); // Prepare the list of elements foreach (DataRow dr in ds.Tables[0].Rows) { string url = ValidationHelper.GetString(dr["ElementTargetURL"], ""); Group group = new Group(); if (url.EndsWithCSafe("ascx")) { group.ControlPath = url; } else { group.UIElementID = ValidationHelper.GetInteger(dr["ElementID"], 0); } group.CssClass = "ContentMenuGroup"; if (GenerateElementCssClass) { string name = ValidationHelper.GetString(dr["ElementName"], String.Empty).Replace(".", String.Empty); group.CssClass += " ContentMenuGroup" + name; group.SeparatorCssClass = "UniMenuSeparator" + name; } group.Caption = ResHelper.LocalizeString(ValidationHelper.GetString(dr["ElementCaption"], "")); uniMenu.Groups.Add(group); } // Raise groups created event if (OnGroupsCreated != null) { OnGroupsCreated(this, uniMenu.Groups); } // Button created & filtered event handler if (OnButtonCreating != null) { uniMenu.OnButtonCreating += uniMenu_OnButtonCreating; } if (OnButtonCreated != null) { uniMenu.OnButtonCreated += uniMenu_OnButtonCreated; } if (OnButtonFiltered != null) { uniMenu.OnButtonFiltered += uniMenu_OnButtonFiltered; } } // Add editing icon in development mode if (SettingsKeyProvider.DevelopmentMode && CMSContext.CurrentUser.IsGlobalAdministrator && !DisableEditIcon) { ResourceInfo ri = ResourceInfoProvider.GetResourceInfo(ModuleName); if (ri != null) { ltlAfter.Text += String.Format("<div class=\"UIElementsLink\" >{0}</div>", UIHelper.GetResourceUIElementsLink(Page, ri.ResourceId)); } } }
public virtual void PostWalk(ModuleName node) { }
public static IImportSearchResult FindImports(this PathResolverSnapshot pathResolver, string modulePath, ModuleName importName, bool forceAbsolute) => pathResolver.GetImportsFromAbsoluteName(modulePath, importName.Names.Select(n => n.Name), forceAbsolute);
public bool Matches(string aModuleName, string aFunctionName) { return (ModuleName.Equals(aModuleName, StringComparison.InvariantCultureIgnoreCase) && FunctionName.Equals(aFunctionName, StringComparison.InvariantCultureIgnoreCase)); }
private static Collection <CswNbtDataContractModule> _getModules(CswNbtResources NbtResources) { HashSet <string> seenModules = new HashSet <string>(); Collection <CswNbtDataContractModule> ret = new Collection <CswNbtDataContractModule>(); //This is the "root" module - this exists solely for rendering the tree CswNbtDataContractModule RootModule = new CswNbtDataContractModule { Name = "Modules", Enabled = false //this doesn't really matter because we don't show the root }; ret.Add(RootModule); foreach (CswEnumNbtModuleName ModuleName in CswEnumNbtModuleName.All) { if (CswEnumNbtModuleName.Unknown != ModuleName && false == seenModules.Contains(ModuleName.ToString()) && false == NbtResources.Modules.ModuleHasPrereq(ModuleName)) { seenModules.Add(ModuleName.ToString()); CswNbtDataContractModule module = _getModuleData(NbtResources, ModuleName); _recurse(NbtResources, module, seenModules); if (false == NbtResources.Modules.ModuleIsHidden(ModuleName)) { RootModule.ChildModules.Add(module); } } } return(ret); }
public override void PostWalk(ModuleName node) { PostWalkWorker(node); }
protected void Page_Load(object sender, EventArgs e) { if (StopProcessing) { return; } string localizationCulture = PortalHelper.GetUILocalizationCulture(); uniMenu.ResourceCulture = localizationCulture; // Handle the pre-selection mPreselectedItem = QueryHelper.GetString(QueryParameterName, ""); if (mPreselectedItem.StartsWith("cms.", StringComparison.OrdinalIgnoreCase)) { mPreselectedItem = mPreselectedItem.Substring(4); } uniMenu.HighlightItem = mPreselectedItem; // If element name is not set, use root module element string elemName = ElementName; if (String.IsNullOrEmpty(elemName)) { elemName = ModuleName.Replace(".", ""); } // Get the UI elements DataSet ds = UIElementInfoProvider.GetChildUIElements(ModuleName, elemName); if (!DataHelper.DataSourceIsEmpty(ds)) { FilterElements(ds); // Prepare the list of elements foreach (DataRow dr in ds.Tables[0].Rows) { string url = ValidationHelper.GetString(dr["ElementTargetURL"], ""); UIElementTypeEnum type = EnumStringRepresentationExtensions.ToEnum <UIElementTypeEnum>(ValidationHelper.GetString(dr["ElementType"], "")); Group group = new Group(); if (url.EndsWith("ascx", StringComparison.OrdinalIgnoreCase) && (type == UIElementTypeEnum.UserControl)) { group.ControlPath = url; } else { group.UIElementID = ValidationHelper.GetInteger(dr["ElementID"], 0); } group.CssClass = "ContentMenuGroup"; if (GenerateElementCssClass) { string name = ValidationHelper.GetString(dr["ElementName"], String.Empty).Replace(".", String.Empty); group.CssClass += " ContentMenuGroup" + name; group.SeparatorCssClass = "UniMenuSeparator" + name; } group.Caption = ResHelper.LocalizeString(ValidationHelper.GetString(dr["ElementCaption"], ""), localizationCulture); if (group.Caption == String.Empty) { group.Caption = ResHelper.LocalizeString(ValidationHelper.GetString(dr["ElementDisplayName"], ""), localizationCulture); } uniMenu.Groups.Add(group); } // Raise groups created event RaiseOnGroupsCreated(this, uniMenu.Groups); // Button created & filtered event handler uniMenu.OnButtonCreating += uniMenu_OnButtonCreating; uniMenu.OnButtonCreated += uniMenu_OnButtonCreated; uniMenu.OnButtonFiltered += uniMenu_OnButtonFiltered; } // Add editing icon in development mode if (SystemContext.DevelopmentMode && MembershipContext.AuthenticatedUser.CheckPrivilegeLevel(UserPrivilegeLevelEnum.Admin) && !DisableEditIcon) { var link = PortalUIHelper.GetResourceUIElementLink(ModuleName, ElementName); if (!String.IsNullOrEmpty(link)) { ltlAfter.Text += $"<div class=\"UIElementsLink\" >{link}</div>"; } } }
/// <summary> /// Set property values according to the value in the DbConfig file or from the target schema /// </summary> public void syncCustomerInfo() { if( _CompanyIDDefined() ) { // get data from DbConfig file _CswNbtResources.CswDbCfgInfo.makeConfigurationCurrent( CompanyID.Text ); if( _CswNbtResources.CswDbCfgInfo.CurrentDeactivated ) Deactivated.Checked = CswEnumTristate.True; else Deactivated.Checked = CswEnumTristate.False; IPFilterRegex.Text = _CswNbtResources.CswDbCfgInfo.CurrentIPFilterRegex; if( CswTools.IsInteger( _CswNbtResources.CswDbCfgInfo.CurrentUserCount ) ) UserCount.Value = CswConvert.ToInt32( _CswNbtResources.CswDbCfgInfo.CurrentUserCount ); else UserCount.Value = Double.NaN; // case 25960 this.SchemaName.StaticText = _CswNbtResources.CswDbCfgInfo.CurrentUserName; CswCommaDelimitedString YValues = new CswCommaDelimitedString(); foreach( CswEnumNbtModuleName ModuleName in CswEnumNbtModuleName.All ) { if( CswEnumNbtModuleName.Unknown != ModuleName ) { YValues.Add( ModuleName.ToString() ); } } ModulesEnabled.YValues = YValues; ModulesEnabled.XValues = new CswCommaDelimitedString() { ModulesEnabledXValue }; // get data from target schema //string OriginalAccessId = _CswNbtResources.AccessId; //_CswNbtResources.AccessId = CompanyID.Text; CswNbtResources OtherResources = makeOtherResources(); Collection<CswEnumNbtModuleName> Modules = new Collection<CswEnumNbtModuleName>(); foreach( CswEnumNbtModuleName Module in OtherResources.Modules.ModulesEnabled() ) { Modules.Add( Module ); } // case 25960 string OtherSchemaVersion = OtherResources.ConfigVbls.getConfigVariableValue( CswEnumNbtConfigurationVariables.schemaversion.ToString() ); //case 28079 - count the number of pending feedback nodes int count = 0; //Sourced from case 29852. If this schema is out of date, it's very possible that touching MetaData will generate an exception. //Per Steve, we're not doing anything about this now. CswNbtMetaDataObjectClass feedbackOC = OtherResources.MetaData.getObjectClass( CswEnumNbtObjectClass.FeedbackClass ); foreach( CswNbtObjClassFeedback feedbackNode in feedbackOC.getNodes( false, false ) ) { if( feedbackNode.Status.Value.Equals( CswNbtObjClassFeedback.Statuses.PendingReview ) ) { count++; } } PendingFeedbackCount.Value = count; // reconnect to original schema //_CswNbtResources.AccessId = OriginalAccessId; finalizeOtherResources( OtherResources ); foreach( CswEnumNbtModuleName ModuleName in CswEnumNbtModuleName.All ) { if( CswEnumNbtModuleName.Unknown != ModuleName ) { ModulesEnabled.SetValue( ModulesEnabledXValue, ModuleName.ToString(), Modules.Contains( ModuleName ) ); } } this.SchemaVersion.StaticText = OtherSchemaVersion; //case 29751 if( CompanyID.Text == _CswNbtResources.AccessId ) { Login.setHidden( true, false ); } } } // syncCustomerInfo()
public GloryCashDispenser(UIElement parent, ModuleName ctype) : base(parent, ctype) { _cType = ctype; }
public override int GetHashCode() { return(ModuleName.GetHashCode()); }
private void AddFunctionsToModule(ModuleName Module, string[] Functions) { Modules.Add(Module, new List<string>(Functions));//where do you do the section addrs }
protected BmcCashDispenserBase(UIElement parent, ModuleName Ctype) { this.ParentElement = parent; this._Ctype = Ctype; }
// ModuleName public virtual bool Walk(ModuleName node) { return true; }
/// <summary> /// Tries to parse the supplied instruction into a compile time value. /// </summary> /// <param name = "instruction">The instruction to parse.</param> /// <param name = "localVariableMapping">The local variable mapping to apply when confronted with index-instructions (e.g., <code>ldloci</code>)</param> /// <param name="cache">The cache to use for module names and entity references.</param> /// <param name="internalModule"> The module the instruction lives in. Necessary to create absolute entity references.</param> /// <param name = "compileTimeValue">The parsed compile time value, if parsing was successful; undefined otherwise</param> /// <returns>True if parsing was successful; false otherwise</returns> public static bool TryParse(Instruction instruction, IDictionary<int, string> localVariableMapping, CentralCache cache, ModuleName internalModule, out CompileTimeValue compileTimeValue) { var argc = instruction.Arguments; switch (instruction.OpCode) { case OpCode.ldc_int: compileTimeValue.Interpretation = CompileTimeInterpretation.Int; compileTimeValue.Value = (int?) argc; return true; case OpCode.ldc_real: compileTimeValue = default(CompileTimeValue); return false; case OpCode.ldc_bool: compileTimeValue.Interpretation = CompileTimeInterpretation.Bool; compileTimeValue.Value = argc != 0; return true; case OpCode.ldc_string: compileTimeValue.Interpretation = CompileTimeInterpretation.String; compileTimeValue.Value = instruction.Id; return true; case OpCode.ldc_null: compileTimeValue.Interpretation = CompileTimeInterpretation.Null; compileTimeValue.Value = null; return true; case OpCode.ldr_loc: compileTimeValue.Interpretation = CompileTimeInterpretation.LocalVariableReference; compileTimeValue.Value = cache[EntityRef.Variable.Local.Create(instruction.Id)]; return true; case OpCode.ldr_loci: string id; if (!localVariableMapping.TryGetValue(argc, out id) || id == null) goto default; compileTimeValue.Interpretation = CompileTimeInterpretation.LocalVariableReference; compileTimeValue.Value = cache[EntityRef.Variable.Local.Create(id)]; return true; case OpCode.ldr_glob: compileTimeValue.Interpretation = CompileTimeInterpretation.GlobalVariableReference; compileTimeValue.Value = cache[EntityRef.Variable.Global.Create(instruction.Id, instruction.ModuleName ?? internalModule)]; return true; case OpCode.ldr_func: compileTimeValue.Interpretation = CompileTimeInterpretation.FunctionReference; compileTimeValue.Value = cache[EntityRef.Function.Create(instruction.Id, instruction.ModuleName ?? internalModule)]; return true; case OpCode.ldr_cmd: compileTimeValue.Interpretation = CompileTimeInterpretation.CommandReference; compileTimeValue.Value = cache[EntityRef.Command.Create(instruction.Id)]; return true; case OpCode.ldr_app: compileTimeValue = default(CompileTimeValue); return false; case OpCode.ldr_eng: compileTimeValue = default(CompileTimeValue); return false; case OpCode.ldr_type: compileTimeValue = default(CompileTimeValue); return false; default: compileTimeValue = default(CompileTimeValue); return false; } }
// ModuleName public override bool Walk(ModuleName node) { return false; }
public void FlatDottedModuleNameDependency() { const string path = "hay.stack.lazy.impl.pxs"; using (MockFile(path, "name hay::stack::lazy::impl;")) { var desc = Sam.AssembleAsync(Source.FromString(@" name finder; references { hay::stack::lazy::impl }; "), CancellationToken.None).Result; Assert.That(desc, Is.Not.Null); Assert.That(desc.BuildMessages, Is.Empty, "Should not have build (error) messages"); Assert.That(desc.Name, Is.EqualTo(new ModuleName("finder", new Version(0, 0)))); var theModuleName = new ModuleName("hay.stack.lazy.impl", new Version(0, 0)); Assert.That(desc.Dependencies.Count, Is.GreaterThanOrEqualTo(1), "Primary should have at least one dependency."); Assert.That(desc.Dependencies, Contains.Item(theModuleName), string.Format("Primary is expected to depend on {0}.", theModuleName)); var firstOrDefault = Sam.TargetDescriptions.FirstOrDefault(td => td.Name.Equals(theModuleName)); Assert.That(firstOrDefault, Is.Not.Null, string.Format("Expected a target description of {0} in SAM.", theModuleName)); } }
private void AddFunctionsToModule(ModuleName Module, string[] Functions) { Modules.Add(Module, new List <string>(Functions));//where do you do the section addrs }
public void FindProvided() { const string pathFound = "found.pxs"; const string pathLost = "lost.pxs"; // Provide the module lost to the SAM ahead of time, fully resolved var lostModuleName = new ModuleName("lost", new Version(0, 0)); Sam.TargetDescriptions.Add(new ManualTargetDescription(lostModuleName, Source.FromString("name: lost;"), pathLost, Enumerable.Empty<ModuleName>())); // Have module found short-circuit when resolving lost using (MockFile(pathFound, "name found;references{lost}")) { var desc = Sam.AssembleAsync( Source.FromString(@"name finder;references{found};"), CancellationToken.None).Result; Assert.That(desc, Is.Not.Null); Assert.That(desc.BuildMessages, Is.Empty, "Should not have build (error) messages"); Assert.That(desc.Name, Is.EqualTo(new ModuleName("finder", new Version(0, 0)))); // Does the primary module depend on lost? var foundModuleName = new ModuleName("found", new Version(0, 0)); Assert.That(desc.Dependencies.Count, Is.GreaterThanOrEqualTo(1), "Primary should have at least one dependency."); Assert.That(desc.Dependencies, Contains.Item(foundModuleName), string.Format("Primary is expected to depend on {0}.", foundModuleName)); // Does SAM contain the found module? var foundTarget = Sam.TargetDescriptions.FirstOrDefault(td => td.Name.Equals(foundModuleName)); Assert.That(foundTarget, Is.Not.Null, string.Format("Expected a target description of {0} in SAM.", foundModuleName)); Debug.Assert(foundTarget != null); // Does found depend on lost? // ReSharper disable PossibleNullReferenceException Assert.That(foundTarget.Dependencies, Contains.Item(lostModuleName), string.Format("{1} is expected to depend on {0}.", lostModuleName, foundModuleName)); Assert.That(foundTarget.BuildMessages, Is.Empty, string.Format("{0} should not have build (error) messages", foundModuleName)); // does SAM contain the lost module? var lostTarget = Sam.TargetDescriptions.FirstOrDefault(td => td.Name.Equals(lostModuleName)); Assert.That(lostTarget, Is.Not.Null, string.Format("Expected a target description of {0} in SAM.", lostModuleName)); Assert.That(lostTarget.BuildMessages, Is.Empty, string.Format("{0} should not have build (error) messages", lostModuleName)); // ReSharper restore PossibleNullReferenceException } }
// ModuleName public override bool Walk(ModuleName node) { return(Location >= node.StartIndex && Location <= node.EndIndex); }
// ModuleName public virtual bool Walk(ModuleName node) { return(true); }
public override IConsoleResultModel Run() { var max = Max <= 0 ? 10 : (Max > 500 ? 500 : Max); int total; var portalDesktopModules = DesktopModuleController.GetPortalDesktopModules(PortalId); var pageIndex = (Page > 0 ? Page - 1 : 0); pageIndex = pageIndex < 0 ? 0 : pageIndex; var pageSize = Max; pageSize = pageSize > 0 && pageSize <= 100 ? pageSize : 10; ModuleName = ModuleName?.Replace("*", ""); ModuleTitle = ModuleTitle?.Replace("*", ""); var modules = ModuleController.Instance.GetModules(PortalSettings.PortalId) .Cast <ModuleInfo>().Where(ModulePermissionController.CanViewModule); if (!string.IsNullOrEmpty(ModuleName)) { modules = modules.Where(module => module.DesktopModule.ModuleName.IndexOf(ModuleName, StringComparison.OrdinalIgnoreCase) >= 0); } if (!string.IsNullOrEmpty(ModuleTitle)) { modules = modules.Where(module => module.ModuleTitle.IndexOf(ModuleTitle, StringComparison.OrdinalIgnoreCase) >= 0); } //Return only deleted modules with matching criteria. if (PageId.HasValue && PageId.Value > 0) { modules = modules.Where(x => x.TabID == PageId.Value); } if (Deleted.HasValue) { modules = modules.Where(module => module.IsDeleted == Deleted); } //Get distincts. modules = modules.GroupBy(x => x.ModuleID).Select(group => group.First()).OrderBy(x => x.ModuleID); var moduleInfos = modules as IList <ModuleInfo> ?? modules.ToList(); total = moduleInfos.Count; modules = moduleInfos.Skip(pageIndex * pageSize).Take(pageSize) .Where(m => { var moduleDefinition = ModuleDefinitionController.GetModuleDefinitionByID(m.ModuleDefID); return(portalDesktopModules.Any(kvp => kvp.Value.DesktopModuleID == moduleDefinition?.DesktopModuleID)); }); var results = modules.Select(x => PromptModuleInfo.FromDnnModuleInfo(x, Deleted)); var totalPages = total / max + (total % max == 0 ? 0 : 1); var pageNo = Page > 0 ? Page : 1; return(new ConsoleResultModel { Data = results, PagingInfo = new PagingInfo { PageNo = pageNo, TotalPages = totalPages, TotalRecords = total, PageSize = max }, Records = results.Count(), Output = results.Count() == 0 ? LocalizeString("Prompt_NoModules") : "" }); }
public bool ValidCommand() { var tmp = GlobalSettings.AvailableCmd.Where(a => a.ModuleName.ToLower() == ModuleName?.ToLower()).Select(a => a.ModuleName).ToList(); if (tmp.Count > 0) { ModuleName = tmp[0]; _moduleisvalid = true; var tmp2 = GlobalSettings.AvailableCmd.Where(a => a.ModuleName == ModuleName && a.CommandName.ToLower() == CommandName?.ToLower()).Select(a => a).ToList(); if (tmp2.Count > 0) { CommandName = tmp2[0].CommandName; _commandisvalid = true; Assembly = tmp2[0].Assembly; Attr = tmp2[0].Attr; } } return(_moduleisvalid && _commandisvalid); }
public UI.Controls.Menu.SiteMapNode CreateMenuForCustomReport(HRM.Presentation.UI.Controls.Menu.XmlSiteMap sitemap, List<Rep_MasterModel> ListMaster, ModuleName module, string alias) { List<Rep_MasterModel> item = ListMaster.Where(m => m.ReportStoreModule == module.ToString()).ToList(); if (item != null && item.Count > 0) { //Add menu cha HRM.Presentation.UI.Controls.Menu.SiteMapNode node = new UI.Controls.Menu.SiteMapNode(); node.ControllerName = "Sys_CustomReport"; node.ActionName = "GeneralCustomReport"; node.HrmWebSite = "Hrm_Sys_Web"; //node.Alias = ConstantPathWeb.Hrm_Main_Web; node.RouteValues = sitemap.RootNode.ChildNodes.LastOrDefault().RouteValues; node.ImageUrl = "/Content/images/icons/submenu/menu/Att_ShiftTimeSheet.png"; node.Title = "Báo Cáo Động"; node.Visible = true; node.ChildNodes = new List<UI.Controls.Menu.SiteMapNode>(); foreach (var t in item) { HRM.Presentation.UI.Controls.Menu.SiteMapNode nodeitem = new UI.Controls.Menu.SiteMapNode(); nodeitem.ControllerName = "Sys_CustomReport"; nodeitem.ActionName = "GeneralCustomReport?id=" + t.ID; nodeitem.HrmWebSite = "Hrm_Sys_Web"; nodeitem.Alias = alias; //nodeitem.Alias = ConstantPathWeb.Hrm_Main_Web; nodeitem.Url = "#" + nodeitem.HrmWebSite + "/" + nodeitem.ControllerName + "/" + nodeitem.ActionName; nodeitem.RouteValues = sitemap.RootNode.ChildNodes.LastOrDefault().RouteValues; nodeitem.ImageUrl = "/Content/images/icons/submenu/menu/Att_ShiftTimeSheet.png"; nodeitem.Title = t.ReportName; nodeitem.Visible = true; node.ChildNodes.Add(nodeitem); } return node; } return null; }
public ModuleEventData(ModuleName name, object value = null) { this.name = name; this.value = value; }
// ModuleName public override bool Walk(ModuleName node) { return(false); }
public override void PostWalk(ModuleName node) { }