<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<Description>C# Rapid Open Widget</Description>
<BaseAddress>4194304</BaseAddress>
- <ReleaseVersion>0.5</ReleaseVersion>
<OutputPath>$(SolutionDir)build\$(Configuration)</OutputPath>
<IntermediateOutputPath>$(SolutionDir)build\obj\$(Configuration)</IntermediateOutputPath>
<AssemblyOriginatorKeyFile>crow.key</AssemblyOriginatorKeyFile>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
if (parent == value)
return;
DataSourceChangeEventArgs e = new DataSourceChangeEventArgs (parent, value);
- parent = value;
+ lock (this)
+ parent = value;
onParentChanged (this, e);
}
public virtual void Paint (ref Context ctx)
{
//TODO:this test should not be necessary
- if (Slot.Height < 0 || Slot.Width < 0)
+ if (Slot.Height < 0 || Slot.Width < 0 || parent == null)
return;
+ lock (this) {
+ LastPaintedSlot = Slot;
- LastPaintedSlot = Slot;
+ if (cacheEnabled) {
+ if (Slot.Width > Interface.MaxCacheSize || Slot.Height > Interface.MaxCacheSize)
+ cacheEnabled = false;
+ }
- if (cacheEnabled) {
- if (Slot.Width > Interface.MaxCacheSize || Slot.Height > Interface.MaxCacheSize)
- cacheEnabled = false;
- }
+ if (cacheEnabled) {
+ if (IsDirty)
+ RecreateCache ();
- if (cacheEnabled) {
- if (IsDirty)
- RecreateCache ();
+ UpdateCache (ctx);
+ if (!isEnabled)
+ paintDisabled (ctx, Slot + Parent.ClientRectangle.Position);
+ } else {
+ Rectangle rb = Slot + Parent.ClientRectangle.Position;
+ ctx.Save ();
- UpdateCache (ctx);
- if (!isEnabled)
- paintDisabled (ctx, Slot + Parent.ClientRectangle.Position);
- } else {
- Rectangle rb = Slot + Parent.ClientRectangle.Position;
- ctx.Save ();
+ ctx.Translate (rb.X, rb.Y);
- ctx.Translate (rb.X, rb.Y);
+ onDraw (ctx);
+ if (!isEnabled)
+ paintDisabled (ctx, Slot);
- onDraw (ctx);
- if (!isEnabled)
- paintDisabled (ctx, Slot);
-
- ctx.Restore ();
+ ctx.Restore ();
+ }
}
}
void paintDisabled(Context gr, Rectangle rb){
}
public virtual void ClearChildren()
{
- while(Children.Count > 0){
- GraphicObject g = Children[Children.Count-1];
- g.LayoutChanged -= OnChildLayoutChanges;
- g.Parent = null;
- Children.RemoveAt(Children.Count-1);
+ lock (children) {
+ while (Children.Count > 0) {
+ GraphicObject g = Children [Children.Count - 1];
+ g.LayoutChanged -= OnChildLayoutChanges;
+ g.Parent = null;
+ Children.RemoveAt (Children.Count - 1);
+ }
}
resetChildrenMaxSize ();
{
if (Children.Contains(w))
{
- Children.Remove(w);
- Children.Add(w);
+ lock (children) {
+ Children.Remove (w);
+ Children.Add (w);
+ }
}
}
public void putWidgetOnBottom(GraphicObject w)
{
if (Children.Contains(w))
{
- Children.Remove(w);
- Children.Insert(0, w);
+ lock (children) {
+ Children.Remove (w);
+ Children.Insert (0, w);
+ }
}
}
public override void OnDataSourceChanged (object sender, DataSourceChangeEventArgs e)
{
base.OnDataSourceChanged (this, e);
- foreach (GraphicObject g in children)
- if (g.localDataSourceIsNull & g.localLogicalParentIsNull)
- g.OnDataSourceChanged (sender, e);
+ lock (children) {
+ foreach (GraphicObject g in children)
+ if (g.localDataSourceIsNull & g.localLogicalParentIsNull)
+ g.OnDataSourceChanged (sender, e);
+ }
}
public override GraphicObject FindByName (string nameToFind)
{
if (Name == nameToFind)
return this;
-
- foreach (GraphicObject w in Children) {
- GraphicObject r = w.FindByName (nameToFind);
- if (r != null)
- return r;
+ GraphicObject tmp = null;
+ lock (children) {
+ foreach (GraphicObject w in Children) {
+ tmp = w.FindByName (nameToFind);
+ if (tmp != null)
+ break;
+ }
}
- return null;
+ return tmp;
}
public override bool Contains (GraphicObject goToFind)
{
Picture _pic;
string _svgSub;
bool scaled, keepProps;
+ double opacity;
#region Public properties
[XmlAttributeAttribute][DefaultValue(true)]
RegisterForGraphicUpdate ();
}
}
+ [XmlAttributeAttribute()][DefaultValue(1.0)]
+ public virtual double Opacity {
+ get { return opacity; }
+ set {
+ if (opacity == value)
+ return;
+ opacity = value;
+ NotifyValueChanged ("Faded", opacity);
+ RegisterForRedraw ();
+ }
+ }
#endregion
#region CTOR
return;
_pic.Paint (gr, ClientRectangle, _svgSub);
+
+ if (Opacity<1.0) {
+ gr.SetSourceRGBA (0.0, 0.0, 0.0, 1.0-Opacity);
+ gr.Operator = Operator.DestOut;
+ gr.Rectangle (ClientRectangle);
+ gr.Fill ();
+ gr.Operator = Operator.Over;
+ }
}
#endregion
}
il.Emit(OpCodes.Ldc_I4, dmVC);//load index of dynmathod
il.Emit (OpCodes.Call, CompilerServices.miDSChangeEmitHelper);
+ il.MarkLabel (cancel);
+
if (bindingDef.TwoWay){
il.Emit (OpCodes.Ldarg_1);//arg1: dataSourceChange source, the origine of the binding
il.Emit (OpCodes.Ldstr, bindingDef.SourceMember);//arg2: orig member
il.Emit (OpCodes.Call, CompilerServices.miDSReverseBinding);
}
- il.MarkLabel (cancel);
}
il.Emit (OpCodes.Ret);
Debug.WriteLine ("Member '{0}' not found in new DataSource '{1}' of '{2}'", destMember, dest, orig);
return;
}
+ #if DEBUG_BINDING
+ Debug.WriteLine ("DS Reverse binding: Member '{0}' found in new DS '{1}' of '{2}'", destMember, dest, orig);
+ #endif
#region ValueChanged emit
DynamicMethod dm = new DynamicMethod ("dyn_valueChanged" + NewId,
lock (DrawingQueue)
g = DrawingQueue.Dequeue ();
g.IsQueueForRedraw = false;
- g.Parent.RegisterClip (g.LastPaintedSlot);
- g.Parent.RegisterClip (g.getSlot ());
+ if (g.Parent == null)
+ continue;
+ lock (g) {
+ g.Parent.RegisterClip (g.LastPaintedSlot);
+ g.Parent.RegisterClip (g.getSlot ());
+ }
}
#if MEASURE_TIME