private protected IParameterObserverRootNode CreateParameterObserverChain(
            object?parameter,
            IPropertyNode property)
        {
            ParameterObserverRootNode parameterObserverRoot;
            IPropertyNode             next;

            if (parameter is IReadOnlyParameter p)
            {
                if (!(property is { Next : IPropertyNode nextProperty }))
Exemple #2
0
		PropertyDefSettingsCommand(IPropertyNode propNode, PropertyDefOptions options) {
			this.propNode = propNode;
			this.newOptions = options;
			this.origOptions = new PropertyDefOptions(propNode.PropertyDef);

			this.origParentNode = (IDocumentTreeNodeData)propNode.TreeNode.Parent.Data;
			this.origParentChildIndex = this.origParentNode.TreeNode.Children.IndexOf(propNode.TreeNode);
			Debug.Assert(this.origParentChildIndex >= 0);
			if (this.origParentChildIndex < 0)
				throw new InvalidOperationException();

			this.nameChanged = origOptions.Name != newOptions.Name;
		}
 public virtual void visit(IPropertyNode value)
 {
     // TODO:  Add AbstractVisitor.SemanticTree.ISemanticVisitor.visit implementation
 }
Exemple #4
0
		public PropInfo GetProperty(IPropertyNode prop)
		{
			return (PropInfo)defs[prop];
		}
Exemple #5
0
		public PropInfo AddProperty(IPropertyNode prop, PropertyInfo pi)
		{
			PropInfo pi2 = new PropInfo(pi);
			defs[prop] = pi2;
			return pi2;
		}
 private PropertyInfo[] get_named_properties(IPropertyNode[] props)
 {
     PropertyInfo[] arr = new PropertyInfo[props.Length];
     for (int i = 0; i < arr.Length; i++)
     {
         if (props[i] is ICompiledPropertyNode)
             arr[i] = (props[i] as ICompiledPropertyNode).property_info;
         else
             arr[i] = helper.GetProperty(props[i]).prop;
     }
     return arr;
 }
		PropertyDefSettingsCommand(IPropertyNode propNode, PropertyDefOptions options) {
			this.propNode = propNode;
			this.newOptions = options;
			this.origOptions = new PropertyDefOptions(propNode.PropertyDef);

			this.origParentNode = (IFileTreeNodeData)propNode.TreeNode.Parent.Data;
			this.origParentChildIndex = this.origParentNode.TreeNode.Children.IndexOf(propNode.TreeNode);
			Debug.Assert(this.origParentChildIndex >= 0);
			if (this.origParentChildIndex < 0)
				throw new InvalidOperationException();

			this.nameChanged = origOptions.Name != newOptions.Name;
		}
		DeletePropertyDefCommand(IPropertyNode[] propNodes) {
			this.nodes = new DeletableNodes<IPropertyNode>(propNodes);
		}
			public void Delete(IPropertyNode[] nodes) {
				Debug.Assert(infos == null);
				if (infos != null)
					throw new InvalidOperationException();

				infos = new ModelInfo[nodes.Length];

				for (int i = 0; i < infos.Length; i++) {
					var node = nodes[i];

					var info = new ModelInfo(node.PropertyDef);
					infos[i] = info;
					info.OwnerType.Properties.RemoveAt(info.PropertyIndex);

					for (int j = 0; j < info.Methods.Length; j++) {
						int index = info.OwnerType.Methods.IndexOf(info.Methods[j]);
						Debug.Assert(index >= 0);
						if (index < 0)
							throw new InvalidOperationException();
						info.OwnerType.Methods.RemoveAt(index);
						info.MethodIndexes[j] = index;
					}
				}
			}
			public void Restore(IPropertyNode[] nodes) {
				Debug.Assert(infos != null);
				if (infos == null)
					throw new InvalidOperationException();
				Debug.Assert(infos.Length == nodes.Length);
				if (infos.Length != nodes.Length)
					throw new InvalidOperationException();

				for (int i = infos.Length - 1; i >= 0; i--) {
					var node = nodes[i];
					var info = infos[i];
					info.OwnerType.Properties.Insert(info.PropertyIndex, node.PropertyDef);

					for (int j = info.Methods.Length - 1; j >= 0; j--)
						info.OwnerType.Methods.Insert(info.MethodIndexes[j], info.Methods[j]);
				}

				infos = null;
			}
Exemple #11
0
 public void visit(IPropertyNode value)
 {
     string s = value.GetType().Name + ".";
     prepare_string_node(value.name, s + "name");
     //value.comprehensive_type
     //value.get_function
     prepare_string_node(value.node_kind.ToString(), s + "node_kind");
     prepare_collection(value.parameters, s + "parameters", "parameters", value.parameters.Length);
     //value.property_type
     //value.set_function
 }
Exemple #12
0
 public ModelPropertyNodeAdapter(IModelNodeAdapterParent parent, IPropertyNode propertyNode) : base(parent)
 {
     this.propertyNode = propertyNode;
 }
		public virtual void visit(IPropertyNode value)
		{
			// TODO:  Add AbstractVisitor.SemanticTree.ISemanticVisitor.visit implementation
		}
Exemple #14
0
 CreatePropertyDefCommand(ITypeNode ownerNode, PropertyDefOptions options)
 {
     this.ownerNode = ownerNode;
     this.propNode  = ownerNode.Create(options.CreatePropertyDef(ownerNode.TypeDef.Module));
 }
		CreatePropertyDefCommand(ITypeNode ownerNode, PropertyDefOptions options) {
			this.ownerNode = ownerNode;
			this.propNode = ownerNode.Create(options.CreatePropertyDef(ownerNode.TypeDef.Module));
		}
 public PropertyNodeCreator(IModuleFileNode modNode, ITypeNode ownerNode, PropertyDef property)
 {
     this.ownerNode = ownerNode;
     this.propNode  = modNode.Context.FileTreeView.Create(property);
 }
Exemple #17
0
 public void visit(IPropertyNode value)
 {
     throw new System.NotSupportedException(value.GetType().ToString());
 }