• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Model.ModelItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Activities.Presentation.Model.ModelItem的典型用法代码示例。如果您正苦于以下问题:C# ModelItem类的具体用法?C# ModelItem怎么用?C# ModelItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ModelItem类属于System.Activities.Presentation.Model命名空间,在下文中一共展示了ModelItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CanMerge

        public static bool CanMerge(ModelItem source)
        {
            Contract.Requires(source != null);

            var task = source.GetTaskActivity();
            return task.Status == TaskActivityStatus.CheckedIn;
        }
开发者ID:barbarossia,项目名称:CWF,代码行数:7,代码来源:MultipleAuthorService.cs


示例2: CanAssign

        public static bool CanAssign(ModelItem source)
        {
            Contract.Requires(source != null);

            return !CheckIsTask(source) &&
                !CompositeService.GetParents(source).Any(m => m.GetTaskActivity() != null);
        }
开发者ID:barbarossia,项目名称:CWF,代码行数:7,代码来源:MultipleAuthorService.cs


示例3: CanUnassign

        public static bool CanUnassign(ModelItem source)
        {
            Contract.Requires(source != null);

            var task = source.GetTaskActivity();
            return task.Status != TaskActivityStatus.Editing;
        }
开发者ID:barbarossia,项目名称:CWF,代码行数:7,代码来源:MultipleAuthorService.cs


示例4: DateTimeDesignerViewModel

 public DateTimeDesignerViewModel(ModelItem modelItem)
     : base(modelItem)
 {
     AddTitleBarHelpToggle();
     TimeModifierTypes = new List<string>(DateTimeFormatter.TimeModifierTypes);
     SelectedTimeModifierType = string.IsNullOrEmpty(TimeModifierType) ? TimeModifierTypes[0] : TimeModifierType;
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:7,代码来源:DateTimeDesignerViewModel.cs


示例5: CommandLineDesignerViewModel

 public CommandLineDesignerViewModel(ModelItem modelItem)
     : base(modelItem)
 {
     AddTitleBarLargeToggle();
     AddTitleBarHelpToggle();
     InitializeCommandPriorities();
 }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:7,代码来源:CommandLineDesignerViewModel.cs


示例6: CreateProperty

 ModelProperty CreateProperty(ModelItem parent, PropertyDescriptor propertyDescriptor)
 {
     bool isAttached = propertyDescriptor is AttachedPropertyDescriptor;
     return this.createFakeModelProperties ?
         (ModelProperty)(new FakeModelPropertyImpl((FakeModelItemImpl)parent, propertyDescriptor)) :
         (ModelProperty)(new ModelPropertyImpl(parent, propertyDescriptor, isAttached));
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:ModelPropertyCollectionImpl.cs


示例7: DateTimeDifferenceDesignerViewModel

 public DateTimeDifferenceDesignerViewModel(ModelItem modelItem)
     : base(modelItem)
 {
     AddTitleBarHelpToggle();
     OutputTypes = new List<string>(DateTimeComparer.OutputFormatTypes);
     SelectedOutputType = string.IsNullOrEmpty(OutputType) ? OutputTypes[0] : OutputType;
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:7,代码来源:DateTimeDifferenceDesignerViewModel.cs


示例8: StoreViewState

 public override void StoreViewState(ModelItem modelItem, string key, object value)
 {
     if (modelItem == null)
     {
         throw FxTrace.Exception.AsError(new ArgumentNullException("modelItem"));
     }
     if (key == null)
     {
         throw FxTrace.Exception.AsError(new ArgumentNullException("key"));
     }
   
     object oldValue = null;
     Dictionary<string, object> viewState = WorkflowViewStateService.GetViewState(modelItem.GetCurrentValue());
     if (viewState == null)
     {
         viewState = new Dictionary<string, object>();
         WorkflowViewStateService.SetViewState(modelItem.GetCurrentValue(), viewState);
     }
     viewState.TryGetValue(key, out oldValue);
     if (value != null)
     {
         viewState[key] = value;
     }
     else
     {
         RemoveViewState(modelItem, key);
     }
     if (this.ViewStateChanged != null && value != oldValue)
     {
         this.ViewStateChanged(this, new ViewStateChangedEventArgs(modelItem, key, value, oldValue));
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:32,代码来源:WorkflowViewStateService.cs


示例9: SortRecordsDesignerViewModel

 public SortRecordsDesignerViewModel(ModelItem modelItem)
     : base(modelItem)
 {
     AddTitleBarHelpToggle();
     SortOrderTypes = new List<string> { "Forward", "Backwards" };
     SelectedSelectedSort = string.IsNullOrEmpty(SelectedSort) ? SortOrderTypes[0] : SelectedSort;
 }
开发者ID:Robin--,项目名称:Warewolf,代码行数:7,代码来源:SortRecordsDesignerViewModel.cs


示例10: ActivityArgumentBinder

        internal ActivityArgumentBinder(ModelItem activityModelItem)
        {
            Contract.Requires(activityModelItem != null);

            this.activityModelItem = activityModelItem;
            Init();
        }
开发者ID:nagyistoce,项目名称:Neuroflow,代码行数:7,代码来源:ActivityArgumentBinder.cs


示例11: SharepointListReadDesignerViewModel

 public SharepointListReadDesignerViewModel(ModelItem modelItem)
     : base(modelItem, new AsyncWorker(), EnvironmentRepository.Instance.ActiveEnvironment, EventPublishers.Aggregator,false)
 {
     WhereOptions = new ObservableCollection<string>(SharepointSearchOptions.SearchOptions());
     dynamic mi = ModelItem;
     InitializeItems(mi.FilterCriteria);
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:7,代码来源:SharepointListReadDesignerViewModel.cs


示例12: RandomDesignerViewModel

 public RandomDesignerViewModel(ModelItem modelItem)
     : base(modelItem)
 {
     AddTitleBarHelpToggle();
     RandomTypes = Dev2EnumConverter.ConvertEnumsTypeToStringList<enRandomType>();
     SelectedRandomType = Dev2EnumConverter.ConvertEnumValueToString(RandomType);
 }
开发者ID:Robin--,项目名称:Warewolf,代码行数:7,代码来源:RandomDesignerViewModel.cs


示例13: Find

        public static IEnumerable<ModelItem> Find(ModelItem startingItem, Predicate<Type> matcher)
        {
            Contract.Requires(startingItem != null);
            Contract.Requires(matcher != null);

            return ModelItemService.FindCore(startingItem, matcher);
        }
开发者ID:barbarossia,项目名称:CWF,代码行数:7,代码来源:ModelItemService.cs


示例14: ActivityDelegateItem

        public ActivityDelegateItem(ModelItem modelItem, ActivityDelegateMetadataAttribute metadata = null)
        {
            Contract.Requires(modelItem != null);
            ModelItem = modelItem;

            if (metadata == null)
            {
                var pmi = modelItem.Parent.Properties.Where(p => p.Value == modelItem).First();
                metadata = pmi.Attributes[typeof(ActivityDelegateMetadataAttribute)] as ActivityDelegateMetadataAttribute;
            }

            if (metadata != null)
            {
                ObjectName = metadata.ObjectName;
                ResultName = metadata.ResultName;
                Argument1Name = metadata.Argument1Name;
                Argument2Name = metadata.Argument2Name;
                Argument3Name = metadata.Argument3Name;
                Argument4Name = metadata.Argument4Name;
                Argument5Name = metadata.Argument5Name;
                Argument6Name = metadata.Argument6Name;
                Argument7Name = metadata.Argument7Name;
                Argument8Name = metadata.Argument8Name;
            }
            if (string.IsNullOrWhiteSpace(ObjectName)) ObjectName = ModelItem.ItemType.GetGenericArguments()[0].Name;
        }
开发者ID:nagyistoce,项目名称:Neuroflow,代码行数:26,代码来源:ActivityDelegateItem.cs


示例15: ModelItemDictionaryImpl

        public ModelItemDictionaryImpl(ModelTreeManager modelTreeManager, Type itemType, Object instance, ModelItem parent)
        {
            Fx.Assert(modelTreeManager != null, "modelTreeManager cannot be null");
            Fx.Assert(itemType != null, "item type cannot be null");
            Fx.Assert(instance != null, "instance cannot be null");
            this.itemType = itemType;
            this.instance = new DictionaryWrapper(instance);
            this.modelTreeManager = modelTreeManager;
            this.parents = new List<ModelItem>(1);
            this.sources = new List<ModelProperty>(1);
            this.helper = new ModelTreeItemHelper();
            if (parent != null)
            {
                this.manuallySetParent = parent;
            }
            this.modelPropertyStore = new Dictionary<string, ModelItem>();
            this.subTreeNodesThatNeedBackLinkPatching = new List<ModelItem>();
            this.modelItems = new NullableKeyDictionary<ModelItem, ModelItem>();
            UpdateInstance();


            if (ItemsCollectionObject != null)
            {
                ItemsCollectionModelItemCollection.CollectionChanged += new NotifyCollectionChangedEventHandler(itemsCollection_CollectionChanged);
                this.ItemsCollectionObject.ModelDictionary = this;
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:27,代码来源:ModelItemDictionaryImpl.cs


示例16: UpdateTypeArgument

        private static void UpdateTypeArgument(ModelItem modelItem, Type value)
        {
            if (value != null)
            {
                Type oldModelItemType = modelItem.ItemType;
                Fx.Assert(oldModelItemType.GetGenericArguments().Count() == 1, "we only support changing a single type parameter ?");
                Type newModelItemType = oldModelItemType.GetGenericTypeDefinition().MakeGenericType(value);
                Fx.Assert(newModelItemType != null, "New model item type needs to be non null or we cannot proceed further");
                ModelItem newModelItem = ModelFactory.CreateItem(modelItem.GetEditingContext(), Activator.CreateInstance(newModelItemType));
                MorphHelper.MorphObject(modelItem, newModelItem);
                MorphHelper.MorphProperties(modelItem, newModelItem);

                if (oldModelItemType.IsSubclassOf(typeof(Activity)) && newModelItemType.IsSubclassOf(typeof(Activity)))
                {
                    if (string.Equals((string)modelItem.Properties["DisplayName"].ComputedValue, GetActivityDefaultName(oldModelItemType), StringComparison.Ordinal))
                    {
                        newModelItem.Properties["DisplayName"].SetValue(GetActivityDefaultName(newModelItemType));
                    }
                }

                DesignerView designerView = modelItem.GetEditingContext().Services.GetService<DesignerView>();
                if (designerView != null)
                {
                    Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Render, (Action)(() =>
                    {
                        if (designerView.RootDesigner != null && ((WorkflowViewElement)designerView.RootDesigner).ModelItem == modelItem)
                        {
                            designerView.MakeRootDesigner(newModelItem, true);
                        }
                        Selection.SelectOnly(modelItem.GetEditingContext(), newModelItem);
                    }));
                }
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:34,代码来源:GenericArgumentsUpdater.cs


示例17: NotifyPropertyChanged

 public void NotifyPropertyChanged(ModelItem modelItem)
 {
     if (null != modelItem)
     {
         ((IModelTreeItem)modelItem).OnPropertyChanged(this.Name);
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:AttachedProperty.cs


示例18: ActivityActionMorphHelper

        public static object ActivityActionMorphHelper(ModelItem originalValue, ModelProperty newModelProperty)
        {
            Fx.Assert(newModelProperty.PropertyType.GetGenericArguments().Count() == 1, "This should only be applied for ActivityAction<T>");
            Type activityActionTypeArgument = newModelProperty.PropertyType.GetGenericArguments()[0];
            Type activityActionType = typeof(ActivityAction<>).MakeGenericType(activityActionTypeArgument);
            object activityAction = Activator.CreateInstance(activityActionType);
            ModelItem morphed = ModelFactory.CreateItem(originalValue.GetEditingContext(), activityAction);

            ModelItem originalActivityActionArgument = originalValue.Properties[PropertyNames.ActionArgument].Value;
            if (originalActivityActionArgument != null)
            {
                Type variableType = typeof(DelegateInArgument<>).MakeGenericType(activityActionTypeArgument);
                DelegateInArgument iterationDelegateArgument = (DelegateInArgument)Activator.CreateInstance(variableType);
                iterationDelegateArgument.Name = (string)originalActivityActionArgument.Properties[PropertyNames.NameProperty].Value.GetCurrentValue();
                morphed.Properties[PropertyNames.ActionArgument].SetValue(iterationDelegateArgument);
            }

            ModelItem originalActivityActionHandler = originalValue.Properties[PropertyNames.ActionHandler].Value;
            if (originalActivityActionHandler != null)
            {
                morphed.Properties[PropertyNames.ActionHandler].SetValue(originalActivityActionHandler);
                originalValue.Properties[PropertyNames.ActionHandler].SetValue(null);
            }

            return morphed;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:26,代码来源:MorphHelpers.cs


示例19: MorphArgument

        internal static Argument MorphArgument(ModelItem originalValue, Type targetType)
        {
            Argument morphed = null;
            Argument original = (Argument)originalValue.GetCurrentValue();
            ActivityWithResult originalExpression = original.Expression;
            
            if (originalExpression != null)
            {
                Type expressionType = originalExpression.GetType();
                Type expressionGenericType = expressionType.IsGenericType ? expressionType.GetGenericTypeDefinition() : null;

                if (expressionGenericType != null)
                {       
                    bool isLocation = ExpressionHelper.IsGenericLocationExpressionType(originalExpression);
                    ActivityWithResult morphedExpression;
                    EditingContext context = originalValue.GetEditingContext();
                    morphed = Argument.Create(targetType, original.Direction);
                    if (ExpressionHelper.TryMorphExpression(originalExpression, isLocation, targetType, 
                        context, out morphedExpression))
                    {                        
                        morphed.Expression = morphedExpression;
                    }
                    //[....] 

                }
            }
            return morphed;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:28,代码来源:MorphHelpers.cs


示例20: ScriptDesignerViewModel

 public ScriptDesignerViewModel(ModelItem modelItem)
     : base(modelItem)
 {
     AddTitleBarHelpToggle();
     ScriptTypes = Dev2EnumConverter.ConvertEnumsTypeToStringList<enScriptType>();
     SelectedScriptType = Dev2EnumConverter.ConvertEnumValueToString(ScriptType);
 }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:7,代码来源:ScriptDesignerViewModel.cs



注:本文中的System.Activities.Presentation.Model.ModelItem类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Statements.FlowStep类代码示例发布时间:2022-05-26
下一篇:
C# Presentation.EditingContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap