Exemplo n.º 1
0
        /// <summary>
        /// Sets the values passed by the property grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void SetPropertyBagValue(object sender, PropertySpecEventArgs e)
        {
            switch (e.Property.Name)
            {
            case "ShowLabel": this.ShowLabel = (bool)e.Value; break;

            case "Text":
                //use the logic and the constraint of the object that is being reflected
                if (e.Value.ToString() != null)
                {
                    this.mText = (string)e.Value;
                }
                else
                {
                    MessageBox.Show("Not a valid label", "Invalid label", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }

                break;
            }
            this.Invalidate();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the value of the requested property
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void GetPropertyBagValue(object sender, PropertySpecEventArgs e)
        {
            base.GetPropertyBagValue(sender, e);
            switch (e.Property.Name)
            {
            case "Text": e.Value = this.Text; break;

            case "LineColor": e.Value = mLineColor; break;

            case "LineWeight": e.Value = this.mLineWeight; break;

            case "LineStyle": e.Value = this.mLineStyle; break;

            case "LineEnd": e.Value = this.mLineEnd; break;

            case "LinePath": e.Value = this.mLinePath; break;

            case "Layer":
                if (Layer == null)
                {
                    e.Value = GraphAbstract.DefaultLayer;
                }
                else
                {
                    e.Value = this.Layer;
                }
                break;

            case "BoxedLabel":
                e.Value = this.mBoxedLabel;
                break;

            case "Z-order":
                e.Value = this.ZOrder;
                break;
            }
        }
Exemplo n.º 3
0
 protected override void SetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     base.SetPropertyBagValue(sender, e);
     switch (e.Property.Name) {
         case "Angle":
             this.Angle =(float)e.Value;
             break;
     }
 }
Exemplo n.º 4
0
 /* Allows the propertygrid to set new values */
 protected override void GetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     switch (e.Property.Name)
     {
         case "Labels": e.Value = this.localLabels; break;
         case "Variables": e.Value = this.localVariables; break;
         case "Name": e.Value = this.name; break;
         case "arcType": e.Value = this.XmlArcType; break;
         case "directed": e.Value = this.directed; break;
         case "doubly directed": e.Value = this.doublyDirected; break;
         case "contains all local labels": e.Value = this.containsAllLocalLabels; break;
         case "direction is equal": e.Value = this.directionIsEqual; break;
         case "null means null": e.Value = this.nullMeansNull; break;
     }
 }
Exemplo n.º 5
0
        /* Allows the propertygrid to set new values */
        protected override void GetPropertyBagValue(object sender, PropertySpecEventArgs e)
        {
            switch (e.Property.Name)
            {
                case "Labels": e.Value = this.localLabels; break;
                case "Variables": e.Value = this.localVariables; break;
                case "Name": e.Value = this.name; break;
                case "nodeType": e.Value = this.XmlNodeType; break;
                case "contains all local labels": e.Value = this.containsAllLocalLabels; break;
                case "strict degree match": e.Value = this.strictDegreeMatch; break;

            }
        }
Exemplo n.º 6
0
        protected override void GetPropertyBagValue(object sender, PropertySpecEventArgs e)
        {
            base.GetPropertyBagValue (sender, e);
            switch(e.Property.Name)
            {
                case "Size": e.Value=this.mRectangle.Size;break;
                case "Location": e.Value=this.mRectangle.Location;break;
                //case "Connectors": e.Value=this.connectors;break;
                case "NodeColor": e.Value=this.mNodeColor;break;

            }
        }
Exemplo n.º 7
0
 /* Allows the propertygrid to set new values */
 protected void GetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     switch (e.Property.Name)
     {
         case "induced": e.Value = this.induced; break;
         case "spanning": e.Value = this.spanning; break;
         case "containsAllGlobalLabels": e.Value = this.containsAllGlobalLabels; break;
         case "Name": e.Value = this.name; break;
         case "Embedding Rules": e.Value = this.embeddingRules.Count; break;
         /*case "LHS Name": e.Value = this.L.name; break;*/
         case "LHS Labels": e.Value = this.L.globalLabels; break;
         case "LHS Variables": e.Value = this.L.globalVariables; break;
         /*case "RHS Name": e.Value = this.R.name; break;*/
         case "RHS Labels": e.Value = this.R.globalLabels; break;
         case "RHS Variables": e.Value = this.R.globalVariables; break;
         case "Parametric Apply Functions": e.Value = this.applyFunctions; break;
         case "Parametric Recognize Functions": e.Value = this.recognizeFunctions; break;
     }
 }
            public override object GetValue(object component)
            {
                // Have the property bag raise an event to get the current value
                // of the property.

                PropertySpecEventArgs e = new PropertySpecEventArgs(item, null);
                bag.OnGetValue(e);
                return e.Value;
            }
Exemplo n.º 9
0
 protected override void GetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     base.GetPropertyBagValue(sender, e);
     switch (e.Property.Name){
         case "Font":
             e.Value = this.Font;
             break;
         case "TextColor":
             e.Value = this.TextColor;
             break;
     }
 }
Exemplo n.º 10
0
 /* Allows the propertygrid to set new values */
 protected virtual void GetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     switch (e.Property.Name)
     {
         case "Labels": e.Value = this.localLabels; break;
         case "Variables": e.Value = this.localVariables; break;
         case "Name": e.Value = this.name; break;
         case "arcType": e.Value = this.XmlArcType; break;
         case "directed": e.Value = this.directed; break;
         case "doubly directed": e.Value = this.doublyDirected; break;
     }
 }
 /// <summary>
 /// Gets the value of the requested property
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void GetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     base.GetPropertyBagValue (sender, e);
     switch(e.Property.Name)
     {
         case "Text": e.Value=this.mText;break;
         case "LineColor": e.Value=this.mLineColor; break;
         case "ShowLabel": e.Value=this.mShowLabel; break;
         case "LineWeight": e.Value = this.mLineWeight; break;
         case "LineStyle": e.Value = this.mLineStyle; break;
         case "LineEnd": e.Value = this.mLineEnd; break;
         case "LinePath": e.Value = this.mLinePath; break;
         //case "test": e.Value =test; break;
     }
 }
Exemplo n.º 12
0
        /// <summary>
        /// Determines which properties are accessible via the property grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void GetPropertyBagValue(object sender, PropertySpecEventArgs e)
        {
            switch(e.Property.Name)
            {
                case "Text": e.Value=this.mText;break;

            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// Sets the values passed by the property grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void SetPropertyBagValue(object sender, PropertySpecEventArgs e)
        {
            switch(e.Property.Name)
            {
                case "Text":
                    //use the logic and the constraint of the object that is being reflected
                    if(e.Value.ToString() != null)
                    {
                        this.mText=(string) e.Value;

                    }
                    else
                        MessageBox.Show("Not a valid label","Invalid label",MessageBoxButtons.OK,MessageBoxIcon.Warning);
                    this.Invalidate();
                    break;
            }
        }
 /// <summary>
 /// This member overrides PropertyBag.OnSetValue.
 /// </summary>
 protected override void OnSetValue(PropertySpecEventArgs e)
 {
     propValues[e.Property.Name] = e.Value;
     base.OnSetValue(e);
 }
 /// <summary>
 /// This member overrides PropertyBag.OnGetValue.
 /// </summary>
 protected override void OnGetValue(PropertySpecEventArgs e)
 {
     e.Value = propValues[e.Property.Name];
     base.OnGetValue(e);
 }
            public override void SetValue(object component, object value)
            {
                // Have the property bag raise an event to set the current value
                // of the property.

                PropertySpecEventArgs e = new PropertySpecEventArgs(item, value);
                bag.OnSetValue(e);
            }
        /// <summary>
        /// Sets the values passed by the property grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void SetPropertyBagValue(object sender, PropertySpecEventArgs e)
        {
            switch(e.Property.Name)
            {
                case "AutomataPulse":
                    this.AutomataPulse = (int) e.Value;
                    break;
                case "BackgroundColor":
                    this.mBackgroundColor = (Color) e.Value;
                    this.Invalidate();
                    break;
                case "BackgroundImagePath":
                    this.mBackgroundImagePath = (string) e.Value;
                    this.Invalidate();
                    break;
                case "DefaultConnectionPath":
                    this.connectionPath = (string) e.Value;
                    break;
                case "DefaultLineEnd":
                    this.connectionEnd = (ConnectionEnds) e.Value;
                    break;
                case "EnableContextMenu":
                    this.EnableContextMenu = (bool) e.Value;
                    this.Invalidate();
                    break;
                case "EnableLayout":
                    this.EnableLayout = (bool) e.Value;
                    break;
                case "GradientBottom":
                    this.mGradientBottom = (Color) e.Value;
                    this.Invalidate();
                    break;
                case "GradientTop":
                    this.mGradientTop = (Color) e.Value;
                    this.Invalidate();
                    break;
                case "GraphLayoutAlgorithm":
                    this.layoutFactory.GraphLayoutAlgorithm = (GraphLayoutAlgorithms) e.Value;
                    break;
                case "GridSize":
                    this.mGridSize = (int) e.Value;
                    this.Invalidate();
                    break;
                case "RestrictToCanvas":
                    this.mRestrictToCanvas = (bool) e.Value;
                    break;
                case "ShowGrid":
                    this.mShowGrid = (bool) e.Value;
                    this.Invalidate();
                    break;
                case "Snap":
                    this.mSnap = (bool) e.Value;
                    this.Invalidate();
                    break;
                case "BackgroundType":
                    this.mBackgroundType= (CanvasBackgroundTypes) e.Value;
                    this.Invalidate();
                    break;
                case "AllowAddShape":
                    this.mAllowAddShape = (bool) e.Value;
                    break;
                case "AllowAddConnection":
                    this.mAllowAddConnection = (bool) e.Value;
                    break;
                case "AllowDeleteShape":
                    this.mAllowDeleteShape = (bool) e.Value;
                    break;
                case "AllowMoveShape":
                    this.mAllowMoveShape = (bool) e.Value;
                    break;

            }
        }
Exemplo n.º 18
0
 /// <summary>
 /// This member overrides PropertyBag.OnGetValue.
 /// </summary>
 protected override void OnGetValue(PropertySpecEventArgs e)
 {
     e.Value = propValues[e.Property.Name];
     base.OnGetValue(e);
 }
Exemplo n.º 19
0
 /* Allows the propertygrid to set new values */
 protected void GetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     switch (e.Property.Name)
     {
         case "Global Labels": e.Value = this.globalLabels; break;
         case "Variables": e.Value = this.globalVariables; break;
         case "Name": e.Value = this.name; break;
         case "Graphic": e.Value = this.graphic; break;
     }
 }
 /// <summary>
 /// Raises the SetValue event.
 /// </summary>
 /// <param name="e">A PropertySpecEventArgs that contains the event data.</param>
 protected virtual void OnSetValue(PropertySpecEventArgs e)
 {
     if(SetValue != null)
         SetValue(this, e);
 }
 /// <summary>
 /// Sets the value of the given property
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void SetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     base.SetPropertyBagValue (sender, e);
     switch(e.Property.Name)
     {
         case "LineColor": this.LineColor=(Color) e.Value; break;
         case "ShowLabel": this.mShowLabel=(bool) e.Value; break;
         case "LineWeight": this.LineWeight = (ConnectionWeight) e.Value; break;
         case "LineStyle": this.LineStyle = (DashStyle) e.Value; break;
         case "LineEnd": this.LineEnd = (ConnectionEnds) e.Value; break;
         case "LinePath": this.LinePath = (string) e.Value; break;
         //case "test": test = (string) e.Value; break;
     }
 }
Exemplo n.º 22
0
 /* Allows the propertygrid to set new values. */
 protected void SetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     switch (e.Property.Name)
     {
         case "Global Labels": this.globalLabels = (List<string>)e.Value; break;
         case "Variables": this.globalVariables = (List<double>)e.Value; break;
         case "Name": this.name = (string)e.Value; break;
     }
 }
Exemplo n.º 23
0
 /// <summary>
 /// This member overrides PropertyBag.OnSetValue.
 /// </summary>
 protected override void OnSetValue(PropertySpecEventArgs e)
 {
     propValues[e.Property.Name] = e.Value;
     base.OnSetValue(e);
 }
Exemplo n.º 24
0
 /* Allows the propertygrid to set new values */
 protected virtual void GetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     switch (e.Property.Name)
     {
         case "Labels": e.Value = this.localLabels; break;
         case "Variables": e.Value = this.localVariables; break;
         case "Name": e.Value = this.name; break;
         case "nodeType": e.Value = this.XmlNodeType; break;
     }
 }
Exemplo n.º 25
0
 protected override void SetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     base.SetPropertyBagValue(sender, e);
     switch (e.Property.Name){
         case "Font":
             this.Font= e.Value as Font;
             break;
         case "TextColor":
             this.TextColor = (Color)e.Value ;
             break;
     }
 }
Exemplo n.º 26
0
 /* Allows the propertygrid to set new values. */
 protected virtual void SetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     switch (e.Property.Name)
     {
         case "Labels": this.localLabels = (List<string>)e.Value; break;
         case "Variables": this.localVariables = (List<double>)e.Value; break;
         case "Name": this.name = (string)e.Value; break;
         case "nodeType": this.XmlNodeType = (string)e.Value; break;
     }
 }
Exemplo n.º 27
0
        protected override void SetPropertyBagValue(object sender, PropertySpecEventArgs e)
        {
            base.SetPropertyBagValue (sender, e);

            switch(e.Property.Name)
            {
                case "Size":
                    if(this.Resizable) this.mRectangle.Size=(SizeF) e.Value;
                    else
                        MessageBox.Show("The shape is defined as non-resizable.","Not allowed", MessageBoxButtons.OK,MessageBoxIcon.Information);
                    if(this.ShapeTracker!=null)
                    {
                        this.ShapeTracker.Rectangle=this.mRectangle;
                    }
                    recalculateSize = false;
                    this.Invalidate();
                    break;
                case "Location":
                    this.mRectangle.Location=(PointF) e.Value;
                    if(this.ShapeTracker!=null)
                    {
                        ShapeTracker.ChangeLocation((PointF) e.Value);
                    }
                    recalculateSize = false;
                    this.Invalidate();
                    break;
                case "NodeColor":
                    this.mNodeColor=(Color) e.Value;
                    recalculateSize = false;
                    this.Invalidate();
                    break;
            }
            if(e.Property.Name=="Text" && this.Resizable) recalculateSize = true;
        }
Exemplo n.º 28
0
 /* Allows the propertygrid to set new values */
 protected void GetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     switch (e.Property.Name)
     {
         case "Name": e.Value = this.name; break;
         case "choiceMethod": e.Value = this.choiceMethod; break;
         case "triggerRule #":
             {
                 if ((this.triggerRuleNum < 0) || (this.triggerRuleNum >= this.rules.Count))
                     e.Value = -1;
                 else e.Value = triggerRuleNum + 1;
             }
             break;
         case "after normal cycle": e.Value = (nextGenerationSteps)this.nextGenerationStep[0]; break;
         case "choice sends a STOP": e.Value = (nextGenerationSteps)this.nextGenerationStep[1]; break;
         case "number of calls reached": e.Value = (nextGenerationSteps)this.nextGenerationStep[2]; break;
         case "no rules recognized": e.Value = (nextGenerationSteps)this.nextGenerationStep[3]; break;
         case "trigger rule invoked": e.Value = (nextGenerationSteps)this.nextGenerationStep[4]; break;
         case "Recognize Source Files": e.Value = this.recognizeSourceFiles; break;
         case "Apply Source Files": e.Value = this.applySourceFiles; break;
         case "interim candidates are": e.Value = this.interimCandidates; break;
         case "final candidates are": e.Value = this.finalCandidates; break;
     }
 }
Exemplo n.º 29
0
 /* Allows the propertygrid to set new values. */
 protected void SetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     switch (e.Property.Name)
     {
         case "induced": this.induced = (Boolean)e.Value; break;
         case "spanning": this.spanning = (Boolean)e.Value; break;
         case "containsAllGlobalLabels": this.containsAllGlobalLabels = (Boolean)e.Value; break;
         case "Name": this.name = (string)e.Value; break;
         case "Embedding Rules":
             {
                 while (this.embeddingRules.Count < (int)e.Value)
                     this.embeddingRules.Add(new embeddingRule());
                 break;
             }
         /*case "LHS Name": this.L.name = (string)e.Value; break;*/
         case "LHS Labels": this.L.globalLabels = (List<string>)e.Value; break;
         case "LHS Variables": this.L.globalVariables = (List<double>)e.Value; break;
         /*case "RHS Name": this.R.name = (string)e.Value; break;*/
         case "RHS Labels": this.R.globalLabels = (List<string>)e.Value; break;
         case "RHS Variables": this.R.globalVariables = (List<double>)e.Value; break;
         case "Parametric Apply Functions":
             {
                 this.applyFunctions = checkForFunctions(false, (List<string>)e.Value);
                 break;
             }
         case "Parametric Recognize Functions":
             {
                 this.recognizeFunctions = checkForFunctions(true, (List<string>)e.Value);
                 break;
             }
     }
 }
Exemplo n.º 30
0
 /* Allows the propertygrid to set new values. */
 protected void SetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     switch (e.Property.Name)
     {
         case "Name": this.name = (string)e.Value; break;
         case "choiceMethod": this.choiceMethod = (choiceMethods)e.Value; break;
         case "Recognize Source Files":
             {
                 this.recognizeSourceFiles = (List<string>)e.Value;
                 for (int i = recognizeSourceFiles.Count; i != 0; i--)
                 {
                     if (recognizeSourceFiles[i - 1].Equals("cs"))
                         recognizeSourceFiles.RemoveAt(i - 1);
                     else if (!recognizeSourceFiles[i - 1].EndsWith(".cs"))
                         recognizeSourceFiles[i - 1] += ".cs";
                 }
                 checkForSourceFiles();
                 break;
             }
         case "Apply Source Files":
             {
                 this.applySourceFiles = (List<string>)e.Value;
                 for (int i = applySourceFiles.Count; i != 0; i--)
                 {
                     if (applySourceFiles[i - 1].Equals("cs"))
                         applySourceFiles.RemoveAt(i - 1);
                     else if (!applySourceFiles[i - 1].EndsWith(".cs"))
                         applySourceFiles[i - 1] += ".cs";
                 }
                 checkForSourceFiles();
                 break;
             }
         case "triggerRule #":
             {
                 if (((int)e.Value > rules.Count) || ((int)e.Value < 0))
                     triggerRuleNum = -1;
                 else triggerRuleNum = (int)e.Value - 1;
                 break;
             }
         case "after normal cycle": this.nextGenerationStep[0] = (nextGenerationSteps)e.Value; break;
         case "choice sends a STOP": this.nextGenerationStep[1] = (nextGenerationSteps)e.Value; break;
         case "number of calls reached": this.nextGenerationStep[2] = (nextGenerationSteps)e.Value; break;
         case "no rules recognized": this.nextGenerationStep[3] = (nextGenerationSteps)e.Value; break;
         case "trigger rule invoked": this.nextGenerationStep[4] = (nextGenerationSteps)e.Value; break;
         case "interim candidates are": this.interimCandidates = (candidatesAre)e.Value; break;
         case "final candidates are": this.finalCandidates = (candidatesAre)e.Value; break;
     }
 }
Exemplo n.º 31
0
 /* Allows the propertygrid to set new values. */
 protected override void SetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     switch (e.Property.Name)
     {
         case "Labels": this.localLabels = (List<string>)e.Value; break;
         case "Variables": this.localVariables = (List<double>)e.Value; break;
         case "Name": this.name = (string)e.Value; break;
         case "arcType": this.XmlArcType = (string)e.Value; break;
         case "directed": this.directed = (Boolean)e.Value; break;
         case "doubly directed": this.doublyDirected = (Boolean)e.Value; break;
         case "contains all local labels": this.containsAllLocalLabels = (Boolean)e.Value; break;
         case "direction is equal": this.directionIsEqual = (Boolean)e.Value; break;
         case "null means null": this.nullMeansNull = (Boolean)e.Value; break;
     }
 }
        /// <summary>
        /// Determines which properties are accessible via the property grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void GetPropertyBagValue(object sender, PropertySpecEventArgs e)
        {
            switch(e.Property.Name)
            {

                case "AutomataPulse": e.Value=this.mAutomataPulse;break;
                case "BackgroundColor": e.Value=this.mBackgroundColor;break;
                case "BackgroundImagePath": e.Value=this.mBackgroundImagePath;break;
                case "DefaultConnectionPath": e.Value=this.connectionPath;break;
                case "DefaultLineEnd": e.Value=this.connectionEnd;break;
                case "EnableContextMenu": e.Value=this.mEnableContextMenu;break;
                case "EnableLayout": e.Value=this.mEnableLayout;break;
                case "GradientBottom": e.Value=this.mGradientBottom;break;
                case "GradientTop": e.Value=this.mGradientTop;break;
                case "GraphLayoutAlgorithm": e.Value=this.layoutFactory.GraphLayoutAlgorithm;break;
                case "GridSize": e.Value=this.mGridSize;break;
                case "RestrictToCanvas": e.Value=this.mRestrictToCanvas;break;
                case "ShowGrid": e.Value=this.mShowGrid;break;
                case "Snap": e.Value=this.mSnap;break;
                case "BackgroundType": e.Value=this.mBackgroundType;break;
                case "AllowAddShape": e.Value=this.mAllowAddShape; break;
                case "AllowAddConnection": e.Value=this.mAllowAddConnection; break;
                case "AllowDeleteShape": e.Value = this.mAllowDeleteShape; break;
                case "AllowMoveShape": e.Value = this.mAllowMoveShape; break;

            }
        }
Exemplo n.º 33
0
 /* Allows the propertygrid to set new values. */
 protected override void SetPropertyBagValue(object sender, PropertySpecEventArgs e)
 {
     switch (e.Property.Name)
     {
         case "Labels": this.localLabels = (List<string>)e.Value; break;
         case "Variables": this.localVariables = (List<double>)e.Value; break;
         case "Name": this.name = (string)e.Value; break;
         case "nodeType": this.XmlNodeType = (string)e.Value; break;
         case "contains all local labels": this.containsAllLocalLabels = (Boolean)e.Value; break;
         case "strict degree match": this.strictDegreeMatch = (Boolean)e.Value; break;
     }
 }
Exemplo n.º 34
0
        protected override void GetPropertyBagValue(object sender, PropertySpecEventArgs e)
        {
            base.GetPropertyBagValue(sender, e);
            switch (e.Property.Name) {
                case "UID":
                    e.Value = this.UID.ToString();

                    break;
                case "Angle":
                    e.Value = this.angle;

                    break;
            }
        }