Ejemplo n.º 1
0
 protected override void GetControlViewAndTag(Control control, out IControlDesignerView view, out IControlDesignerTag tag)
 {
     view = null;
     tag  = null;
     IDesignerHost designerHost = ((IDesignerHost)serviceProvider.GetService(typeof(IDesignerHost)));
     IDesigner     designer     = designerHost.GetDesigner(control);
 }
 protected internal abstract void GetControlViewAndTag(Control control, out IControlDesignerView view, out IControlDesignerTag tag);
 protected internal abstract void GetControlViewAndTag(Control control, out IControlDesignerView view, out IControlDesignerTag tag);
 protected internal override void GetControlViewAndTag(Control control, out IControlDesignerView view, out IControlDesignerTag tag)
 {
     view = null;
     tag = null;
 }
Ejemplo n.º 5
0
    protected void PropertyChanged(string propName)
    {
        IControlDesignerTag myHtmlControlDesignBehavior = this.Tag;

        DataBindingCollection myDataBindingCollection;
        DataBinding           myDataBinding1, myDataBinding2;
        String myStringReplace1, myDataBindingExpression1, removedBinding, removedBindingAfterReplace, myDataBindingExpression2, myStringReplace2;

        string[] removedBindings1, removedBindings2;
        Int32    temp;

        if (myHtmlControlDesignBehavior == null)
        {
            return;
        }
        // Use the DataBindingCollection constructor to
        // create the myDataBindingCollection1 object.
        // Then set this object equal to the
        // DataBindings property of the control created
        // by this custom designer.
        DataBindingCollection myDataBindingCollection1 = new DataBindingCollection();

        myDataBindingCollection1 = myDataBindingCollection = DataBindings;
        if (myDataBindingCollection.Contains(propName))
        {
            myDataBinding1   = myDataBindingCollection[propName];
            myStringReplace1 = propName.Replace(".", "-");
            if (myDataBinding1 == null)
            {
                myHtmlControlDesignBehavior.RemoveAttribute(myStringReplace1);
                return;
            }
            // DataBinding is not null.
            myDataBindingExpression1 = String.Concat("<%#", myDataBinding1.Expression, "%>");
            myHtmlControlDesignBehavior.SetAttribute(myStringReplace1, myDataBindingExpression1);
            int index = myStringReplace1.IndexOf("-");
        }
        else
        {
            // Use the DataBindingCollection.RemovedBindings
            // property to set the value of the removedBindings
            // arrays.
            removedBindings2 = removedBindings1 = DataBindings.RemovedBindings;
            temp             = 0;
            while (removedBindings2.Length > temp)
            {
                removedBinding             = removedBindings2[temp];
                removedBindingAfterReplace = removedBinding.Replace('.', '-');
                myHtmlControlDesignBehavior.RemoveAttribute(removedBindingAfterReplace);
                temp = temp + 1;
            }
        }
        // Use the DataBindingCollection.GetEnumerator method
        // to iterate through the myDataBindingCollection object
        // and write the PropertyName, PropertyType, and Expression
        // properties to a file for each DataBinding object
        // in the MyDataBindingCollection object.
        myDataBindingCollection = DataBindings;
        IEnumerator myEnumerator = myDataBindingCollection.GetEnumerator();

        while (myEnumerator.MoveNext())
        {
            myDataBinding2 = (DataBinding)myEnumerator.Current;
            String dataBindingOutput1, dataBindingOutput2, dataBindingOutput3;
            dataBindingOutput1 = String.Concat("The property name is ", myDataBinding2.PropertyName);
            dataBindingOutput2 = String.Concat("The property type is ", myDataBinding2.PropertyType.ToString(), "-", dataBindingOutput1);
            dataBindingOutput3 = String.Concat("The expression is ", myDataBinding2.Expression, "-", dataBindingOutput2);
            WriteToFile(dataBindingOutput3);

            myDataBindingExpression2 = String.Concat("<%#", myDataBinding2.Expression, "%>");
            myStringReplace2         = myDataBinding2.PropertyName.Replace(".", "-");
            myHtmlControlDesignBehavior.SetAttribute(myStringReplace2, myDataBindingExpression2);
            int index = myStringReplace2.IndexOf('-');
        }    // while loop ends
    }
Ejemplo n.º 6
0
 public WebFormViewActionList(IComponent component, IControlDesignerTag designerTag)
     : base(component)
 {
     this.formView = component as WebFormView;
     this.tag = designerTag;
 }