Exemple #1
0
        /// <summary>
        /// Handles the <see cref="IElements"/>.<see cref="Added"/> event which is fired when an element is added
        /// to the elements mgr of this workspace.
        /// </summary>
        internal void _elementsMgr_Added(IElements sender, ElementCollectionEventArgs ea)
        {
            if (sender != null)
            {
                // subscribe to the StatusChange events when an element is added to the elements mgr.
                for (int i = 0; i < ea.Elements.Length; i++)
                {
                    ea.Elements[i].StatusChanged += new StatusChangeEventHandler<IElement, ElementStatusChangeEventArgs>(element_StatusChanged);
                    ea.Elements[i].RequestVariableValues+=new RequestVariableValuesEventHandler<IElement>(element_RequestVariableValues);
                    ea.Elements[i].SelectionChanged += new SelectionEventHandler<IElement, SelectionEventArgs>(element_SelectionChanged);
                }

                // fire the event which confirms to subscribers that the element(s) has been successfully added.  This
                // is the final confirmation of a successful addition of an element.
                if (ea.Elements.Length > 0)
                {
                    ElementInstancesAddedEventArgs arg = new ElementInstancesAddedEventArgs(ea.Elements);
                    OnElementInstancesAdded(arg);
                }

                //ExecMgr mgr = new ExecMgr();
               // mgr.BuildExecOrder(ElementsMgr);
            }
        }
Exemple #2
0
 public void ElementInstancesAdded_DummyHandler(IWorkSpace sender, ElementInstancesAddedEventArgs ea)
 {
     //throw new Exception("The method or operation is not implemented.");
     ElementInstancesAdded_TimesHandled++;
 }
Exemple #3
0
 /// <summary>
 /// Triggers the ElementInstancesAdded event.
 /// </summary>
 internal virtual void OnElementInstancesAdded(ElementInstancesAddedEventArgs ea)
 {
     if (ElementInstancesAdded != null)
         ElementInstancesAdded(this, ea);
 }
Exemple #4
0
 internal void _wkSpce_ElementInstanceAdded(IWorkSpace sender, ElementInstancesAddedEventArgs ea)
 {
     // TODO LOG!!!!! this is where to log that an element instance was added, as this is the confirmation
     // from the workspace.  Here to is were you should notify of errors.  Otherwise, there is nothing else needed to do here
     //if (sender !=null)
     //{
     //    StringBuilder sb = new StringBuilder();
     //    sb.Append("Element (models) added:");
     //    sb.Append(Environment.NewLine);
     //    for (int i = 0; i < ea.Elements.Length; i++)
     //    {
     //        sb.Append(string.Format("{0}: [{1}]", ea.Elements[i].TypeName, ea.Elements[i].TypeId));
     //        sb.Append(Environment.NewLine);
     //    }
     //    Debug.Write(sb.ToString());
     //}
 }