public ActivityToolboxItem(Type type) : base(type)
 {
     if (type != null)
     {
         if (type.Name != null)
         {
             string name = type.Name;
             if (((type.Assembly == Assembly.GetExecutingAssembly()) || (((type.Assembly != null) && (type.Assembly.FullName != null)) && type.Assembly.FullName.Equals("System.Workflow.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", StringComparison.OrdinalIgnoreCase))) && (type.Name.EndsWith("Activity", StringComparison.Ordinal) && !type.Name.Equals("Activity", StringComparison.Ordinal)))
             {
                 name = type.Name.Substring(0, type.Name.Length - "Activity".Length);
             }
             base.DisplayName = name;
         }
         base.Description = ActivityDesigner.GetActivityDescription(type);
     }
 }
Example #2
0
        public ActivityToolboxItem(Type type)
            : base(type)
        {
            //
            if (type != null)
            {
                if (type.Name != null)
                {
                    string name = type.Name;
                    if ((type.Assembly == Assembly.GetExecutingAssembly() ||
                         type.Assembly != null && type.Assembly.FullName != null &&
                         type.Assembly.FullName.Equals(AssemblyRef.ActivitiesAssemblyRef, StringComparison.OrdinalIgnoreCase)) &&
                        type.Name.EndsWith(ActivitySuffix, StringComparison.Ordinal) &&
                        !type.Name.Equals(ActivitySuffix, StringComparison.Ordinal))
                    {
                        name = type.Name.Substring(0, type.Name.Length - ActivitySuffix.Length);
                    }

                    base.DisplayName = name;
                }

                base.Description = ActivityDesigner.GetActivityDescription(type);
            }
        }