public static void SetSettings(object target, VisualBasicSettings value) { AttachablePropertyServices.SetProperty(target, settingsPropertyID, value); }
public static void SetFoo(object target, string value) { AttachablePropertyServices.SetProperty(target, FooIdentifier, value); }
protected static void SetProtected(object target, string value) { AttachablePropertyServices.SetProperty(target, ProtectedIdentifier, value); }
internal static void SetInternalFoo(object target, string value) { AttachablePropertyServices.SetProperty(target, internalFooPropertyName, value); }
internal static void SetInternalBar(object target, int value) { AttachablePropertyServices.SetProperty(target, internalBarPropertyName, value); }
public static void SetFoo(object target, string value) { AttachablePropertyServices.SetProperty(target, fooPropertyName, value); }
public static void SetBar(object target, int value) { AttachablePropertyServices.SetProperty(target, barPropertyName, value); }
public static void SetValueWithDefault(object target, string value) { AttachablePropertyServices.SetProperty(target, valueWithDefaultName, value); }
public static int GetPropertyTwo(object target) { int value; return(AttachablePropertyServices.TryGetProperty(target, propertyTwo, out value) ? value : 0); }
public static void SetMaybeSerialized(object target, string value) { AttachablePropertyServices.SetProperty(target, maybeSerializedPropertyName, value); }
public static string GetValueWithDefault(object target) { string value; return(AttachablePropertyServices.TryGetProperty(target, valueWithDefaultName, out value) ? value : String.Empty); }
public static string GetMaybeSerialized(object target) { string value; return(AttachablePropertyServices.TryGetProperty(target, maybeSerializedPropertyName, out value) ? value : String.Empty); }
public static void SetNonSerialized2(object target, string value) { AttachablePropertyServices.SetProperty(target, nonSerialized2PropertyName, value); }
public static VisualBasicSettings GetSettings(object target) { VisualBasicSettings value; return(AttachablePropertyServices.TryGetProperty(target, settingsPropertyID, out value) ? value : null); }
static void CutCopyOperation(List <ModelItem> modelItemsToCutCopy, EditingContext context, bool isCutOperation) { List <object> objectsOnClipboard = null; List <object> metaData = null; if (modelItemsToCutCopy.Count > 0) { objectsOnClipboard = new List <object>(modelItemsToCutCopy.Count); metaData = new List <object>(); Dictionary <ICompositeView, List <ModelItem> > notifyDictionary = new Dictionary <ICompositeView, List <ModelItem> >(); UIElement breadCrumbRootView = ((DesignerView)context.Services.GetService <DesignerView>()).RootDesigner; foreach (ModelItem modelItem in modelItemsToCutCopy) { object currentElement = modelItem.GetCurrentValue(); if (typeof(Activity).IsAssignableFrom(currentElement.GetType())) { string fileName; if (AttachablePropertyServices.TryGetProperty(currentElement, XamlDebuggerXmlReader.FileNameName, out fileName)) { AttachablePropertyServices.RemoveProperty(currentElement, XamlDebuggerXmlReader.FileNameName); } } if (modelItem.View != null) { //The case where the breadcrumbroot designer is Cut/Copied. We do not delete the root designer, we only copy it. if (breadCrumbRootView.Equals(modelItem.View)) { notifyDictionary.Clear(); objectsOnClipboard.Add(modelItem.GetCurrentValue()); break; } else { ICompositeView container = (ICompositeView)DragDropHelper.GetCompositeView((WorkflowViewElement)modelItem.View); if (container != null) { //If the parent and some of its children are selected and cut/copied, we ignore the children. //The entire parent will be cut/copied. //HashSet parentModelItems contains all the model items in the parent chain of current modelItem. //We use HashSet.IntersectWith operation to determine if one of the parents is set to be cut. HashSet <ModelItem> parentModelItems = CutCopyPasteHelper.GetSelectableParentModelItems(modelItem); parentModelItems.IntersectWith(modelItemsToCutCopy); if (parentModelItems.Count == 0) { if (!notifyDictionary.ContainsKey(container)) { notifyDictionary[container] = new List <ModelItem>(); } notifyDictionary[container].Add(modelItem); } } } } } foreach (ICompositeView container in notifyDictionary.Keys) { object containerMetaData = false; if (isCutOperation) { containerMetaData = container.OnItemsCut(notifyDictionary[container]); } else { containerMetaData = container.OnItemsCopied(notifyDictionary[container]); } if (containerMetaData != null) { metaData.Add(containerMetaData); } //Put the actual activities and not the modelItems in the clipboard. foreach (ModelItem modelItem in notifyDictionary[container]) { objectsOnClipboard.Add(modelItem.GetCurrentValue()); } } if (metaData.Count == 0) { metaData = null; } } try { FrameworkName targetFramework = context.Services.GetService <DesignerConfigurationService>().TargetFrameworkName; PutOnClipBoard(objectsOnClipboard, metaData, targetFramework); } catch (XamlObjectReaderException exception) { if (modelItemsToCutCopy.Count > 0 && ErrorActivity.GetHasErrorActivities(modelItemsToCutCopy[0].Root.GetCurrentValue())) { ErrorReporting.ShowErrorMessage(SR.CutCopyErrorActivityMessage); } else { ErrorReporting.ShowErrorMessage(exception.Message); } } }
public static void SetPropertyTwo(object target, int value) { AttachablePropertyServices.SetProperty(target, propertyTwo, value); }
public static void SetSymbol(object instance, object value) { AttachablePropertyServices.SetProperty(instance, SymbolName, value); }
public static ComplexAttachedProperty GetComplex(object target) { ComplexAttachedProperty value; return(AttachablePropertyServices.TryGetProperty(target, complexPropertyName, out value) ? value : null); }
public static int GetBar(object target) { int value; return(AttachablePropertyServices.TryGetProperty(target, barPropertyName, out value) ? value : 0); }
public static void SetComplex(object target, ComplexAttachedProperty value) { AttachablePropertyServices.SetProperty(target, complexPropertyName, value); }
internal static string GetInternalFoo(object target) { string value; return(AttachablePropertyServices.TryGetProperty(target, internalFooPropertyName, out value) ? value : null); }
public static int GetNonSerialized(object target) { int value; return(AttachablePropertyServices.TryGetProperty(target, nonSerializedPropertyName, out value) ? value : 0); }
internal static int GetInternalBar(object target) { int value; return(AttachablePropertyServices.TryGetProperty(target, internalBarPropertyName, out value) ? value : 0); }
public static void SetFileName(object instance, object value) { AttachablePropertyServices.SetProperty(instance, FileNameName, value); }
public static string GetFoo(object target) { string v; return(AttachablePropertyServices.TryGetProperty(target, FooIdentifier, out v) ? v : null); }
public static void SetHintSize(object instance, object value) { AttachablePropertyServices.SetProperty(instance, HintSizeName, value); }
protected static string GetProtected(object target) { string v; return(AttachablePropertyServices.TryGetProperty(target, ProtectedIdentifier, out v) ? v : null); }
// // Attached property getter for the compiled expression root for the implementation surface area of an activity public static object GetCompiledExpressionRootForImplementation(object target) { AttachablePropertyServices.TryGetProperty(target, compiledExpressionRootForImplementationProperty, out object value); return(value); }
public static void SetStartColumn(object instance, object value) { AttachablePropertyServices.SetProperty(instance, StartColumnName, value); }
/// <summary> /// Removes the entry for the specified attachable member from this /// attachable member store. /// </summary> /// <param name="attachableMemberIdentifier"> /// The XAML type system identifier for /// the attachable member entry to remove. /// </param> /// <returns> /// <see langword="true" /> if an attachable member entry for /// <paramref name="attachableMemberIdentifier" /> was found in the store /// and /// removed; otherwise, <see langword="false" />. /// </returns> public bool RemoveProperty(AttachableMemberIdentifier attachableMemberIdentifier) { return(AttachablePropertyServices.RemoveProperty(this, attachableMemberIdentifier)); }