public ArasHttpConnection(IHttpService service, string innovatorServerUrl) { _service = service; this.Compression = CompressionType.none; _factory = new ElementFactory(_context); if (innovatorServerUrl.EndsWith("Server/InnovatorServer.aspx", StringComparison.OrdinalIgnoreCase)) { innovatorServerUrl = innovatorServerUrl.Substring(0, innovatorServerUrl.Length - 20); } else if (innovatorServerUrl.EndsWith("/Server", StringComparison.OrdinalIgnoreCase) || innovatorServerUrl.EndsWith("/Server/", StringComparison.OrdinalIgnoreCase)) { innovatorServerUrl += (innovatorServerUrl.EndsWith("/") ? "" : "/"); } else { innovatorServerUrl += (innovatorServerUrl.EndsWith("/") ? "" : "/") + "Server/"; } this._innovatorServerBaseUrl = new Uri(innovatorServerUrl); this._innovatorServerUrl = new Uri(this._innovatorServerBaseUrl, "InnovatorServer.aspx"); this._innovatorClientBin = new Uri(this._innovatorServerBaseUrl, "../Client/cbin/"); _vaultConn = new ArasVaultConnection(this); }
public void CreateLabel_Default_SetsDefaultText() { var factory = new ElementFactory(); var label = factory.CreateLabel(); Assert.Equal("Label", label.Text); }
public void SetUp() { nodeFactory = new NodeFactory(ModelType.Truss2D); node1 = nodeFactory.CreateFor2DTruss(0, 0); node2 = nodeFactory.CreateFor2DTruss(0, 1); SUT = new ElementFactory(ModelType.Truss2D); }
public static void MapCustomElement(string elementName, Func<IElement, bool> validate, Func<INode, IQualifiedName, IElement> create) { var factory = new ElementFactory(elementName, validate, create); if (!customElementFactories.ContainsKey(elementName)) customElementFactories[elementName] = new List<IElementFactory> { factory }; else customElementFactories[elementName].Add(factory); }
public void SetUp() { this.nodeFactory = new NodeFactory(ModelType.Truss1D); this.start = nodeFactory.Create(0); this.end = nodeFactory.Create(1); this.elementFactory = new ElementFactory(ModelType.Truss1D); this.spring = elementFactory.CreateLinearConstantSpring(start, end, 2); this.SUT = new LinearTrussStiffnessMatrixBuilder(spring); }
public void ElementsCanBeCreatedAndAddedToTheRepository() { ElementRepository repository = new ElementRepository(); SUT = new ElementFactory(ModelType.Full3D, repository); Assert.AreEqual(0, repository.Count); SUT.CreateLinearConstantSpring(node1, node2, 2); Assert.AreEqual(1, repository.Count); }
protected void CreateAndStore3DSpringFromOriginTo(double x, double y, double z) { nodeFactory = new NodeFactory(ModelType.Truss3D); start = nodeFactory.Create(0, 0, 0); end = nodeFactory.Create(x, y, z); elementFactory = new ElementFactory(ModelType.Truss3D); this.spring = elementFactory.CreateLinearConstantSpring(start, end, 1); this.SUT = new LinearTrussStiffnessMatrixBuilder(this.spring); }
protected void CreateAndStore2DSpringFromOriginTo(double x, double z) { this.nodeFactory = new NodeFactory(ModelType.Truss2D); this.start = nodeFactory.CreateFor2DTruss(0, 0); this.end = nodeFactory.CreateFor2DTruss(x, z); this.elementFactory = new ElementFactory(ModelType.Truss2D); this.spring = elementFactory.CreateLinearConstantSpring(this.start, this.end, 1); this.SUT = new LinearTrussStiffnessMatrixBuilder(this.spring); }
public void SetUp() { nodeFactory = new NodeFactory(ModelType.Frame2D); start = nodeFactory.CreateFor2DTruss(0, 0); end = nodeFactory.CreateFor2DTruss(1, 0); elementFactory = new ElementFactory(ModelType.Frame2D); material = new GenericElasticMaterial(0, 1, 0, 1); section = new GenericCrossSection(1, 1, 1, 1); beam = elementFactory.CreateLinear3DBeam(start, end, material, section); SUT = new Linear3DBernoulliBeamStiffnessMatrixBuilder(beam); }
private void VariableSetterGrid_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { var frameworkElement = sender as FrameworkElement; var variable = frameworkElement?.DataContext as IVariable; if (variable == null) return; var elementFactory = new ElementFactory(SystemElementIds.VariableSetter, FactoryCategoryNames.Variable, "Set", context => new VariableSetter(context, variable.Id), typeof(VariableSetter), variable.Type.Id); DragDrop.DoDragDrop(frameworkElement, elementFactory, DragDropEffects.Copy); }
public void ExploreAssembly(IMetadataAssembly assembly, IProject project, UnitTestElementConsumer consumer) { var a = Assembly.LoadFrom(assembly.Location); var specTypes = FilterToSpecs(a.GetTypes()); var elementFactory = new ElementFactory(project, consumer, _provider); foreach (var type in specTypes) { var instance = Activator.CreateInstance(type); var spec = (instance is ISpec) ? (ISpec)instance : new SpecWrapper(instance); elementFactory.CreateContainerElements(spec); } }
public void CanCreateGlobalStiffnessMatrixForBeamAlignedToGlobalXAxisInReverseOrientation() { elementFactory = new ElementFactory(ModelType.Beam1D); beam = elementFactory.CreateLinear1DBeam(end, start, material, section); SUT = new Linear1DBernoulliBeamStiffnessMatrixBuilder(beam); StiffnessHelpers.Assert12x12StiffnessMatrix(SUT, 1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 6, 0, 0, 0, -12, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 0, 0, 0, -6, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, 0, -6, 0, 0, 0, 12, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 2, 0, 0, 0, -6, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); }
static HostViewModelLocator() { var customResources = new View.CustomResources(); customResources.InitializeComponent(); var commentFactory = new ElementFactory(CustomElementTypeIds.Comment, "Custom", "Comment", context => new CommentViewModel(context), typeof(CommentViewModel)); var functionService = new FunctionService(GetFunctions, GetFunction); var factories = new IElementFactory[] { commentFactory, }; //Create the plugin var plugin = new VplPlugin( "Host", factories, new[] { customResources }, services: new[] { functionService }); var plugin1 = new VplPlugin("Alert", new IElementFactory[] { new ElementFactory(new Guid("FBB6804C-B90C-4A88-B28B-8B733C1A9F0D"), "Interaction", "Alert", context => new Alert(context), typeof(Alert)), }); var plugins = SystemPluginFactory.CreateAllPlugins() .ToList(); plugins.Add(plugin); plugins.Add(plugin1); VplService = new VplService(plugins); }
public TElement Find <TElement>(How how, string @using) where TElement : IHtmlElement, new() { var element = ElementFactory.Create <TElement>(this, new Locator(how, @using)); return(element); }
protected virtual void Init(TypeSystem t, Node node, bool interProcedural, bool fixpoint, int maxDepth) { factory = new ElementFactory(this); classFilter = ClassFilter; moduleFilter = ModuleFilter; typeSystem = t; unitUnderAnalysis = node; analyzableMethods = new Set<Method>(); this.interProceduralAnalysis = interProcedural; this.fixPointForMethods = fixpoint; this.maximumStackDepth = maxDepth; if (verbose) Console.Out.WriteLine("MaxDepth: {0}", this.maximumStackDepth); // For Inperprocedural FixPoint should be better // to traverse the methdod in a bottom up fashion... if (interProceduralAnalysis && fixPointForMethods) { //Set<System.Compiler.Analysis.CallGraph> CGs; // cg = System.Compiler.Analysis.AnalyzableMethodFinder.ComputeAnalyzableMethods(node, out CGs); cg = AnalyzableMethodFinder.ComputeAnalyzableMethods(node, this); analyzableMethods = cg.Methods; } }
public mp_PolicyAccessItem(ElementFactory amlContext, params object[] content) : base(amlContext, content) { }
public ConversionTaskResult(ElementFactory amlContext, params object[] content) : base(amlContext, content) { }
/// <summary> /// Create a file map. /// </summary> /// <param name="fileName">Valid file name, either absoulte, or relative /// to the current working directory.</param> /// <param name="cacheDurationDays">Duration of the cache</param> /// <param name="factory">Element factory to create elements of a given type. If null, /// Elements will always be created, and T MUST be Element.</param> public FileMap(string fileName, Int32 cacheDurationDays, ElementFactory factory) { this.Factory = factory; this.CacheDurationDays = cacheDurationDays; this.FileName = fileName; }
public StoredSecureMessage(ElementFactory amlContext, params object[] content) : base(amlContext, content) { }
public IList <Label> GetListElements(ElementState state, ElementsCount count) { return(ElementFactory.FindElements <Label>(By.XPath("//ul[@id='blockbestsellers']//li"), state: state, expectedCount: count)); }
public void Constructor9_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() { var exception = new ComposablePartException((string)null, ElementFactory.Create(), new Exception()); ExceptionAssert.HasDefaultMessage(exception); }
/// <summary> /// This method deals with the starting tags. /// </summary> /// <param name="name">the name of the tag</param> /// <param name="attributes">the list of attributes</param> public void HandleStartingTags(String name, itextProperties attributes) { //System.err.Println("Start: " + name); if (ignore || ElementTags.IGNORE.Equals(name)) { ignore = true; return; } // maybe there is some meaningful data that wasn't between tags if (currentChunk != null) { ITextElementArray current; try { current = (ITextElementArray)stack.Pop(); } catch { if (bf == null) { current = new Paragraph("", new Font()); } else { current = new Paragraph("", new Font(this.bf)); } } current.Add(currentChunk); stack.Push(current); currentChunk = null; } // registerfont if (name.Equals("registerfont")) { FontFactory.Register(attributes); } // header if (ElementTags.HEADER.Equals(name)) { stack.Push(new HeaderFooter(attributes)); return; } // footer if (ElementTags.FOOTER.Equals(name)) { stack.Push(new HeaderFooter(attributes)); return; } // before if (name.Equals("before")) { HeaderFooter tmp = (HeaderFooter)stack.Pop(); tmp.Before = ElementFactory.GetPhrase(attributes); stack.Push(tmp); return; } // after if (name.Equals("after")) { HeaderFooter tmp = (HeaderFooter)stack.Pop(); tmp.After = ElementFactory.GetPhrase(attributes); stack.Push(tmp); return; } // chunks if (ElementTags.CHUNK.Equals(name)) { currentChunk = ElementFactory.GetChunk(attributes); if (bf != null) { currentChunk.Font = new Font(this.bf); } return; } // symbols if (ElementTags.ENTITY.Equals(name)) { Font f = new Font(); if (currentChunk != null) { HandleEndingTags(ElementTags.CHUNK); f = currentChunk.Font; } currentChunk = EntitiesToSymbol.Get(attributes[ElementTags.ID], f); return; } // phrases if (ElementTags.PHRASE.Equals(name)) { stack.Push(ElementFactory.GetPhrase(attributes)); return; } // anchors if (ElementTags.ANCHOR.Equals(name)) { stack.Push(ElementFactory.GetAnchor(attributes)); return; } // paragraphs and titles if (ElementTags.PARAGRAPH.Equals(name) || ElementTags.TITLE.Equals(name)) { stack.Push(ElementFactory.GetParagraph(attributes)); return; } // lists if (ElementTags.LIST.Equals(name)) { stack.Push(ElementFactory.GetList(attributes)); return; } // listitems if (ElementTags.LISTITEM.Equals(name)) { stack.Push(ElementFactory.GetListItem(attributes)); return; } // cells if (ElementTags.CELL.Equals(name)) { stack.Push(ElementFactory.GetCell(attributes)); return; } // tables if (ElementTags.TABLE.Equals(name)) { Table table = ElementFactory.GetTable(attributes); float[] widths = table.ProportionalWidths; for (int i = 0; i < widths.Length; i++) { if (widths[i] == 0) { widths[i] = 100.0f / (float)widths.Length; } } try { table.Widths = widths; } catch (BadElementException bee) { // this shouldn't happen throw new Exception("", bee); } stack.Push(table); return; } // sections if (ElementTags.SECTION.Equals(name)) { IElement previous = (IElement)stack.Pop(); Section section; section = ElementFactory.GetSection((Section)previous, attributes); stack.Push(previous); stack.Push(section); return; } // chapters if (ElementTags.CHAPTER.Equals(name)) { stack.Push(ElementFactory.GetChapter(attributes)); return; } // images if (ElementTags.IMAGE.Equals(name)) { try { Image img = ElementFactory.GetImage(attributes); try { AddImage(img); return; } catch { // if there is no element on the stack, the Image is added to the document try { document.Add(img); } catch (DocumentException de) { throw new Exception("", de); } return; } } catch (Exception e) { throw new Exception("", e); } } // annotations if (ElementTags.ANNOTATION.Equals(name)) { Annotation annotation = ElementFactory.GetAnnotation(attributes); ITextElementArray current; try { try { current = (ITextElementArray)stack.Pop(); try { current.Add(annotation); } catch { document.Add(annotation); } stack.Push(current); } catch { document.Add(annotation); } return; } catch (DocumentException de) { throw de; } } // newlines if (IsNewline(name)) { ITextElementArray current; try { current = (ITextElementArray)stack.Pop(); current.Add(Chunk.NEWLINE); stack.Push(current); } catch { if (currentChunk == null) { try { document.Add(Chunk.NEWLINE); } catch (DocumentException de) { throw de; } } else { currentChunk.Append("\n"); } } return; } // newpage if (IsNewpage(name)) { ITextElementArray current; try { current = (ITextElementArray)stack.Pop(); Chunk newPage = new Chunk(""); newPage.SetNewPage(); if (bf != null) { newPage.Font = new Font(this.bf); } current.Add(newPage); stack.Push(current); } catch { document.NewPage(); } return; } if (ElementTags.HORIZONTALRULE.Equals(name)) { ITextElementArray current; LineSeparator hr = new LineSeparator(1.0f, 100.0f, null, Element.ALIGN_CENTER, 0); try { current = (ITextElementArray)stack.Pop(); current.Add(hr); stack.Push(current); } catch (InvalidOperationException) { document.Add(hr); } return; } // documentroot if (IsDocumentRoot(name)) { String value; // pagesize and orientation specific code suggested by Samuel Gabriel // Updated by Ricardo Coutinho. Only use if set in html! Rectangle pageSize = null; String orientation = null; foreach (string key in attributes.Keys) { value = attributes[key]; // margin specific code suggested by Reza Nasiri if (Util.EqualsIgnoreCase(ElementTags.LEFT, key)) { leftMargin = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo); } if (Util.EqualsIgnoreCase(ElementTags.RIGHT, key)) { rightMargin = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo); } if (Util.EqualsIgnoreCase(ElementTags.TOP, key)) { topMargin = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo); } if (Util.EqualsIgnoreCase(ElementTags.BOTTOM, key)) { bottomMargin = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo); } if (ElementTags.PAGE_SIZE.Equals(key)) { pageSize = (Rectangle)typeof(PageSize).GetField(value).GetValue(null); } else if (ElementTags.ORIENTATION.Equals(key)) { if ("landscape".Equals(value)) { orientation = "landscape"; } } else { document.Add(new Meta(key, value)); } } if (pageSize != null) { if ("landscape".Equals(orientation)) { pageSize = pageSize.Rotate(); } document.SetPageSize(pageSize); } document.SetMargins(leftMargin, rightMargin, topMargin, bottomMargin); if (controlOpenClose) { document.Open(); } } }
public cmf_DocumentLifeCycleState(ElementFactory amlContext, params object[] content) : base(amlContext, content) { }
void OnOpenClick(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal); if (openFileDialog.ShowDialog() == DialogResult.OK) { _pipelineOK = false; if (_playbin != null) { _playbin.SetState(State.Null); } else { _playbin = ElementFactory.Make("playbin", "playbin"); } if (_playbin == null) { throw new Exception("Unable to create element playbin"); } scale.Value = 0; _playbin.Bus.EnableSyncMessageEmission(); _playbin.Bus.AddSignalWatch(); _playbin.Bus.SyncMessage += OnBusSyncMessage; _playbin.Bus.Message += OnBusMessage; var filePath = openFileDialog.FileName; var fileName = Path.GetFileNameWithoutExtension(filePath); this.Text = this.Name + " : " + fileName; switch (Environment.OSVersion.Platform) { case PlatformID.Unix: _playbin["uri"] = "file://" + filePath; break; case PlatformID.Win32NT: case PlatformID.Win32S: case PlatformID.Win32Windows: case PlatformID.WinCE: _playbin["uri"] = "file:///" + filePath.Replace("\\", "/"); break; } StateChangeReturn sret = _playbin.SetState(Gst.State.Playing); if (sret == StateChangeReturn.Async) { sret = _playbin.GetState(out var state, out var pending, Gst.Constants.SECOND * 5L); } if (sret == StateChangeReturn.Success) { Console.WriteLine("State change successful"); _pipelineOK = true; } else { Console.WriteLine($"State change failed for {filePath} ({sret})\n"); } } }
public static void Register() { Type typeToRegister = typeof(TextFieldExtended); ElementFactory.RegisterElementType(typeToRegister); }
public PackageDefinition(ElementFactory amlContext, params object[] content) : base(amlContext, content) { }
public void CreateLabel_Default_CreatesLabel() { var factory = new ElementFactory(); var element = factory.CreateLabel(); Assert.IsType<LabelElement>(element); }
public IList <Label> GetListElementsById(ElementState state, ElementsCount count) { return(ElementFactory.FindElements <Label>(BestSellersById, state: state, expectedCount: count)); }
private void CreateFiniteElement1D(double startX, double startY, double startZ, double endX, double endY, double endZ) { nodeFactory = new NodeFactory(ModelType.Truss3D); start = nodeFactory.Create(startX, startY, startZ); end = nodeFactory.Create(endX, endY, endZ); elementFactory = new ElementFactory(ModelType.Truss3D); SUT = elementFactory.CreateLinearConstantSpring(start, end, 0); }
public IList <Label> GetListElementsByName(ElementState state, ElementsCount count) { return(ElementFactory.FindElements <Label>(InputByName, state: state, expectedCount: count)); }
/// <summary> /// </summary> /// <param name="buf"> </param> /// <param name="offset"> </param> /// <param name="ct"> </param> /// <param name="tok"> </param> private void StartTag(byte[] buf, int offset, ContentToken ct, TOK tok) { m_Depth++; int colon; string name; string prefix; var ht = new Hashtable(); m_ns.PushScope(); // if i have attributes if ((tok == TOK.START_TAG_WITH_ATTS) || (tok == TOK.EMPTY_ELEMENT_WITH_ATTS)) { int start; int end; string val; for (int i = 0; i < ct.getAttributeSpecifiedCount(); i++) { start = ct.getAttributeNameStart(i); end = ct.getAttributeNameEnd(i); name = utf.GetString(buf, start, end - start); start = ct.getAttributeValueStart(i); end = ct.getAttributeValueEnd(i); // val = utf.GetString(buf, start, end - start); val = NormalizeAttributeValue(buf, start, end - start); // <foo b='&'/> // <foo b='&amp;' // TODO: if val includes &, it gets double-escaped if (name.StartsWith("xmlns:")) { colon = name.IndexOf(':'); prefix = name.Substring(colon + 1); m_ns.AddNamespace(prefix, val); } else if (name == "xmlns") { m_ns.AddNamespace(string.Empty, val); } else { ht.Add(name, val); } } } name = utf.GetString(buf, offset + m_enc.MinBytesPerChar, ct.NameEnd - offset - m_enc.MinBytesPerChar); colon = name.IndexOf(':'); string ns = string.Empty; prefix = null; if (colon > 0) { prefix = name.Substring(0, colon); name = name.Substring(colon + 1); ns = m_ns.LookupNamespace(prefix); } else { ns = m_ns.DefaultNamespace; } Element newel = ElementFactory.GetElement(prefix, name, ns); foreach (string attrname in ht.Keys) { newel.SetAttribute(attrname, (string)ht[attrname]); } if (m_root == null) { m_root = newel; // FireOnDocumentStart(m_root); if (OnStreamStart != null) { OnStreamStart(this, m_root, m_ns.DefaultNamespace ?? ""); } } else { if (current != null) { current.AddChild(newel); } current = newel; } }
public IList <Label> GetListElementsByCss(ElementState state, ElementsCount count) { return(ElementFactory.FindElements <Label>(ItemByCssSelector, state: state, expectedCount: count)); }
private static CompositionError CreateCompositionErrorWithElementChain(int count) { return(new CompositionError("Description", ElementFactory.CreateChain(count))); }
public HistoryTemplate(ElementFactory amlContext, params object[] content) : base(amlContext, content) { }
public ReplicationRuleFileType(ElementFactory amlContext, params object[] content) : base(amlContext, content) { }
public void CreateContainer_Default_CreateContainer() { var factory = new ElementFactory(); var element = factory.CreateContainer(); Assert.IsType<ContainerElement>(element); }
public fr_SupportedFileType(ElementFactory amlContext, params object[] content) : base(amlContext, content) { }
public override void Apply(MshtmlMarkupServices markupServices, MarkupRange markupRange, MshtmlCoreCommandSet commands) { ElementFactory factory = () => markupServices.CreateElement(_ELEMENT_TAG_ID.TAGID_SUB, String.Empty); WrapInElement(factory, markupServices, markupRange); }
public TElement Find <TElement>(Locator locator) where TElement : IHtmlElement, new() { var element = ElementFactory.Create <TElement>(this, locator); return(element); }
public cmf_ContentTypeExportRel(ElementFactory amlContext, params object[] content) : base(amlContext, content) { }
public cmf_ContentElementItems(ElementFactory amlContext, params object[] content) : base(amlContext, content) { }
public Permission_PropertyValue(ElementFactory amlContext, params object[] content) : base(amlContext, content) { }
public void CreateLine_Default_CreatesLineElement() { var factory = new ElementFactory(); var element = factory.CreateLine(); Assert.IsType<LineElement>(element); }
public tp_XmlSchema(ElementFactory amlContext, params object[] content) : base(amlContext, content) { }
public void SetUp() { nodeFactory = new NodeFactory(ModelType.Truss1D); start = nodeFactory.Create(0); end = nodeFactory.Create(1); elementFactory = new ElementFactory(ModelType.Truss1D); SUT = elementFactory.CreateLinearConstantSpring(start, end, 0); }
public ReplicationTxn(ElementFactory amlContext, params object[] content) : base(amlContext, content) { }
public IList <Label> GetListElementsByDottedXPath(ElementState state, ElementsCount count) { return(ElementFactory.FindElements <Label>(DottedXPath, state: state, expectedCount: count)); }
public void Constructor9_NullAsInnerExceptionArgument_ShouldSetInnerExceptionPropertyToNull() { var exception = new ComposablePartException("Message", ElementFactory.Create(), (Exception)null); Assert.IsNull(exception.InnerException); }
public Core_ItemGridLayout(ElementFactory amlContext, params object[] content) : base(amlContext, content) { }
public void Logout(bool unlockOnLogout, bool async) { Process(new Command("<logoff skip_unlock=\"" + (unlockOnLogout ? 0 : 1) + "\"/>").WithAction(CommandAction.LogOff), async) .Done(r => { _context = null; _factory = null; _httpDatabase = null; _httpPassword = null; _httpUsername = null; _userId = null; }); }