IsState() public method

public IsState ( States state ) : bool
state States
return bool
Exemplo n.º 1
0
 private static void DrawOverlays(Asset asset, Asset metaAsset, Rect itemRect)
 {
     CreateStaticResources();
     float width = 16f;
     float num2 = 1f;
     float num3 = 4f;
     float num4 = -4f;
     Rect iconRect = new Rect(itemRect.x - num2, itemRect.y - num3, width, width);
     Rect rect2 = new Rect((itemRect.xMax - width) + num2, itemRect.y - num3, width, width);
     Rect rect3 = new Rect(itemRect.x - num2, (itemRect.yMax - width) + num3, width, width);
     Rect rect4 = new Rect((itemRect.xMax - width) + num4, (itemRect.yMax - width) + num3, width, width);
     Asset.States states = Asset.States.MetaFile | Asset.States.ReadOnly | Asset.States.Synced | Asset.States.Local;
     bool flag = (metaAsset == null) || ((metaAsset.state & states) == states);
     Asset.States states2 = (metaAsset != null) ? (metaAsset.state & (Asset.States.LockedLocal | Asset.States.AddedLocal | Asset.States.DeletedLocal | Asset.States.CheckedOutLocal)) : Asset.States.None;
     Asset.States states3 = (metaAsset != null) ? (metaAsset.state & (Asset.States.LockedRemote | Asset.States.AddedRemote | Asset.States.DeletedRemote | Asset.States.CheckedOutRemote)) : Asset.States.None;
     bool flag2 = asset.isFolder && Provider.isVersioningFolders;
     if (asset.IsState(Asset.States.AddedLocal))
     {
         DrawOverlay(Asset.States.AddedLocal, iconRect);
         if (((metaAsset != null) && ((states2 & Asset.States.AddedLocal) == Asset.States.None)) && !flag)
         {
             DrawMetaOverlay(iconRect, false);
         }
     }
     else if (asset.IsState(Asset.States.DeletedLocal))
     {
         DrawOverlay(Asset.States.DeletedLocal, iconRect);
         if (((metaAsset != null) && ((states2 & Asset.States.DeletedLocal) == Asset.States.None)) && metaAsset.IsState(Asset.States.Missing | Asset.States.Local))
         {
             DrawMetaOverlay(iconRect, false);
         }
     }
     else if (asset.IsState(Asset.States.LockedLocal))
     {
         DrawOverlay(Asset.States.LockedLocal, iconRect);
         if (((metaAsset != null) && ((states2 & Asset.States.LockedLocal) == Asset.States.None)) && !flag)
         {
             DrawMetaOverlay(iconRect, false);
         }
     }
     else if (asset.IsState(Asset.States.CheckedOutLocal))
     {
         DrawOverlay(Asset.States.CheckedOutLocal, iconRect);
         if (((metaAsset != null) && ((states2 & Asset.States.CheckedOutLocal) == Asset.States.None)) && !flag)
         {
             DrawMetaOverlay(iconRect, false);
         }
     }
     else if ((asset.IsState(Asset.States.Local) && !asset.IsState(Asset.States.OutOfSync)) && !asset.IsState(Asset.States.Synced))
     {
         DrawOverlay(Asset.States.Local, rect3);
         if ((metaAsset != null) && (metaAsset.IsUnderVersionControl || !metaAsset.IsState(Asset.States.Local)))
         {
             DrawMetaOverlay(rect3, false);
         }
     }
     else if ((metaAsset != null) && metaAsset.IsState(Asset.States.AddedLocal))
     {
         DrawOverlay(Asset.States.AddedLocal, iconRect);
         if (flag2)
         {
             DrawMetaOverlay(iconRect, false);
         }
     }
     else if ((metaAsset != null) && metaAsset.IsState(Asset.States.DeletedLocal))
     {
         DrawOverlay(Asset.States.DeletedLocal, iconRect);
         if (flag2)
         {
             DrawMetaOverlay(iconRect, false);
         }
     }
     else if ((metaAsset != null) && metaAsset.IsState(Asset.States.LockedLocal))
     {
         DrawOverlay(Asset.States.LockedLocal, iconRect);
         if (flag2)
         {
             DrawMetaOverlay(iconRect, false);
         }
     }
     else if ((metaAsset != null) && metaAsset.IsState(Asset.States.CheckedOutLocal))
     {
         DrawOverlay(Asset.States.CheckedOutLocal, iconRect);
         if (flag2)
         {
             DrawMetaOverlay(iconRect, false);
         }
     }
     else if ((((metaAsset != null) && metaAsset.IsState(Asset.States.Local)) && (!metaAsset.IsState(Asset.States.OutOfSync) && !metaAsset.IsState(Asset.States.Synced))) && (!asset.IsState(Asset.States.Conflicted) && ((metaAsset == null) || !metaAsset.IsState(Asset.States.Conflicted))))
     {
         DrawOverlay(Asset.States.Local, rect3);
         if (flag2)
         {
             DrawMetaOverlay(rect3, false);
         }
     }
     if (asset.IsState(Asset.States.Conflicted) || ((metaAsset != null) && metaAsset.IsState(Asset.States.Conflicted)))
     {
         DrawOverlay(Asset.States.Conflicted, rect3);
     }
     if (asset.IsState(Asset.States.AddedRemote))
     {
         DrawOverlay(Asset.States.AddedRemote, rect2);
         if ((metaAsset != null) && ((states3 & Asset.States.AddedRemote) == Asset.States.None))
         {
             DrawMetaOverlay(rect2, true);
         }
     }
     else if (asset.IsState(Asset.States.DeletedRemote))
     {
         DrawOverlay(Asset.States.DeletedRemote, rect2);
         if ((metaAsset != null) && ((states3 & Asset.States.DeletedRemote) == Asset.States.None))
         {
             DrawMetaOverlay(rect2, true);
         }
     }
     else if (asset.IsState(Asset.States.LockedRemote))
     {
         DrawOverlay(Asset.States.LockedRemote, rect2);
         if ((metaAsset != null) && ((states3 & Asset.States.LockedRemote) == Asset.States.None))
         {
             DrawMetaOverlay(rect2, true);
         }
     }
     else if (asset.IsState(Asset.States.CheckedOutRemote))
     {
         DrawOverlay(Asset.States.CheckedOutRemote, rect2);
         if ((metaAsset != null) && ((states3 & Asset.States.CheckedOutRemote) == Asset.States.None))
         {
             DrawMetaOverlay(rect2, true);
         }
     }
     else if ((metaAsset != null) && metaAsset.IsState(Asset.States.AddedRemote))
     {
         DrawOverlay(Asset.States.AddedRemote, rect2);
         if (flag2)
         {
             DrawMetaOverlay(rect2, true);
         }
     }
     else if ((metaAsset != null) && metaAsset.IsState(Asset.States.DeletedRemote))
     {
         DrawOverlay(Asset.States.DeletedRemote, rect2);
         if (flag2)
         {
             DrawMetaOverlay(rect2, true);
         }
     }
     else if ((metaAsset != null) && metaAsset.IsState(Asset.States.LockedRemote))
     {
         DrawOverlay(Asset.States.LockedRemote, rect2);
         if (flag2)
         {
             DrawMetaOverlay(rect2, true);
         }
     }
     else if ((metaAsset != null) && metaAsset.IsState(Asset.States.CheckedOutRemote))
     {
         DrawOverlay(Asset.States.CheckedOutRemote, rect2);
         if (flag2)
         {
             DrawMetaOverlay(rect2, true);
         }
     }
     if (asset.IsState(Asset.States.OutOfSync) || ((metaAsset != null) && metaAsset.IsState(Asset.States.OutOfSync)))
     {
         DrawOverlay(Asset.States.OutOfSync, rect4);
     }
 }
Exemplo n.º 2
0
        internal static string AllStateToString(Asset.States state)
        {
            StringBuilder stringBuilder = new StringBuilder();

            if (Asset.IsState(state, Asset.States.AddedLocal))
            {
                stringBuilder.AppendLine("Added Local");
            }
            if (Asset.IsState(state, Asset.States.AddedRemote))
            {
                stringBuilder.AppendLine("Added Remote");
            }
            if (Asset.IsState(state, Asset.States.CheckedOutLocal))
            {
                stringBuilder.AppendLine("Checked Out Local");
            }
            if (Asset.IsState(state, Asset.States.CheckedOutRemote))
            {
                stringBuilder.AppendLine("Checked Out Remote");
            }
            if (Asset.IsState(state, Asset.States.Conflicted))
            {
                stringBuilder.AppendLine("Conflicted");
            }
            if (Asset.IsState(state, Asset.States.DeletedLocal))
            {
                stringBuilder.AppendLine("Deleted Local");
            }
            if (Asset.IsState(state, Asset.States.DeletedRemote))
            {
                stringBuilder.AppendLine("Deleted Remote");
            }
            if (Asset.IsState(state, Asset.States.Local))
            {
                stringBuilder.AppendLine("Local");
            }
            if (Asset.IsState(state, Asset.States.LockedLocal))
            {
                stringBuilder.AppendLine("Locked Local");
            }
            if (Asset.IsState(state, Asset.States.LockedRemote))
            {
                stringBuilder.AppendLine("Locked Remote");
            }
            if (Asset.IsState(state, Asset.States.OutOfSync))
            {
                stringBuilder.AppendLine("Out Of Sync");
            }
            if (Asset.IsState(state, Asset.States.Synced))
            {
                stringBuilder.AppendLine("Synced");
            }
            if (Asset.IsState(state, Asset.States.Missing))
            {
                stringBuilder.AppendLine("Missing");
            }
            if (Asset.IsState(state, Asset.States.ReadOnly))
            {
                stringBuilder.AppendLine("ReadOnly");
            }
            return(stringBuilder.ToString());
        }
Exemplo n.º 3
0
 private static void DrawOverlays(Asset asset, Asset metaAsset, Rect itemRect)
 {
   Overlay.CreateStaticResources();
   float num1 = 16f;
   float num2 = 1f;
   float num3 = 4f;
   float num4 = -4f;
   Rect iconRect1 = new Rect(itemRect.x - num2, itemRect.y - num3, num1, num1);
   Rect iconRect2 = new Rect(itemRect.xMax - num1 + num2, itemRect.y - num3, num1, num1);
   Rect iconRect3 = new Rect(itemRect.x - num2, itemRect.yMax - num1 + num3, num1, num1);
   Rect iconRect4 = new Rect(itemRect.xMax - num1 + num4, itemRect.yMax - num1 + num3, num1, num1);
   Asset.States states1 = Asset.States.Local | Asset.States.Synced | Asset.States.ReadOnly | Asset.States.MetaFile;
   bool flag1 = metaAsset == null || (metaAsset.state & states1) == states1;
   Asset.States states2 = metaAsset != null ? metaAsset.state & (Asset.States.CheckedOutLocal | Asset.States.DeletedLocal | Asset.States.AddedLocal | Asset.States.LockedLocal) : Asset.States.None;
   Asset.States states3 = metaAsset != null ? metaAsset.state & (Asset.States.CheckedOutRemote | Asset.States.DeletedRemote | Asset.States.AddedRemote | Asset.States.LockedRemote) : Asset.States.None;
   bool flag2 = asset.isFolder && Provider.isVersioningFolders;
   if (asset.IsState(Asset.States.AddedLocal))
   {
     Overlay.DrawOverlay(Asset.States.AddedLocal, iconRect1);
     if (metaAsset != null && (states2 & Asset.States.AddedLocal) == Asset.States.None && !flag1)
       Overlay.DrawMetaOverlay(iconRect1, false);
   }
   else if (asset.IsState(Asset.States.DeletedLocal))
   {
     Overlay.DrawOverlay(Asset.States.DeletedLocal, iconRect1);
     if (metaAsset != null && (states2 & Asset.States.DeletedLocal) == Asset.States.None && metaAsset.IsState(Asset.States.Local | Asset.States.Missing))
       Overlay.DrawMetaOverlay(iconRect1, false);
   }
   else if (asset.IsState(Asset.States.LockedLocal))
   {
     Overlay.DrawOverlay(Asset.States.LockedLocal, iconRect1);
     if (metaAsset != null && (states2 & Asset.States.LockedLocal) == Asset.States.None && !flag1)
       Overlay.DrawMetaOverlay(iconRect1, false);
   }
   else if (asset.IsState(Asset.States.CheckedOutLocal))
   {
     Overlay.DrawOverlay(Asset.States.CheckedOutLocal, iconRect1);
     if (metaAsset != null && (states2 & Asset.States.CheckedOutLocal) == Asset.States.None && !flag1)
       Overlay.DrawMetaOverlay(iconRect1, false);
   }
   else if (asset.IsState(Asset.States.Local) && !asset.IsState(Asset.States.OutOfSync) && !asset.IsState(Asset.States.Synced))
   {
     Overlay.DrawOverlay(Asset.States.Local, iconRect3);
     if (metaAsset != null && (metaAsset.IsUnderVersionControl || !metaAsset.IsState(Asset.States.Local)))
       Overlay.DrawMetaOverlay(iconRect3, false);
   }
   else if (metaAsset != null && metaAsset.IsState(Asset.States.AddedLocal))
   {
     Overlay.DrawOverlay(Asset.States.AddedLocal, iconRect1);
     if (flag2)
       Overlay.DrawMetaOverlay(iconRect1, false);
   }
   else if (metaAsset != null && metaAsset.IsState(Asset.States.DeletedLocal))
   {
     Overlay.DrawOverlay(Asset.States.DeletedLocal, iconRect1);
     if (flag2)
       Overlay.DrawMetaOverlay(iconRect1, false);
   }
   else if (metaAsset != null && metaAsset.IsState(Asset.States.LockedLocal))
   {
     Overlay.DrawOverlay(Asset.States.LockedLocal, iconRect1);
     if (flag2)
       Overlay.DrawMetaOverlay(iconRect1, false);
   }
   else if (metaAsset != null && metaAsset.IsState(Asset.States.CheckedOutLocal))
   {
     Overlay.DrawOverlay(Asset.States.CheckedOutLocal, iconRect1);
     if (flag2)
       Overlay.DrawMetaOverlay(iconRect1, false);
   }
   else if (metaAsset != null && metaAsset.IsState(Asset.States.Local) && (!metaAsset.IsState(Asset.States.OutOfSync) && !metaAsset.IsState(Asset.States.Synced)) && (!asset.IsState(Asset.States.Conflicted) && (metaAsset == null || !metaAsset.IsState(Asset.States.Conflicted))))
   {
     Overlay.DrawOverlay(Asset.States.Local, iconRect3);
     if (flag2)
       Overlay.DrawMetaOverlay(iconRect3, false);
   }
   if (asset.IsState(Asset.States.Conflicted) || metaAsset != null && metaAsset.IsState(Asset.States.Conflicted))
     Overlay.DrawOverlay(Asset.States.Conflicted, iconRect3);
   if (asset.IsState(Asset.States.AddedRemote))
   {
     Overlay.DrawOverlay(Asset.States.AddedRemote, iconRect2);
     if (metaAsset != null && (states3 & Asset.States.AddedRemote) == Asset.States.None)
       Overlay.DrawMetaOverlay(iconRect2, true);
   }
   else if (asset.IsState(Asset.States.DeletedRemote))
   {
     Overlay.DrawOverlay(Asset.States.DeletedRemote, iconRect2);
     if (metaAsset != null && (states3 & Asset.States.DeletedRemote) == Asset.States.None)
       Overlay.DrawMetaOverlay(iconRect2, true);
   }
   else if (asset.IsState(Asset.States.LockedRemote))
   {
     Overlay.DrawOverlay(Asset.States.LockedRemote, iconRect2);
     if (metaAsset != null && (states3 & Asset.States.LockedRemote) == Asset.States.None)
       Overlay.DrawMetaOverlay(iconRect2, true);
   }
   else if (asset.IsState(Asset.States.CheckedOutRemote))
   {
     Overlay.DrawOverlay(Asset.States.CheckedOutRemote, iconRect2);
     if (metaAsset != null && (states3 & Asset.States.CheckedOutRemote) == Asset.States.None)
       Overlay.DrawMetaOverlay(iconRect2, true);
   }
   else if (metaAsset != null && metaAsset.IsState(Asset.States.AddedRemote))
   {
     Overlay.DrawOverlay(Asset.States.AddedRemote, iconRect2);
     if (flag2)
       Overlay.DrawMetaOverlay(iconRect2, true);
   }
   else if (metaAsset != null && metaAsset.IsState(Asset.States.DeletedRemote))
   {
     Overlay.DrawOverlay(Asset.States.DeletedRemote, iconRect2);
     if (flag2)
       Overlay.DrawMetaOverlay(iconRect2, true);
   }
   else if (metaAsset != null && metaAsset.IsState(Asset.States.LockedRemote))
   {
     Overlay.DrawOverlay(Asset.States.LockedRemote, iconRect2);
     if (flag2)
       Overlay.DrawMetaOverlay(iconRect2, true);
   }
   else if (metaAsset != null && metaAsset.IsState(Asset.States.CheckedOutRemote))
   {
     Overlay.DrawOverlay(Asset.States.CheckedOutRemote, iconRect2);
     if (flag2)
       Overlay.DrawMetaOverlay(iconRect2, true);
   }
   if (!asset.IsState(Asset.States.OutOfSync) && (metaAsset == null || !metaAsset.IsState(Asset.States.OutOfSync)))
     return;
   Overlay.DrawOverlay(Asset.States.OutOfSync, iconRect4);
 }
Exemplo n.º 4
0
 public bool IsState(Asset.States state)
 {
     return(Asset.IsState(this.state, state));
 }