Ejemplo n.º 1
0
        public static string BuildNewCode()
        {
            string code   = "";
            bool   exists = true;

            while (exists)
            {
                code   = "P-" + SBObject.generateCode();
                exists = SBProduct.productCodeExists(code);
            }
            return(code);
        }
        public static string BuildNewTransactionCode(int transaction_type_id, string prefix)
        {
            bool   valid_code = false;
            string fcode      = "{0}{1}";
            string code       = "";

            while (!valid_code)
            {
                code = string.Format(fcode, prefix, SBObject.generateCode());
                string query = "SELECT transaction_id FROM transactions WHERE transaction_type_id = " + transaction_type_id.ToString() + "" +
                               " AND transaction_code = '" + code + "'";
                Hashtable row = SBFactory.getDbh().QueryRow(query);
                if (row == null)
                {
                    valid_code = true;
                }
            }
            return(code);
        }
Ejemplo n.º 3
0
        private static void ChkR(SBObject sb)
        {
            int?[] start, end;

            if (sb.Rotate.Count != 0)
            {
                List <int?> tmpstart = sb.Rotate.starttime_L.ToList();
                tmpstart.Sort();

                if (IsEqual(tmpstart, sb.Rotate.starttime_L))
                {
                    tmpstart = null;
                }
                else
                {
                    start = sb.Rotate.starttime_L.ToArray();
                    end   = sb.Rotate.endtime_L.ToArray();
                    var line = sb.Rotate.R.ToArray();
                    Sort(start, end, line);

                    sb.Rotate.R = new List <Rotate>(line);
                }
            }
        }
Ejemplo n.º 4
0
 public virtual void MoveTo(SBObject to)
 {
     ObjectiveCRuntime.SendMessage(this, "moveTo:", to);
 }
Ejemplo n.º 5
0
 public virtual void DuplicateToWithProperties(SBObject to, NSDictionary withProperties)
 {
     ObjectiveCRuntime.SendMessage(this, "duplicateTo:withProperties:", to, withProperties);
 }
        internal void LoadApps()
        {
            applicationsTable.Enabled = false;
            progressIndicator.StartAnimation(this);

            List <FinderFile> currentApps = new List <FinderFile> ();

            appTableContent.Remove(NSArray.FromArray <NSObject> ((NSArray)appTableContent.Content));
            //((NSMutableArray)appTableContent.Content).RemoveAll();

            SBElementArray folders = (SBElementArray)finder.ValueForKeyPath((NSString)"startupDisk.folders");
            SBObject       apps    = (SBObject)folders.Object("Applications");
            bool           exists  = apps.ValueForKey((NSString)"exists").ToString() == "1" ? true : false;

            // if the applicatoins folder exists...
            if (exists)
            {
                // get the applications in the folder
                SBElementArray topLevelApps = (SBElementArray)apps.ValueForKey((NSString)"applicationFiles");

                for (int x = 0; x <= topLevelApps.Count; x++)
                {
                    if (((SBObject)topLevelApps.ObjectAt(NSValue.FromObject(x))).ValueForKey((NSString)"name") != null)
                    {
                        // add each of the applications to our list of applications
                        currentApps.Add(new FinderFile((SBObject)topLevelApps.ObjectAt(NSValue.FromObject(x))));
                    }
                }


                SBObject       apps2      = (SBObject)folders.Object("Applications");
                SBElementArray appFolders = (SBElementArray)apps2.ValueForKey((NSString)"folders");

                for (int x = 0; x <= appFolders.Count; x++)
                {
                    // get the nth Folder
                    SBObject nthFolder = (SBObject)appFolders.ObjectAt(NSValue.FromObject(x));
                    // get the applications contained in the nth Folder
                    SBElementArray secondLevelApps = (SBElementArray)nthFolder.ValueForKey((NSString)"applicationFiles");

                    for (int s = 0; s <= secondLevelApps.Count; s++)
                    {
                        if (((SBObject)secondLevelApps.ObjectAt(NSValue.FromObject(s))).ValueForKey((NSString)"name") != null)
                        {
                            // add each of the applications to our list of applications
                            currentApps.Add(new FinderFile((SBObject)secondLevelApps.ObjectAt(NSValue.FromObject(s))));
                        }
                    }
                }
            }

            // now add each FinderFile to the table content array
            foreach (FinderFile ff in currentApps)
            {
                appTableContent.AddObject(ff);
            }

            progressIndicator.StopAnimation(this);

            applicationsTable.Enabled = true;
        }
Ejemplo n.º 7
0
 public virtual void OpenUsingWithProperties(SBObject @using, NSDictionary withProperties)
 {
     ObjectiveCRuntime.SendMessage(this, "openUsing:withProperties:", @using, withProperties);
 }
Ejemplo n.º 8
0
 public virtual SBObject MoveToReplacingPositionedAtRoutingSuppressed(SBObject to, Boolean replacing, NSArray positionedAt, Boolean routingSuppressed)
 {
     return ObjectiveCRuntime.SendMessage <SBObject>(this, "moveTo:replacing:positionedAt:routingSuppressed:", to, replacing, positionedAt, routingSuppressed);
 }
Ejemplo n.º 9
0
 public virtual SBObject DuplicateToReplacingRoutingSuppressed(SBObject to, Boolean replacing, Boolean routingSuppressed)
 {
     return ObjectiveCRuntime.SendMessage <SBObject>(this, "duplicateTo:replacing:routingSuppressed:", to, replacing, routingSuppressed);
 }
 public FinderFile(SBObject fileObject)
 {
     sbFile = fileObject;
 }
Ejemplo n.º 11
0
        public static bool Check(SBObject sb)
        {
            ChkM(sb); ChkF(sb); ChkS(sb); ChkR(sb);
            ChkC(sb); ChkMX(sb); ChkMY(sb); ChkV(sb);

            for (int i = 1; i < sb.Move.Count; i++)
            {
                if (sb.Move[i].StartTime < sb.Move[i - 1].EndTime ||
                    sb.Move[i].StartTime == sb.Move[i - 1].StartTime && sb.Move[i].EndTime == sb.Move[i - 1].EndTime &&
                    sb.Move[i].StartTime == sb.Move[i].EndTime)
                {
                    return(false);
                }
            }
            for (int i = 1; i < sb.Fade.Count; i++)
            {
                if (sb.Fade[i].StartTime < sb.Fade[i - 1].EndTime ||
                    sb.Fade[i].StartTime == sb.Fade[i - 1].StartTime && sb.Fade[i].EndTime == sb.Fade[i - 1].EndTime &&
                    sb.Fade[i].StartTime == sb.Fade[i].EndTime)
                {
                    return(false);
                }
            }
            for (int i = 1; i < sb.Scale.Count; i++)
            {
                if (sb.Scale[i].StartTime < sb.Scale[i - 1].EndTime ||
                    sb.Scale[i].StartTime == sb.Scale[i - 1].StartTime && sb.Scale[i].EndTime == sb.Scale[i - 1].EndTime &&
                    sb.Scale[i].StartTime == sb.Scale[i].EndTime)
                {
                    return(false);
                }
            }
            for (int i = 1; i < sb.Rotate.Count; i++)
            {
                if (sb.Rotate[i].StartTime < sb.Rotate[i - 1].EndTime ||
                    sb.Rotate[i].StartTime == sb.Rotate[i - 1].StartTime && sb.Rotate[i].EndTime == sb.Rotate[i - 1].EndTime &&
                    sb.Rotate[i].StartTime == sb.Rotate[i].EndTime)
                {
                    return(false);
                }
            }
            for (int i = 1; i < sb.Color.Count; i++)
            {
                if (sb.Color[i].StartTime < sb.Color[i - 1].EndTime ||
                    sb.Color[i].StartTime == sb.Color[i - 1].StartTime && sb.Color[i].EndTime == sb.Color[i - 1].EndTime &&
                    sb.Color[i].StartTime == sb.Color[i].EndTime)
                {
                    return(false);
                }
            }
            for (int i = 1; i < sb.MoveX.Count; i++)
            {
                if (sb.MoveX[i].StartTime < sb.MoveX[i - 1].EndTime ||
                    sb.MoveX[i].StartTime == sb.MoveX[i - 1].StartTime && sb.MoveX[i].EndTime == sb.MoveX[i - 1].EndTime &&
                    sb.MoveX[i].StartTime == sb.MoveX[i].EndTime)
                {
                    return(false);
                }
            }
            for (int i = 1; i < sb.MoveY.Count; i++)
            {
                if (sb.MoveY[i].StartTime < sb.MoveY[i - 1].EndTime ||
                    sb.MoveY[i].StartTime == sb.MoveY[i - 1].StartTime && sb.MoveY[i].EndTime == sb.MoveY[i - 1].EndTime &&
                    sb.MoveY[i].StartTime == sb.MoveY[i].EndTime)
                {
                    return(false);
                }
            }
            for (int i = 1; i < sb.Vector.Count; i++)
            {
                if (sb.Vector[i].StartTime < sb.Vector[i - 1].EndTime ||
                    sb.Vector[i].StartTime == sb.Vector[i - 1].StartTime && sb.Vector[i].EndTime == sb.Vector[i - 1].EndTime &&
                    sb.Vector[i].StartTime == sb.Vector[i].EndTime)
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 12
0
		public FinderFile (SBObject fileObject)
		{
			sbFile = fileObject;
		}
Ejemplo n.º 13
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public static SBType GetType(SBObject obj)
 {
     return(CacheList.ToList().FirstOrDefault(f => f.TypeId == obj?.TypeId));
 }